From: Bartosz Dziewoński Date: Fri, 27 Sep 2013 20:52:44 +0000 (+0200) Subject: Remove calls to deprecated HTMLForm#setTitle X-Git-Tag: 1.31.0-rc.0~18523 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=2e68e7e8b851464df85241167f657f839ca247e2;p=lhc%2Fweb%2Fwiklou.git Remove calls to deprecated HTMLForm#setTitle Use DerivativeContext with modified title instead. Most of those should be using FormSpecialPage… Change-Id: Ia66f3b4b22866cc4ac4ac7b1f2fc2a4b1a9e73f6 --- diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 784ad0416a..f1992c0f18 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -96,8 +96,9 @@ class SpecialBlockList extends SpecialPage { 'default' => 50, ), ); - $form = new HTMLForm( $fields, $this->getContext() ); - $form->setTitle( $this->getTitle() ); // Remove subpage + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage + $form = new HTMLForm( $fields, $context ); $form->setMethod( 'get' ); $form->setWrapperLegendMsg( 'ipblocklist-legend' ); $form->setSubmitTextMsg( 'ipblocklist-submit' ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index b6005de4e5..501552e91f 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -547,8 +547,9 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $this->toc = false; } - $form = new EditWatchlistNormalHTMLForm( $fields, $this->getContext() ); - $form->setTitle( $this->getTitle() ); + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage + $form = new EditWatchlistNormalHTMLForm( $fields, $context ); $form->setSubmitTextMsg( 'watchlistedit-normal-submit' ); # Used message keys: 'accesskey-watchlistedit-normal-submit', 'tooltip-watchlistedit-normal-submit' $form->setSubmitTooltip( 'watchlistedit-normal-submit' ); @@ -610,8 +611,9 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { 'default' => $titles, ), ); - $form = new HTMLForm( $fields, $this->getContext() ); - $form->setTitle( $this->getTitle( 'raw' ) ); + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle( 'raw' ) ); // Reset subpage + $form = new HTMLForm( $fields, $context ); $form->setSubmitTextMsg( 'watchlistedit-raw-submit' ); # Used message keys: 'accesskey-watchlistedit-raw-submit', 'tooltip-watchlistedit-raw-submit' $form->setSubmitTooltip( 'watchlistedit-raw-submit' ); diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 27188c37e3..2e90d99609 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -148,11 +148,12 @@ class SpecialEmailUser extends UnlistedSpecialPage { $this->mTargetObj = $ret; - $form = new HTMLForm( $this->getFormFields(), $this->getContext() ); + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage + $form = new HTMLForm( $this->getFormFields(), $context ); // By now we are supposed to be sure that $this->mTarget is a user name $form->addPreText( $this->msg( 'emailpagetext', $this->mTarget )->parse() ); $form->setSubmitTextMsg( 'emailsend' ); - $form->setTitle( $this->getTitle() ); $form->setSubmitCallback( array( __CLASS__, 'uiSubmit' ) ); $form->setWrapperLegendMsg( 'email-legend' ); $form->loadData(); diff --git a/includes/specials/SpecialNewimages.php b/includes/specials/SpecialNewimages.php index 814e213e9f..37d29734a0 100644 --- a/includes/specials/SpecialNewimages.php +++ b/includes/specials/SpecialNewimages.php @@ -181,8 +181,9 @@ class NewFilesPager extends ReverseChronologicalPager { unset( $fields['like'] ); } - $form = new HTMLForm( $fields, $this->getContext() ); - $form->setTitle( $this->getTitle() ); + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage + $form = new HTMLForm( $fields, $context ); $form->setSubmitTextMsg( 'ilsubmit' ); $form->setMethod( 'get' ); $form->setWrapperLegendMsg( 'newimages-legend' ); diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index cc7b8fae4f..ce7a45b334 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -75,10 +75,11 @@ class SpecialPreferences extends SpecialPage { $this->getOutput()->addWikiMsg( 'prefs-reset-intro' ); - $htmlForm = new HTMLForm( array(), $this->getContext(), 'prefs-restore' ); + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle( 'reset' ) ); // Reset subpage + $htmlForm = new HTMLForm( array(), $context, 'prefs-restore' ); $htmlForm->setSubmitTextMsg( 'restoreprefs' ); - $htmlForm->setTitle( $this->getTitle( 'reset' ) ); $htmlForm->setSubmitCallback( array( $this, 'submitReset' ) ); $htmlForm->suppressReset(); diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 51a0a867d1..09facf4f2e 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -221,6 +221,8 @@ class SpecialUpload extends SpecialPage { */ protected function getUploadForm( $message = '', $sessionKey = '', $hideIgnoreWarning = false ) { # Initialize form + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage $form = new UploadForm( array( 'watch' => $this->getWatchCheck(), 'forreupload' => $this->mForReUpload, @@ -232,8 +234,7 @@ class SpecialUpload extends SpecialPage { 'texttop' => $this->uploadFormTextTop, 'textaftersummary' => $this->uploadFormTextAfterSummary, 'destfile' => $this->mDesiredDestName, - ), $this->getContext() ); - $form->setTitle( $this->getTitle() ); + ), $context ); # Check the token, but only if necessary if ( diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 002e949be9..87b644280d 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -343,15 +343,16 @@ class SpecialUploadStash extends UnlistedSpecialPage { // create the form, which will also be used to execute a callback to process incoming form data // this design is extremely dubious, but supposedly HTMLForm is our standard now? + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage $form = new HTMLForm( array( 'Clear' => array( 'type' => 'hidden', 'default' => true, 'name' => 'clear', ) - ), $this->getContext(), 'clearStashedUploads' ); + ), $context, 'clearStashedUploads' ); $form->setSubmitCallback( array( __CLASS__, 'tryClearStashedUploads' ) ); - $form->setTitle( $this->getTitle() ); $form->setSubmitTextMsg( 'uploadstash-clear' ); $form->prepareForm();