You are here

function flag_features_providing_module in Flag 7.3

Same name and namespace in other branches
  1. 6.2 includes/flag.features.inc \flag_features_providing_module()
  2. 7.2 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 106
Features integration for Flag module.

Code

function flag_features_providing_module() {
  $modules = array();
  $hook = 'flag_type_info';
  foreach (module_implements($hook) as $module) {
    foreach (module_invoke($module, $hook) as $key => $value) {
      $modules[$key] = isset($value['module']) ? $value['module'] : $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;
}