Merge "Consistently follow conventions for documenting parameters"
[lhc/web/wiklou.git] / includes / HTMLForm.php
index 84e7874..5de34d6 100644 (file)
@@ -574,6 +574,21 @@ class HTMLForm extends ContextSource {
                return $this;
        }
 
+       /**
+        * Add an array of hidden fields to the output
+        *
+        * @since 1.22
+        * @param array $fields Associative array of fields to add;
+        *        mapping names to their values
+        * @return HTMLForm $this for chaining calls
+        */
+       public function addHiddenFields( array $fields ) {
+               foreach ( $fields as $name => $value ) {
+                       $this->mHiddenFields[] = array( $value, array( 'name' => $name ) );
+               }
+               return $this;
+       }
+
        /**
         * Add a button to the form
         * @param string $name field name.
@@ -685,7 +700,7 @@ class HTMLForm extends ContextSource {
         * @return String HTML.
         */
        function getButtons() {
-               $html = '';
+               $html = '<span class="mw-htmlform-submit-buttons">';
 
                if ( $this->mShowSubmit ) {
                        $attribs = array();
@@ -735,6 +750,8 @@ class HTMLForm extends ContextSource {
                        $html .= Html::element( 'input', $attrs );
                }
 
+               $html .= '</span>';
+
                return $html;
        }