From: Jeroen De Dauw Date: Sun, 29 Jan 2012 15:23:23 +0000 (+0000) Subject: allow people to actually specify post targets with a query X-Git-Tag: 1.31.0-rc.0~25031 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=9175d8e37f7ad5faa741fd9fee089c5f25e297db;p=lhc%2Fweb%2Fwiklou.git allow people to actually specify post targets with a query --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 41a12c1d22..3999e67e5a 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; + } + } /**