function batch_test_multistep_form_submit

Form submission handler for batch_test_multistep_form().

See also

batch_test_multistep_form()

File

drupal/core/modules/system/tests/modules/batch_test/batch_test.module, line 161
Helper module for the Batch API tests.

Code

function batch_test_multistep_form_submit($form, &$form_state) {
  batch_test_stack(NULL, TRUE);
  switch ($form_state['storage']['step']) {
    case 1:
      batch_set(_batch_test_batch_1());
      break;
    case 2:
      batch_set(_batch_test_batch_2());
      break;
  }
  if ($form_state['storage']['step'] < 2) {
    $form_state['storage']['step']++;
    $form_state['rebuild'] = TRUE;
  }

  // This will only be effective on the last step.
  $form_state['redirect'] = 'batch-test/redirect';
}