You are here

function _devel_node_access_module_invoke_all in Devel 6

Same name and namespace in other branches
  1. 5 devel_node_access.module \_devel_node_access_module_invoke_all()
  2. 7 devel_node_access.module \_devel_node_access_module_invoke_all()
1 call to _devel_node_access_module_invoke_all()
devel_node_access_block in ./devel_node_access.module

File

./devel_node_access.module, line 192
This module gives developers feedback as to what their node_access table contains, and which nodes are protected or visible to the public.

Code

function _devel_node_access_module_invoke_all() {

  // array and scalar returns only!
  $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)) {
      if (is_array($result)) {
        foreach ($result as $key => $value) {

          // add name of module that returned the value:
          $result[$key]['#module'] = $module;
        }
      }
      else {

        // build array with result keyed by $module:
        $result = array(
          $module => $result,
        );
      }
      $return = array_merge($return, $result);
    }
  }
  return $return;
}