You are here

function field_group_pre_render_multipage in Field Group 7

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

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

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 964
Fieldgroup module.

Code

function field_group_pre_render_multipage(&$element, $group, &$form) {
  $group->classes .= $group->format_settings['formatter'] == 'start' ? ' multipage-open' : ' multipage-closed';
  $element += array(
    '#type' => 'multipage_pane',
    '#title' => check_plain(t($group->label)),
    '#collapsible' => $group->collapsible,
    '#collapsed' => $group->collapsed,
    '#attributes' => array(
      'class' => explode(" ", $group->classes),
    ),
    '#group' => $group->parent_name,
    '#group_object' => $group,
    '#parent_group_object' => $form['#groups'][$group->parent_name],
    // very important. Cannot be added on the form!
    '#parents' => array(
      $group->parent_name,
    ),
    '#description' => $group->description,
  );
  $element['#attached']['library'][] = array(
    'field_group',
    'multipage',
  );
}