function theme_task_list

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()
install_display_output in drupal/core/includes/install.core.inc
Displays themed installer output and ends the page request.
update_task_list in drupal/core/update.php
Adds the update task list to the current page.

File

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

Code

function theme_task_list($variables) {
  $t = get_t();
  $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;
}