You are here

function themekey_invoke_modules in ThemeKey 6.2

Same name and namespace in other branches
  1. 6.4 themekey_base.inc \themekey_invoke_modules()
  2. 6.3 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

3 calls to themekey_invoke_modules()
themekey_themekey_global in ./themekey.module
Implements hook_themekey_global().
themekey_themekey_paths in ./themekey.module
Implements hook_themekey_paths().
themekey_themekey_properties in ./themekey.module
Implements hook_themekey_properties().

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(
    'themekey.node',
  )) as $module) {
    if (is_readable(drupal_get_path('module', 'themekey') . '/modules/' . $module . '.inc')) {
      require_once drupal_get_path('module', 'themekey') . '/modules/' . $module . '.inc';
    }
    $function = str_replace('.', '_', $module) . '_' . $hook;
    if (function_exists($function)) {
      $return = array_merge_recursive($return, $function());
    }
  }
  return $return;
}