You are here

function ctools_component_features_api in Features 7.2

Same name and namespace in other branches
  1. 6 includes/features.ctools.inc \ctools_component_features_api()
  2. 7 includes/features.ctools.inc \ctools_component_features_api()

Master implementation of hook_features_api() for all ctools components.

This is not registered as a hook implementation by itself. Instead, it gets called from other implementations, especially those dynamically declared in ctools_features_declare_functions().

Note that this master hook does not use $component like the others, but uses the component module's namespace instead.

Parameters

string $module_name: The module on behalf of which ctools wants to declare components.

Return value

array[] Component definitions for the given module.

See also

\ctools_features_declare_functions()

\hook_features_api()

File

includes/features.ctools.inc, line 148
Features integration for 'ctools' module.

Code

function ctools_component_features_api($module_name) {
  $api = array();
  foreach (_ctools_features_get_info() as $component => $info) {

    // If module owner is set to "ctools" we need to compare the component.
    if ($info['module'] == $module_name || $info['module'] === 'ctools' && $component == $module_name) {
      $api[$component] = $info;
    }
  }
  return $api;
}