You are here

function batch_test_multistep_form_submit in Drupal 7

Submit handler for the multistep form.

File

modules/simpletest/tests/batch_test.module, line 153
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';
}