mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
* fixed hooks return value
* (internal) added new function: $hooks->exist($type)
This commit is contained in:
parent
d04f2b7965
commit
fade78efc1
@ -42,12 +42,12 @@ class Hook
|
||||
$ret = $tmp($params);
|
||||
}*/
|
||||
|
||||
global $db, $config, $template_path, $ots, $content;
|
||||
global $db, $config, $template_path, $ots, $content, $twig;
|
||||
if(file_exists(BASE . $this->_file)) {
|
||||
require(BASE . $this->_file);
|
||||
$ret = require(BASE . $this->_file);
|
||||
}
|
||||
|
||||
return true;
|
||||
return $ret === null || $ret == 1 || $ret;
|
||||
}
|
||||
|
||||
public function name() {return $this->_name;}
|
||||
@ -71,11 +71,17 @@ class Hooks
|
||||
if(isset(self::$_hooks[$type]))
|
||||
{
|
||||
foreach(self::$_hooks[$type] as $name => $hook)
|
||||
$ret = $hook->execute($params);
|
||||
if(!$hook->execute($params)) {
|
||||
$ret = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function exist($type) {
|
||||
return isset(self::$_hooks[$type]);
|
||||
}
|
||||
|
||||
public function load()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user