You are here

function fieldset_helper_test_form in Fieldset helper 6.2

Same name and namespace in other branches
  1. 6 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.

1 string reference to 'fieldset_helper_test_form'
fieldset_helper_test in ./fieldset_helper.admin.inc
Test page for the 'Fieldset helper' module.

File

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

Code

function fieldset_helper_test_form() {

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