function og_fields_info in Organic groups 7
Same name and namespace in other branches
- 7.2 og.module \og_fields_info()
Get all the modules fields that can be assigned to fieldable enteties.
5 calls to og_fields_info()
- og_create_field in ./
og.module - Create an organic groups field in a bundle.
- og_field_attach_form in ./
og.field.inc - Implements hook_field_attach_form().
- og_ui_field_settings in og_ui/
og_ui.admin.inc - Groups permissions on default settings form.
- og_ui_field_settings_submit in og_ui/
og_ui.admin.inc - og_ui_field_settings_validate in og_ui/
og_ui.admin.inc
File
- ./
og.module, line 2932 - Enable users to create and manage groups with roles and permissions.
Code
function og_fields_info($field_name = NULL) {
$return =& drupal_static(__FUNCTION__, array());
if (empty($return)) {
foreach (module_implements('og_fields_info') as $module) {
if ($fields = module_invoke($module, 'og_fields_info')) {
foreach ($fields as $key => $field) {
// Add default values.
$field += array(
'entity type' => array(),
'disable on node translate' => TRUE,
);
// Add the module information.
$return[$key] = array_merge($field, array(
'module' => $module,
));
}
}
}
// Allow other modules to alter the field info.
drupal_alter('og_fields_info', $return);
}
return empty($field_name) ? $return : $return[$field_name];
}