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

File

includes/theme.maintenance.inc, line 104

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.