function flag_features_providing_module in Flag 7.2
Same name and namespace in other branches
- 6.2 includes/flag.features.inc \flag_features_providing_module()
- 7.3 includes/flag.features.inc \flag_features_providing_module()
Helper function; Retrieve the providing modules defining the flags.
1 call to flag_features_providing_module()
- flag_features_export in includes/
flag.features.inc - Implements hook_features_export().
File
- includes/
flag.features.inc, line 83 - Features integration for Flag module.
Code
function flag_features_providing_module() {
$modules = array();
$hook = 'flag_definitions';
foreach (module_implements($hook) as $module) {
foreach (module_invoke($module, $hook) as $key => $value) {
$modules[$key] = $module;
}
}
// Any entity type without a flag providing module will be provided by the
// flag module.
foreach (entity_get_info() as $entity_type => $entity) {
if (!isset($modules[$entity_type]) && empty($entity['configuration']) && $entity_type !== 'taxonomy_vocabulary') {
$modules[$entity_type] = 'flag';
}
}
return $modules;
}