mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
parent
6a00eaf34d
commit
8e6fc1580e
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Controllers;
|
namespace Icinga\Controllers;
|
||||||
|
|
||||||
|
use Icinga\Application\Config;
|
||||||
use Icinga\Web\Controller;
|
use Icinga\Web\Controller;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -15,7 +16,23 @@ class NavigationController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
$user = $this->Auth()->getUser();
|
||||||
|
$userConfig = $user->loadNavigationConfig();
|
||||||
|
$sharedConfig = Config::app('navigation');
|
||||||
|
|
||||||
|
$this->view->items = array_merge(
|
||||||
|
$sharedConfig->select()->where('owner', $user->getUsername())->fetchAll(),
|
||||||
|
iterator_to_array($userConfig)
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->getTabs()->add(
|
||||||
|
'navigation',
|
||||||
|
array(
|
||||||
|
'title' => $this->translate('List and configure your own navigation items'),
|
||||||
|
'label' => $this->translate('Navigation'),
|
||||||
|
'url' => 'navigation'
|
||||||
|
)
|
||||||
|
)->activate('navigation');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
39
application/views/scripts/navigation/index.phtml
Normal file
39
application/views/scripts/navigation/index.phtml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php if (! $this->compact): ?>
|
||||||
|
<div class="controls">
|
||||||
|
<?= $this->tabs; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
|
<div class="content" data-base-target="_next">
|
||||||
|
<a href="<?= $this->href('navigation/add'); ?>">
|
||||||
|
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Navigation Item'); ?>
|
||||||
|
</a>
|
||||||
|
<table class="action alternating">
|
||||||
|
<thead>
|
||||||
|
<th><?= $this->translate('Navigation'); ?></th>
|
||||||
|
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($items as $name => $item): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $this->qlink(
|
||||||
|
$name,
|
||||||
|
'navigation/edit',
|
||||||
|
array('name' => $name),
|
||||||
|
array(
|
||||||
|
'title' => sprintf($this->translate('Edit navigation item %s'), $name)
|
||||||
|
)
|
||||||
|
); ?></td>
|
||||||
|
<td><?= $this->qlink(
|
||||||
|
'',
|
||||||
|
'navigation/remove',
|
||||||
|
array('name' => $name),
|
||||||
|
array(
|
||||||
|
'icon' => 'trash',
|
||||||
|
'title' => sprintf($this->translate('Remove navigation item %s'), $name)
|
||||||
|
)
|
||||||
|
); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user