From d988dae61fdbbcf4802f7de1bbfa8fe4be85827a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 30 Jan 2002 18:15:02 +0000 Subject: - Applied Natrak's module improvements. --- includes/module.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'includes') diff --git a/includes/module.inc b/includes/module.inc index 2e8476572..8f53e8591 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -19,6 +19,20 @@ function module_invoke($name, $hook, $a1 = NULL, $a2 = NULL, $a3 = NULL, $a4 = N } } +// invoke $hook for all appropriate modules: +function module_invoke_all($hook, $a1 = NULL, $a2 = NULL, $a3 = NULL, $a4 = NULL) { + $return = array(); + foreach (module_list() as $name) { + if (module_hook($name, $hook)) { + if ($result = module_invoke($name, $hook, $a1, $a2, $a3, $a4)) { + $return = array_merge($return, $result); + } + } + } + + return $return; +} + // return array of module names (includes lazy module loading): function module_list() { static $list; -- cgit v1.2.3