(bug 32412) TOC links on [[Special:EditWatchlist]] now points to the fieldset
[lhc/web/wiklou.git] / includes / Xml.php
index f937003..a0722f7 100644 (file)
@@ -334,10 +334,10 @@ class Xml {
 
        /**
         * Convenience function to build an HTML radio button
-        * @param $name value of the name attribute
-        * @param $value value of the value attribute
-        * @param $checked Whether the checkbox is checked or not
-        * @param $attribs other attributes
+        * @param $name String value of the name attribute
+        * @param $value String value of the value attribute
+        * @param $checked Bool Whether the checkbox is checked or not
+        * @param $attribs Array other attributes
         * @return string HTML
         */
        public static function radio( $name, $value, $checked = false, $attribs = array() ) {
@@ -376,8 +376,8 @@ class Xml {
         * @param $label String text of the label
         * @param $name String value of the name attribute
         * @param $id String id of the input
-        * @param $size int value of the size attribute
-        * @param $value value of the value attribute
+        * @param $size Int|Bool value of the size attribute
+        * @param $value String|Bool value of the value attribute
         * @param $attribs array other attributes
         * @return string HTML
         */
@@ -389,11 +389,11 @@ class Xml {
        /**
         * Same as Xml::inputLabel() but return input and label in an array
         *
-        * @param $label
-        * @param $name
-        * @param $id
-        * @param $size
-        * @param $value
+        * @param $label String
+        * @param $name String
+        * @param $id String
+        * @param $size Int|Bool
+        * @param $value String|Bool
         * @param $attribs array
         *
         * @return array
@@ -466,7 +466,7 @@ class Xml {
                if( $selected ) {
                        $attribs['selected'] = 'selected';
                }
-               return self::element( 'option', $attribs, $text );
+               return Html::element( 'option', $attribs, $text );
        }
 
        /**
@@ -794,7 +794,7 @@ class Xml {
                $s = Xml::openElement( 'table', $attribs );
 
                if ( is_array( $headers ) ) {
-                       $s = Xml::openElement( 'thead', $attribs );
+                       $s .= Xml::openElement( 'thead', $attribs );
 
                        foreach( $headers as $id => $header ) {
                                $attribs = array();
@@ -805,7 +805,7 @@ class Xml {
 
                                $s .= Xml::element( 'th', $attribs, $header );
                        }
-                       $s = Xml::closeElement( 'thead' );
+                       $s .= Xml::closeElement( 'thead' );
                }
 
                foreach( $rows as $id => $row ) {
@@ -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 ) );
        }
 }