getHookObjects() takes parent classes into account

This commit is contained in:
Uwe Steinmann 2022-06-16 12:43:50 +02:00
parent 199f26703c
commit c3f5a637f6

View File

@ -217,13 +217,16 @@ class SeedDMS_View_Common {
*/ */
public function getHookObjects($classname='') { /* {{{ */ public function getHookObjects($classname='') { /* {{{ */
if($classname) if($classname)
$tmp = explode('_', $classname); $tmps = array(explode('_', $classname)[2]);
else else
$tmp = explode('_', get_class($this)); $tmps = $this->getHookClassNames();
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) { $hooks = [];
return $GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])]; foreach($tmps as $tmp) {
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp)])) {
$hooks = array_merge($hooks, $GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp)]);
} }
return array(); }
return $hooks;
} /* }}} */ } /* }}} */
/** /**