function form_process_group

Arranges elements into groups.

Parameters

$element: An associative array containing the properties and children of the element. Note that $element must be taken by reference here, so processed child elements are taken over into $form_state.

$form_state: The $form_state array for the form this element belongs to.

Return value

The processed element.

Related topics

1 string reference to 'form_process_group'
system_element_info in drupal/core/modules/system/system.module
Implements hook_element_info().

File

drupal/core/includes/form.inc, line 3893
Functions for form and batch generation and processing.

Code

function form_process_group(&$element, &$form_state) {
  $parents = implode('][', $element['#parents']);

  // Each details element forms a new group. The #type 'vertical_tabs' basically
  // only injects a new details element.
  $form_state['groups'][$parents]['#group_exists'] = TRUE;
  $element['#groups'] =& $form_state['groups'];

  // Process vertical tabs group member details elements.
  if (isset($element['#group'])) {

    // Add this details element to the defined group (by reference).
    $group = $element['#group'];
    $form_state['groups'][$group][] =& $element;
  }

  // Contains form element summary functionalities.
  $element['#attached']['library'][] = array(
    'system',
    'drupal.form',
  );
  return $element;
}