diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 6aa6f0a1f..0379e1104 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -751,21 +751,16 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $menuitems['transfer_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.TransferDocument". $docid, 'label'=>getMLText('transfer_document')); } - /* Check if hook exists because otherwise callHook() will override $menuitems */ - if($this->hasHook('documentNavigationBar')) - $menuitems = $this->callHook('documentNavigationBar', $document, $menuitems); - - /* Do not use $this->callHook() because $menuitems must be returned by the hook - * or left unchanged + /* Do not use $this->callHook() because $menuitems must be returned by the the + * first hook and passed to next hook. $this->callHook() will just pass + * the menuitems to each single hook. Hence, the last hook will win. */ - /* $hookObjs = $this->getHookObjects(); foreach($hookObjs as $hookObj) { if (method_exists($hookObj, 'documentNavigationBar')) { $menuitems = $hookObj->documentNavigationBar($this, $document, $menuitems); } } - */ self::showNavigationBar($menuitems); diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index de5965c4c..f1f878a54 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -748,21 +748,16 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $menuitems['transfer_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.TransferDocument". $docid, 'label'=>getMLText('transfer_document')); } - /* Check if hook exists because otherwise callHook() will override $menuitems */ - if($this->hasHook('documentNavigationBar')) - $menuitems = $this->callHook('documentNavigationBar', $document, $menuitems); - - /* Do not use $this->callHook() because $menuitems must be returned by the hook - * or left unchanged + /* Do not use $this->callHook() because $menuitems must be returned by the the + * first hook and passed to next hook. $this->callHook() will just pass + * the menuitems to each single hook. Hence, the last hook will win. */ - /* $hookObjs = $this->getHookObjects(); foreach($hookObjs as $hookObj) { if (method_exists($hookObj, 'documentNavigationBar')) { $menuitems = $hookObj->documentNavigationBar($this, $document, $menuitems); } } - */ self::showNavigationBar($menuitems); } /* }}} */