mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02: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
@ -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…
x
Reference in New Issue
Block a user