add method callHook()

this method is ment to be called from the view classes. It checks
for a hook set up for the current view.
This commit is contained in:
Uwe Steinmann 2013-05-02 12:12:28 +02:00
parent 18bfb51dd5
commit 50e41be376

View File

@ -52,5 +52,17 @@ class SeedDMS_View_Common {
function show() {
}
function callHook($hook) {
$tmp = explode('_', get_class($this));
if(isset($GLOBALS['SEEDDMS_HOOKS'][lcfirst($tmp[2])])) {
foreach($GLOBALS['SEEDDMS_HOOKS'][lcfirst($tmp[2])] as $hookObj) {
if (method_exists($hookObj, $hook)) {
return $hookObj->$hook($this);
}
}
}
return "";
}
}
?>