You are here

function util_run_utilities in Util 5

1 call to util_run_utilities()
util_menu in ./util.module

File

./util.module, line 27

Code

function util_run_utilities() {
  global $hook_files;
  $files = drupal_system_listing("\\.inc", drupal_get_path('module', 'util') . "/utilities", 'name', 1);
  ksort($files);
  $hook_files = array();
  $hooks = array();
  foreach ($files as $file) {
    include $file->filename;
    $hooks = array_merge(call_user_func($file->name . "_util", "hook registry"), $hooks);
    $hook_files[$file->name] = call_user_func($file->name . "_util", "hook registry");
  }

  /*
   *  Functionality to be used in a future version - see 5.x-2.x-dev
   *  Doesn't work yet - don't uncomment
   */

  /*
  foreach ($hooks as $hook)
  {
  	$call = '';
    foreach($hook_files as $file => $hook_file) {
      foreach ($hook_file as $hook) {
        if(function_exists($file .'_util_'. $hook)) {
          $call .= 'call_user_func_array(\''.$file .'_util_'. $hook .'\', $args);';
        }
      }
    }
    eval("
    function util_". $hook ."() {
      \$args = func_get_args();
      ". $call ."
    }
    ");
  }
  */
}