1 update.php update_task_list($set_active = NULL)

Adds the update task list to the current page.

File

core/update.php, line 441
Administrative page for handling updates from one Backdrop version to another.

Code

function update_task_list($set_active = NULL) {
  static $active;
  if ($set_active) {
    $active = $set_active;
  }

  // Default list of tasks.
  $tasks = array(
    'requirements' => 'Verify requirements',
    'info' => 'Overview',
    'backup' => 'Backup',
    'select' => 'Review updates',
    'update' => 'Run updates',
    'finished' => 'Review log',
  );

  // Hide the Backup task if upgrading from Drupal 7, where the original
  // database has already been modified and no config exists.
  if (!update_backup_enabled()) {
    unset($tasks['backup']);
  }

  // Only show the task list on the left sidebar if the logged-in user is has
  // permission to perform updates, or if the 'update_free_access' setting in
  // settings.php has been set to TRUE.
  if (settings_get('update_free_access') || user_access('administer software updates')) {
    return theme('task_list', array('items' => $tasks, 'active' => $active));
  }

  // Return nothing if access is not allowed.
  return '';
}