Apply vform styling to HTMLForm buttons
authorBryan Davis <bd808@wikimedia.org>
Fri, 5 Sep 2014 21:56:19 +0000 (15:56 -0600)
committerBryan Davis <bd808@wikimedia.org>
Fri, 5 Sep 2014 21:56:19 +0000 (15:56 -0600)
Check for isVForm() and apply styling matching the default submit button
when generating alternate form submit buttons.

Change-Id: Ia3313087248af1537ac4740694846b6ff1187b1a

includes/htmlform/HTMLForm.php

index fc2222a..c810f68 100644 (file)
@@ -936,12 +936,15 @@ class HTMLForm extends ContextSource {
                                $attrs['id'] = $button['id'];
                        }
 
-                       if ( $useMediaWikiUIEverywhere ) {
+                       if ( $this->isVForm() || $useMediaWikiUIEverywhere ) {
                                if ( isset( $attrs['class'] ) ) {
                                        $attrs['class'] .= ' mw-ui-button';
                                } else {
                                        $attrs['class'] = 'mw-ui-button';
                                }
+                               if ( $this->isVForm() ) {
+                                       $attrs['class'] .= ' mw-ui-big mw-ui-block';
+                               }
                        }
 
                        $buttons .= Html::element( 'input', $attrs ) . "\n";