mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:44 +01:00
method to disable a hook for the current request
This commit is contained in:
parent
80cb358d88
commit
282c0bc90f
@ -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