theme_task_list

  1. drupal
    1. 6
    2. 8
    3. 7
Versions
6 theme_task_list($items, $active = NULL)
8 – 7 theme_task_list($variables)

Returns HTML for a list of maintenance tasks to perform.

Parameters

$variables An associative array containing:

  • items: An associative array of maintenance tasks.
  • active: The key for the currently active maintenance task.

Related topics

Code

includes/theme.maintenance.inc, line 104

<?php
function theme_task_list($variables) {
  $items = $variables['items'];
  $active = $variables['active'];

  $done = isset($items[$active]) || $active == NULL;
  $output = '<h2 class="element-invisible">Installation tasks</h2>';
  $output .= '<ol class="task-list">';

  foreach ($items as $k => $item) {
    if ($active == $k) {
      $class = 'active';
      $status = '(' . t('active') . ')';
      $done = FALSE;
    }
    else {
      $class = $done ? 'done' : '';
      $status = $done ? '(' . t('done') . ')' : '';
    }
    $output .= '<li';
    $output .= ($class ? ' class="' . $class . '"' : '') . '>';
    $output .= $item;
    $output .= ($status ? '<span class="element-invisible">' . $status . '</span>' : '');
    $output .= '</li>';
  }
  $output .= '</ol>';
  return $output;
}
?>