You are here

function update_manager_update_form_submit in Drupal 7

Form submission handler for update_manager_update_form().

Sets up a batch that downloads, extracts, and verifies the selected releases.

See also

update_manager_update_form_validate()

Related topics

File

modules/update/update.manager.inc, line 310
Administrative screens and processing functions of the Update Manager module.

Code

function update_manager_update_form_submit($form, &$form_state) {
  $projects = array();
  foreach (array(
    'projects',
    'disabled_projects',
  ) as $type) {
    if (!empty($form_state['values'][$type])) {
      $projects = array_merge($projects, array_keys(array_filter($form_state['values'][$type])));
    }
  }
  $operations = array();
  foreach ($projects as $project) {
    $operations[] = array(
      'update_manager_batch_project_get',
      array(
        $project,
        $form_state['values']['project_downloads'][$project],
      ),
    );
  }
  $batch = array(
    'title' => t('Downloading updates'),
    'init_message' => t('Preparing to download selected updates'),
    'operations' => $operations,
    'finished' => 'update_manager_download_batch_finished',
    'file' => drupal_get_path('module', 'update') . '/update.manager.inc',
  );
  batch_set($batch);
}