shared navigation overview: Add sort control

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-17 15:17:46 +02:00
parent d4a9198310
commit 6e2d7dca9b
2 changed files with 19 additions and 3 deletions

View File

@ -88,8 +88,9 @@ class NavigationController extends Controller
public function sharedAction() public function sharedAction()
{ {
$this->assertPermission('config/application/navigation'); $this->assertPermission('config/application/navigation');
$this->view->items = Config::app('navigation'); $config = Config::app('navigation');
$this->view->types = $this->listItemTypes(); $config->getConfigObject()->setKeyColumn('name');
$query = $config->select();
$removeForm = new Form(); $removeForm = new Form();
$removeForm->setUidDisabled(); $removeForm->setUidDisabled();
@ -110,7 +111,10 @@ class NavigationController extends Controller
'label' => $this->view->icon('trash'), 'label' => $this->view->icon('trash'),
'title' => $this->translate('Unshare this navigation item') 'title' => $this->translate('Unshare this navigation item')
)); ));
$this->view->removeForm = $removeForm; $this->view->removeForm = $removeForm;
$this->view->types = $this->listItemTypes();
$this->view->items = $query;
$this->getTabs()->add( $this->getTabs()->add(
'navigation/shared', 'navigation/shared',
@ -120,6 +124,14 @@ class NavigationController extends Controller
'url' => 'navigation/shared' 'url' => 'navigation/shared'
) )
)->activate('navigation/shared'); )->activate('navigation/shared');
$this->setupSortControl(
array(
'name' => $this->translate('Shared Navigation'),
'type' => $this->translate('Type'),
'owner' => $this->translate('Owner')
),
$query
);
} }
/** /**

View File

@ -1,10 +1,14 @@
<?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">
<?php if ($items->isEmpty()): ?> <?php if (count($items) === 0): ?>
<?= $this->translate('There are currently no navigation items being shared'); ?> <?= $this->translate('There are currently no navigation items being shared'); ?>
<?php else: ?> <?php else: ?>
<table class="action alternating"> <table class="action alternating">