mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-06-08 16:12:43 -04:00
Don't show the link for resource removal if the resource is utilized for configuration
refs #9804
This commit is contained in:
parent
647c0b4354
commit
7331904851
2 changed files with 16 additions and 10 deletions
|
|
@ -315,6 +315,8 @@ class ConfigController extends Controller
|
|||
{
|
||||
$this->assertPermission('config/application/resources');
|
||||
$this->view->resources = Config::app('resources', true);
|
||||
$configResource = Config::app()->get('global', 'config_resource');
|
||||
$this->view->unremovableResources = $configResource === null ? array() : array($configResource);
|
||||
$this->createApplicationTabs()->activate('resource');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,16 +58,20 @@
|
|||
) ?>
|
||||
</td>
|
||||
<td class="icon-col text-right">
|
||||
<?= $this->qlink(
|
||||
'',
|
||||
'config/removeresource',
|
||||
array('resource' => $name),
|
||||
array(
|
||||
'class' => 'action-link',
|
||||
'icon' => 'cancel',
|
||||
'title' => sprintf($this->translate('Remove resource %s'), $name)
|
||||
)
|
||||
) ?>
|
||||
<?php
|
||||
if (! in_array($name, $unremovableResources)) {
|
||||
echo $this->qlink(
|
||||
'',
|
||||
'config/removeresource',
|
||||
array('resource' => $name),
|
||||
array(
|
||||
'class' => 'action-link',
|
||||
'icon' => 'cancel',
|
||||
'title' => sprintf($this->translate('Remove resource %s'), $name)
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue