1 form_test.module _form_test_tableselect_form_builder($form, $form_state, $element_properties)

Build a form to test the tableselect element.

Parameters

$form_state: The form_state

$element_properties: An array of element properties for the tableselect element.

Return value

A form with a tableselect element and a submit button.:

File

core/modules/simpletest/tests/form_test.module, line 656
Helper module for the form API tests.

Code

function _form_test_tableselect_form_builder($form, $form_state, $element_properties) {
  list($header, $options) = _form_test_tableselect_get_data();

  $form['tableselect'] = $element_properties;

  $form['tableselect'] += array(
    '#prefix' => '<div id="tableselect-wrapper">',
    '#suffix' => '</div>',
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $options,
    '#multiple' => FALSE,
    '#empty' => t('Empty text.'),
    '#ajax' => array(
      'callback' => '_form_test_tableselect_ajax_callback',
      'wrapper' => 'tableselect-wrapper',
    ),
  );

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );

  return $form;
}