Utilize Icinga\Web\Menu instead of Icinga\Application\Web::getMenu()

refs #2338
This commit is contained in:
Johannes Meyer 2018-04-30 10:26:00 +02:00
parent 71cb682832
commit e81d2f9af0
3 changed files with 6 additions and 6 deletions

View File

@ -3,8 +3,8 @@
namespace Icinga\Controllers;
use Icinga\Application\Icinga;
use Icinga\Web\Controller\ActionController;
use Icinga\Web\Menu;
/**
* Create complex layout parts
@ -18,7 +18,7 @@ class LayoutController extends ActionController
{
$this->setAutorefreshInterval(15);
$this->_helper->layout()->disableLayout();
$this->view->menuRenderer = Icinga::app()->getMenu()->getRenderer();
$this->view->menuRenderer = (new Menu())->getRenderer();
}
public function announcementsAction()

View File

@ -5,7 +5,6 @@ namespace Icinga\Controllers;
use Exception;
use Icinga\Application\Config;
use Icinga\Application\Icinga;
use Icinga\Exception\NotFoundError;
use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\Data\Filter\FilterMatchCaseInsensitive;
@ -13,6 +12,7 @@ use Icinga\Forms\ConfirmRemovalForm;
use Icinga\Forms\Navigation\NavigationConfigForm;
use Icinga\Web\Controller;
use Icinga\Web\Form;
use Icinga\Web\Menu;
use Icinga\Web\Navigation\Navigation;
use Icinga\Web\Notification;
use Icinga\Web\Url;
@ -419,7 +419,7 @@ class NavigationController extends Controller
'url' => Url::fromRequest()
));
$menu = Icinga::app()->getMenu();
$menu = new Menu();
$navigation = $menu->findItem($name);

View File

@ -1,6 +1,6 @@
<?php
use Icinga\Application\Icinga;
use Icinga\Web\Menu;
// Don't render a menu for unauthenticated users unless menu is auth aware
if (! $this->auth()->isAuthenticated()) {
@ -26,7 +26,7 @@ if (! $this->auth()->isAuthenticated()) {
'layout/menu.phtml',
'default',
array(
'menuRenderer' => Icinga::app()->getMenu()->getRenderer()->setUseStandardItemRenderer()
'menuRenderer' => (new Menu())->getRenderer()->setUseStandardItemRenderer()
)
) ?>
</div>