public static function runCallbacks($name, &$arguments = array(), $type = 'all', &$object = null, &$function = null, &$data = array()) {
    if (isset(Hook::$hooks['all'])) {
      foreach (Hook::$hooks['all'] as $curCallback) {
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
          call_user_func_array($curCallback[1], array(&$arguments, $name, &$object, &$function, &$data));
          if ($arguments === false) {
            return;
          }
        }
      }
    }
    if (isset(Hook::$hooks[$name])) {
      foreach (Hook::$hooks[$name] as $curCallback) {
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
          call_user_func_array($curCallback[1], array(&$arguments, $name, &$object, &$function, &$data));
          if ($arguments === false) {
            return;
          }
        }
      }
    }
  }
public static function runCallbacks($name, &$arguments = array(), $type = 'all', &$object = null, &$function = null, &$data = array()) {
    if (isset(Hook::$hooks['all'])) {
      foreach (Hook::$hooks['all'] as $curCallback) {
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
          call_user_func_array($curCallback[1], array(&$arguments, $name, &$object, &$function, &$data));
          if ($arguments === false) {
            return;
          }
        }
      }
    }
    if (isset(Hook::$hooks[$name])) {
      foreach (Hook::$hooks[$name] as $curCallback) {
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
          call_user_func_array($curCallback[1], array(&$arguments, $name, &$object, &$function, &$data));
          if ($arguments === false) {
            return;
          }
        }
      }
    }
  }
public static function runCallbacks ( $ name , & $ arguments = array ( ) , $ type = 'all' , & $ object = null , & $ function = null , & $ data = array ( ) ) { if ( isset ( Hook :: $ hooks [ 'all' ] ) ) { foreach ( Hook :: $ hooks [ 'all' ] as $ curCallback ) { if ( ( $ type == 'all' && $ curCallback [ 0 ] != 0 ) || ( $ type == 'before' && $ curCallback [ 0 ] < 0 ) || ( $ type == 'after' && $ curCallback [ 0 ] > 0 ) ) { call_user_func_array ( $ curCallback [ 1 ] , array ( & $ arguments , $ name , & $ object , & $ function , & $ data ) ) ; if ( $ arguments === false ) { return ; } } } } if ( isset ( Hook :: $ hooks [ $ name ] ) ) { foreach ( Hook :: $ hooks [ $ name ] as $ curCallback ) { if ( ( $ type == 'all' && $ curCallback [ 0 ] != 0 ) || ( $ type == 'before' && $ curCallback [ 0 ] < 0 ) || ( $ type == 'after' && $ curCallback [ 0 ] > 0 ) ) { call_user_func_array ( $ curCallback [ 1 ] , array ( & $ arguments , $ name , & $ object , & $ function , & $ data ) ) ; if ( $ arguments === false ) { return ; } } } } }
Run the callbacks for a given hook.

Each callback is run and passed the array of arguments, and the name of
the given hook. If any callback changes $arguments to FALSE, the
following callbacks will not be called, and FALSE will be returned.

@param string $name The name of the hook.
@param array &$arguments An array of arguments to be passed to the callbacks.
@param string $type The type of callbacks to run. 'before', 'after', or 'all'.
@param mixed &$object The object on which the hook was called.
@param callback &$function The function which is called at "0". You can change this in the "before" callbacks to effectively takeover a function.
@param array &$data A data array for callback communication.
Run the callbacks for a given hook .