mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
parent
996224f54a
commit
2cf52df0a8
@ -7,6 +7,7 @@ use Exception;
|
|||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
|
use Icinga\Data\DataArray\ArrayDatasource;
|
||||||
use Icinga\Forms\ConfirmRemovalForm;
|
use Icinga\Forms\ConfirmRemovalForm;
|
||||||
use Icinga\Forms\Navigation\NavigationConfigForm;
|
use Icinga\Forms\Navigation\NavigationConfigForm;
|
||||||
use Icinga\Web\Controller;
|
use Icinga\Web\Controller;
|
||||||
@ -63,14 +64,16 @@ class NavigationController extends Controller
|
|||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$user = $this->Auth()->getUser();
|
$user = $this->Auth()->getUser();
|
||||||
$userConfig = $user->loadNavigationConfig();
|
|
||||||
$sharedConfig = Config::app('navigation');
|
$ds = new ArrayDatasource(array_merge(
|
||||||
|
Config::app('navigation')->select()->where('owner', $user->getUsername())->fetchAll(),
|
||||||
|
iterator_to_array($user->loadNavigationConfig())
|
||||||
|
));
|
||||||
|
$ds->setKeyColumn('name');
|
||||||
|
$query = $ds->select();
|
||||||
|
|
||||||
$this->view->types = $this->listItemTypes();
|
$this->view->types = $this->listItemTypes();
|
||||||
$this->view->items = array_merge(
|
$this->view->items = $query;
|
||||||
$sharedConfig->select()->where('owner', $user->getUsername())->fetchAll(),
|
|
||||||
iterator_to_array($userConfig)
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->getTabs()->add(
|
$this->getTabs()->add(
|
||||||
'navigation',
|
'navigation',
|
||||||
@ -80,6 +83,13 @@ class NavigationController extends Controller
|
|||||||
'url' => 'navigation'
|
'url' => 'navigation'
|
||||||
)
|
)
|
||||||
)->activate('navigation');
|
)->activate('navigation');
|
||||||
|
$this->setupSortControl(
|
||||||
|
array(
|
||||||
|
'name' => $this->translate('Shared Navigation'),
|
||||||
|
'type' => $this->translate('Type')
|
||||||
|
),
|
||||||
|
$query
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,12 +1,19 @@
|
|||||||
<?php if (! $this->compact): ?>
|
<?php if (! $this->compact): ?>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs; ?>
|
||||||
|
<?= $this->sortBox; ?>
|
||||||
|
<?= $this->limiter; ?>
|
||||||
|
<?= $this->paginator; ?>
|
||||||
|
<?= $this->filterEditor; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content" data-base-target="_next">
|
<div class="content" data-base-target="_next">
|
||||||
<a href="<?= $this->href('navigation/add'); ?>">
|
<a href="<?= $this->href('navigation/add'); ?>">
|
||||||
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Navigation Item'); ?>
|
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Navigation Item'); ?>
|
||||||
</a>
|
</a>
|
||||||
|
<?php if (count($items) === 0): ?>
|
||||||
|
<p><?= $this->translate('You did not create any navigation item yet'); ?></p>
|
||||||
|
<?php else: ?>
|
||||||
<table class="action alternating">
|
<table class="action alternating">
|
||||||
<thead>
|
<thead>
|
||||||
<th><?= $this->translate('Navigation'); ?></th>
|
<th><?= $this->translate('Navigation'); ?></th>
|
||||||
@ -40,4 +47,5 @@
|
|||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
@ -9,7 +9,7 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content" data-base-target="_next">
|
<div class="content" data-base-target="_next">
|
||||||
<?php if (count($items) === 0): ?>
|
<?php if (count($items) === 0): ?>
|
||||||
<?= $this->translate('There are currently no navigation items being shared'); ?>
|
<p><?= $this->translate('There are currently no navigation items being shared'); ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<table class="action alternating">
|
<table class="action alternating">
|
||||||
<thead>
|
<thead>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user