theme_fieldset

Definition

theme_fieldset($element)
includes/form.inc, line 699

Description

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

Namesort iconDescription
Form generationFunctions to enable output of HTML forms and form elements.

Code

<?php
function theme_fieldset($element) {
  if ($element['#collapsible']) {
    drupal_add_js('misc/collapse.js');

    $element['#attributes']['class'] .= ' collapsible';
    if ($element['#collapsed']) {
     $element['#attributes']['class'] .= ' collapsed';
    }
  }

  return '<fieldset' . drupal_attributes($element['#attributes']) .'>' . ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . ($element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . $element['#children'] . $element['#value'] . "</fieldset>\n";

}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.