theme_update_page

Versions
6
theme_update_page($content, $show_messages = TRUE)
7
theme_update_page($variables)

Generate a themed update page.

Note: this function is not themeable.

Parameters

$variables An associative array containing:

  • content: The page content to show.
  • show_messages: Whether to output status and error messages. FALSE can be useful to postpone the messages to a subsequent page.

Code

includes/theme.maintenance.inc, line 183

<?php
function theme_update_page($variables) {
  // Set required headers.
  drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');

  // Variable processors invoked manually since this function and theme_install_page()
  // are exceptions in how it works within the theme system.
  template_preprocess($variables, 'update_page');
  template_preprocess_maintenance_page($variables);
  template_process($variables, 'update_page');

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

  // 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.