From: John Du Hart Date: Sun, 23 Oct 2011 18:09:44 +0000 (+0000) Subject: HTMLForm is now a context source. X-Git-Tag: 1.31.0-rc.0~26947 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=04f7572ea10915b7cb83a7ac1e19a5be78e236cf;p=lhc%2Fweb%2Fwiklou.git HTMLForm is now a context source. Replace wfMessage() calls with $this->msg() --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 11e477b242..f97519ce1f 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -53,7 +53,7 @@ * * TODO: Document 'section' / 'subsection' stuff */ -class HTMLForm { +class HTMLForm extends ContextSource { # A mapping of 'type' inputs onto standard HTMLFormField subclasses static $typeMappings = array( @@ -105,7 +105,6 @@ class HTMLForm { protected $mSubmitText; protected $mSubmitTooltip; - protected $mContext; // mContext = $context; + $this->setContext( $context ); $this->mTitle = false; // We don't need them to set a title $this->mMessagePrefix = $messagePrefix; } else { @@ -586,7 +585,7 @@ class HTMLForm { * @param $msg String message key */ public function setSubmitTextMsg( $msg ) { - return $this->setSubmitText( wfMessage( $msg )->escaped() ); + return $this->setSubmitText( $this->msg( $msg )->escaped() ); } /** @@ -634,7 +633,7 @@ class HTMLForm { * @param $msg String message key */ public function setWrapperLegendMsg( $msg ) { - return $this->setWrapperLegend( wfMessage( $msg )->escaped() ); + return $this->setWrapperLegend( $this->msg( $msg )->escaped() ); } /** @@ -665,36 +664,6 @@ class HTMLForm { : $this->mTitle; } - /** - * @return IContextSource - */ - public function getContext(){ - return $this->mContext instanceof IContextSource - ? $this->mContext - : RequestContext::getMain(); - } - - /** - * @return OutputPage - */ - public function getOutput(){ - return $this->getContext()->getOutput(); - } - - /** - * @return WebRequest - */ - public function getRequest(){ - return $this->getContext()->getRequest(); - } - - /** - * @return User - */ - public function getUser(){ - return $this->getContext()->getUser(); - } - /** * Set the method used to submit the form * @param $method String