diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2013-07-31 19:07:29 +0200 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-07-31 19:07:29 +0200 |
commit | 2586f61fa6012e65f30cd5e9004ea4d6dea25238 (patch) | |
tree | dfd6489111e65fd152367ce3f534c3a6fdcde782 /lib/plugins | |
parent | 7b3674bd7a2b20df3ba37b32b7cc33f574a95dc5 (diff) | |
download | rpg-2586f61fa6012e65f30cd5e9004ea4d6dea25238.tar.gz rpg-2586f61fa6012e65f30cd5e9004ea4d6dea25238.tar.bz2 |
add html5 attributes to email fields of the config manager
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/config/settings/config.class.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 8eb99284d..63be3a726 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -717,6 +717,29 @@ if (!class_exists('setting_email')) { $this->_local = $input; return true; } + function html(&$plugin, $echo=false) { + $value = ''; + $disable = ''; + + if ($this->is_protected()) { + $value = $this->_protected; + $disable = 'disabled="disabled"'; + } else { + if ($echo && $this->_error) { + $value = $this->_input; + } else { + $value = is_null($this->_local) ? $this->_default : $this->_local; + } + } + + $multiple = $this->_multiple ? 'multiple="multiple"' : ''; + $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="email" class="edit" value="'.$value.'" '.$multiple.' '.$disable.'/>'; + return array($label,$input); + } } } |