diff options
author | Yaco <franco@reevo.org> | 2022-03-08 13:08:34 +0000 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2022-03-08 13:08:34 +0000 |
commit | c985c40d3f3fc6a2be3be3186df3bf2f32189475 (patch) | |
tree | cee11f5e5a7e351ee0fec36d58d72cbee4f7e49b /platform/www/lib/plugins/config/core/Setting/SettingString.php |
first commit after acervus codebase
Diffstat (limited to 'platform/www/lib/plugins/config/core/Setting/SettingString.php')
-rw-r--r-- | platform/www/lib/plugins/config/core/Setting/SettingString.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/config/core/Setting/SettingString.php b/platform/www/lib/plugins/config/core/Setting/SettingString.php new file mode 100644 index 0000000..b819407 --- /dev/null +++ b/platform/www/lib/plugins/config/core/Setting/SettingString.php @@ -0,0 +1,32 @@ +<?php + +namespace dokuwiki\plugin\config\core\Setting; + +/** + * Class setting_string + */ +class SettingString extends Setting { + /** @inheritdoc */ + public function html(\admin_plugin_config $plugin, $echo = false) { + $disable = ''; + + if($this->isProtected()) { + $value = $this->protected; + $disable = 'disabled="disabled"'; + } else { + if($echo && $this->error) { + $value = $this->input; + } else { + $value = is_null($this->local) ? $this->default : $this->local; + } + } + + $key = htmlspecialchars($this->key); + $value = htmlspecialchars($value); + + $label = '<label for="config___' . $key . '">' . $this->prompt($plugin) . '</label>'; + $input = '<input id="config___' . $key . '" name="config[' . $key . + ']" type="text" class="edit" value="' . $value . '" ' . $disable . '/>'; + return array($label, $input); + } +} |