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

This commit is contained in:
Alexandre Emsenhuber 2011-10-24 17:24:38 +00:00
parent 109e5113c0
commit ae45908c59
21 changed files with 84 additions and 63 deletions

View file

@ -1360,14 +1360,11 @@ class EditPage {
function setHeaders() { function setHeaders() {
global $wgOut; global $wgOut;
$wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setRobotPolicy( 'noindex,nofollow' );
if ( $this->formtype == 'preview' ) {
$wgOut->setPageTitleActionText( wfMsg( 'preview' ) );
}
if ( $this->isConflict ) { if ( $this->isConflict ) {
$wgOut->setPageTitle( wfMsg( 'editconflict', $this->getContextTitle()->getPrefixedText() ) ); $wgOut->setPageTitleMsg( 'editconflict', $this->getContextTitle()->getPrefixedText() );
} elseif ( $this->section != '' ) { } elseif ( $this->section != '' ) {
$msg = $this->section == 'new' ? 'editingcomment' : 'editingsection'; $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection';
$wgOut->setPageTitle( wfMsg( $msg, $this->getContextTitle()->getPrefixedText() ) ); $wgOut->setPageTitleMsg( $msg, $this->getContextTitle()->getPrefixedText() );
} else { } else {
# Use the title defined by DISPLAYTITLE magic word when present # Use the title defined by DISPLAYTITLE magic word when present
if ( isset( $this->mParserOutput ) if ( isset( $this->mParserOutput )
@ -1376,7 +1373,7 @@ class EditPage {
} else { } else {
$title = $this->getContextTitle()->getPrefixedText(); $title = $this->getContextTitle()->getPrefixedText();
} }
$wgOut->setPageTitle( wfMsg( 'editing', $title ) ); $wgOut->setPageTitleMsg( 'editing', $title );
} }
} }
@ -2229,7 +2226,7 @@ HTML
array( 'returnto' => $this->getContextTitle()->getPrefixedText() ) array( 'returnto' => $this->getContextTitle()->getPrefixedText() )
); );
$wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) ); $wgOut->setPageTitleMsg( 'whitelistedittitle' );
$wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false ); $wgOut->setArticleRelated( false );
@ -2244,7 +2241,7 @@ HTML
function noSuchSectionPage() { function noSuchSectionPage() {
global $wgOut; global $wgOut;
$wgOut->setPageTitle( wfMsg( 'nosuchsectiontitle' ) ); $wgOut->setPageTitleMsg( 'nosuchsectiontitle' );
$wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false ); $wgOut->setArticleRelated( false );
@ -2264,7 +2261,7 @@ HTML
static function spamPage( $match = false ) { static function spamPage( $match = false ) {
global $wgOut, $wgTitle; global $wgOut, $wgTitle;
$wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) ); $wgOut->setPageTitleMsg( 'spamprotectiontitle' );
$wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false ); $wgOut->setArticleRelated( false );
@ -2287,7 +2284,7 @@ HTML
global $wgOut; global $wgOut;
$this->textbox2 = $this->textbox1; $this->textbox2 = $this->textbox1;
$wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) ); $wgOut->setPageTitleMsg( 'spamprotectiontitle' );
$wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false ); $wgOut->setArticleRelated( false );
@ -2848,7 +2845,7 @@ HTML
function noCreatePermission() { function noCreatePermission() {
global $wgOut; global $wgOut;
$wgOut->setPageTitle( wfMsg( 'nocreatetitle' ) ); $wgOut->setPageTitleMsg( 'nocreatetitle' );
$wgOut->addWikiMsg( 'nocreatetext' ); $wgOut->addWikiMsg( 'nocreatetext' );
} }

View file

@ -78,7 +78,7 @@ class FileDeleteForm {
$wgOut->addHTML( '</span>' ); $wgOut->addHTML( '</span>' );
} }
if( $status->ok ) { if( $status->ok ) {
$wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); $wgOut->setPageTitleMsg( 'actioncomplete' );
$wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) ); $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
// Return to the main page if we just deleted all versions of the // Return to the main page if we just deleted all versions of the
// file, otherwise go back to the description page // file, otherwise go back to the description page
@ -271,7 +271,7 @@ class FileDeleteForm {
*/ */
private function setHeaders() { private function setHeaders() {
global $wgOut; global $wgOut;
$wgOut->setPageTitle( wfMsg( 'filedelete', $this->title->getText() ) ); $wgOut->setPageTitleMsg( 'filedelete', $this->title->getText() );
$wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setSubtitle( wfMsg( $wgOut->setSubtitle( wfMsg(
'filedelete-backlink', 'filedelete-backlink',

View file

@ -760,6 +760,19 @@ class OutputPage extends ContextSource {
$this->mHTMLtitle = $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() );
}
/** /**
* Return the "HTML title", i.e. the content of the <title> tag. * Return the "HTML title", i.e. the content of the <title> tag.
* *
@ -784,7 +797,20 @@ class OutputPage extends ContextSource {
$this->mPagetitle = $nameWithTags; $this->mPagetitle = $nameWithTags;
# change "<i>foo&amp;bar</i>" to "foo&bar" # change "<i>foo&amp;bar</i>" to "foo&bar"
$this->setHTMLTitle( $this->msg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) )->text() ); $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() );
} }
/** /**
@ -1927,8 +1953,8 @@ class OutputPage extends ContextSource {
if ( $this->getTitle() ) { if ( $this->getTitle() ) {
$this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n"; $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
} }
$this->setPageTitle( $this->msg( $title )->text() ); $this->setPageTitleMsg( $title );
$this->setHTMLTitle( $this->msg( 'errorpagetitle' )->text() ); $this->setHTMLTitleMsg( 'errorpagetitle' );
$this->setRobotPolicy( 'noindex,nofollow' ); $this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false ); $this->setArticleRelated( false );
$this->enableClientCache( false ); $this->enableClientCache( false );
@ -1953,8 +1979,8 @@ class OutputPage extends ContextSource {
public function showPermissionsErrorPage( $errors, $action = null ) { public function showPermissionsErrorPage( $errors, $action = null ) {
$this->mDebugtext .= 'Original title: ' . $this->mDebugtext .= 'Original title: ' .
$this->getTitle()->getPrefixedText() . "\n"; $this->getTitle()->getPrefixedText() . "\n";
$this->setPageTitle( $this->msg( 'permissionserrors' )->text() ); $this->setPageTitleMsg( 'permissionserrors' );
$this->setHTMLTitle( $this->msg( 'permissionserrors' )->text() ); $this->setHTMLTitleMsg( 'permissionserrors' );
$this->setRobotPolicy( 'noindex,nofollow' ); $this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false ); $this->setArticleRelated( false );
$this->enableClientCache( false ); $this->enableClientCache( false );
@ -1970,8 +1996,8 @@ class OutputPage extends ContextSource {
* @param $version Mixed: the version of MediaWiki needed to use the page * @param $version Mixed: the version of MediaWiki needed to use the page
*/ */
public function versionRequired( $version ) { public function versionRequired( $version ) {
$this->setPageTitle( $this->msg( 'versionrequired', $version )->text() ); $this->setPageTitleMsg( 'versionrequired' );
$this->setHTMLTitle( $this->msg( 'versionrequired', $version )->text() ); $this->setHTMLTitleMsg( 'versionrequired', $version );
$this->setRobotPolicy( 'noindex,nofollow' ); $this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false ); $this->setArticleRelated( false );
$this->mBodytext = ''; $this->mBodytext = '';
@ -1997,8 +2023,8 @@ class OutputPage extends ContextSource {
throw new PermissionsError( 'read' ); throw new PermissionsError( 'read' );
} }
$this->setPageTitle( $this->msg( 'loginreqtitle' )->text() ); $this->setPageTitleMsg( 'loginreqtitle' );
$this->setHTMLTitle( $this->msg( 'errorpagetitle' )->text() ); $this->setHTMLTitleMsg( 'errorpagetitle' );
$this->setRobotPolicy( 'noindex,nofollow' ); $this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false ); $this->setArticleRelated( false );
@ -2090,12 +2116,12 @@ class OutputPage extends ContextSource {
if ( !empty( $reasons ) ) { if ( !empty( $reasons ) ) {
// Permissions error // Permissions error
if( $source ) { if( $source ) {
$this->setPageTitle( $this->msg( 'viewsource' )->text() ); $this->setPageTitleMsg( 'viewsource' );
$this->setSubtitle( $this->setSubtitle(
$this->msg( 'viewsourcefor', Linker::linkKnown( $this->getTitle() ) )->text() $this->msg( 'viewsourcefor', Linker::linkKnown( $this->getTitle() ) )->text()
); );
} else { } else {
$this->setPageTitle( $this->msg( 'badaccess' )->text() ); $this->setPageTitleMsg( 'badaccess' );
} }
$this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) ); $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
} else { } else {
@ -2165,7 +2191,7 @@ $templates
} }
public function showFatalError( $message ) { public function showFatalError( $message ) {
$this->setPageTitle( $this->msg( 'internalerror' )->text() ); $this->setPageTitleMsg( 'internalerror' );
$this->setRobotPolicy( 'noindex,nofollow' ); $this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false ); $this->setArticleRelated( false );
$this->enableClientCache( false ); $this->enableClientCache( false );
@ -2257,7 +2283,7 @@ $templates
$ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
if ( $this->getHTMLTitle() == '' ) { if ( $this->getHTMLTitle() == '' ) {
$this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() )->text() ); $this->setHTMLTitleMsg( 'pagetitle', $this->getPageTitle() );
} }
$openHead = Html::openElement( 'head' ); $openHead = Html::openElement( 'head' );

View file

@ -224,7 +224,7 @@ class ProtectionForm {
} }
$titleLink = Linker::link( $this->mTitle ); $titleLink = Linker::link( $this->mTitle );
$wgOut->setPageTitle( wfMsg( 'protect-title', $this->mTitle->getPrefixedText() ) ); $wgOut->setPageTitleMsg( 'protect-title', $this->mTitle->getPrefixedText() );
$wgOut->setSubtitle( wfMsg( 'protect-backlink', $titleLink ) ); $wgOut->setSubtitle( wfMsg( 'protect-backlink', $titleLink ) );
# Show an appropriate message if the user isn't allowed or able to change # Show an appropriate message if the user isn't allowed or able to change

View file

@ -67,7 +67,7 @@ class MarkpatrolledAction extends FormlessAction {
$return = SpecialPage::getTitleFor( $returnto ); $return = SpecialPage::getTitleFor( $returnto );
if ( in_array( array( 'markedaspatrollederror-noautopatrol' ), $errors ) ) { if ( in_array( array( 'markedaspatrollederror-noautopatrol' ), $errors ) ) {
$this->getOutput()->setPageTitle( wfMsg( 'markedaspatrollederror' ) ); $this->getOutput()->setPageTitleMsg( 'markedaspatrollederror' );
$this->getOutput()->addWikiMsg( 'markedaspatrollederror-noautopatrol' ); $this->getOutput()->addWikiMsg( 'markedaspatrollederror-noautopatrol' );
$this->getOutput()->returnToMain( null, $return ); $this->getOutput()->returnToMain( null, $return );
return; return;
@ -79,7 +79,7 @@ class MarkpatrolledAction extends FormlessAction {
} }
# Inform the user # Inform the user
$this->getOutput()->setPageTitle( wfMsg( 'markedaspatrolled' ) ); $this->getOutput()->setPageTitleMsg( 'markedaspatrolled' );
$this->getOutput()->addWikiMsg( 'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() ); $this->getOutput()->addWikiMsg( 'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
$this->getOutput()->returnToMain( null, $return ); $this->getOutput()->returnToMain( null, $return );
} }

View file

@ -54,7 +54,7 @@ class RollbackAction extends FormlessAction {
} }
if ( isset( $result[0][0] ) && ( $result[0][0] == 'alreadyrolled' || $result[0][0] == 'cantrollback' ) ) { if ( isset( $result[0][0] ) && ( $result[0][0] == 'alreadyrolled' || $result[0][0] == 'cantrollback' ) ) {
$this->getOutput()->setPageTitle( wfMsg( 'rollbackfailed' ) ); $this->getOutput()->setPageTitleMsg( 'rollbackfailed' );
$errArray = $result[0]; $errArray = $result[0];
$errMsg = array_shift( $errArray ); $errMsg = array_shift( $errArray );
$this->getOutput()->addWikiMsgArray( $errMsg, $errArray ); $this->getOutput()->addWikiMsgArray( $errMsg, $errArray );
@ -95,7 +95,7 @@ class RollbackAction extends FormlessAction {
$current = $details['current']; $current = $details['current'];
$target = $details['target']; $target = $details['target'];
$newId = $details['newid']; $newId = $details['newid'];
$this->getOutput()->setPageTitle( wfMsg( 'actioncomplete' ) ); $this->getOutput()->setPageTitleMsg( 'actioncomplete' );
$this->getOutput()->setRobotPolicy( 'noindex,nofollow' ); $this->getOutput()->setRobotPolicy( 'noindex,nofollow' );
if ( $current->getUserText() === '' ) { if ( $current->getUserText() === '' ) {

View file

@ -91,7 +91,7 @@ class SpecialBlock extends SpecialPage {
$this->outputHeader(); $this->outputHeader();
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( wfMsg( 'blockip-title' ) ); $out->setPageTitleMsg( 'blockip-title' );
$out->addModules( array( 'mediawiki.special', 'mediawiki.special.block' ) ); $out->addModules( array( 'mediawiki.special', 'mediawiki.special.block' ) );
$fields = $this->getFormFields(); $fields = $this->getFormFields();
@ -111,7 +111,7 @@ class SpecialBlock extends SpecialPage {
$this->doPostText( $form ); $this->doPostText( $form );
if( $form->show() ){ if( $form->show() ){
$out->setPageTitle( wfMsg( 'blockipsuccesssub' ) ); $out->setPageTitleMsg( 'blockipsuccesssub' );
$out->addWikiMsg( 'blockipsuccesstext', $this->target ); $out->addWikiMsg( 'blockipsuccesstext', $this->target );
} }
} }

View file

@ -43,7 +43,7 @@ class SpecialBlockList extends SpecialPage {
$this->setHeaders(); $this->setHeaders();
$this->outputHeader(); $this->outputHeader();
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( wfMsg( 'ipblocklist' ) ); $out->setPageTitleMsg( 'ipblocklist' );
$out->addModuleStyles( 'mediawiki.special' ); $out->addModuleStyles( 'mediawiki.special' );
$request = $this->getRequest(); $request = $this->getRequest();

View file

@ -84,14 +84,14 @@ class SpecialContributions extends SpecialPage {
if( $this->opts['contribs'] != 'newbie' ) { if( $this->opts['contribs'] != 'newbie' ) {
$target = $nt->getText(); $target = $nt->getText();
$out->setSubtitle( $this->contributionsSub( $nt, $id ) ); $out->setSubtitle( $this->contributionsSub( $nt, $id ) );
$out->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) ); $out->setHTMLTitleMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) );
$userObj = User::newFromName( $target, false ); $userObj = User::newFromName( $target, false );
if ( is_object( $userObj ) ) { if ( is_object( $userObj ) ) {
$this->getSkin()->setRelevantUser( $userObj ); $this->getSkin()->setRelevantUser( $userObj );
} }
} else { } else {
$out->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') ); $out->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
$out->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) ); $out->setHTMLTitleMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) );
} }
if( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) { if( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {

View file

@ -268,7 +268,7 @@ class DeletedContributionsPage extends SpecialPage {
$request = $this->getRequest(); $request = $this->getRequest();
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( wfMsgExt( 'deletedcontributions-title', array( 'parsemag' ) ) ); $out->setPageTitleMsg( 'deletedcontributions-title' );
$options = array(); $options = array();

View file

@ -34,7 +34,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
# Anons don't get a watchlist # Anons don't get a watchlist
if( $this->getUser()->isAnon() ) { if( $this->getUser()->isAnon() ) {
$out->setPageTitle( wfMsg( 'watchnologin' ) ); $out->setPageTitleMsg( 'watchnologin' );
$llink = Linker::linkKnown( $llink = Linker::linkKnown(
SpecialPage::getTitleFor( 'Userlogin' ), SpecialPage::getTitleFor( 'Userlogin' ),
wfMsgHtml( 'loginreqlink' ), wfMsgHtml( 'loginreqlink' ),
@ -75,7 +75,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
// Pass on to the raw editor, from which it's very easy to clear. // Pass on to the raw editor, from which it's very easy to clear.
case self::EDIT_RAW: case self::EDIT_RAW:
$out->setPageTitle( wfMsg( 'watchlistedit-raw-title' ) ); $out->setPageTitleMsg( 'watchlistedit-raw-title' );
$form = $this->getRawForm(); $form = $this->getRawForm();
if( $form->show() ){ if( $form->show() ){
$out->addHTML( $this->successMessage ); $out->addHTML( $this->successMessage );
@ -85,7 +85,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
case self::EDIT_NORMAL: case self::EDIT_NORMAL:
default: default:
$out->setPageTitle( wfMsg( 'watchlistedit-normal-title' ) ); $out->setPageTitleMsg( 'watchlistedit-normal-title' );
$form = $this->getNormalForm(); $form = $this->getNormalForm();
if( $form->show() ){ if( $form->show() ){
$out->addHTML( $this->successMessage ); $out->addHTML( $this->successMessage );

View file

@ -135,11 +135,11 @@ class SpecialEmailUser extends UnlistedSpecialPage {
return false; return false;
} }
$out->setPageTitle( wfMsg( 'emailpage' ) ); $out->setPageTitleMsg( 'emailpage' );
$result = $form->show(); $result = $form->show();
if( $result === true || ( $result instanceof Status && $result->isGood() ) ) { if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
$out->setPageTitle( wfMsg( 'emailsent' ) ); $out->setPageTitleMsg( 'emailsent' );
$out->addWikiMsg( 'emailsenttext' ); $out->addWikiMsg( 'emailsenttext' );
$out->returnToMain( false, $this->mTargetObj->getUserPage() ); $out->returnToMain( false, $this->mTargetObj->getUserPage() );
} }

View file

@ -167,9 +167,6 @@ class SpecialMergeHistory extends SpecialPage {
} }
private function showHistory() { private function showHistory() {
$out = $this->getOutput();
$out->setPageTitle( wfMsg( 'mergehistory' ) );
$this->showMergeForm(); $this->showMergeForm();
# List all stored revisions # List all stored revisions
@ -178,6 +175,7 @@ class SpecialMergeHistory extends SpecialPage {
); );
$haveRevisions = $revisions && $revisions->getNumRows() > 0; $haveRevisions = $revisions && $revisions->getNumRows() > 0;
$out = $this->getOutput();
$titleObj = $this->getTitle(); $titleObj = $this->getTitle();
$action = $titleObj->getLocalURL( array( 'action' => 'submit' ) ); $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
# Start the form here # Start the form here

View file

@ -75,7 +75,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
return false; return false;
} }
$this->getOutput()->setPageTitle( wfMsg( 'recentchangeslinked-title', $title->getPrefixedText() ) ); $this->getOutput()->setPageTitleMsg( 'recentchangeslinked-title', $title->getPrefixedText() );
/* /*
* Ordinary links are in the pagelinks table, while transclusions are * Ordinary links are in the pagelinks table, while transclusions are

View file

@ -435,8 +435,8 @@ class SpecialSearch extends SpecialPage {
$this->searchAdvanced = ($this->profile === 'advanced'); $this->searchAdvanced = ($this->profile === 'advanced');
$out = $this->getOutput(); $out = $this->getOutput();
if( strval( $term ) !== '' ) { if( strval( $term ) !== '' ) {
$out->setPageTitle( wfMsg( 'searchresults') ); $out->setPageTitleMsg( 'searchresults' );
$out->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'searchresults-title', $term ) ) ); $out->setHTMLTitleMsg( 'pagetitle', wfMsg( 'searchresults-title', $term ) );
} }
// add javascript specific to special:search // add javascript specific to special:search
$out->addModules( 'mediawiki.special.search' ); $out->addModules( 'mediawiki.special.search' );

View file

@ -40,7 +40,7 @@ class SpecialTags extends SpecialPage {
$this->outputHeader(); $this->outputHeader();
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( wfMsg( 'tags-title' ) ); $out->setPageTitleMsg( 'tags-title' );
$out->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' ); $out->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
// Write the headers // Write the headers

View file

@ -53,7 +53,7 @@ class SpecialUnblock extends SpecialPage {
$this->outputHeader(); $this->outputHeader();
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( wfMsg( 'unblockip' ) ); $out->setPageTitleMsg( 'unblockip' );
$out->addModules( 'mediawiki.special' ); $out->addModules( 'mediawiki.special' );
$form = new HTMLForm( $this->getFields(), $this->getContext() ); $form = new HTMLForm( $this->getFields(), $this->getContext() );

View file

@ -648,9 +648,9 @@ class SpecialUndelete extends SpecialPage {
$out = $this->getOutput(); $out = $this->getOutput();
if ( $this->mAllowed ) { if ( $this->mAllowed ) {
$out->setPageTitle( wfMsg( 'undeletepage' ) ); $out->setPageTitleMsg( 'undeletepage' );
} else { } else {
$out->setPageTitle( wfMsg( 'viewdeletedpage' ) ); $out->setPageTitleMsg( 'viewdeletedpage' );
} }
if( $par != '' ) { if( $par != '' ) {
@ -801,7 +801,7 @@ class SpecialUndelete extends SpecialPage {
} }
} }
$out->setPageTitle( wfMsg( 'undeletepage' ) ); $out->setPageTitleMsg( 'undeletepage' );
if( $this->mDiff ) { if( $this->mDiff ) {
$previousRev = $archive->getPreviousRevision( $timestamp ); $previousRev = $archive->getPreviousRevision( $timestamp );
@ -1015,9 +1015,9 @@ class SpecialUndelete extends SpecialPage {
$out = $this->getOutput(); $out = $this->getOutput();
if( $this->mAllowed ) { if( $this->mAllowed ) {
$out->addModules( 'mediawiki.special.undelete' ); $out->addModules( 'mediawiki.special.undelete' );
$out->setPageTitle( wfMsg( 'undeletepage' ) ); $out->setPageTitleMsg( 'undeletepage' );
} else { } else {
$out->setPageTitle( wfMsg( 'viewdeletedpage' ) ); $out->setPageTitleMsg( 'viewdeletedpage' );
} }
$out->wrapWikiMsg( $out->wrapWikiMsg(
"<div class='mw-undelete-pagetitle'>\n$1\n</div>\n", "<div class='mw-undelete-pagetitle'>\n$1\n</div>\n",

View file

@ -189,7 +189,7 @@ class LoginForm extends SpecialPage {
$u->addNewUserLogEntry( true, $this->mReason ); $u->addNewUserLogEntry( true, $this->mReason );
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( $this->msg( 'accmailtitle' )->text() ); $out->setPageTitleMsg( 'accmailtitle' );
if( !$result->isGood() ) { if( !$result->isGood() ) {
$this->mainLoginForm( $this->msg( 'mailerror', $result->getWikiText() )->text() ); $this->mainLoginForm( $this->msg( 'mailerror', $result->getWikiText() )->text() );
@ -251,7 +251,7 @@ class LoginForm extends SpecialPage {
} }
} else { } else {
# Confirm that the account was created # Confirm that the account was created
$out->setPageTitle( $this->msg( 'accountcreated' )->text() ); $out->setPageTitleMsg( 'accountcreated' );
$out->addWikiMsg( 'accountcreatedtext', $u->getName() ); $out->addWikiMsg( 'accountcreatedtext', $u->getName() );
$out->returnToMain( false, $this->getTitle() ); $out->returnToMain( false, $this->getTitle() );
wfRunHooks( 'AddNewAccount', array( $u, false ) ); wfRunHooks( 'AddNewAccount', array( $u, false ) );
@ -883,7 +883,7 @@ class LoginForm extends SpecialPage {
*/ */
private function displaySuccessfulLogin( $msgname, $injected_html ) { private function displaySuccessfulLogin( $msgname, $injected_html ) {
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( $this->msg( 'loginsuccesstitle' )->text() ); $out->setPageTitleMsg( 'loginsuccesstitle' );
if( $msgname ){ if( $msgname ){
$out->addWikiMsg( $msgname, wfEscapeWikiText( $this->getUser()->getName() ) ); $out->addWikiMsg( $msgname, wfEscapeWikiText( $this->getUser()->getName() ) );
} }
@ -914,7 +914,7 @@ class LoginForm extends SpecialPage {
# out. # out.
$out = $this->getOutput(); $out = $this->getOutput();
$out->setPageTitle( $this->msg( 'cantcreateaccounttitle' )->text() ); $out->setPageTitleMsg( 'cantcreateaccounttitle' );
$block_reason = $block->mReason; $block_reason = $block->mReason;
if ( strval( $block_reason ) === '' ) { if ( strval( $block_reason ) === '' ) {
@ -1077,9 +1077,9 @@ class LoginForm extends SpecialPage {
// Changes the title depending on permissions for creating account // Changes the title depending on permissions for creating account
$out = $this->getOutput(); $out = $this->getOutput();
if ( $user->isAllowed( 'createaccount' ) ) { if ( $user->isAllowed( 'createaccount' ) ) {
$out->setPageTitle( $this->msg( 'userlogin' )->text() ); $out->setPageTitleMsg( 'userlogin' );
} else { } else {
$out->setPageTitle( $this->msg( 'userloginnocreate' )->text() ); $out->setPageTitleMsg( 'userloginnocreate' );
} }
$out->disallowUserJs(); // just in case... $out->disallowUserJs(); // just in case...

View file

@ -55,7 +55,7 @@ class SpecialWatchlist extends SpecialPage {
# Anons don't get a watchlist # Anons don't get a watchlist
if( $user->isAnon() ) { if( $user->isAnon() ) {
$output->setPageTitle( wfMsg( 'watchnologin' ) ); $output->setPageTitleMsg( 'watchnologin' );
$llink = Linker::linkKnown( $llink = Linker::linkKnown(
SpecialPage::getTitleFor( 'Userlogin' ), SpecialPage::getTitleFor( 'Userlogin' ),
wfMsgHtml( 'loginreqlink' ), wfMsgHtml( 'loginreqlink' ),

View file

@ -86,7 +86,7 @@ class SpecialWhatLinksHere extends SpecialPage {
$this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() ); $this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() );
$out->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) ); $out->setPageTitleMsg( 'whatlinkshere-title', $this->target->getPrefixedText() );
$out->setSubtitle( wfMsg( 'whatlinkshere-backlink', Linker::link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) ); $out->setSubtitle( wfMsg( 'whatlinkshere-backlink', Linker::link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) );
$this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ), $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ),