You are here

function field_group_read_groups in Field Group 7.2

Same name in this branch
  1. 7.2 field_group.api.php \field_group_read_groups()
  2. 7.2 field_group.module \field_group_read_groups()
Same name and namespace in other branches
  1. 7 field_group.api.php \field_group_read_groups()
  2. 7 field_group.module \field_group_read_groups()

Read all groups.

Parameters

$params: Parameters for the query $name The name of the entity. $bundle The name of the bundle. $view_mode The view mode.

4 calls to field_group_read_groups()
field_group_exists in ./field_group.module
Checks if a field_group exists in required context.
field_group_field_attach_delete_bundle in ./field_group.module
Implements hook_field_attach_delete_bundle().
field_group_field_ui_clone_field_groups in ./field_group.field_ui.inc
Submit handler to save existing fieldgroups from one view mode or form to another.
field_group_info_groups in ./field_group.module
Get all groups.

File

./field_group.module, line 1399
Fieldgroup module.

Code

function field_group_read_groups($params = array()) {
  $groups = array();
  ctools_include('export');
  if (empty($params)) {
    $records = ctools_export_load_object('field_group');
  }
  else {
    $records = ctools_export_load_object('field_group', 'conditions', $params);
  }
  foreach ($records as $group) {

    // Deleted groups.
    // @TODO remove the code below and add something meaningfull for "disabled" state.
    if (isset($group->disabled) && $group->disabled) {
      continue;
    }
    $groups[$group->entity_type][$group->bundle][$group->mode][$group->group_name] = field_group_unpack($group);
  }
  return $groups;
}