module_invoke_all()
drupal-5/includes/module.inc, line 399
Invoke a hook in all enabled modules that implement it.
$hook The name of the hook to invoke.
... Arguments to pass to the hook.
An array of return values of the hook implementations. If modules return arrays from their implementations, those are merged into one array.
<?php
function module_invoke_all() {
$args = func_get_args();
$hook = array_shift($args);
$return = array();
foreach (module_implements($hook) as $module) {
$function = $module .'_'. $hook;
$result = call_user_func_array($function, $args);
if (isset($result) && is_array($result)) {
$return = array_merge($return, $result);
}
else if (isset($result)) {
$return[] = $result;
}
}
return $return;
}
?>