You are here

function features_get_default_hooks in Features 6

Same name and namespace in other branches
  1. 7.2 features.export.inc \features_get_default_hooks()
  2. 7 features.export.inc \features_get_default_hooks()

Gets the available default hooks keyed by components.

3 calls to features_get_default_hooks()
features_get_default in ./features.export.inc
Get defaults for a given module/component pair.
features_get_default_map in ./features.export.inc
Get a map of components to their providing modules.
features_get_normal in ./features.export.inc
Get normal objects for a given module/component pair.

File

./features.export.inc, line 333

Code

function features_get_default_hooks($component = NULL, $reset = FALSE) {
  static $hooks;
  if (!isset($hooks) || $reset) {
    $hooks = array();
    features_include();
    foreach (module_implements('features_api') as $module) {
      $info = module_invoke($module, 'features_api');
      foreach ($info as $k => $v) {
        if (isset($v['default_hook'])) {
          $hooks[$k] = $v['default_hook'];
        }
      }
    }
  }
  if (isset($component)) {
    return isset($hooks[$component]) ? $hooks[$component] : FALSE;
  }
  return $hooks;
}