You are here

function field_group_pre_render_fieldset in Field Group 7

Same name and namespace in other branches
  1. 7.2 field_group.module \field_group_pre_render_fieldset()

Implements field_group_pre_render_<format-type>. Format type: Fieldset.

Parameters

$element The field group form element.:

$group The Field group object prepared for pre_render.:

$form The root element or form.:

File

./field_group.module, line 692
Fieldgroup module.

Code

function field_group_pre_render_fieldset(&$element, $group, &$form) {
  $element += array(
    '#type' => 'fieldset',
    '#title' => check_plain(t($group->label)),
    '#collapsible' => $group->collapsible,
    '#collapsed' => $group->collapsed,
    '#pre_render' => array(),
    '#attributes' => array(
      'class' => explode(' ', $group->classes),
    ),
    '#description' => $group->description,
  );
  if ($group->collapsible || $group->collapsed) {
    $element['#attached']['library'][] = array(
      'system',
      'drupal.collapse',
    );
  }
}