mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
method to disable a hook for the current request
This commit is contained in:
parent
809e96794e
commit
9b98e07b69
@ -203,6 +203,23 @@ class Hooks
|
||||
return isset(self::$locations[$location]) ? array_keys(self::$locations[$location]) : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a hook for this request
|
||||
*
|
||||
* @param string $hook
|
||||
* @return boolean true if hook existed, false otherwise
|
||||
*/
|
||||
static public function disable($hook)
|
||||
{
|
||||
if (!isset(self::$locations)) self::read();
|
||||
|
||||
$ret = isset(self::$locations[$hook]);
|
||||
|
||||
unset(self::$locations[$hook]);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read all hooks into self::$locations
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user