r110245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110244‎ | r110245 | r110246 >
Date:15:23, 29 January 2012
Author:jeroendedauw
Status:ok
Tags:
Comment:
allow people to actually specify post targets with a query
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -107,6 +107,12 @@
108108
109109 protected $mTitle;
110110 protected $mMethod = 'post';
 111+
 112+ /**
 113+ * @since 1.19
 114+ * @var false|string
 115+ */
 116+ protected $mAction = false;
111117
112118 protected $mUseMultipart = false;
113119 protected $mHiddenFields = array();
@@ -472,7 +478,7 @@
473479 : 'application/x-www-form-urlencoded';
474480 # Attributes
475481 $attribs = array(
476 - 'action' => $this->getTitle()->getFullURL(),
 482+ 'action' => $this->mAction === false ? $this->getTitle()->getFullURL() : $this->mAction,
477483 'method' => $this->mMethod,
478484 'class' => 'visualClear',
479485 'enctype' => $encType,
@@ -845,6 +851,19 @@
846852 public function getLegend( $key ) {
847853 return wfMsg( "{$this->mMessagePrefix}-$key" );
848854 }
 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+
849868 }
850869
851870 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r110278comment mAction / whitespaces...hashar11:33, 30 January 2012

Status & tagging log