1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Corrected toAttribute method. <select> item was not respecting attributes when using renderElement().

This commit is contained in:
Cameron
2016-04-14 16:32:48 -07:00
parent 04f7244f63
commit e4b9db6307
2 changed files with 23 additions and 5 deletions

View File

@@ -1984,7 +1984,6 @@ class e_parse extends e_parser
// Xhtml compliance.
$text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
if(!preg_match('/&#|\'|"|<|>/s', $text))
{
$text = $this->replaceConstants($text);
@@ -1992,7 +1991,7 @@ class e_parse extends e_parser
}
else
{
return '';
return $text;
}
}

View File

@@ -1939,6 +1939,8 @@ class e_form
{
if(!is_array($options)) parse_str($options, $options);
if(vartrue($options['size']) && !is_numeric($options['size']))
{
if(!empty($options['class']))
@@ -1952,6 +1954,8 @@ class e_form
unset($options['size']); // don't include in html 'size='.
}
$options = $this->format_options('select', $name, $options);
return "<select name='{$name}'".$this->get_attributes($options, $name).">";
@@ -4309,6 +4313,8 @@ class e_form
}
}
// XXX Fixes For the above. - use optArray variable. eg. $field['key']['writeParms']['optArray'] = array('one','two','three');
if(($attributes['type'] == 'dropdown' || $attributes['type'] == 'radio' || $attributes['type'] == 'checkboxes') && !empty($parms['optArray']))
{
@@ -4577,12 +4583,24 @@ class e_form
case 'dropdown':
case 'comma':
if(!empty($attributes['writeParms']['optArray']))
{
$eloptions = $attributes['writeParms'];
unset($eloptions['optArray']);
}
else
{
$eloptions = vartrue($parms['__options'], array());
}
if(is_string($eloptions)) parse_str($eloptions, $eloptions);
if($attributes['type'] === 'comma') $eloptions['multiple'] = true;
unset($parms['__options']);
if(vartrue($eloptions['multiple']) && !is_array($value)) $value = explode(',', $value);
// Allow Ajax API.
if(!empty($ajaxParms))
{
@@ -4590,6 +4608,7 @@ class e_form
$eloptions['class'] = 'e-ajax ' . varset($eloptions['class']);
}
$ret = vartrue($eloptions['pre']).$this->selectbox($key, $parms, $value, $eloptions).vartrue($eloptions['post']);
break;