You are here

function themekey_invoke_modules in ThemeKey 6.3

Same name and namespace in other branches
  1. 6.4 themekey_base.inc \themekey_invoke_modules()
  2. 6.2 themekey_base.inc \themekey_invoke_modules()
  3. 7.3 themekey_base.inc \themekey_invoke_modules()
  4. 7 themekey_base.inc \themekey_invoke_modules()
  5. 7.2 themekey_base.inc \themekey_invoke_modules()

Invokes a hook on all modules stored in the global variable 'themekey_modules'

Parameters

$hook: name of the hook as string

Return value

mixed output of all hooks

2 calls to themekey_invoke_modules()
themekey_get_global_parameters in ./themekey_base.inc
Assigns global parameters' values to ThemeKey properties. Therefore, it calls hook_themekey_global()
themekey_rebuild in ./themekey_build.inc
Rebuilds all ThemeKey related drupal variables by calling ThemeKey's hooks:

File

./themekey_base.inc, line 25
The functions in this file are the back end of ThemeKey.

Code

function themekey_invoke_modules($hook) {
  $return = array();
  foreach (variable_get('themekey_modules', array(
    'node',
  )) as $module) {
    if (module_exists($module) && is_readable(drupal_get_path('module', 'themekey') . '/modules/themekey.' . $module . '.inc')) {
      require_once drupal_get_path('module', 'themekey') . '/modules/themekey.' . $module . '.inc';
      $function = 'themekey_' . $module . '_' . $hook;
      if (function_exists($function)) {
        $return = array_merge_recursive($return, $function());
      }
    }
    else {

      // seems like a module has been deactivated => update variable 'themekey_modules'
      module_load_include('inc', 'themekey', 'themekey_build');
      themekey_scan_modules();
    }
  }
  return $return;
}