template_preprocess_maintenance_task_list(&$variables)
Prepares variables for maintenance task list templates.
Default template: maintenance-task-list.html.twig.
array $variables: An associative array containing:
function template_preprocess_maintenance_task_list(&$variables) { $items = $variables['items']; $active = $variables['active']; $done = isset($items[$active]) || $active == NULL; foreach ($items as $k => $item) { $variables['tasks'][$k]['item'] = $item; $variables['tasks'][$k]['attributes'] = new Attribute(); if ($active == $k) { $variables['tasks'][$k]['attributes']->addClass('is-active'); $variables['tasks'][$k]['status'] = t('active'); $done = FALSE; } else { if ($done) { $variables['tasks'][$k]['attributes']->addClass('done'); $variables['tasks'][$k]['status'] = t('done'); } } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!theme.inc/function/template_preprocess_maintenance_task_list/8.1.x