You are here

function foundation_group_field_group_attach_groups_alter in ZURB Section 7

Implements hook_field_group_attach_groups_alter().

Parameters

$groups:

File

./foundation_group.module, line 81

Code

function foundation_group_field_group_attach_groups_alter(&$groups) {

  // if passed array is empty, do nothing
  if (!count($groups)) {
    return;
  }
  $types = _foundation_group_get_types();
  $parents = array();
  foreach ($groups as $key => $group) {
    if (in_array($group->format_type, $types)) {
      unset($groups[$key]);
      $parents[$key] = $group;
    }
  }
  if (count($parents)) {
    $groups += $parents;
  }
}