Skip navigation
Help

theme_task_list

6 theme.maintenance.inc theme_task_list($items, $active = NULL)
7 theme.maintenance.inc 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

2 theme calls to theme_task_list()

File

drupal/includes/theme.maintenance.inc, line 104
Theming for maintenance pages.

Code

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;
}