function _form_test_tableselect_form_builder

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.

4 calls to _form_test_tableselect_form_builder()
_form_test_tableselect_empty_form in modules/simpletest/tests/form_test.module
Test functionality of the tableselect #empty property.
_form_test_tableselect_js_select_form in modules/simpletest/tests/form_test.module
Test functionality of the tableselect #js_select property.
_form_test_tableselect_multiple_false_form in modules/simpletest/tests/form_test.module
Test the tableselect #multiple = FALSE functionality.
_form_test_tableselect_multiple_true_form in modules/simpletest/tests/form_test.module
Test the tableselect #multiple = TRUE functionality.

File

modules/simpletest/tests/form_test.module, line 614

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.