Small cleanups to XmlSelect
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 8 Oct 2011 11:41:10 +0000 (11:41 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 8 Oct 2011 11:41:10 +0000 (11:41 +0000)
includes/Xml.php

index c2fa819..c5150ad 100644 (file)
@@ -466,7 +466,7 @@ class Xml {
                if( $selected ) {
                        $attribs['selected'] = 'selected';
                }
-               return self::element( 'option', $attribs, $text );
+               return Html::element( 'option', $attribs, $text );
        }
 
        /**
@@ -888,7 +888,7 @@ class XmlSelect {
         * @return array|null
         */
        public function getAttribute( $name ) {
-               if ( isset($this->attributes[$name]) ) {
+               if ( isset( $this->attributes[$name] ) ) {
                        return $this->attributes[$name];
                } else {
                        return null;
@@ -932,7 +932,7 @@ class XmlSelect {
                foreach( $options as $label => $value ) {
                        if ( is_array( $value ) ) {
                                $contents = self::formatOptions( $value, $default );
-                               $data .= Xml::tags( 'optgroup', array( 'label' => $label ), $contents ) . "\n";
+                               $data .= Html::rawElement( 'optgroup', array( 'label' => $label ), $contents ) . "\n";
                        } else {
                                $data .= Xml::option( $label, $value, $value === $default ) . "\n";
                        }
@@ -951,7 +951,7 @@ class XmlSelect {
                        $contents .= self::formatOptions( $options, $this->default );
                }
 
-               return Xml::tags( 'select', $this->attributes, rtrim( $contents ) );
+               return Html::rawElement( 'select', $this->attributes, rtrim( $contents ) );
        }
 }