X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXmlSelect.php;h=45002e82f66ee39becf44f0233fef6181b6d26c1;hb=e3c9107089c261d538d2fe161e2ec2446379c6f6;hp=1cd04ae10e27e30f4feb0c0782bf18bf65046045;hpb=b305d72af57101d580783d639e0cd88f2a049dae;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/XmlSelect.php b/includes/XmlSelect.php index 1cd04ae10e..45002e82f6 100644 --- a/includes/XmlSelect.php +++ b/includes/XmlSelect.php @@ -1,6 +1,6 @@ . + * Class for generating HTML elements + * Class for generating HTML probably has the multiple attribute, + // so we should check if each $value is in $default, rather than checking if + // $value is equal to $default. + $selected = is_array( $default ) ? in_array( $value, $default ) : $value === $default; + $data .= Xml::option( $label, $value, $selected ) . "\n"; } } @@ -125,6 +131,6 @@ class XmlSelect { $contents .= self::formatOptions( $options, $this->default ); } - return Html::rawElement( 'select', $this->attributes, rtrim( $contents ) ); + return Html::rawElement( $this->tagName, $this->attributes, rtrim( $contents ) ); } }