By suggestion of NikeRabbit, move wfBuildForm into Xml.php
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 24 Apr 2008 11:46:20 +0000 (11:46 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 24 Apr 2008 11:46:20 +0000 (11:46 +0000)
includes/GlobalFunctions.php
includes/Xml.php
includes/XmlFunctions.php

index 9983b2d..4e56dbd 100644 (file)
@@ -2537,32 +2537,3 @@ function wfGetAvailableRights() {
        
        return $rights;
 }
-
-/**
- * Generate a form (without the opening form element).
- * Output DOES include a submit button.
- * @param array $fields Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input.
- * @param string $submitLable A message containing a label for the submit button.
- * @return string HTML form.
- */
-function wfBuildForm( $fields, $submitLabel ) {
-       $form = '';
-       $form .= "<table><tbody>";
-
-       foreach( $fields as $labelmsg => $input ) {
-               $id = "mw-gb-$labelmsg";
-               $form .= Xml::openElement( 'tr', array( 'class' => $id ) );
-
-               $form .= Xml::element( 'td', array('valign' => 'top'), wfMsg( $labelmsg ) );
-
-               $form .= Xml::openElement( 'td' ) . $input . Xml::closeElement( 'td' );
-
-               $form .= Xml::closeElement( 'tr' );
-       }
-
-       $form .= "</tbody></table>";
-
-       $form .= wfSubmitButton( wfMsg($submitLabel) );
-
-       return $form;
-}
index 5bb64fe..5b8d088 100644 (file)
@@ -520,4 +520,33 @@ class Xml {
                        array( '&quot;', '&gt;', '&lt;' ),
                        $in );
        }
+       
+       /**
+       * Generate a form (without the opening form element).
+       * Output DOES include a submit button.
+       * @param array $fields Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input.
+       * @param string $submitLable A message containing a label for the submit button.
+       * @return string HTML form.
+       */
+       function buildForm( $fields, $submitLabel ) {
+               $form = '';
+               $form .= "<table><tbody>";
+       
+               foreach( $fields as $labelmsg => $input ) {
+                       $id = "mw-gb-$labelmsg";
+                       $form .= Xml::openElement( 'tr' );
+       
+                       $form .= Xml::element( 'td', array('valign' => 'top'), wfMsg( $labelmsg ) );
+       
+                       $form .= Xml::openElement( 'td' ) . $input . Xml::closeElement( 'td' );
+       
+                       $form .= Xml::closeElement( 'tr' );
+               }
+       
+               $form .= "</tbody></table>";
+       
+               $form .= wfSubmitButton( wfMsg($submitLabel) );
+       
+               return $form;
+       }
 }
index 1a5aeac..bc18a2c 100644 (file)
@@ -60,3 +60,7 @@ function wfIsWellFormedXml( $text ) {
 function wfIsWellFormedXmlFragment( $text ) {
        return Xml::isWellFormedXmlFragment( $text );
 }
+
+function wfBuildForm( $fields, $submitLabel ) {
+       return Xml::buildForm( $fields, $submitLabel );
+}