Fix editor su impostazioni

This commit is contained in:
loviuz 2023-02-24 11:26:42 +01:00
parent 78ae0dc072
commit 6b28ded828
1 changed files with 14 additions and 1 deletions

View File

@ -220,8 +220,21 @@ class Settings
{[ "type": "checkbox", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "checkbox", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
// Editor
elseif ($setting->tipo == 'ckeditor') {
$result = input([
'type' => 'ckeditor',
'label' => json_encode($setting->nome),
'readonly' => !$setting->editable,
'name' => 'setting['.$setting->id.']',
'value' => $setting->valore,
'required' => intval($required),
'help' => $setting->help,
]);
}
// Campi di default // Campi di default
elseif (in_array($setting->tipo, ['textarea', 'ckeditor', 'timestamp', 'date', 'time'])) { elseif (in_array($setting->tipo, ['textarea', 'timestamp', 'date', 'time'])) {
$result = ' $result = '
{[ "type": "'.$setting->tipo.'", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "'.$setting->tipo.'", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }