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'] );
}
/**
- * 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!
}
/**
- * 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!