You are here

function pathauto_bulk_update_form_submit in Pathauto 7

Same name and namespace in other branches
  1. 6.2 pathauto.admin.inc \pathauto_bulk_update_form_submit()

Form submit handler for path alias bulk update form.

See also

pathauto_batch_update_form()

pathauto_bulk_update_batch_finished()

File

./pathauto.admin.inc, line 290
Admin page callbacks for the Pathauto module.

Code

function pathauto_bulk_update_form_submit($form, &$form_state) {
  $batch = array(
    'title' => t('Bulk updating URL aliases'),
    'operations' => array(
      array(
        'pathauto_bulk_update_batch_start',
        array(),
      ),
    ),
    'finished' => 'pathauto_bulk_update_batch_finished',
    'file' => drupal_get_path('module', 'pathauto') . '/pathauto.admin.inc',
  );
  foreach ($form_state['values']['update'] as $callback) {
    if (!empty($callback)) {
      $settings = $form['#update_callbacks'][$callback];
      if (!empty($settings->batch_file)) {
        $batch['operations'][] = array(
          'pathauto_bulk_update_batch_process',
          array(
            $callback,
            $settings,
          ),
        );
      }
      else {
        $batch['operations'][] = array(
          $callback,
          array(),
        );
      }
    }
  }
  batch_set($batch);
}