Merge "Add framework for file warnings"
[lhc/web/wiklou.git] / includes / Html.php
index fe8f57e..8799225 100644 (file)
@@ -141,16 +141,17 @@ class Html {
                if ( !$attrs ) {
                        $attrs = array();
                }
-               if ( isset( $attrs['class'] ) ) {
-                       if ( is_array( $attrs['class'] ) ) {
-                               $attrs['class'][] = 'mw-ui-input';
+               if ( $wgUseMediaWikiUIEverywhere ) {
+                       if ( isset( $attrs['class'] ) ) {
+                               if ( is_array( $attrs['class'] ) ) {
+                                       $attrs['class'][] = 'mw-ui-input';
+                               } else {
+                                       $attrs['class'] .= ' mw-ui-input';
+                               }
                        } else {
-                               $attrs['class'] .= ' mw-ui-input';
+                               $attrs['class'] = 'mw-ui-input';
                        }
-               } else {
-                       $attrs['class'] = 'mw-ui-input';
-               }
-               if ( $wgUseMediaWikiUIEverywhere ) {
+
                        // Note that size can effect the desired width rendering of mw-ui-input elements
                        // so it is removed. Left intact when mediawiki ui not enabled.
                        unset( $attrs['size'] );
@@ -159,7 +160,8 @@ class Html {
        }
 
        /**
-        * Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enabled).
+        * Returns an HTML link element in a string styled as a button
+        * (when $wgUseMediaWikiUIEverywhere is enabled).
         *
         * @param string $contents The raw HTML contents of the element: *not*
         *   escaped!
@@ -178,7 +180,8 @@ class Html {
        }
 
        /**
-        * Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enabled).
+        * Returns an HTML link element in a string styled as a button
+        * (when $wgUseMediaWikiUIEverywhere is enabled).
         *
         * @param string $contents The raw HTML contents of the element: *not*
         *   escaped!