Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -107,6 +107,12 @@ |
108 | 108 | |
109 | 109 | protected $mTitle; |
110 | 110 | protected $mMethod = 'post'; |
| 111 | + |
| 112 | + /** |
| 113 | + * @since 1.19 |
| 114 | + * @var false|string |
| 115 | + */ |
| 116 | + protected $mAction = false; |
111 | 117 | |
112 | 118 | protected $mUseMultipart = false; |
113 | 119 | protected $mHiddenFields = array(); |
— | — | @@ -472,7 +478,7 @@ |
473 | 479 | : 'application/x-www-form-urlencoded'; |
474 | 480 | # Attributes |
475 | 481 | $attribs = array( |
476 | | - 'action' => $this->getTitle()->getFullURL(), |
| 482 | + 'action' => $this->mAction === false ? $this->getTitle()->getFullURL() : $this->mAction, |
477 | 483 | 'method' => $this->mMethod, |
478 | 484 | 'class' => 'visualClear', |
479 | 485 | 'enctype' => $encType, |
— | — | @@ -845,6 +851,19 @@ |
846 | 852 | public function getLegend( $key ) { |
847 | 853 | return wfMsg( "{$this->mMessagePrefix}-$key" ); |
848 | 854 | } |
| 855 | + |
| 856 | + /** |
| 857 | + * Set the value for the action attribute of the form. |
| 858 | + * When set to false (which is the default state), the set title is used. |
| 859 | + * |
| 860 | + * @since 1.19 |
| 861 | + * |
| 862 | + * @param string|false $action |
| 863 | + */ |
| 864 | + public function setAction( $action ) { |
| 865 | + $this->mAction = $action; |
| 866 | + } |
| 867 | + |
849 | 868 | } |
850 | 869 | |
851 | 870 | /** |