menu access hook

  1. function menu_access_invoke_all() {
  2.   $args = func_get_args();
  3.   $hook = $args[0];
  4.   unset($args[0]);
  5.   $return = TRUE;
  6.   foreach (module_implements($hook) as $module) {
  7.     $function = $module .'_'. $hook;
  8.     $result = call_user_func_array($function, $args);
  9.     if (isset($result)) {
  10.       $return &= $result;
  11.     }
  12.   }
  13.  
  14.   return $return;
  15. }