}
/**
- * This will be called immediately after the <body> tag. Split into
+ * This will be called immediately after the "<body>" tag. Split into
* two functions to make it easier to subclass.
* @return string
*/
}
/**
- * This gets called shortly before the </body> tag.
- * @return String HTML to be put before </body>
+ * This gets called shortly before the "</body>" tag.
+ * @return String HTML to be put before "</body>"
*/
function afterContent() {
return $this->doAfterContent();
. $this->getSkin()->escapeSearchLink() . "\">\n"
. '<input type="text" id="searchInput' . $this->searchboxes . '" name="search" size="19" value="'
. htmlspecialchars( substr( $search, 0, 256 ) ) . "\" />\n"
- . '<input type="submit" name="go" value="' . wfMsg( 'searcharticle' ) . '" />';
+ . '<input type="submit" name="go" value="' . wfMessage( 'searcharticle' )->text() . '" />';
if ( $wgUseTwoButtonsSearchForm ) {
- $s .= ' <input type="submit" name="fulltext" value="' . wfMsg( 'searchbutton' ) . "\" />\n";
+ $s .= ' <input type="submit" name="fulltext" value="' . wfMessage( 'searchbutton' )->text() . "\" />\n";
} else {
- $s .= ' <a href="' . $this->getSkin()->escapeSearchLink() . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a>\n";
+ $s .= ' <a href="' . $this->getSkin()->escapeSearchLink() . '" rel="search">' . wfMessage( 'powersearch-legend' )->text() . "</a>\n";
}
$s .= '</form>';
}
// @todo FIXME: Is using Language::pipeList impossible here? Do not quite understand the use of the newline
- return implode( $s, wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n" );
+ return implode( $s, wfMessage( 'pipe-separator' )->escaped() . "\n" );
}
/**
if ( count( $s ) ) {
global $wgLang;
- $out = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
+ $out = wfMessage( 'pipe-separator' )->escaped();
$out .= $wgLang->pipeList( $s );
}
function bottomLinks() {
global $wgOut, $wgUser;
- $sep = wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n";
+ $sep = wfMessage( 'pipe-separator' )->escaped() . "\n";
$s = '';
if ( $wgOut->isArticleRelated() ) {
return '';
}
- $s = wfMsg( 'otherlanguages' ) . wfMsg( 'colon-separator' );
+ $s = wfMessage( 'otherlanguages' )->text() . wfMessage( 'colon-separator' )->text();
$first = true;
if ( $wgLang->isRTL() ) {
foreach ( $a as $l ) {
if ( !$first ) {
- $s .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
+ $s .= wfMessage( 'pipe-separator' )->escaped();
}
$first = false;
$obj->getTitle()->getPrefixedDBkey() );
}
- return Html::rawElement( 'form', array( 'id' => 'specialpages', 'method' => 'get',
- 'action' => $wgScript ), $select->getHTML() . Xml::submitButton( wfMsg( 'go' ) ) );
+ return Html::rawElement( 'form',
+ array( 'id' => 'specialpages', 'method' => 'get', 'action' => $wgScript ),
+ $select->getHTML() . Xml::submitButton( wfMessage( 'go' )->text() ) );
}
function pageTitleLinks() {
if ( $wgOut->isArticleRelated() ) {
if ( $title->getNamespace() == NS_FILE ) {
- $name = $title->getDBkey();
$image = wfFindFile( $title );
if ( $image ) {
- $link = htmlspecialchars( $image->getURL() );
- $style = Linker::getInternalLinkAttributes( $link, $name );
- $s[] = "<a href=\"{$link}\"{$style}>{$name}</a>";
+ $href = $image->getURL();
+ $s[] = Html::element( 'a', array( 'href' => $href,
+ 'title' => $href ), $title->getText() );
+
}
}
}
if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
$s[] .= Linker::linkKnown(
- $title,
- wfMsg( 'currentrev' )
+ $title,
+ wfMessage( 'currentrev' )->text()
);
}
if ( !$title->equals( $wgUser->getTalkPage() ) ) {
$tl = Linker::linkKnown(
$wgUser->getTalkPage(),
- wfMsgHtml( 'newmessageslink' ),
+ wfMessage( 'newmessageslink' )->escaped(),
array(),
array( 'redirect' => 'no' )
);
$dl = Linker::linkKnown(
$wgUser->getTalkPage(),
- wfMsgHtml( 'newmessagesdifflink' ),
+ wfMessage( 'newmessagesdifflink' )->escaped(),
array(),
array( 'diff' => 'cur' )
);
- $s[] = '<strong>' . wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>';
+ $s[] = '<strong>' . wfMessage( 'youhavenewmessages', $tl, $dl )->text() . '</strong>';
# disable caching
$wgOut->setSquidMaxage( 0 );
$wgOut->enableClientCache( false );
if ( $sub == '' ) {
global $wgExtraSubtitle;
- $sub = wfMsgExt( 'tagline', 'parsemag' ) . $wgExtraSubtitle;
+ $sub = wfMessage( 'tagline' )->parse() . $wgExtraSubtitle;
}
$subpages = $this->getSkin()->subPageSubtitle();
if ( !$wgOut->isPrintable() ) {
$printurl = htmlspecialchars( $this->getSkin()->getTitle()->getLocalUrl(
$wgRequest->appendQueryValue( 'printable', 'yes', true ) ) );
- $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
+ $s[] = "<a href=\"$printurl\" rel=\"alternate\">"
+ . wfMessage( 'printableversion' )->text() . '</a>';
}
if ( $wgOut->isSyndicated() ) {
foreach ( $wgOut->getSyndicationLinks() as $format => $link ) {
$feedurl = htmlspecialchars( $link );
$s[] = "<a href=\"$feedurl\" rel=\"alternate\" type=\"application/{$format}+xml\""
- . " class=\"feedlink\">" . wfMsgHtml( "feed-$format" ) . "</a>";
+ . " class=\"feedlink\">" . wfMessage( "feed-$format" )->escaped() . "</a>";
}
}
return $wgLang->pipeList( $s );
global $wgOut;
if ( !$wgOut->isArticleRelated() ) {
- $s = wfMsg( 'protectedpage' );
+ $s = wfMessage( 'protectedpage' )->text();
} else {
$title = $this->getSkin()->getTitle();
if ( $title->quickUserCan( 'edit' ) && $title->exists() ) {
- $t = wfMsg( 'editthispage' );
+ $t = wfMessage( 'editthispage' )->text();
} elseif ( $title->quickUserCan( 'create' ) && !$title->exists() ) {
- $t = wfMsg( 'create-this-page' );
+ $t = wfMessage( 'create-this-page' )->text();
} else {
- $t = wfMsg( 'viewsource' );
+ $t = wfMessage( 'viewsource' )->text();
}
$s = Linker::linkKnown(
$title = $this->getSkin()->getTitle();
if ( $title->getArticleID() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
- $t = wfMsg( 'deletethispage' );
+ $t = wfMessage( 'deletethispage' )->text();
$s = Linker::linkKnown(
$title,
if ( $title->getArticleID() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) ) {
if ( $title->isProtected() ) {
- $text = wfMsg( 'unprotectthispage' );
+ $text = wfMessage( 'unprotectthispage' )->text();
$query = array( 'action' => 'unprotect' );
} else {
- $text = wfMsg( 'protectthispage' );
+ $text = wfMessage( 'protectthispage' )->text();
$query = array( 'action' => 'protect' );
}
$title = $this->getSkin()->getTitle();
if ( $wgOut->isArticleRelated() ) {
- if ( $title->userIsWatching() ) {
- $text = wfMsg( 'unwatchthispage' );
+ if ( $wgUser->isWatched( $title ) ) {
+ $text = wfMessage( 'unwatchthispage' )->text();
$query = array(
'action' => 'unwatch',
'token' => UnwatchAction::getUnwatchToken( $title, $wgUser ),
);
$id = 'mw-unwatch-link' . $this->mWatchLinkNum;
} else {
- $text = wfMsg( 'watchthispage' );
+ $text = wfMessage( 'watchthispage' )->text();
$query = array(
'action' => 'watch',
'token' => WatchAction::getWatchToken( $title, $wgUser ),
$query
);
} else {
- $s = wfMsg( 'notanarticle' );
+ $s = wfMessage( 'notanarticle' )->text();
}
return $s;
if ( $this->getSkin()->getTitle()->quickUserCan( 'move' ) ) {
return Linker::linkKnown(
SpecialPage::getTitleFor( 'Movepage' ),
- wfMsg( 'movethispage' ),
+ wfMessage( 'movethispage' )->text(),
array(),
array( 'target' => $this->getSkin()->getTitle()->getPrefixedDBkey() )
);
function historyLink() {
return Linker::link(
$this->getSkin()->getTitle(),
- wfMsgHtml( 'history' ),
+ wfMessage( 'history' )->escaped(),
array( 'rel' => 'archives' ),
array( 'action' => 'history' )
);
function whatLinksHere() {
return Linker::linkKnown(
SpecialPage::getTitleFor( 'Whatlinkshere', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
- wfMsgHtml( 'whatlinkshere' )
+ wfMessage( 'whatlinkshere' )->escaped()
);
}
function userContribsLink() {
return Linker::linkKnown(
SpecialPage::getTitleFor( 'Contributions', $this->getSkin()->getTitle()->getDBkey() ),
- wfMsgHtml( 'contributions' )
+ wfMessage( 'contributions' )->escaped()
);
}
function emailUserLink() {
return Linker::linkKnown(
SpecialPage::getTitleFor( 'Emailuser', $this->getSkin()->getTitle()->getDBkey() ),
- wfMsgHtml( 'emailuser' )
+ wfMessage( 'emailuser' )->escaped()
);
}
} else {
return Linker::linkKnown(
SpecialPage::getTitleFor( 'Recentchangeslinked', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
- wfMsgHtml( 'recentchangeslinked-toolbox' )
+ wfMessage( 'recentchangeslinked-toolbox' )->escaped()
);
}
}
$link = $title->getSubjectPage();
switch( $link->getNamespace() ) {
case NS_MAIN:
- $text = wfMsg( 'articlepage' );
+ $text = wfMessage( 'articlepage' );
break;
case NS_USER:
- $text = wfMsg( 'userpage' );
+ $text = wfMessage( 'userpage' );
break;
case NS_PROJECT:
- $text = wfMsg( 'projectpage' );
+ $text = wfMessage( 'projectpage' );
break;
case NS_FILE:
- $text = wfMsg( 'imagepage' );
+ $text = wfMessage( 'imagepage' );
# Make link known if image exists, even if the desc. page doesn't.
if ( wfFindFile( $link ) )
$linkOptions[] = 'known';
break;
case NS_MEDIAWIKI:
- $text = wfMsg( 'mediawikipage' );
+ $text = wfMessage( 'mediawikipage' );
break;
case NS_TEMPLATE:
- $text = wfMsg( 'templatepage' );
+ $text = wfMessage( 'templatepage' );
break;
case NS_HELP:
- $text = wfMsg( 'viewhelppage' );
+ $text = wfMessage( 'viewhelppage' );
break;
case NS_CATEGORY:
- $text = wfMsg( 'categorypage' );
+ $text = wfMessage( 'categorypage' );
break;
default:
- $text = wfMsg( 'articlepage' );
+ $text = wfMessage( 'articlepage' );
}
} else {
$link = $title->getTalkPage();
- $text = wfMsg( 'talkpage' );
+ $text = wfMessage( 'talkpage' );
}
- $s = Linker::link( $link, $text, array(), array(), $linkOptions );
+ $s = Linker::link( $link, $text->text(), array(), array(), $linkOptions );
return $s;
}
return Linker::linkKnown(
$title,
- wfMsg( 'postcomment' ),
+ wfMessage( 'postcomment' )->text(),
array(),
array(
'action' => 'edit',
if ( $wgUploadNavigationUrl ) {
# Using an empty class attribute to avoid automatic setting of "external" class
- return Linker::makeExternalLink( $wgUploadNavigationUrl, wfMsgHtml( 'upload' ), false, null, array( 'class' => '' ) );
+ return Linker::makeExternalLink( $wgUploadNavigationUrl,
+ wfMessage( 'upload' )->escaped(),
+ false, null, array( 'class' => '' ) );
} else {
return Linker::linkKnown(
SpecialPage::getTitleFor( 'Upload' ),
- wfMsgHtml( 'upload' )
+ wfMessage( 'upload' )->escaped()
);
}
}
$ret .= "$name $talkLink";
} else {
- $ret .= wfMsg( 'notloggedin' );
+ $ret .= wfMessage( 'notloggedin' )->text();
}
$query = array();
: 'login';
$ret .= "\n<br />" . Linker::link(
SpecialPage::getTitleFor( 'Userlogin' ),
- wfMsg( $loginlink ), array(), $query
+ wfMessage( $loginlink )->text(), array(), $query
);
} else {
$talkLink = Linker::link( $wgUser->getTalkPage(),
$ret .= " $talkLink<br />";
$ret .= $wgLang->pipeList( array(
Linker::link(
- SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
+ SpecialPage::getTitleFor( 'Userlogout' ), wfMessage( 'logout' )->text(),
array(), array( 'returnto' => $returnTo->getPrefixedDBkey() )
),
Linker::specialLink( 'Preferences' ),
$ret = $wgLang->pipeList( array(
$ret,
Linker::link(
- Title::newFromText( wfMsgForContent( 'helppage' ) ),
- wfMsg( 'help' )
+ Title::newFromText( wfMessage( 'helppage' )->inContentLanguage()->text() ),
+ wfMessage( 'help' )->text()
),
) );