You are here

function fieldset_helper_test in Fieldset helper 6

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

Test page for the 'Fieldset helper' module.

2 string references to 'fieldset_helper_test'
fieldset_helper_form_alter in ./fieldset_helper.module
Implementation of hook_form_alter().
fieldset_helper_menu in ./fieldset_helper.module
Implementation of hook_menu().

File

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

Code

function fieldset_helper_test() {
  $output = '';

  // Test FAPI fieldsets
  $output .= '<h3>' . t('Test collapsible fieldsets associated with a FAPI form') . '</h3>';
  $output .= drupal_get_form('fieldset_helper_test_form');

  // Test unassociated fieldsets
  $output .= '<h3>' . t('Test a collapsible fieldset that is not associated with a form or node') . '</h3>';
  $element = array(
    '#type' => 'fieldset',
    '#title' => t('The un-associated fieldset'),
    '#value' => '<div>' . t('Testing the un-associated fieldset') . '</div>',
    '#collapsible' => TRUE,
  );
  $output .= theme('fieldset', $element);

  // Test unassociated fieldsets
  $output .= '<h3>' . t('Test a collapsible fieldset that is just plain html') . '</h3>';
  $output .= '<fieldset class="collapsible"><legend>The plain html fieldset</legend><div>';
  $output .= t('Testing a fieldset that is plain html');
  $output .= '<fieldset class="collapsible"><legend>A nested plain html fieldset</legend><div>' . t('Testing a nested fieldset that is plain html') . '</div></fieldset>';
  $output .= '</div></fieldset>';
  return $output;
}