diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-08-15 07:14:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-08-15 07:14:37 +0000 |
commit | d102bf73e3f22d90ca1908ee18143581df3041d7 (patch) | |
tree | 52e32d767b79a05d1019fa672f48c082bcbe87e2 /includes/module.inc | |
parent | 343437e75050c84dcaf6f980dac8c35203344bb1 (diff) | |
download | brdo-d102bf73e3f22d90ca1908ee18143581df3041d7.tar.gz brdo-d102bf73e3f22d90ca1908ee18143581df3041d7.tar.bz2 |
- Reverted module.inc to the old module_invoke() function.
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/includes/module.inc b/includes/module.inc index 0f75ed3c8..b5453b800 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -15,23 +15,19 @@ function module_iterate($function, $argument = "") { } // invoke hook $hook of module $name with optional arguments: -function module_invoke(){ - $args = func_get_args(); - $function = array_shift($args); - $function .= "_". array_shift($args); - +function module_invoke($name, $hook, $a1 = NULL, $a2 = NULL, $a3 = NULL, $a4 = NULL) { + $function = $name ."_". $hook; if (function_exists($function)) { - return $function(implode(",", $args)); + return $function($a1, $a2, $a3, $a4); } } // invoke $hook for all appropriate modules: -function module_invoke_all() { +function module_invoke_all($hook, $a1 = NULL, $a2 = NULL, $a3 = NULL, $a4 = NULL) { $return = array(); - $args = func_get_args(); foreach (module_list() as $name) { - if (module_hook($name, $args[0])) { - if ($result = module_invoke($name, implode(",", $args))) { + if (module_hook($name, $hook)) { + if ($result = module_invoke($name, $hook, $a1, $a2, $a3, $a4)) { $return = array_merge($return, $result); } } |