diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-01-16 18:44:49 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-01-16 18:44:49 +0000 |
commit | 971a0e24aa6344da7ae07f476ed3fb371bd744d0 (patch) | |
tree | 130b8c7e3e374b5edb7fa9ed91a80b890ab4275e /includes/module.inc | |
parent | b04d46df4dfae84eab09f3f8a7f06cf462452711 (diff) | |
download | brdo-971a0e24aa6344da7ae07f476ed3fb371bd744d0.tar.gz brdo-971a0e24aa6344da7ae07f476ed3fb371bd744d0.tar.bz2 |
- Patch #14731 by chx: made it possible to rewrite node queries.
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/includes/module.inc b/includes/module.inc index 820fdf7e9..b2b1354a7 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -137,6 +137,30 @@ function module_hook($module, $hook) { } /** + * Determine which modules are implementing a hook. + * + * @param $hook + * The name of the hook (e.g. "help" or "menu"). + * @return + * An array with the names of the modules which are implementing this hook. + */ +function module_implements($hook) { + static $implementations; + + if (!isset($implementations[$hook])) { + $implementations[$hook] = array(); + $list = module_list(); + foreach ($list as $module) { + if (module_hook($module, $hook)) { + $implementations[$hook][] = $module; + } + } + } + + return $implementations[$hook]; +} + +/** * Invoke a hook in a particular module. * * @param $module |