fix calling hook 'globalNavigationBar'

This commit is contained in:
Uwe Steinmann 2020-04-21 15:38:18 +02:00
parent 49ba7df19b
commit 9056e91bc3

View File

@ -388,8 +388,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$menuitems['help'] = array('link'=>'../out/out.Help.php?context='.$tmp[1], 'label'=>"help");
}
/* Check if hook exists because otherwise callHook() will override $menuitems */
if($this->hasHook('globalNavigationBar'))
$menuitems = $this->callHook('globalNavigationBar', $menuitems);
foreach($hookObjs as $hookObj) {
if (method_exists($hookObj, 'globalNavigationBar')) {
$menuitems = $hookObj->globalNavigationBar($this, $menuitems);
}
}
foreach($menuitems as $menuitem) {
echo "<li><a href=\"".$menuitem['link']."\"".(isset($menuitem['target']) ? ' target="'.$menuitem['target'].'"' : '').">".getMLText($menuitem['label'])."</a></li>";
}