Use better icons for resource and auth views

refs #9908
This commit is contained in:
Matthias Jentsch 2015-08-17 11:27:41 +02:00
parent 93f8297344
commit d51ecc3d72
6 changed files with 53 additions and 9 deletions

View File

@ -332,7 +332,7 @@ class ConfigController extends Controller
public function resourceAction()
{
$this->assertPermission('config/application/resources');
$this->view->resources = Config::app('resources', true)->keys();
$this->view->resources = Config::app('resources', true);
$this->createApplicationTabs()->activate('resource');
}

View File

@ -35,7 +35,7 @@ class UsergroupbackendController extends Controller
*/
public function listAction()
{
$this->view->backendNames = Config::app('groups')->keys();
$this->view->backendNames = Config::app('groups');
$this->createListTabs()->activate('usergroupbackend');
}

View File

@ -3,6 +3,7 @@
namespace Icinga\Forms\Config;
use Icinga\Application\Config;
use Icinga\Forms\ConfigForm;
use Icinga\Exception\NotFoundError;
use Icinga\Web\Notification;
@ -28,6 +29,16 @@ class UserBackendReorderForm extends ConfigForm
return $this->config->keys();
}
/**
* Return the ordered backend configuration
*
* @return Config
*/
public function getConfig()
{
return $this->config;
}
/**
* Create and add elements to this form
*

View File

@ -11,15 +11,38 @@
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
</thead>
<tbody>
<?php foreach ($this->resources as $name): ?>
<?php foreach ($this->resources as $name => $value): ?>
<tr>
<td>
<?php
switch ($value->type) {
case 'db':
$icon = 'database';
break;
case 'ldap':
$icon = 'sitemap';
break;
case 'livestatus':
$icon = 'flash';
break;
case 'ssh':
$icon = 'user';
break;
case 'file':
case 'ini':
$icon = 'doc-text';
break;
default:
$icon = 'edit';
break;
}
?>
<?= $this->qlink(
$name,
'config/editresource',
array('resource' => $name),
array(
'icon' => 'edit',
'icon' => $icon,
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
); ?>

View File

@ -6,8 +6,12 @@
<th style="width: 5em"><?= $this->translate('Order'); ?></th>
</thead>
<tbody>
<?php $backendNames = $form->getBackendOrder(); ?>
<?php for ($i = 0; $i < count($backendNames); $i++): ?>
<?php
$backendNames = $form->getBackendOrder();
$backendConfigs = $form->getConfig();
for ($i = 0; $i < count($backendNames); $i++):
$type = $backendConfigs->getSection($backendNames[$i])->get('backend');
?>
<tr>
<td class="action">
<?= $this->qlink(
@ -15,7 +19,8 @@
'config/edituserbackend',
array('backend' => $backendNames[$i]),
array(
'icon' => 'edit',
'icon' => $type === 'external' ?
'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'class' => 'rowaction',
'title' => sprintf($this->translate('rEdit user backend %s'), $backendNames[$i])
)

View File

@ -19,14 +19,19 @@
<tr>
</thead>
<tbody>
<?php foreach ($backendNames as $backendName): ?>
<?php foreach ($backendNames as $backendName => $config):
$type = $config->get('backend');
?>
<tr>
<td class="backend-name">
<?= $this->qlink(
$backendName,
'usergroupbackend/edit',
array('backend' => $backendName),
array('title' => sprintf($this->translate('Edit user group backend %s'), $backendName))
array(
'icon' => $type === 'external' ? 'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'title' => sprintf($this->translate('Edit user group backend %s'), $backendName)
)
); ?>
</td>
<td class="backend-remove"><?= $this->qlink(