Merge "Fix HTML output arround HTMLForm's submit buttons when in vform"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index 6af2f5f..422fa8a 100644 (file)
@@ -700,7 +700,10 @@ class HTMLForm extends ContextSource {
                $this->getOutput()->preventClickjacking();
                $this->getOutput()->addModules( 'mediawiki.htmlform' );
                if ( $this->isVForm() ) {
-                       $this->getOutput()->addModuleStyles( 'mediawiki.ui' );
+                       $this->getOutput()->addModuleStyles( array(
+                               'mediawiki.ui',
+                               'mediawiki.ui.button',
+                       ) );
                        // @todo Should vertical form set setWrapperLegend( false )
                        // to hide ugly fieldsets?
                }
@@ -809,7 +812,14 @@ class HTMLForm extends ContextSource {
                        if ( $this->isVForm() ) {
                                // mw-ui-block is necessary because the buttons aren't necessarily in an
                                // immediate child div of the vform.
-                               array_push( $attribs['class'], 'mw-ui-button', 'mw-ui-big', 'mw-ui-primary', 'mw-ui-block' );
+                               // @todo Let client specify if the primary submit button is progressive or destructive
+                               array_push(
+                                       $attribs['class'],
+                                       'mw-ui-button',
+                                       'mw-ui-big',
+                                       'mw-ui-constructive',
+                                       'mw-ui-block'
+                               );
                        }
 
                        $buttons .= Xml::submitButton( $this->getSubmitText(), $attribs ) . "\n";