function batch_test_form

6.x batch.test.inc batch_test_form()
5.x batch.test.inc batch_test_form()

Basic sample form, accessed at site.com/batch-test

File

modules/batch/batch.test.inc, line 37
This file contains functionality for testing out Batch's processing with a sample form which performs some arbitrary actions.

Code

function batch_test_form() {
  $form = array();

  $form ["mark" . $m++] = array(
    "value" => "<p>" . t("This is a test form, so you can see how the Batch API system works.  When you submit this form,
                           an arbitrary batch process will begin.") . "</p>",
  );


  $form ["items"] = array(
    "label" => t("How many 'items' to process?"),
    "type" => "select",
    "options" => array(100 => 100, 200 => 200, 300 => 300, 400 => 400, 500 => 500),
    "hide_please_select" => TRUE,
  );


  $form ["destination"] = array(
    "label" => t("Destination after batch is complete:"),
    "type" => "select",
    "options" => array("default" => t("None set. By default return to this form page."), "function" => t("Function - go to the function 'batch_test_finished_page'.")),
    "hide_please_select" => TRUE,
  );

  $form ["display_percent"] = array(
    "type" => "checkbox",
    "label" => "Display percentage in progress bar area?",
  );


  $form ["submit_btn"] = array(
    "type" => "submit",
    "value" => t("Submit and begin batch..."),
  );


  return $form;
}