user/list.phtml: Fix coding style, link targets, css, etc

refs #10367
This commit is contained in:
Johannes Meyer 2015-10-15 17:06:02 +02:00
parent 1144c86936
commit 9ccd6cd953
2 changed files with 26 additions and 28 deletions

View File

@ -44,7 +44,7 @@ class UserController extends AuthBackendController
'backend', 'backend',
array( array(
'autosubmit' => true, 'autosubmit' => true,
'label' => $this->translate('Authentication Backend'), 'label' => $this->translate('User Backend'),
'multiOptions' => array_combine($backendNames, $backendNames), 'multiOptions' => array_combine($backendNames, $backendNames),
'value' => $this->params->get('backend') 'value' => $this->params->get('backend')
) )

View File

@ -1,41 +1,34 @@
<?php <?php
use Icinga\Data\Extensible; use Icinga\Data\Extensible;
use Icinga\Data\Reducible; use Icinga\Data\Reducible;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls separated dont-print">
<?= $this->tabs ?> <?= $tabs ?>
<div class="grid dont-print"> <div class="grid">
<div class="col-1-3 text-left">
<?= $this->limiter ?> <?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?> <?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?> <?= $this->sortBox ?>
</div> </div>
</div>
<div> <div>
<?= $this->backendSelection ?> <?= $this->backendSelection ?>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if (! isset($backend)): ?>
<p><?= $this->translate('No backend found which is able to list users.') ?></p>
</div>
<?php return; endif ?>
<?php if (! $users->hasResult()): ?>
<p><?= $this->translate('No users found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<?php <?php
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible; if (! isset($backend)) {
echo $this->translate('No backend found which is able to list users') . '</div>';
return;
} else {
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible;
}
?> ?>
<?php if ($extensible): ?> <?php if ($extensible): ?>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Add a New User') , $this->translate('Add a New User') ,
@ -44,12 +37,17 @@ $reducible = $this->hasPermission('config/authentication/users/remove') && $back
array( array(
'class' => 'button-link', 'class' => 'button-link',
'data-base-target' => '_next', 'data-base-target' => '_next',
'icon' => 'plus', 'icon' => 'plus'
'title' => $this->translate('Create a new user')
) )
) ?> ) ?>
<?php endif ?> <?php endif ?>
<table class="action-table listing-table" data-base-target="_next">
<?php if (! $users->hasResult()): ?>
<p><?= $this->translate('No users found matching the filter') ?></p>
</div>
<?php return; endif ?>
<table data-base-target="_next" class="action-table listing-table">
<thead> <thead>
<tr> <tr>
<th><?= $this->translate('Username') ?></th> <th><?= $this->translate('Username') ?></th>