You are here

function fieldset_helper_test in Fieldset helper 7.2

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

Test page for the 'Fieldset helper' module.

1 string reference to 'fieldset_helper_test'
fieldset_helper_menu in ./fieldset_helper.module
Implements hook_menu().

File

./fieldset_helper.admin.inc, line 170
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 .= render(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', array(
    'element' => $element,
  ));

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