saving the settings will no longer reenable an extention with no configuration

This commit is contained in:
Uwe Steinmann 2020-11-22 12:35:26 +01:00
parent ab858a9af8
commit 386e37db0d
3 changed files with 14 additions and 3 deletions

View File

@ -12,6 +12,8 @@
- fix .htaccess file in restapi
- restapi: add setDocumentOwner, owner can be set when uploading a document
- theme in configuration can override theme of user
- saving the settings will no longer reenable an extention with no configuration
- put a red/green bullet before the extension name in the settings
--------------------------------------------------------------------------------
Changes in version 5.1.20

View File

@ -216,7 +216,9 @@ ul.jqtree-tree li.jqtree_common > .jqtree-element:hover {
}
i.success {color: #00b000;}
i.enabled {color: #00b000;}
i.error {color: #b00000;}
i.disabled {color: #b00000;}
i.warning {color: #ff9900;}
i.initstate {color: #ff9900;}
i.released {color: #00b000;}

View File

@ -38,7 +38,8 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
protected function showStartPaneContent($name, $isactive) { /* {{{ */
echo '<div class="tab-pane'.($isactive ? ' active' : '').'" id="'.$name.'">';
$this->contentContainerStart();
echo '<table class="table-condensed">';
echo '<table class="table-condensed" style="table-layout: fixed;">';
echo '<tr><td width="20%"></td><td width="80%"></td></tr>';
} /* }}} */
protected function showEndPaneContent($name, $currentab) { /* {{{ */
@ -510,8 +511,8 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
if($this->hasHook('processConfig'))
$extconf = $this->callHook('processConfig', $extname, $extconf);
if($extconf['config']) {
$this->showRawConfigHeadline("<a name=\"".$extname."\"></a>".'<input type="hidden" name="extensions['.$extname.'][__disable__]" value="'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? '1' : '').'" />'.$extconf['title']);
foreach($extconf['config'] as $confkey=>$conf) {
$this->showRawConfigHeadline("<a name=\"".$extname."\"></a>".'<input type="hidden" name="extensions['.$extname.'][__disable__]" value="'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? '1' : '').'" /><i class="fa fa-circle'.($settings->_extensions[$extname]["__disable__"] ? ' disabled' : ' enabled').'"></i> <span title="'.$extname.'">'.$extconf['title'].'</span>');
foreach($extconf['config'] as $confkey=>$conf) {
ob_start();
switch($conf['type']) {
case 'checkbox':
@ -631,6 +632,12 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
$html = ob_get_clean();
$this->showConfigPlain($conf['title'], isset($conf['help']) ? $conf['help'] : '', $html);
}
} else {
/* Even no configuration exists, output the input field to enable/disable
* the extension. Otherwise it will be enabled each time the config is
* saved.
*/
echo '<input type="hidden" name="extensions['.$extname.'][__disable__]" value="'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? '1' : '').'" />'."\n";
}
}
$this->showEndPaneContent('extensions', $currenttab);