parent
ddafae6271
commit
1a6d1a20fb
|
@ -33,7 +33,7 @@ class LayoutController extends ActionController
|
|||
/** @var Hook\Layout\TopBar $hook */
|
||||
$hook = null;
|
||||
|
||||
foreach (Hook::all(Hook::TARGET_LAYOUT_TOPBAR) as $hook) {
|
||||
foreach (Hook::all('TopBar') as $hook) {
|
||||
$topbarHtmlParts[] = $hook->getHtml($this->getRequest(), $this->view);
|
||||
}
|
||||
|
||||
|
|
|
@ -573,9 +573,14 @@ class Module
|
|||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function registerHook($name, $key, $class)
|
||||
protected function registerHook($name, $class, $key = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
$key = $this->name;
|
||||
}
|
||||
|
||||
Hook::register($name, $key, $class);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,11 +45,6 @@ use \Icinga\Exception\ProgrammingError;
|
|||
*/
|
||||
class Hook
|
||||
{
|
||||
/**
|
||||
* Hook name
|
||||
*/
|
||||
const TARGET_LAYOUT_TOPBAR = 'Layout\\TopBar';
|
||||
|
||||
/**
|
||||
* Our hook name registry
|
||||
*
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Web\Hook\Layout;
|
||||
namespace Icinga\Web\Hook;
|
||||
|
||||
use \Icinga\Web\Request;
|
||||
use \Zend_View;
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace Icinga\Module\Monitoring\Web\Hook;
|
||||
|
||||
use Icinga\Web\Hook\Layout\TopBar as IcingaTopBar;
|
||||
use Icinga\Web\Hook\TopBar as IcingaTopBar;
|
||||
use Icinga\Module\Monitoring\DataView\StatusSummary as StatusSummaryView;
|
||||
use Icinga\Web\Request;
|
||||
use Zend_View;
|
||||
|
|
|
@ -6,18 +6,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Authentication\Manager as AuthManager;
|
||||
use Icinga\Web\Hook;
|
||||
|
||||
if (Icinga::app()->isCli()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AuthManager::getInstance()->isAuthenticated()) {
|
||||
Hook::register(
|
||||
Hook::TARGET_LAYOUT_TOPBAR,
|
||||
'monitoring-topbar',
|
||||
'Icinga\\Module\\Monitoring\\Web\\Hook\\TopBar'
|
||||
);
|
||||
}
|
||||
$this->registerHook(
|
||||
'TopBar',
|
||||
'Icinga\\Module\\Monitoring\\Web\\Hook\\TopBar'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue