You are here

function field_group_pre_render in Field Group 7

Same name and namespace in other branches
  1. 8.3 field_group.module \field_group_pre_render()
  2. 8 field_group.module \field_group_pre_render()
  3. 7.2 field_group.module \field_group_pre_render()

Function to pre render the field group element.

Parameters

$element Array of group element that needs to be created!:

$group Object with the group information.:

$form The form object itself.:

See also

field_group_fields_nest()

1 call to field_group_pre_render()
field_group_fields_nest in ./field_group.module
Recursive function to nest fields in the field groups.

File

./field_group.module, line 2145
Fieldgroup module.

Code

function field_group_pre_render(&$element, $group, &$form) {

  // Only run the pre_render function if the group has elements.
  // $group->group_name
  if ($element == array()) {
    return;
  }

  // Let modules define their wrapping element.
  // Note that the group element has no properties, only elements.
  foreach (module_implements('field_group_pre_render') as $module) {
    $function = $module . '_field_group_pre_render';
    if (function_exists($function)) {

      // The intention here is to have the opportunity to alter the
      // elements, as defined in hook_field_group_formatter_info.
      // Note, implement $element by reference!
      $function($element, $group, $form);
    }
  }

  // Allow others to alter the pre_render.
  drupal_alter('field_group_pre_render', $element, $group, $form);
}