Per Nikerabbit's comment on r100621:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 27 Oct 2011 20:23:16 +0000 (20:23 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 27 Oct 2011 20:23:16 +0000 (20:23 +0000)
* Removed OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() and make OutputPage::setPageTitle() and OutputPage::setHTMLTitle() accept a Message object
* Updated core calls (including some that I missed last time because of non-matching case)
* Added Message::setContext() and use it in RequestContext so that I don't need to duplicate the call in OutputPage
* Yes, I'm calling $this->msg() on places and then setting the context one more time in OutputPage::setPageTitle() or OutputPage::setHTMLTitle(), but at least I won't be confused about which objects $

29 files changed:
includes/Article.php
includes/EditPage.php
includes/FileDeleteForm.php
includes/ImagePage.php
includes/Message.php
includes/OutputPage.php
includes/ProtectionForm.php
includes/actions/MarkpatrolledAction.php
includes/actions/RollbackAction.php
includes/context/RequestContext.php
includes/diff/DifferenceEngine.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialEmailuser.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialTags.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php

index 4794eee..546e2d9 100644 (file)
@@ -1334,7 +1334,7 @@ class Article extends Page {
                        return;
                }
 
-               $wgOut->setPagetitle( wfMsg( 'delete-confirm', $this->getTitle()->getPrefixedText() ) );
+               $wgOut->setPageTitle( wfMessage( 'delete-confirm', $this->getTitle()->getPrefixedText() ) );
 
                # Better double-check that it hasn't been deleted yet!
                $dbw = wfGetDB( DB_MASTER );
@@ -1529,7 +1529,7 @@ class Article extends Page {
                if ( $this->mPage->doDeleteArticle( $reason, $suppress, $id, $error ) ) {
                        $deleted = $this->getTitle()->getPrefixedText();
 
-                       $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
+                       $wgOut->setPageTitle( wfMessage( 'actioncomplete' ) );
                        $wgOut->setRobotPolicy( 'noindex,nofollow' );
 
                        $loglink = '[[Special:Log/delete|' . wfMsgNoTrans( 'deletionlog' ) . ']]';
index 7c4221a..1696b26 100644 (file)
@@ -1361,10 +1361,10 @@ class EditPage {
                global $wgOut;
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                if ( $this->isConflict ) {
-                       $wgOut->setPageTitleMsg( 'editconflict', $this->getContextTitle()->getPrefixedText() );
+                       $wgOut->setPageTitle( wfMessage( 'editconflict', $this->getContextTitle()->getPrefixedText() ) );
                } elseif ( $this->section != '' ) {
                        $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection';
-                       $wgOut->setPageTitleMsg( $msg, $this->getContextTitle()->getPrefixedText() );
+                       $wgOut->setPageTitle( wfMessage( $msg, $this->getContextTitle()->getPrefixedText() ) );
                } else {
                        # Use the title defined by DISPLAYTITLE magic word when present
                        if ( isset( $this->mParserOutput )
@@ -1373,7 +1373,7 @@ class EditPage {
                        } else {
                                $title = $this->getContextTitle()->getPrefixedText();
                        }
-                       $wgOut->setPageTitleMsg( 'editing', $title );
+                       $wgOut->setPageTitle( wfMessage( 'editing', $title ) );
                }
        }
 
@@ -2226,7 +2226,7 @@ HTML
                        array( 'returnto' => $this->getContextTitle()->getPrefixedText() )
                );
 
-               $wgOut->setPageTitleMsg( 'whitelistedittitle' );
+               $wgOut->setPageTitle( wfMessage( 'whitelistedittitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
 
@@ -2241,7 +2241,7 @@ HTML
        function noSuchSectionPage() {
                global $wgOut;
 
-               $wgOut->setPageTitleMsg( 'nosuchsectiontitle' );
+               $wgOut->setPageTitle( wfMessage( 'nosuchsectiontitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
 
@@ -2261,7 +2261,7 @@ HTML
        static function spamPage( $match = false ) {
                global $wgOut, $wgTitle;
 
-               $wgOut->setPageTitleMsg( 'spamprotectiontitle' );
+               $wgOut->setPageTitle( wfMessage( 'spamprotectiontitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
 
@@ -2284,7 +2284,7 @@ HTML
                global $wgOut;
                $this->textbox2 = $this->textbox1;
 
-               $wgOut->setPageTitleMsg( 'spamprotectiontitle' );
+               $wgOut->setPageTitle( wfMessage( 'spamprotectiontitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
 
@@ -2845,7 +2845,7 @@ HTML
 
        function noCreatePermission() {
                global $wgOut;
-               $wgOut->setPageTitleMsg( 'nocreatetitle' );
+               $wgOut->setPageTitle( wfMessage( 'nocreatetitle' ) );
                $wgOut->addWikiMsg( 'nocreatetext' );
        }
 
index e70d551..97ac28e 100644 (file)
@@ -78,7 +78,7 @@ class FileDeleteForm {
                                $wgOut->addHTML( '</span>' );
                        }
                        if( $status->ok ) {
-                               $wgOut->setPageTitleMsg( 'actioncomplete' );
+                               $wgOut->setPageTitle( wfMessage( 'actioncomplete' ) );
                                $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
                                // Return to the main page if we just deleted all versions of the
                                // file, otherwise go back to the description page
@@ -271,7 +271,7 @@ class FileDeleteForm {
         */
        private function setHeaders() {
                global $wgOut;
-               $wgOut->setPageTitleMsg( 'filedelete', $this->title->getText() );
+               $wgOut->setPageTitle( wfMessage( 'filedelete', $this->title->getText() ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setSubtitle( wfMsg(
                        'filedelete-backlink',
index 7950aaf..8bd94ee 100644 (file)
@@ -795,7 +795,7 @@ EOT
         */
        function showError( $description ) {
                global $wgOut;
-               $wgOut->setPageTitle( wfMsg( 'internalerror' ) );
+               $wgOut->setPageTitle( wfMessage( 'internalerror' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
                $wgOut->enableClientCache( false );
index 803f091..578e5f1 100644 (file)
@@ -204,6 +204,19 @@ class Message {
                return $this;
        }
 
+       /**
+        * Set the language and the title from a context object
+        *
+        * @param $context IContextSource
+        * @return Message: $this
+        */
+       public function setContext( IContextSource $context ) {
+               $this->inLanguage( $context->getLang() );
+               $this->title( $context->getTitle() );
+
+               return $this;
+       }
+
        /**
         * Request the message in any language that is supported.
         * As a side effect interface message status is unconditionally
index c4c1a72..463cdaf 100644 (file)
@@ -760,20 +760,11 @@ class OutputPage extends ContextSource {
         * @param $name string
         */
        public function setHTMLTitle( $name ) {
-               $this->mHTMLtitle = $name;
-       }
-
-       /**
-        * Same as setHTMLTitle(), but takes a message name and parameter instead
-        * of directly the string to display.
-        *
-        * @since 1.19
-        * @param $name String message name
-        * @param $args Array|String message parameters, if there's only one
-        *              parameter it can be passed directly as a string.
-        */
-       public function setHTMLTitleMsg( $name, $args = array() ) {
-               $this->setHTMLTitle( $this->msg( $name, $args )->text() );
+               if ( $name instanceof Message ) {
+                       $this->mHTMLtitle = $name->setContext( $this->getContext() )->text();
+               } else {
+                       $this->mHTMLtitle = $name;
+               }
        }
 
        /**
@@ -791,29 +782,20 @@ class OutputPage extends ContextSource {
         * This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed.
         * Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
         *
-        * @param $name string
+        * @param $name string|Message
         */
        public function setPageTitle( $name ) {
+               if ( $name instanceof Message ) {
+                       $name = $name->setContext( $this->getContext() )->text();
+               }
+
                # change "<script>foo&bar</script>" to "&lt;script&gt;foo&amp;bar&lt;/script&gt;"
                # but leave "<i>foobar</i>" alone
                $nameWithTags = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $name ) );
                $this->mPagetitle = $nameWithTags;
 
                # change "<i>foo&amp;bar</i>" to "foo&bar"
-               $this->setHTMLTitleMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) );
-       }
-
-       /**
-        * Same as setPageTitle(), but takes a message name and parameter instead
-        * of directly the string to display.
-        *
-        * @since 1.19
-        * @param $name String message name
-        * @param $args Array|String message parameters, if there's only one
-        *              parameter it can be passed directly as a string.
-        */
-       public function setPageTitleMsg( $name, $args = array() ) {
-               $this->setPageTitle( $this->msg( $name, $args )->text() );
+               $this->setHTMLTitle( $this->msg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) ) );
        }
 
        /**
@@ -1956,8 +1938,8 @@ class OutputPage extends ContextSource {
                if ( $this->getTitle() ) {
                        $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
                }
-               $this->setPageTitleMsg( $title );
-               $this->setHTMLTitleMsg( 'errorpagetitle' );
+               $this->setPageTitle( $this->msg( $title ) );
+               $this->setHTMLTitle( $this->msg( 'errorpagetitle' ) );
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleRelated( false );
                $this->enableClientCache( false );
@@ -1982,8 +1964,8 @@ class OutputPage extends ContextSource {
        public function showPermissionsErrorPage( $errors, $action = null ) {
                $this->mDebugtext .= 'Original title: ' .
                $this->getTitle()->getPrefixedText() . "\n";
-               $this->setPageTitleMsg( 'permissionserrors' );
-               $this->setHTMLTitleMsg( 'permissionserrors' );
+               $this->setPageTitle( $this->msg( 'permissionserrors' ) );
+               $this->setHTMLTitle( $this->msg('permissionserrors' ) );
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleRelated( false );
                $this->enableClientCache( false );
@@ -1999,8 +1981,8 @@ class OutputPage extends ContextSource {
         * @param $version Mixed: the version of MediaWiki needed to use the page
         */
        public function versionRequired( $version ) {
-               $this->setPageTitleMsg( 'versionrequired' );
-               $this->setHTMLTitleMsg( 'versionrequired', $version );
+               $this->setPageTitle( $this->msg( 'versionrequired' ) );
+               $this->setHTMLTitle( $this->msg( 'versionrequired', $version ) );
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleRelated( false );
                $this->mBodytext = '';
@@ -2026,8 +2008,8 @@ class OutputPage extends ContextSource {
                        throw new PermissionsError( 'read' );
                }
 
-               $this->setPageTitleMsg( 'loginreqtitle' );
-               $this->setHTMLTitleMsg( 'errorpagetitle' );
+               $this->setPageTitle( $this->msg( 'loginreqtitle' ) );
+               $this->setHTMLTitle( $this->msg( 'errorpagetitle' ) );
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleRelated( false );
 
@@ -2119,12 +2101,12 @@ class OutputPage extends ContextSource {
                if ( !empty( $reasons ) ) {
                        // Permissions error
                        if( $source ) {
-                               $this->setPageTitleMsg( 'viewsource' );
+                               $this->setPageTitle( $this->msg( 'viewsource' ) );
                                $this->setSubtitle(
                                        $this->msg( 'viewsourcefor', Linker::linkKnown( $this->getTitle() ) )->text()
                                );
                        } else {
-                               $this->setPageTitleMsg( 'badaccess' );
+                               $this->setPageTitle( $this->msg( 'badaccess' ) );
                        }
                        $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
                } else {
@@ -2194,7 +2176,7 @@ $templates
        }
 
        public function showFatalError( $message ) {
-               $this->setPageTitleMsg( 'internalerror' );
+               $this->setPageTitle( $this->msg( 'internalerror' ) );
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleRelated( false );
                $this->enableClientCache( false );
@@ -2286,7 +2268,7 @@ $templates
                $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
 
                if ( $this->getHTMLTitle() == '' ) {
-                       $this->setHTMLTitleMsg( 'pagetitle', $this->getPageTitle() );
+                       $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() ) );
                }
 
                $openHead = Html::openElement( 'head' );
index 4d90808..ae0479a 100644 (file)
@@ -224,7 +224,7 @@ class ProtectionForm {
                }
 
                $titleLink = Linker::link( $this->mTitle );
-               $wgOut->setPageTitleMsg( 'protect-title', $this->mTitle->getPrefixedText() );
+               $wgOut->setPageTitle( wfMessage( 'protect-title', $this->mTitle->getPrefixedText() ) );
                $wgOut->setSubtitle( wfMsg( 'protect-backlink', $titleLink ) );
 
                # Show an appropriate message if the user isn't allowed or able to change
index 0ac5293..f9b760a 100644 (file)
@@ -67,7 +67,7 @@ class MarkpatrolledAction extends FormlessAction {
                $return = SpecialPage::getTitleFor( $returnto );
 
                if ( in_array( array( 'markedaspatrollederror-noautopatrol' ), $errors ) ) {
-                       $this->getOutput()->setPageTitleMsg( 'markedaspatrollederror' );
+                       $this->getOutput()->setPageTitle( $this->msg( 'markedaspatrollederror' ) );
                        $this->getOutput()->addWikiMsg( 'markedaspatrollederror-noautopatrol' );
                        $this->getOutput()->returnToMain( null, $return );
                        return;
@@ -79,7 +79,7 @@ class MarkpatrolledAction extends FormlessAction {
                }
 
                # Inform the user
-               $this->getOutput()->setPageTitleMsg( 'markedaspatrolled' );
+               $this->getOutput()->setPageTitle( $this->msg( 'markedaspatrolled' ) );
                $this->getOutput()->addWikiMsg( 'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
                $this->getOutput()->returnToMain( null, $return );
        }
index b1d3b19..e7a6521 100644 (file)
@@ -54,7 +54,7 @@ class RollbackAction extends FormlessAction {
                }
 
                if ( isset( $result[0][0] ) && ( $result[0][0] == 'alreadyrolled' || $result[0][0] == 'cantrollback' ) ) {
-                       $this->getOutput()->setPageTitleMsg( 'rollbackfailed' );
+                       $this->getOutput()->setPageTitle( $this->msg( 'rollbackfailed' ) );
                        $errArray = $result[0];
                        $errMsg = array_shift( $errArray );
                        $this->getOutput()->addWikiMsgArray( $errMsg, $errArray );
@@ -95,7 +95,7 @@ class RollbackAction extends FormlessAction {
                $current = $details['current'];
                $target = $details['target'];
                $newId = $details['newid'];
-               $this->getOutput()->setPageTitleMsg( 'actioncomplete' );
+               $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
                $this->getOutput()->setRobotPolicy( 'noindex,nofollow' );
 
                if ( $current->getUserText() === '' ) {
index fffad42..3cbe253 100644 (file)
@@ -252,7 +252,7 @@ class RequestContext implements IContextSource {
         */
        public function msg() {
                $args = func_get_args();
-               return call_user_func_array( 'wfMessage', $args )->inLanguage( $this->getLang() )->title( $this->getTitle() );
+               return call_user_func_array( 'wfMessage', $args )->setContext( $this );
        }
 
        /** Static methods **/
index 664fea5..bdea4eb 100644 (file)
@@ -188,7 +188,7 @@ class DifferenceEngine {
                        $d = wfMsgExt( 'missingarticle-diff', array( 'escape' ),
                                $this->deletedIdMarker( $this->mOldid ),
                                $this->deletedIdMarker( $this->mNewid ) );
-                       $wgOut->setPagetitle( wfMsg( 'errorpagetitle' ) );
+                       $wgOut->setPageTitle( wfMessage( 'errorpagetitle' ) );
                        $wgOut->addWikiMsg( 'missing-article', "<nowiki>$t</nowiki>", "<span class='plainlinks'>$d</span>" );
                        wfProfileOut( __METHOD__ );
                        return;
index 5b848f0..8395b4e 100644 (file)
@@ -73,10 +73,10 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                $namespaces = $wgContLang->getNamespaces();
 
-               $out->setPagetitle(
+               $out->setPageTitle(
                        ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ?
-                       wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
-                       wfMsg( 'allarticles' )
+                       $this->msg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
+                       $this->msg( 'allarticles' )
                );
                $out->addModuleStyles( 'mediawiki.special' );
 
index 25114f8..d4625b3 100644 (file)
@@ -91,7 +91,7 @@ class SpecialBlock extends SpecialPage {
                $this->outputHeader();
 
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'blockip-title' );
+               $out->setPageTitle( $this->msg( 'blockip-title' ) );
                $out->addModules( array( 'mediawiki.special', 'mediawiki.special.block' ) );
 
                $fields = $this->getFormFields();
@@ -111,7 +111,7 @@ class SpecialBlock extends SpecialPage {
                $this->doPostText( $form );
 
                if( $form->show() ){
-                       $out->setPageTitleMsg( 'blockipsuccesssub' );
+                       $out->setPageTitle( $this->msg( 'blockipsuccesssub' ) );
                        $out->addWikiMsg( 'blockipsuccesstext',  $this->target );
                }
        }
index f6041ca..9891e28 100644 (file)
@@ -43,7 +43,7 @@ class SpecialBlockList extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'ipblocklist' );
+               $out->setPageTitle( $this->msg( 'ipblocklist' ) );
                $out->addModuleStyles( 'mediawiki.special' );
 
                $request = $this->getRequest();
index df4db79..03aa649 100644 (file)
@@ -84,14 +84,14 @@ class SpecialContributions extends SpecialPage {
                if( $this->opts['contribs'] != 'newbie' ) {
                        $target = $nt->getText();
                        $out->setSubtitle( $this->contributionsSub( $nt, $id ) );
-                       $out->setHTMLTitleMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) );
+                       $out->setHTMLTitle( $this->msg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ), $target ) ) );
                        $userObj = User::newFromName( $target, false );
                        if ( is_object( $userObj ) ) {
                                $this->getSkin()->setRelevantUser( $userObj );
                        }
                } else {
                        $out->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
-                       $out->setHTMLTitleMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) );
+                       $out->setHTMLTitle( $this->msg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) );
                }
 
                if( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
index 2096227..52946dd 100644 (file)
@@ -269,7 +269,7 @@ class DeletedContributionsPage extends SpecialPage {
 
                $request = $this->getRequest();
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'deletedcontributions-title' );
+               $out->setPageTitle( $this->msg( 'deletedcontributions-title' ) );
 
                $options = array();
 
index 2e2554f..e03048a 100644 (file)
@@ -34,7 +34,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                # Anons don't get a watchlist
                if( $this->getUser()->isAnon() ) {
-                       $out->setPageTitleMsg( 'watchnologin' );
+                       $out->setPageTitle( $this->msg( 'watchnologin' ) );
                        $llink = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Userlogin' ),
                                wfMsgHtml( 'loginreqlink' ),
@@ -75,7 +75,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                // Pass on to the raw editor, from which it's very easy to clear.
 
                        case self::EDIT_RAW:
-                               $out->setPageTitleMsg( 'watchlistedit-raw-title' );
+                               $out->setPageTitle( $this->msg( 'watchlistedit-raw-title' ) );
                                $form = $this->getRawForm();
                                if( $form->show() ){
                                        $out->addHTML( $this->successMessage );
@@ -85,7 +85,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                        case self::EDIT_NORMAL:
                        default:
-                               $out->setPageTitleMsg( 'watchlistedit-normal-title' );
+                               $out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) );
                                $form = $this->getNormalForm();
                                if( $form->show() ){
                                        $out->addHTML( $this->successMessage );
index 40b627b..314da72 100644 (file)
@@ -135,11 +135,11 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        return false;
                }
 
-               $out->setPageTitleMsg( 'emailpage' );
+               $out->setPageTitle( $this->msg( 'emailpage' ) );
                $result = $form->show();
 
                if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
-                       $out->setPageTitleMsg( 'emailsent' );
+                       $out->setPageTitle( $this->msg( 'emailsent' ) );
                        $out->addWikiMsg( 'emailsenttext' );
                        $out->returnToMain( false, $this->mTargetObj->getUserPage() );
                }
index cc4c61c..4f66414 100644 (file)
@@ -112,7 +112,7 @@ class MovePageForm extends UnlistedSpecialPage {
                $oldTitleLink = Linker::link( $this->oldTitle );
 
                $out = $this->getOutput();
-               $out->setPagetitle( wfMsg( 'move-page', $this->oldTitle->getPrefixedText() ) );
+               $out->setPageTitle( $this->msg( 'move-page', $this->oldTitle->getPrefixedText() ) );
                $out->addModules( 'mediawiki.special.movePage' );
 
                $newTitle = $this->newTitle;
index fd5005e..43b7d27 100644 (file)
@@ -54,10 +54,10 @@ class SpecialPrefixindex extends SpecialAllpages {
                $namespace = (int)$ns; // if no namespace given, use 0 (NS_MAIN).
 
                $namespaces = $wgContLang->getNamespaces();
-               $out->setPagetitle(
+               $out->setPageTitle(
                        ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) )
-                               ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) )
-                               : wfMsg( 'prefixindex' )
+                               ? $this->msg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) )
+                               : $this->msg( 'prefixindex' )
                );
 
                $showme = '';
index 45f293f..000ef3e 100644 (file)
@@ -75,7 +75,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                        return false;
                }
 
-               $this->getOutput()->setPageTitleMsg( 'recentchangeslinked-title', $title->getPrefixedText() );
+               $this->getOutput()->setPageTitle( $this->msg( 'recentchangeslinked-title', $title->getPrefixedText() ) );
 
                /*
                 * Ordinary links are in the pagelinks table, while transclusions are
index e967a90..4f8edda 100644 (file)
@@ -538,7 +538,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Report that the submit operation succeeded
         */
        protected function success() {
-               $this->getOutput()->setPagetitle( wfMsg( 'actioncomplete' ) );
+               $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
                $this->getOutput()->wrapWikiMsg( "<span class=\"success\">\n$1\n</span>", $this->typeInfo['success'] );
                $this->list->reloadFromMaster();
                $this->showForm();
@@ -548,7 +548,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Report that the submit operation failed
         */
        protected function failure( $status ) {
-               $this->getOutput()->setPagetitle( wfMsg( 'actionfailed' ) );
+               $this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
                $this->getOutput()->addWikiText( $status->getWikiText( $this->typeInfo['failure'] ) );
                $this->showForm();
        }
index 7b19870..857a38c 100644 (file)
@@ -435,8 +435,8 @@ class SpecialSearch extends SpecialPage {
                $this->searchAdvanced = ($this->profile === 'advanced');
                $out = $this->getOutput();
                if( strval( $term ) !== ''  ) {
-                       $out->setPageTitleMsg( 'searchresults' );
-                       $out->setHTMLTitleMsg( 'pagetitle', wfMsg( 'searchresults-title', $term ) );
+                       $out->setPageTitle( $this->msg( 'searchresults' ) );
+                       $out->setHTMLTitle( $this->msg( 'pagetitle', $this->msg( 'searchresults-title', $term )->plain() ) );
                }
                // add javascript specific to special:search
                $out->addModules( 'mediawiki.special.search' );
index 358843d..d6011d2 100644 (file)
@@ -40,7 +40,7 @@ class SpecialTags extends SpecialPage {
                $this->outputHeader();
 
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'tags-title' );
+               $out->setPageTitle( $this->msg( 'tags-title' ) );
                $out->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
 
                // Write the headers
index e9a59cd..3ecbdbd 100644 (file)
@@ -53,7 +53,7 @@ class SpecialUnblock extends SpecialPage {
                $this->outputHeader();
 
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'unblockip' );
+               $out->setPageTitle( $this->msg( 'unblockip' ) );
                $out->addModules( 'mediawiki.special' );
 
                $form = new HTMLForm( $this->getFields(), $this->getContext() );
index 7342f3f..cfc59ae 100644 (file)
@@ -649,9 +649,9 @@ class SpecialUndelete extends SpecialPage {
                $out = $this->getOutput();
 
                if ( $this->mAllowed ) {
-                       $out->setPageTitleMsg( 'undeletepage' );
+                       $out->setPageTitle( $this->msg( 'undeletepage' ) );
                } else {
-                       $out->setPageTitleMsg( 'viewdeletedpage' );
+                       $out->setPageTitle( $this->msg( 'viewdeletedpage' ) );
                }
 
                if( $par != '' ) {
@@ -802,7 +802,7 @@ class SpecialUndelete extends SpecialPage {
                        }
                }
 
-               $out->setPageTitleMsg( 'undeletepage' );
+               $out->setPageTitle( $this->msg( 'undeletepage' ) );
 
                if( $this->mDiff ) {
                        $previousRev = $archive->getPreviousRevision( $timestamp );
@@ -1016,9 +1016,9 @@ class SpecialUndelete extends SpecialPage {
                $out = $this->getOutput();
                if( $this->mAllowed ) {
                        $out->addModules( 'mediawiki.special.undelete' );
-                       $out->setPageTitleMsg( 'undeletepage' );
+                       $out->setPageTitle( $this->msg( 'undeletepage' ) );
                } else {
-                       $out->setPageTitleMsg( 'viewdeletedpage' );
+                       $out->setPageTitle( $this->msg( 'viewdeletedpage' ) );
                }
                $out->wrapWikiMsg(
                        "<div class='mw-undelete-pagetitle'>\n$1\n</div>\n",
index f06c307..65e258f 100644 (file)
@@ -189,7 +189,7 @@ class LoginForm extends SpecialPage {
                $u->addNewUserLogEntry( true, $this->mReason );
 
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'accmailtitle' );
+               $out->setPageTitle( $this->msg( 'accmailtitle' ) );
 
                if( !$result->isGood() ) {
                        $this->mainLoginForm( $this->msg( 'mailerror', $result->getWikiText() )->text() );
@@ -251,7 +251,7 @@ class LoginForm extends SpecialPage {
                        }
                } else {
                        # Confirm that the account was created
-                       $out->setPageTitleMsg( 'accountcreated' );
+                       $out->setPageTitle( $this->msg( 'accountcreated' ) );
                        $out->addWikiMsg( 'accountcreatedtext', $u->getName() );
                        $out->returnToMain( false, $this->getTitle() );
                        wfRunHooks( 'AddNewAccount', array( $u, false ) );
@@ -883,7 +883,7 @@ class LoginForm extends SpecialPage {
         */
        private function displaySuccessfulLogin( $msgname, $injected_html ) {
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'loginsuccesstitle' );
+               $out->setPageTitle( $this->msg( 'loginsuccesstitle' ) );
                if( $msgname ){
                        $out->addWikiMsg( $msgname, wfEscapeWikiText( $this->getUser()->getName() ) );
                }
@@ -914,7 +914,7 @@ class LoginForm extends SpecialPage {
                # out.
 
                $out = $this->getOutput();
-               $out->setPageTitleMsg( 'cantcreateaccounttitle' );
+               $out->setPageTitle( $this->msg( 'cantcreateaccounttitle' ) );
 
                $block_reason = $block->mReason;
                if ( strval( $block_reason ) === '' ) {
@@ -1077,9 +1077,9 @@ class LoginForm extends SpecialPage {
                // Changes the title depending on permissions for creating account
                $out = $this->getOutput();
                if ( $user->isAllowed( 'createaccount' ) ) {
-                       $out->setPageTitleMsg( 'userlogin' );
+                       $out->setPageTitle( $this->msg( 'userlogin' ) );
                } else {
-                       $out->setPageTitleMsg( 'userloginnocreate' );
+                       $out->setPageTitle( $this->msg( 'userloginnocreate' ) );
                }
 
                $out->disallowUserJs(); // just in case...
index 3c63f2a..ad2c5eb 100644 (file)
@@ -55,7 +55,7 @@ class SpecialWatchlist extends SpecialPage {
 
                # Anons don't get a watchlist
                if( $user->isAnon() ) {
-                       $output->setPageTitleMsg( 'watchnologin' );
+                       $output->setPageTitle( $this->msg( 'watchnologin' ) );
                        $llink = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Userlogin' ),
                                wfMsgHtml( 'loginreqlink' ),
index a6dc6f5..e88a16f 100644 (file)
@@ -86,7 +86,7 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                $this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() );
 
-               $out->setPageTitleMsg( 'whatlinkshere-title', $this->target->getPrefixedText() );
+               $out->setPageTitle( $this->msg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
                $out->setSubtitle( wfMsg( 'whatlinkshere-backlink', Linker::link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no'  ) ) ) );
 
                $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ),