Utilize Icinga\Web\Menu instead of Icinga\Application\Web::getMenu()
refs #2338
This commit is contained in:
parent
71cb682832
commit
e81d2f9af0
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
namespace Icinga\Controllers;
|
namespace Icinga\Controllers;
|
||||||
|
|
||||||
use Icinga\Application\Icinga;
|
|
||||||
use Icinga\Web\Controller\ActionController;
|
use Icinga\Web\Controller\ActionController;
|
||||||
|
use Icinga\Web\Menu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create complex layout parts
|
* Create complex layout parts
|
||||||
|
@ -18,7 +18,7 @@ class LayoutController extends ActionController
|
||||||
{
|
{
|
||||||
$this->setAutorefreshInterval(15);
|
$this->setAutorefreshInterval(15);
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
$this->view->menuRenderer = Icinga::app()->getMenu()->getRenderer();
|
$this->view->menuRenderer = (new Menu())->getRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function announcementsAction()
|
public function announcementsAction()
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace Icinga\Controllers;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Application\Icinga;
|
|
||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
use Icinga\Data\DataArray\ArrayDatasource;
|
use Icinga\Data\DataArray\ArrayDatasource;
|
||||||
use Icinga\Data\Filter\FilterMatchCaseInsensitive;
|
use Icinga\Data\Filter\FilterMatchCaseInsensitive;
|
||||||
|
@ -13,6 +12,7 @@ use Icinga\Forms\ConfirmRemovalForm;
|
||||||
use Icinga\Forms\Navigation\NavigationConfigForm;
|
use Icinga\Forms\Navigation\NavigationConfigForm;
|
||||||
use Icinga\Web\Controller;
|
use Icinga\Web\Controller;
|
||||||
use Icinga\Web\Form;
|
use Icinga\Web\Form;
|
||||||
|
use Icinga\Web\Menu;
|
||||||
use Icinga\Web\Navigation\Navigation;
|
use Icinga\Web\Navigation\Navigation;
|
||||||
use Icinga\Web\Notification;
|
use Icinga\Web\Notification;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
|
@ -419,7 +419,7 @@ class NavigationController extends Controller
|
||||||
'url' => Url::fromRequest()
|
'url' => Url::fromRequest()
|
||||||
));
|
));
|
||||||
|
|
||||||
$menu = Icinga::app()->getMenu();
|
$menu = new Menu();
|
||||||
|
|
||||||
$navigation = $menu->findItem($name);
|
$navigation = $menu->findItem($name);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Web\Menu;
|
||||||
|
|
||||||
// Don't render a menu for unauthenticated users unless menu is auth aware
|
// Don't render a menu for unauthenticated users unless menu is auth aware
|
||||||
if (! $this->auth()->isAuthenticated()) {
|
if (! $this->auth()->isAuthenticated()) {
|
||||||
|
@ -26,7 +26,7 @@ if (! $this->auth()->isAuthenticated()) {
|
||||||
'layout/menu.phtml',
|
'layout/menu.phtml',
|
||||||
'default',
|
'default',
|
||||||
array(
|
array(
|
||||||
'menuRenderer' => Icinga::app()->getMenu()->getRenderer()->setUseStandardItemRenderer()
|
'menuRenderer' => (new Menu())->getRenderer()->setUseStandardItemRenderer()
|
||||||
)
|
)
|
||||||
) ?>
|
) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue