LivePreview: Support section=new for preview
[lhc/web/wiklou.git] / includes / Xml.php
index 6df6258..78b8715 100644 (file)
@@ -94,9 +94,7 @@ class Xml {
                        $attribs = array_map( array( 'UtfNormal', 'cleanUp' ), $attribs );
                }
                if ( $contents ) {
-                       wfProfileIn( __METHOD__ . '-norm' );
                        $contents = $wgContLang->normalize( $contents );
-                       wfProfileOut( __METHOD__ . '-norm' );
                }
                return self::element( $element, $attribs, $contents );
        }
@@ -134,31 +132,6 @@ class Xml {
                return self::openElement( $element, $attribs ) . $contents . "</$element>";
        }
 
-       /**
-        * Build a drop-down box for selecting a namespace
-        *
-        * @param string $selected Namespace which should be pre-selected
-        * @param string|null $all Value of an item denoting all namespaces, or null to omit
-        * @param string $element_name Value of the "name" attribute of the select tag
-        * @param string $label Optional label to add to the field
-        * @return string
-        * @deprecated since 1.19
-        */
-       public static function namespaceSelector( $selected = '', $all = null,
-               $element_name = 'namespace', $label = null
-       ) {
-               wfDeprecated( __METHOD__, '1.19' );
-               return Html::namespaceSelector( array(
-                       'selected' => $selected,
-                       'all' => $all,
-                       'label' => $label,
-               ), array(
-                       'name' => $element_name,
-                       'id' => 'namespace',
-                       'class' => 'namespaceselector',
-               ) );
-       }
-
        /**
         * Create a date selector
         *
@@ -393,12 +366,10 @@ class Xml {
        public static function label( $label, $id, $attribs = array() ) {
                $a = array( 'for' => $id );
 
-               # FIXME avoid copy pasting below:
-               if ( isset( $attribs['class'] ) ) {
-                               $a['class'] = $attribs['class'];
-               }
-               if ( isset( $attribs['title'] ) ) {
-                               $a['title'] = $attribs['title'];
+               foreach ( array( 'class', 'title' ) as $attr ) {
+                       if ( isset( $attribs[$attr] ) ) {
+                               $a[$attr] = $attribs[$attr];
+                       }
                }
 
                return self::element( 'label', $a, $label );