aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>2012-01-29 15:23:23 +0000
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>2012-01-29 15:23:23 +0000
commit9175d8e37f7ad5faa741fd9fee089c5f25e297db (patch)
tree0fbce844f7eca7f31ec1b6e1ae1fdfd722473171 /includes
parentcbb4b4716dba5fbae2add247ee0acfaaa97a9641 (diff)
downloadmediawikicore-9175d8e37f7ad5faa741fd9fee089c5f25e297db.tar.gz
mediawikicore-9175d8e37f7ad5faa741fd9fee089c5f25e297db.zip
allow people to actually specify post targets with a query
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110245
Diffstat (limited to 'includes')
-rw-r--r--includes/HTMLForm.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index 41a12c1d229d..3999e67e5ac9 100644
--- a/includes/HTMLForm.php
+++ b/includes/HTMLForm.php
@@ -107,6 +107,12 @@ class HTMLForm extends ContextSource {
protected $mTitle;
protected $mMethod = 'post';
+
+ /**
+ * @since 1.19
+ * @var false|string
+ */
+ protected $mAction = false;
protected $mUseMultipart = false;
protected $mHiddenFields = array();
@@ -472,7 +478,7 @@ class HTMLForm extends ContextSource {
: 'application/x-www-form-urlencoded';
# Attributes
$attribs = array(
- 'action' => $this->getTitle()->getFullURL(),
+ 'action' => $this->mAction === false ? $this->getTitle()->getFullURL() : $this->mAction,
'method' => $this->mMethod,
'class' => 'visualClear',
'enctype' => $encType,
@@ -845,6 +851,19 @@ class HTMLForm extends ContextSource {
public function getLegend( $key ) {
return wfMsg( "{$this->mMessagePrefix}-$key" );
}
+
+ /**
+ * Set the value for the action attribute of the form.
+ * When set to false (which is the default state), the set title is used.
+ *
+ * @since 1.19
+ *
+ * @param string|false $action
+ */
+ public function setAction( $action ) {
+ $this->mAction = $action;
+ }
+
}
/**