diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 8eafe76..6b2e454 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -3220,11 +3220,9 @@ function drupal_common_theme() { ), 'update_page' => array( 'variables' => array('content' => NULL, 'show_messages' => TRUE), - 'base hook' => 'maintenance_page', ), 'install_page' => array( - 'variables' => array('content' => NULL, 'show_messages' => NULL), - 'base hook' => 'maintenance_page', + 'variables' => array('content' => NULL), ), 'task_list' => array( 'variables' => array('items' => NULL, 'active' => NULL), diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index b660a10..16cf998 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -99,14 +99,14 @@ function _theme_load_offline_registry($theme, $base_theme = NULL, $theme_engine } /** - * Returns HTML for a list of maintenance tasks to perform. + * Prepares variables for maintenance task list templates. * - * @param $variables + * Default template: task-list.html.twig. + * + * @param array $variables * An associative array containing: * - items: An associative array of maintenance tasks. * - active: The key for the currently active maintenance task. - * - * @ingroup themeable */ function template_preprocess_task_list(&$variables) { $t = get_t(); @@ -121,12 +121,12 @@ function template_preprocess_task_list(&$variables) { $tasks[$k]['attributes'] = array('class' => array()); if ($active == $k) { $tasks[$k]['attributes']['class'][] = 'active'; - $tasks[$k]['status'] = '(' . $t('active') . ')'; + $tasks[$k]['status'] = $t('active'); $done = FALSE; } else { $tasks[$k]['attributes']['class'][] = $done ? 'done' : ''; - $tasks[$k]['status'] = $done ? '(' . $t('done') . ')' : ''; + $tasks[$k]['status'] = $done ? $t('done') : ''; } $tasks[$k]['attributes'] = new Attribute($tasks[$k]['attributes']); } @@ -135,7 +135,7 @@ function template_preprocess_task_list(&$variables) { } /** - * Preprocess variables for the installation page. + * Returns HTML for the installation page. * * Note: this function is not themeable. * @@ -143,13 +143,13 @@ function template_preprocess_task_list(&$variables) { * An associative array containing: * - content: The page content to show. */ -function template_preprocess_install_page(&$variables) { +function theme_install_page($variables) { drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - $variables['theme_hook_original'] = 'maintenance_page'; + return theme('maintenance_page', $variables); } /** - * Preprocess variables for the update page. + * Returns HTML for the update page. * * Note: this function is not themeable. * @@ -159,19 +159,19 @@ function template_preprocess_install_page(&$variables) { * - show_messages: Whether to output status and error messages. * FALSE can be useful to postpone the messages to a subsequent page. */ -function template_preprocess_update_page(&$variables) { +function theme_update_page($variables) { drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - $variables['theme_hook_original'] = 'maintenance_page'; + return theme('maintenance_page', $variables); } /** - * Preprocess variables for a report of the results from an operation run via authorize.php. + * Prepares variables for authorize.php operation report templates. * - * @param $variables + * Default template: authorize-report.html.twig. + * + * @param array $variables * An associative array containing: * - messages: An array of result messages. - * - * @ingroup themeable */ function template_preprocess_authorize_report(&$variables) { $messages = $variables['messages']; diff --git a/core/modules/system/templates/task-list.html.twig b/core/modules/system/templates/task-list.html.twig index 94d5595..6e4bce4 100644 --- a/core/modules/system/templates/task-list.html.twig +++ b/core/modules/system/templates/task-list.html.twig @@ -4,8 +4,12 @@ * Default theme implementation for a list of maintenance tasks to perform. * * Available variables: - * - attributes: Information related to the maintenance tasks. - * - items: An associative array of maintenance tasks. + * - tasks: A list of maintenance tasks to perform. Each item in the list has + * the following variables: + * - attributes: HTML attributes for the maintenance task. + * - item: An associative array of maintenance tasks. + * - status: (optional) Text describing the status of the maintenance task, + * 'active' or 'done'. * * @see template_preprocess() * @@ -17,7 +21,7 @@ {% for task in tasks %}
  • {{- task.item -}} - {%- if task.status %} {{ task.status }}{% endif -%} + {%- if task.status %} ({{ task.status }}){% endif -%}
  • {% endfor %} diff --git a/core/update.php b/core/update.php index e56d085..4947d09 100644 --- a/core/update.php +++ b/core/update.php @@ -390,7 +390,8 @@ function update_check_requirements($skip_warnings = FALSE) { drupal_set_title('Requirements problem'); $status_report = theme('status_report', array('requirements' => $requirements)); $status_report .= 'Check the messages and try again.'; - print theme('update_page', array('content' => $status_report)); + drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); + print theme('maintenance_page', array('content' => $status_report)); exit(); } } @@ -533,6 +534,7 @@ function update_check_requirements($skip_warnings = FALSE) { $output->send(); } else { - print theme('update_page', array('content' => $output, 'show_messages' => !$progress_page)); + drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); + print theme('maintenance_page', array('content' => $output, 'show_messages' => !$progress_page)); } }