theme_install_page

Versions
5 – 6
theme_install_page($content)
7
theme_install_page($variables)

Generate a themed installation page.

Note: this function is not themeable.

Parameters

$variables An associative array containing:

  • content: The page content to show.

Code

includes/theme.maintenance.inc, line 129

<?php
function theme_install_page($variables) {
  drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');

  // Delay setting the message variable so it can be processed below.
  $variables['show_messages'] = FALSE;
  // Variable processors invoked manually since this function and theme_update_page()
  // are exceptions in how it works within the theme system.
  template_preprocess($variables, 'install_page');
  template_preprocess_maintenance_page($variables);
  template_process($variables, 'install_page');

  // Special handling of error messages
  $messages = drupal_set_message();
  if (isset($messages['error'])) {
    $title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process');
    $variables['messages'] .= '<h3>' . $title . ':</h3>';
    $variables['messages'] .= theme('status_messages', array('display' => 'error'));
    $variables['content'] .= '<p>' . st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => request_uri())) . '</p>';
  }

  // Special handling of warning messages
  if (isset($messages['warning'])) {
    $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');
    $variables['messages'] .= '<h4>' . $title . ':</h4>';
    $variables['messages'] .= theme('status_messages', array('display' => 'warning'));
  }

  // Special handling of status messages
  if (isset($messages['status'])) {
    $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored');
    $variables['messages'] .= '<h4>' . $title . ':</h4>';
    $variables['messages'] .= theme('status_messages', array('display' => 'status'));
  }

  // This was called as a theme hook (not template), so we need to
  // fix path_to_theme() for the template, to point at the actual
  // theme rather than system module as owner of the hook.
  global $theme_path;
  $theme_path = 'themes/seven';

  return theme_render_template('themes/seven/maintenance-page.tpl.php', $variables);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.