Don't show the link for resource removal if the resource is utilized for configuration

refs #9804
This commit is contained in:
Alexander A. Klimov 2016-11-03 18:28:44 +01:00
parent 647c0b4354
commit 7331904851
2 changed files with 16 additions and 10 deletions

View File

@ -315,6 +315,8 @@ class ConfigController extends Controller
{ {
$this->assertPermission('config/application/resources'); $this->assertPermission('config/application/resources');
$this->view->resources = Config::app('resources', true); $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'); $this->createApplicationTabs()->activate('resource');
} }

View File

@ -58,16 +58,20 @@
) ?> ) ?>
</td> </td>
<td class="icon-col text-right"> <td class="icon-col text-right">
<?= $this->qlink( <?php
'', if (! in_array($name, $unremovableResources)) {
'config/removeresource', echo $this->qlink(
array('resource' => $name), '',
array( 'config/removeresource',
'class' => 'action-link', array('resource' => $name),
'icon' => 'cancel', array(
'title' => sprintf($this->translate('Remove resource %s'), $name) 'class' => 'action-link',
) 'icon' => 'cancel',
) ?> 'title' => sprintf($this->translate('Remove resource %s'), $name)
)
);
}
?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>