HTMLFormField: Don't abuse mClass for VForms
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 14 Jan 2015 23:00:39 +0000 (15:00 -0800)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 14 Jan 2015 23:00:39 +0000 (15:00 -0800)
Various fields use this differently than I thought, breaking things.
Let's add a separate variable.

Change-Id: Ia974a42c2a905cbc9e8405d9f03c10c8ad692864

includes/htmlform/HTMLFormField.php

index a751900..645b507 100644 (file)
@@ -13,6 +13,7 @@ abstract class HTMLFormField {
        protected $mLabel; # String label.  Set on construction
        protected $mID;
        protected $mClass = '';
+       protected $mVFormClass = '';
        protected $mHelpClass = false;
        protected $mDefault;
        protected $mOptions = false;
@@ -512,7 +513,7 @@ abstract class HTMLFormField {
                        array( 'class' => $outerDivClass ) + $cellAttributes,
                        $inputHtml . "\n$errors"
                );
-               $divCssClasses = array( "mw-htmlform-field-$fieldType", $this->mClass, $errorClass );
+               $divCssClasses = array( "mw-htmlform-field-$fieldType", $this->mClass, $this->mVFormClass, $errorClass );
 
                $wrapperAttributes = array(
                        'class' => $divCssClasses,
@@ -561,7 +562,7 @@ abstract class HTMLFormField {
         */
        public function getVForm( $value ) {
                // Ewwww
-               $this->mClass .= ' mw-ui-vform-field';
+               $this->mVFormClass = ' mw-ui-vform-field';
                return $this->getDiv( $value );
        }