commit bacd81754904164f0c69b0ec281781101c92264e Author: Joel Pittet Date: Thu Aug 28 18:29:26 2014 -0700 split task-list out diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 2c7b6de..ce4a01d 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2256,13 +2256,12 @@ function drupal_common_theme() { ), 'task_list' => array( 'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL), - 'template' => 'task-list', - 'file' => '../../includes/theme.maintenance.inc', ), 'authorize_report' => array( 'variables' => array('messages' => array(), 'attributes' => array()), 'template' => 'authorize-report', - 'file' => '../../includes/theme.maintenance.inc', + 'path' => __DIR__, + 'file' => 'theme.maintenance.inc', ), // From pager.inc. 'pager' => array( diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index ac3d6e3..c5888a4 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -7,7 +7,6 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Site\Settings; -use Drupal\Core\Template\Attribute; /** * Sets up the theming system for maintenance page. @@ -105,39 +104,43 @@ function _drupal_maintenance_theme() { } /** - * Prepares variables for maintenance task list templates. + * Returns HTML for a list of maintenance tasks to perform. * - * Default template: task-list.html.twig. - * - * @param array $variables + * @param $variables * An associative array containing: * - items: An associative array of maintenance tasks. * It's the caller's responsibility to ensure this array's items contain no * dangerous HTML such as SCRIPT tags. * - active: The key for the currently active maintenance task. * + * @ingroup themeable */ -function template_preprocess_task_list(&$variables) { +function theme_task_list($variables) { $items = $variables['items']; $active = $variables['active']; $done = isset($items[$active]) || $active == NULL; - $tasks = array(); + $output = '

Installation tasks

'; + $output .= '
    '; foreach ($items as $k => $item) { - $tasks[$k]['item'] = $item; - $tasks[$k]['attributes'] = new Attribute(array('class' => array())); if ($active == $k) { - $tasks[$k]['attributes']['class'][] = 'active'; - $tasks[$k]['status'] = t('active'); + $class = 'active'; + $status = '(' . t('active') . ')'; $done = FALSE; } else { - $tasks[$k]['attributes']['class'][] = $done ? 'done' : ''; - $tasks[$k]['status'] = $done ? t('done') : ''; + $class = $done ? 'done' : ''; + $status = $done ? '(' . t('done') . ')' : ''; } + $output .= ''; + $output .= $item; + $output .= ($status ? ' ' . $status . '' : ''); + $output .= ''; } - $variables['tasks'] = $tasks; + $output .= '
'; + return $output; } /** diff --git a/core/modules/system/templates/task-list.html.twig b/core/modules/system/templates/task-list.html.twig deleted file mode 100644 index b707a0f..0000000 --- a/core/modules/system/templates/task-list.html.twig +++ /dev/null @@ -1,25 +0,0 @@ -{# -/** - * @file - * Default theme implementation for a list of maintenance tasks to perform. - * - * Available variables: - * - tasks: A list of maintenance tasks to perform. Each item in the list has - * the following variables: - * - item: The maintenance task. - * - attributes: HTML attributes for the maintenance task. - * - status: (optional) Text describing the status of the maintenance task, - * 'active' or 'done'. - * - * @ingroup themeable - */ -#} -

Installation tasks

-
    -{% for task in tasks %} - - {{ task.item }} - {% if task.status %} ({{ task.status }}){% endif %} - -{% endfor %} -