function field_group_info_groups in Field Group 7
Same name in this branch
- 7 field_group.api.php \field_group_info_groups()
- 7 field_group.module \field_group_info_groups()
Same name and namespace in other branches
- 8.3 field_group.module \field_group_info_groups()
- 8 field_group.module \field_group_info_groups()
- 7.2 field_group.api.php \field_group_info_groups()
- 7.2 field_group.module \field_group_info_groups()
Get all groups.
Parameters
$entity_type: The name of the entity.
$bundle: The name of the bundle.
$view_mode: The view mode.
$reset.: Whether to reset the cache or not.
18 calls to field_group_info_groups()
- field_group_attach_groups in ./
field_group.module - Attach groups to the (form) build.
- field_group_field_info_max_weight in ./
field_group.field_ui.inc - Implements hook_field_info_max_weight().
- field_group_field_overview_submit in ./
field_group.field_ui.inc - Submit handler for the overview screens.
- field_group_field_ui_form_params in ./
field_group.field_ui.inc - Helper function to get the form parameters to use while building the fields and display overview form.
- field_group_update_7001 in ./
field_group.install - Update hook on the field_group table to add an unique identifier.
File
- ./
field_group.module, line 1650 - Fieldgroup module.
Code
function field_group_info_groups($entity_type = NULL, $bundle = NULL, $view_mode = NULL, $reset = FALSE) {
static $groups = FALSE;
if (!$groups || $reset) {
if (!$reset && ($cached = cache_get('field_groups', 'cache_field'))) {
$groups = $cached->data;
}
else {
$ctools_export_load_object =& drupal_static('ctools_export_load_object');
$ctools_export_load_object_all =& drupal_static('ctools_export_load_object_all');
unset($ctools_export_load_object['field_group']);
unset($ctools_export_load_object_all['field_group']);
$groups = field_group_read_groups();
cache_set('field_groups', $groups, 'cache_field');
}
}
if (!isset($entity_type)) {
return $groups;
}
elseif (!isset($bundle) && isset($groups[$entity_type])) {
return $groups[$entity_type];
}
elseif (!isset($view_mode) && isset($groups[$entity_type][$bundle])) {
return $groups[$entity_type][$bundle];
}
elseif (isset($groups[$entity_type][$bundle][$view_mode])) {
return $groups[$entity_type][$bundle][$view_mode];
}
return array();
}