mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-28 20:47:28 +00:00
allow empty for regular select menus of config variables
This commit is contained in:
parent
23b9def5c8
commit
bb416ffe56
|
@ -634,9 +634,10 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
|||
<?php
|
||||
break;
|
||||
case 'select':
|
||||
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
|
||||
if(!empty($conf['options'])) {
|
||||
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
|
||||
echo "<select class=\"chzn-select\" name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." style=\"width: 100%;\">";
|
||||
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." style=\"width: 100%;\">";
|
||||
if(is_array($conf['options'])) {
|
||||
$options = $conf['options'];
|
||||
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
|
||||
|
@ -644,6 +645,8 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
|||
} else {
|
||||
$options = [];
|
||||
}
|
||||
if($allowempty)
|
||||
echo "<option value=\"\"></option>";
|
||||
foreach($options as $key=>$opt) {
|
||||
echo "<option value=\"".$key."\"";
|
||||
if(in_array($key, $selections))
|
||||
|
@ -653,7 +656,6 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
|||
echo "</select>";
|
||||
} elseif(!empty($conf['internal'])) {
|
||||
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
|
||||
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
|
||||
switch($conf['internal']) {
|
||||
case "categories":
|
||||
$categories = $dms->getDocumentCategories();
|
||||
|
|
Loading…
Reference in New Issue
Block a user