Same name and namespace in other branches
  1. 4.7.x includes/form.inc \theme_fieldset()
  2. 5.x includes/form.inc \theme_fieldset()
  3. 7.x includes/form.inc \theme_fieldset()

Format a group of form items.

Parameters

$element: An associative array containing the properties of the element. Properties used: attributes, title, value, description, children, collapsible, collapsed

Return value

A themed HTML string representing the form item group.

Related topics

1 theme call to theme_fieldset()
theme_system_modules in modules/system/system.admin.inc
Theme callback for the modules form.

File

includes/form.inc, line 1608

Code

function theme_fieldset($element) {
  if (!empty($element['#collapsible'])) {
    drupal_add_js('misc/collapse.js');
    if (!isset($element['#attributes']['class'])) {
      $element['#attributes']['class'] = '';
    }
    $element['#attributes']['class'] .= ' collapsible';
    if (!empty($element['#collapsed'])) {
      $element['#attributes']['class'] .= ' collapsed';
    }
  }
  return '<fieldset' . drupal_attributes($element['#attributes']) . '>' . ($element['#title'] ? '<legend>' . $element['#title'] . '</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') . "</fieldset>\n";
}