You are here

function fieldset_helper_test_form in Fieldset helper 6

Same name and namespace in other branches
  1. 6.2 fieldset_helper.admin.inc \fieldset_helper_test_form()
  2. 7.2 fieldset_helper.admin.inc \fieldset_helper_test_form()

Test form for the 'Fieldset helper' module.

4 string references to 'fieldset_helper_test_form'
FieldsetHelperTestCase::testFieldsetHelperStateManagerCollapsed in ./fieldset_helper.test
Test that all fieldsets are collapsed.
FieldsetHelperTestCase::testFieldsetHelperStateManagerDefault in ./fieldset_helper.test
Test default fieldset state for the test form loaded in SimpleTest.
FieldsetHelperTestCase::testFieldsetHelperStateManagerExpanded in ./fieldset_helper.test
Test that all fieldsets are expanded.
fieldset_helper_test in ./fieldset_helper.admin.inc
Test page for the 'Fieldset helper' module.

File

./fieldset_helper.admin.inc, line 156
Administration page for the 'Fieldset helper' module.

Code

function fieldset_helper_test_form() {

  // Fieldset
  $form['toggle'] = array(
    '#type' => 'markup',
    '#value' => theme('fieldset_helper_toggle_all') . ' [' . t("Collapse's only the below forms fieldsets and not the un-associated fieldset.") . ']',
  );
  $form['default_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Default fieldset'),
  );
  $form['default_fieldset']['textfield'] = array(
    '#type' => 'textfield',
    '#title' => t('Text field'),
  );

  // Collapsible
  $form['collapsible'] = array(
    '#type' => 'fieldset',
    '#title' => t('Collapsible fieldset'),
    '#collapsible' => TRUE,
  );
  $form['collapsible']['textfield'] = array(
    '#type' => 'textfield',
    '#title' => t('Text field'),
  );

  // Collapsed
  $form['collapsed'] = array(
    '#type' => 'fieldset',
    '#title' => t('Collapsed fieldset'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['collapsed']['textfield'] = array(
    '#type' => 'textfield',
    '#title' => t('Text field'),
  );

  // Nested collapsible
  $form['nested'] = array(
    '#type' => 'fieldset',
    '#title' => t('Nested fieldsets'),
    '#collapsible' => TRUE,
  );
  $form['nested']['textfield'] = array(
    '#type' => 'textfield',
    '#title' => t('Text field'),
  );

  // Nested collapsed
  $form['nested']['collapsed'] = array(
    '#type' => 'fieldset',
    '#title' => t('Nested collapsed fieldset'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['nested']['collapsed']['textfield'] = array(
    '#type' => 'textfield',
    '#title' => t('Text field'),
  );
  return $form;
}