Allow HTMLForms to be submitted by GET requests.
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 15 Dec 2010 19:33:03 +0000 (19:33 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 15 Dec 2010 19:33:03 +0000 (19:33 +0000)
includes/HTMLForm.php

index 62aecb0..cd3dc1f 100644 (file)
@@ -92,6 +92,7 @@ class HTMLForm {
        protected $mSubmitText;
        protected $mSubmitTooltip;
        protected $mTitle;
+       protected $mMethod = 'post';
 
        protected $mUseMultipart = false;
        protected $mHiddenFields = array();
@@ -375,7 +376,7 @@ class HTMLForm {
                # Attributes
                $attribs = array(
                        'action'  => $this->getTitle()->getFullURL(),
-                       'method'  => 'post',
+                       'method'  => $this->mMethod,
                        'class'   => 'visualClear',
                        'enctype' => $encType,
                );
@@ -586,6 +587,14 @@ class HTMLForm {
        function getTitle() {
                return $this->mTitle;
        }
+       
+       /**
+        * Set the method used to submit the form
+        * @param $method String
+        */
+       public function setMethod( $method='post' ){
+               $this->mMethod = $method;
+       }
 
        /**
         * TODO: Document