r100621 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100620‎ | r100621 | r100622 >
Date:17:24, 24 October 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Added OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() as modified versions of OutputPage::setPageTitle() and OutputPage::setHTMLTitle() that take an message name and its parameters; updated all calls in core that can use the two new functions
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)
  • /trunk/phase3/includes/actions/MarkpatrolledAction.php (modified) (history)
  • /trunk/phase3/includes/actions/RollbackAction.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlock.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlockList.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialEditWatchlist.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMergeHistory.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialTags.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnblock.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProtectionForm.php
@@ -224,7 +224,7 @@
225225 }
226226
227227 $titleLink = Linker::link( $this->mTitle );
228 - $wgOut->setPageTitle( wfMsg( 'protect-title', $this->mTitle->getPrefixedText() ) );
 228+ $wgOut->setPageTitleMsg( 'protect-title', $this->mTitle->getPrefixedText() );
229229 $wgOut->setSubtitle( wfMsg( 'protect-backlink', $titleLink ) );
230230
231231 # Show an appropriate message if the user isn't allowed or able to change
Index: trunk/phase3/includes/EditPage.php
@@ -1360,14 +1360,11 @@
13611361 function setHeaders() {
13621362 global $wgOut;
13631363 $wgOut->setRobotPolicy( 'noindex,nofollow' );
1364 - if ( $this->formtype == 'preview' ) {
1365 - $wgOut->setPageTitleActionText( wfMsg( 'preview' ) );
1366 - }
13671364 if ( $this->isConflict ) {
1368 - $wgOut->setPageTitle( wfMsg( 'editconflict', $this->getContextTitle()->getPrefixedText() ) );
 1365+ $wgOut->setPageTitleMsg( 'editconflict', $this->getContextTitle()->getPrefixedText() );
13691366 } elseif ( $this->section != '' ) {
13701367 $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection';
1371 - $wgOut->setPageTitle( wfMsg( $msg, $this->getContextTitle()->getPrefixedText() ) );
 1368+ $wgOut->setPageTitleMsg( $msg, $this->getContextTitle()->getPrefixedText() );
13721369 } else {
13731370 # Use the title defined by DISPLAYTITLE magic word when present
13741371 if ( isset( $this->mParserOutput )
@@ -1376,7 +1373,7 @@
13771374 } else {
13781375 $title = $this->getContextTitle()->getPrefixedText();
13791376 }
1380 - $wgOut->setPageTitle( wfMsg( 'editing', $title ) );
 1377+ $wgOut->setPageTitleMsg( 'editing', $title );
13811378 }
13821379 }
13831380
@@ -2229,7 +2226,7 @@
22302227 array( 'returnto' => $this->getContextTitle()->getPrefixedText() )
22312228 );
22322229
2233 - $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
 2230+ $wgOut->setPageTitleMsg( 'whitelistedittitle' );
22342231 $wgOut->setRobotPolicy( 'noindex,nofollow' );
22352232 $wgOut->setArticleRelated( false );
22362233
@@ -2244,7 +2241,7 @@
22452242 function noSuchSectionPage() {
22462243 global $wgOut;
22472244
2248 - $wgOut->setPageTitle( wfMsg( 'nosuchsectiontitle' ) );
 2245+ $wgOut->setPageTitleMsg( 'nosuchsectiontitle' );
22492246 $wgOut->setRobotPolicy( 'noindex,nofollow' );
22502247 $wgOut->setArticleRelated( false );
22512248
@@ -2264,7 +2261,7 @@
22652262 static function spamPage( $match = false ) {
22662263 global $wgOut, $wgTitle;
22672264
2268 - $wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) );
 2265+ $wgOut->setPageTitleMsg( 'spamprotectiontitle' );
22692266 $wgOut->setRobotPolicy( 'noindex,nofollow' );
22702267 $wgOut->setArticleRelated( false );
22712268
@@ -2287,7 +2284,7 @@
22882285 global $wgOut;
22892286 $this->textbox2 = $this->textbox1;
22902287
2291 - $wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) );
 2288+ $wgOut->setPageTitleMsg( 'spamprotectiontitle' );
22922289 $wgOut->setRobotPolicy( 'noindex,nofollow' );
22932290 $wgOut->setArticleRelated( false );
22942291
@@ -2848,7 +2845,7 @@
28492846
28502847 function noCreatePermission() {
28512848 global $wgOut;
2852 - $wgOut->setPageTitle( wfMsg( 'nocreatetitle' ) );
 2849+ $wgOut->setPageTitleMsg( 'nocreatetitle' );
28532850 $wgOut->addWikiMsg( 'nocreatetext' );
28542851 }
28552852
Index: trunk/phase3/includes/OutputPage.php
@@ -761,6 +761,19 @@
762762 }
763763
764764 /**
 765+ * Same as setHTMLTitle(), but takes a message name and parameter instead
 766+ * of directly the string to display.
 767+ *
 768+ * @since 1.19
 769+ * @param $name String message name
 770+ * @param $args Array|String message parameters, if there's only one
 771+ * parameter it can be passed directly as a string.
 772+ */
 773+ public function setHTMLTitleMsg( $name, $args = array() ) {
 774+ $this->setHTMLTitle( $this->msg( $name, $args )->text() );
 775+ }
 776+
 777+ /**
765778 * Return the "HTML title", i.e. the content of the <title> tag.
766779 *
767780 * @return String
@@ -784,10 +797,23 @@
785798 $this->mPagetitle = $nameWithTags;
786799
787800 # change "<i>foo&amp;bar</i>" to "foo&bar"
788 - $this->setHTMLTitle( $this->msg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) )->text() );
 801+ $this->setHTMLTitleMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) );
789802 }
790803
791804 /**
 805+ * Same as setPageTitle(), but takes a message name and parameter instead
 806+ * of directly the string to display.
 807+ *
 808+ * @since 1.19
 809+ * @param $name String message name
 810+ * @param $args Array|String message parameters, if there's only one
 811+ * parameter it can be passed directly as a string.
 812+ */
 813+ public function setPageTitleMsg( $name, $args = array() ) {
 814+ $this->setPageTitle( $this->msg( $name, $args )->text() );
 815+ }
 816+
 817+ /**
792818 * Return the "page title", i.e. the content of the \<h1\> tag.
793819 *
794820 * @return String
@@ -1927,8 +1953,8 @@
19281954 if ( $this->getTitle() ) {
19291955 $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
19301956 }
1931 - $this->setPageTitle( $this->msg( $title )->text() );
1932 - $this->setHTMLTitle( $this->msg( 'errorpagetitle' )->text() );
 1957+ $this->setPageTitleMsg( $title );
 1958+ $this->setHTMLTitleMsg( 'errorpagetitle' );
19331959 $this->setRobotPolicy( 'noindex,nofollow' );
19341960 $this->setArticleRelated( false );
19351961 $this->enableClientCache( false );
@@ -1953,8 +1979,8 @@
19541980 public function showPermissionsErrorPage( $errors, $action = null ) {
19551981 $this->mDebugtext .= 'Original title: ' .
19561982 $this->getTitle()->getPrefixedText() . "\n";
1957 - $this->setPageTitle( $this->msg( 'permissionserrors' )->text() );
1958 - $this->setHTMLTitle( $this->msg( 'permissionserrors' )->text() );
 1983+ $this->setPageTitleMsg( 'permissionserrors' );
 1984+ $this->setHTMLTitleMsg( 'permissionserrors' );
19591985 $this->setRobotPolicy( 'noindex,nofollow' );
19601986 $this->setArticleRelated( false );
19611987 $this->enableClientCache( false );
@@ -1970,8 +1996,8 @@
19711997 * @param $version Mixed: the version of MediaWiki needed to use the page
19721998 */
19731999 public function versionRequired( $version ) {
1974 - $this->setPageTitle( $this->msg( 'versionrequired', $version )->text() );
1975 - $this->setHTMLTitle( $this->msg( 'versionrequired', $version )->text() );
 2000+ $this->setPageTitleMsg( 'versionrequired' );
 2001+ $this->setHTMLTitleMsg( 'versionrequired', $version );
19762002 $this->setRobotPolicy( 'noindex,nofollow' );
19772003 $this->setArticleRelated( false );
19782004 $this->mBodytext = '';
@@ -1997,8 +2023,8 @@
19982024 throw new PermissionsError( 'read' );
19992025 }
20002026
2001 - $this->setPageTitle( $this->msg( 'loginreqtitle' )->text() );
2002 - $this->setHTMLTitle( $this->msg( 'errorpagetitle' )->text() );
 2027+ $this->setPageTitleMsg( 'loginreqtitle' );
 2028+ $this->setHTMLTitleMsg( 'errorpagetitle' );
20032029 $this->setRobotPolicy( 'noindex,nofollow' );
20042030 $this->setArticleRelated( false );
20052031
@@ -2090,12 +2116,12 @@
20912117 if ( !empty( $reasons ) ) {
20922118 // Permissions error
20932119 if( $source ) {
2094 - $this->setPageTitle( $this->msg( 'viewsource' )->text() );
 2120+ $this->setPageTitleMsg( 'viewsource' );
20952121 $this->setSubtitle(
20962122 $this->msg( 'viewsourcefor', Linker::linkKnown( $this->getTitle() ) )->text()
20972123 );
20982124 } else {
2099 - $this->setPageTitle( $this->msg( 'badaccess' )->text() );
 2125+ $this->setPageTitleMsg( 'badaccess' );
21002126 }
21012127 $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
21022128 } else {
@@ -2165,7 +2191,7 @@
21662192 }
21672193
21682194 public function showFatalError( $message ) {
2169 - $this->setPageTitle( $this->msg( 'internalerror' )->text() );
 2195+ $this->setPageTitleMsg( 'internalerror' );
21702196 $this->setRobotPolicy( 'noindex,nofollow' );
21712197 $this->setArticleRelated( false );
21722198 $this->enableClientCache( false );
@@ -2257,7 +2283,7 @@
22582284 $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
22592285
22602286 if ( $this->getHTMLTitle() == '' ) {
2261 - $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() )->text() );
 2287+ $this->setHTMLTitleMsg( 'pagetitle', $this->getPageTitle() );
22622288 }
22632289
22642290 $openHead = Html::openElement( 'head' );
Index: trunk/phase3/includes/actions/MarkpatrolledAction.php
@@ -67,7 +67,7 @@
6868 $return = SpecialPage::getTitleFor( $returnto );
6969
7070 if ( in_array( array( 'markedaspatrollederror-noautopatrol' ), $errors ) ) {
71 - $this->getOutput()->setPageTitle( wfMsg( 'markedaspatrollederror' ) );
 71+ $this->getOutput()->setPageTitleMsg( 'markedaspatrollederror' );
7272 $this->getOutput()->addWikiMsg( 'markedaspatrollederror-noautopatrol' );
7373 $this->getOutput()->returnToMain( null, $return );
7474 return;
@@ -79,7 +79,7 @@
8080 }
8181
8282 # Inform the user
83 - $this->getOutput()->setPageTitle( wfMsg( 'markedaspatrolled' ) );
 83+ $this->getOutput()->setPageTitleMsg( 'markedaspatrolled' );
8484 $this->getOutput()->addWikiMsg( 'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
8585 $this->getOutput()->returnToMain( null, $return );
8686 }
Index: trunk/phase3/includes/actions/RollbackAction.php
@@ -54,7 +54,7 @@
5555 }
5656
5757 if ( isset( $result[0][0] ) && ( $result[0][0] == 'alreadyrolled' || $result[0][0] == 'cantrollback' ) ) {
58 - $this->getOutput()->setPageTitle( wfMsg( 'rollbackfailed' ) );
 58+ $this->getOutput()->setPageTitleMsg( 'rollbackfailed' );
5959 $errArray = $result[0];
6060 $errMsg = array_shift( $errArray );
6161 $this->getOutput()->addWikiMsgArray( $errMsg, $errArray );
@@ -95,7 +95,7 @@
9696 $current = $details['current'];
9797 $target = $details['target'];
9898 $newId = $details['newid'];
99 - $this->getOutput()->setPageTitle( wfMsg( 'actioncomplete' ) );
 99+ $this->getOutput()->setPageTitleMsg( 'actioncomplete' );
100100 $this->getOutput()->setRobotPolicy( 'noindex,nofollow' );
101101
102102 if ( $current->getUserText() === '' ) {
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -78,7 +78,7 @@
7979 $wgOut->addHTML( '</span>' );
8080 }
8181 if( $status->ok ) {
82 - $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
 82+ $wgOut->setPageTitleMsg( 'actioncomplete' );
8383 $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
8484 // Return to the main page if we just deleted all versions of the
8585 // file, otherwise go back to the description page
@@ -271,7 +271,7 @@
272272 */
273273 private function setHeaders() {
274274 global $wgOut;
275 - $wgOut->setPageTitle( wfMsg( 'filedelete', $this->title->getText() ) );
 275+ $wgOut->setPageTitleMsg( 'filedelete', $this->title->getText() );
276276 $wgOut->setRobotPolicy( 'noindex,nofollow' );
277277 $wgOut->setSubtitle( wfMsg(
278278 'filedelete-backlink',
Index: trunk/phase3/includes/specials/SpecialUnblock.php
@@ -53,7 +53,7 @@
5454 $this->outputHeader();
5555
5656 $out = $this->getOutput();
57 - $out->setPageTitle( wfMsg( 'unblockip' ) );
 57+ $out->setPageTitleMsg( 'unblockip' );
5858 $out->addModules( 'mediawiki.special' );
5959
6060 $form = new HTMLForm( $this->getFields(), $this->getContext() );
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php
@@ -75,7 +75,7 @@
7676 return false;
7777 }
7878
79 - $this->getOutput()->setPageTitle( wfMsg( 'recentchangeslinked-title', $title->getPrefixedText() ) );
 79+ $this->getOutput()->setPageTitleMsg( 'recentchangeslinked-title', $title->getPrefixedText() );
8080
8181 /*
8282 * Ordinary links are in the pagelinks table, while transclusions are
Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -648,9 +648,9 @@
649649 $out = $this->getOutput();
650650
651651 if ( $this->mAllowed ) {
652 - $out->setPageTitle( wfMsg( 'undeletepage' ) );
 652+ $out->setPageTitleMsg( 'undeletepage' );
653653 } else {
654 - $out->setPageTitle( wfMsg( 'viewdeletedpage' ) );
 654+ $out->setPageTitleMsg( 'viewdeletedpage' );
655655 }
656656
657657 if( $par != '' ) {
@@ -801,7 +801,7 @@
802802 }
803803 }
804804
805 - $out->setPageTitle( wfMsg( 'undeletepage' ) );
 805+ $out->setPageTitleMsg( 'undeletepage' );
806806
807807 if( $this->mDiff ) {
808808 $previousRev = $archive->getPreviousRevision( $timestamp );
@@ -1015,9 +1015,9 @@
10161016 $out = $this->getOutput();
10171017 if( $this->mAllowed ) {
10181018 $out->addModules( 'mediawiki.special.undelete' );
1019 - $out->setPageTitle( wfMsg( 'undeletepage' ) );
 1019+ $out->setPageTitleMsg( 'undeletepage' );
10201020 } else {
1021 - $out->setPageTitle( wfMsg( 'viewdeletedpage' ) );
 1021+ $out->setPageTitleMsg( 'viewdeletedpage' );
10221022 }
10231023 $out->wrapWikiMsg(
10241024 "<div class='mw-undelete-pagetitle'>\n$1\n</div>\n",
Index: trunk/phase3/includes/specials/SpecialBlockList.php
@@ -43,7 +43,7 @@
4444 $this->setHeaders();
4545 $this->outputHeader();
4646 $out = $this->getOutput();
47 - $out->setPageTitle( wfMsg( 'ipblocklist' ) );
 47+ $out->setPageTitleMsg( 'ipblocklist' );
4848 $out->addModuleStyles( 'mediawiki.special' );
4949
5050 $request = $this->getRequest();
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -189,7 +189,7 @@
190190 $u->addNewUserLogEntry( true, $this->mReason );
191191
192192 $out = $this->getOutput();
193 - $out->setPageTitle( $this->msg( 'accmailtitle' )->text() );
 193+ $out->setPageTitleMsg( 'accmailtitle' );
194194
195195 if( !$result->isGood() ) {
196196 $this->mainLoginForm( $this->msg( 'mailerror', $result->getWikiText() )->text() );
@@ -251,7 +251,7 @@
252252 }
253253 } else {
254254 # Confirm that the account was created
255 - $out->setPageTitle( $this->msg( 'accountcreated' )->text() );
 255+ $out->setPageTitleMsg( 'accountcreated' );
256256 $out->addWikiMsg( 'accountcreatedtext', $u->getName() );
257257 $out->returnToMain( false, $this->getTitle() );
258258 wfRunHooks( 'AddNewAccount', array( $u, false ) );
@@ -883,7 +883,7 @@
884884 */
885885 private function displaySuccessfulLogin( $msgname, $injected_html ) {
886886 $out = $this->getOutput();
887 - $out->setPageTitle( $this->msg( 'loginsuccesstitle' )->text() );
 887+ $out->setPageTitleMsg( 'loginsuccesstitle' );
888888 if( $msgname ){
889889 $out->addWikiMsg( $msgname, wfEscapeWikiText( $this->getUser()->getName() ) );
890890 }
@@ -914,7 +914,7 @@
915915 # out.
916916
917917 $out = $this->getOutput();
918 - $out->setPageTitle( $this->msg( 'cantcreateaccounttitle' )->text() );
 918+ $out->setPageTitleMsg( 'cantcreateaccounttitle' );
919919
920920 $block_reason = $block->mReason;
921921 if ( strval( $block_reason ) === '' ) {
@@ -1077,9 +1077,9 @@
10781078 // Changes the title depending on permissions for creating account
10791079 $out = $this->getOutput();
10801080 if ( $user->isAllowed( 'createaccount' ) ) {
1081 - $out->setPageTitle( $this->msg( 'userlogin' )->text() );
 1081+ $out->setPageTitleMsg( 'userlogin' );
10821082 } else {
1083 - $out->setPageTitle( $this->msg( 'userloginnocreate' )->text() );
 1083+ $out->setPageTitleMsg( 'userloginnocreate' );
10841084 }
10851085
10861086 $out->disallowUserJs(); // just in case...
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -86,7 +86,7 @@
8787
8888 $this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() );
8989
90 - $out->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
 90+ $out->setPageTitleMsg( 'whatlinkshere-title', $this->target->getPrefixedText() );
9191 $out->setSubtitle( wfMsg( 'whatlinkshere-backlink', Linker::link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) );
9292
9393 $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ),
Index: trunk/phase3/includes/specials/SpecialEditWatchlist.php
@@ -34,7 +34,7 @@
3535
3636 # Anons don't get a watchlist
3737 if( $this->getUser()->isAnon() ) {
38 - $out->setPageTitle( wfMsg( 'watchnologin' ) );
 38+ $out->setPageTitleMsg( 'watchnologin' );
3939 $llink = Linker::linkKnown(
4040 SpecialPage::getTitleFor( 'Userlogin' ),
4141 wfMsgHtml( 'loginreqlink' ),
@@ -75,7 +75,7 @@
7676 // Pass on to the raw editor, from which it's very easy to clear.
7777
7878 case self::EDIT_RAW:
79 - $out->setPageTitle( wfMsg( 'watchlistedit-raw-title' ) );
 79+ $out->setPageTitleMsg( 'watchlistedit-raw-title' );
8080 $form = $this->getRawForm();
8181 if( $form->show() ){
8282 $out->addHTML( $this->successMessage );
@@ -85,7 +85,7 @@
8686
8787 case self::EDIT_NORMAL:
8888 default:
89 - $out->setPageTitle( wfMsg( 'watchlistedit-normal-title' ) );
 89+ $out->setPageTitleMsg( 'watchlistedit-normal-title' );
9090 $form = $this->getNormalForm();
9191 if( $form->show() ){
9292 $out->addHTML( $this->successMessage );
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -84,14 +84,14 @@
8585 if( $this->opts['contribs'] != 'newbie' ) {
8686 $target = $nt->getText();
8787 $out->setSubtitle( $this->contributionsSub( $nt, $id ) );
88 - $out->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) );
 88+ $out->setHTMLTitleMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) );
8989 $userObj = User::newFromName( $target, false );
9090 if ( is_object( $userObj ) ) {
9191 $this->getSkin()->setRelevantUser( $userObj );
9292 }
9393 } else {
9494 $out->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
95 - $out->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) );
 95+ $out->setHTMLTitleMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) );
9696 }
9797
9898 if( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -268,7 +268,7 @@
269269
270270 $request = $this->getRequest();
271271 $out = $this->getOutput();
272 - $out->setPageTitle( wfMsgExt( 'deletedcontributions-title', array( 'parsemag' ) ) );
 272+ $out->setPageTitleMsg( 'deletedcontributions-title' );
273273
274274 $options = array();
275275
Index: trunk/phase3/includes/specials/SpecialBlock.php
@@ -91,7 +91,7 @@
9292 $this->outputHeader();
9393
9494 $out = $this->getOutput();
95 - $out->setPageTitle( wfMsg( 'blockip-title' ) );
 95+ $out->setPageTitleMsg( 'blockip-title' );
9696 $out->addModules( array( 'mediawiki.special', 'mediawiki.special.block' ) );
9797
9898 $fields = $this->getFormFields();
@@ -111,7 +111,7 @@
112112 $this->doPostText( $form );
113113
114114 if( $form->show() ){
115 - $out->setPageTitle( wfMsg( 'blockipsuccesssub' ) );
 115+ $out->setPageTitleMsg( 'blockipsuccesssub' );
116116 $out->addWikiMsg( 'blockipsuccesstext', $this->target );
117117 }
118118 }
Index: trunk/phase3/includes/specials/SpecialTags.php
@@ -40,7 +40,7 @@
4141 $this->outputHeader();
4242
4343 $out = $this->getOutput();
44 - $out->setPageTitle( wfMsg( 'tags-title' ) );
 44+ $out->setPageTitleMsg( 'tags-title' );
4545 $out->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
4646
4747 // Write the headers
Index: trunk/phase3/includes/specials/SpecialWatchlist.php
@@ -55,7 +55,7 @@
5656
5757 # Anons don't get a watchlist
5858 if( $user->isAnon() ) {
59 - $output->setPageTitle( wfMsg( 'watchnologin' ) );
 59+ $output->setPageTitleMsg( 'watchnologin' );
6060 $llink = Linker::linkKnown(
6161 SpecialPage::getTitleFor( 'Userlogin' ),
6262 wfMsgHtml( 'loginreqlink' ),
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -435,8 +435,8 @@
436436 $this->searchAdvanced = ($this->profile === 'advanced');
437437 $out = $this->getOutput();
438438 if( strval( $term ) !== '' ) {
439 - $out->setPageTitle( wfMsg( 'searchresults') );
440 - $out->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'searchresults-title', $term ) ) );
 439+ $out->setPageTitleMsg( 'searchresults' );
 440+ $out->setHTMLTitleMsg( 'pagetitle', wfMsg( 'searchresults-title', $term ) );
441441 }
442442 // add javascript specific to special:search
443443 $out->addModules( 'mediawiki.special.search' );
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php
@@ -167,9 +167,6 @@
168168 }
169169
170170 private function showHistory() {
171 - $out = $this->getOutput();
172 - $out->setPageTitle( wfMsg( 'mergehistory' ) );
173 -
174171 $this->showMergeForm();
175172
176173 # List all stored revisions
@@ -178,6 +175,7 @@
179176 );
180177 $haveRevisions = $revisions && $revisions->getNumRows() > 0;
181178
 179+ $out = $this->getOutput();
182180 $titleObj = $this->getTitle();
183181 $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
184182 # Start the form here
Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -135,11 +135,11 @@
136136 return false;
137137 }
138138
139 - $out->setPageTitle( wfMsg( 'emailpage' ) );
 139+ $out->setPageTitleMsg( 'emailpage' );
140140 $result = $form->show();
141141
142142 if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
143 - $out->setPageTitle( wfMsg( 'emailsent' ) );
 143+ $out->setPageTitleMsg( 'emailsent' );
144144 $out->addWikiMsg( 'emailsenttext' );
145145 $out->returnToMain( false, $this->mTargetObj->getUserPage() );
146146 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r101037Per Nikerabbit's comment on r100621:...ialex20:23, 27 October 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   18:24, 24 October 2011

Why was the $wgOut->setPageTitleActionText() call removed?

#Comment by IAlex (talk | contribs)   18:41, 24 October 2011

On yeah, I forgot to mention that in the commit summary. The "PageTitleActionText" is no longer used in anywhere and I am going to deprecate it, since we now use proper messages instead of this lego stuff.

#Comment by Aaron Schulz (talk | contribs)   19:02, 24 October 2011

OK, but is the 'preview' message still added some other way or has the UI changed?

#Comment by IAlex (talk | contribs)   19:46, 24 October 2011

The 'preview' message is no displayed in an <h2> below.

#Comment by Nikerabbit (talk | contribs)   07:21, 25 October 2011

I welcome the change, but I am concerned about the explosion of new message functions, which was something the new wfMessage was supposed to avoid. I'd rather pass wfMessage() objects around than adding new methods to various places.

Status & tagging log