From: Alexandre Emsenhuber Date: Thu, 27 Oct 2011 20:23:16 +0000 (+0000) Subject: Per Nikerabbit's comment on r100621: X-Git-Tag: 1.31.0-rc.0~26870 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=b212bace90bf0c6e34308b8805c127350467c981;p=lhc%2Fweb%2Fwiklou.git Per Nikerabbit's comment on r100621: * 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 $ --- diff --git a/includes/Article.php b/includes/Article.php index 4794eee580..546e2d9066 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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' ) . ']]'; diff --git a/includes/EditPage.php b/includes/EditPage.php index 7c4221a462..1696b26a6a 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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' ); } diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index e70d551f1f..97ac28eebc 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -78,7 +78,7 @@ class FileDeleteForm { $wgOut->addHTML( '' ); } 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', diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 7950aafd8a..8bd94eeaf3 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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 ); diff --git a/includes/Message.php b/includes/Message.php index 803f091c33..578e5f10e0 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -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 diff --git a/includes/OutputPage.php b/includes/OutputPage.php index c4c1a72532..463cdaf059 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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 \ to the same content as \ but with all tags removed. * Bad tags that were escaped in \ will still be escaped in \, and good tags like \ 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 "" to "<script>foo&bar</script>" # but leave "foobar" alone $nameWithTags = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $name ) ); $this->mPagetitle = $nameWithTags; # change "foo&bar" 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' ); diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 4d9080808c..ae0479abe9 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -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 diff --git a/includes/actions/MarkpatrolledAction.php b/includes/actions/MarkpatrolledAction.php index 0ac5293c9f..f9b760ac68 100644 --- a/includes/actions/MarkpatrolledAction.php +++ b/includes/actions/MarkpatrolledAction.php @@ -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 ); } diff --git a/includes/actions/RollbackAction.php b/includes/actions/RollbackAction.php index b1d3b1932a..e7a6521e36 100644 --- a/includes/actions/RollbackAction.php +++ b/includes/actions/RollbackAction.php @@ -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() === '' ) { diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index fffad42ab0..3cbe253e3b 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -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 **/ diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 664fea5d73..bdea4eb73e 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -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', "$t", "$d" ); wfProfileOut( __METHOD__ ); return; diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 5b848f0e08..8395b4e17d 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -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' ); diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 25114f8eb8..d4625b3162 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -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 ); } } diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index f6041cabdf..9891e289f5 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -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(); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index df4db79c3e..03aa64991b 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -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 !== '' ) { diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 209622731a..52946dd1f4 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -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(); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 2e2554fce1..e03048ab80 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -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 ); diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 40b627b2d8..314da7274c 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -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() ); } diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index cc4c61c90c..4f66414420 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -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; diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index fd5005e323..43b7d27900 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -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 = ''; diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 45f293f49d..000ef3e5e3 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -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 diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index e967a900b6..4f8eddad2e 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -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( "\n$1\n", $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(); } diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 7b19870648..857a38c0f4 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -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' ); diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 358843d585..d6011d2907 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -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( "
\n$1\n
", 'tags-intro' ); // Write the headers diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php index e9a59cd474..3ecbdbd1a2 100644 --- a/includes/specials/SpecialUnblock.php +++ b/includes/specials/SpecialUnblock.php @@ -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() ); diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 7342f3f8d1..cfc59aeca0 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -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( "
\n$1\n
\n", diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index f06c307aea..65e258fa0d 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -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... diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 3c63f2ac4d..ad2c5eba94 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -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' ), diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index a6dc6f5d14..e88a16f6c3 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -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' ),