* @param OutputPage $out
*/
function initPage( OutputPage $out ) {
- wfProfileIn( __METHOD__ );
$this->preloadExistence();
- wfProfileOut( __METHOD__ );
}
/**
$msg = $this->msg( 'pagecategories' )->numParams( count( $allCats['normal'] ) )->escaped();
$linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text();
+ $title = Title::newFromText( $linkPage );
+ $link = $title ? Linker::link( $title, $msg ) : $msg;
$s .= '<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
- Linker::link( Title::newFromText( $linkPage ), $msg )
- . $colon . '<ul>' . $t . '</ul>' . '</div>';
+ $link . $colon . '<ul>' . $t . '</ul>' . '</div>';
}
# Hidden categories
$url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL() ) );
}
- return $this->msg( 'retrievedfrom', '<a dir="ltr" href="' . $url
- . '">' . $url . '</a>' )->text();
+ return $this->msg( 'retrievedfrom' )
+ ->rawParams( '<a dir="ltr" href="' . $url. '">' . $url . '</a>' )
+ ->parse();
}
/**
- * @return string
+ * @return string HTML
*/
function getUndeleteLink() {
$action = $this->getRequest()->getVal( 'action', 'view' );
if ( $this->getTitle()->userCan( 'deletedhistory', $this->getUser() ) &&
- ( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) {
+ ( !$this->getTitle()->exists() || $action == 'history' ) ) {
$n = $this->getTitle()->isDeleted();
if ( $n ) {
Linker::linkKnown(
SpecialPage::getTitleFor( 'Undelete', $this->getTitle()->getPrefixedDBkey() ),
$this->msg( 'restorelink' )->numParams( $n )->escaped() )
- )->text();
+ )->escaped();
}
}
function getPoweredBy() {
global $wgResourceBasePath;
- $url = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" );
- $text = '<a href="//www.mediawiki.org/"><img src="' . $url
- . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
+ $url1 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" );
+ $url1_5 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png" );
+ $url2 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png" );
+ $text = '<a href="//www.mediawiki.org/"><img src="' . $url1
+ . '" srcset="' . $url1_5 . ' 1.5x, ' . $url2 . ' 2x" '
+ . 'height="31" width="88" alt="Powered by MediaWiki" /></a>';
Hooks::run( 'SkinGetPoweredBy', array( &$text, $this ) );
return $text;
}
if ( $timestamp ) {
$d = $this->getLanguage()->userDate( $timestamp, $this->getUser() );
$t = $this->getLanguage()->userTime( $timestamp, $this->getUser() );
- $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->text();
+ $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->parse();
} else {
$s = '';
}
if ( wfGetLB()->getLaggedSlaveMode() ) {
- $s .= ' <strong>' . $this->msg( 'laggedslavemode' )->text() . '</strong>';
+ $s .= ' <strong>' . $this->msg( 'laggedslavemode' )->parse() . '</strong>';
}
return $s;
* @return string HTML anchor
*/
public function footerLink( $desc, $page ) {
- $section = new ProfileSection( __METHOD__ );
// if the link description has been set to "-" in the default language,
if ( $this->msg( $desc )->inContentLanguage()->isDisabled() ) {
// then it is disabled, for all languages.
// but we make the link target be the one site-wide page.
$title = Title::newFromText( $this->msg( $page )->inContentLanguage()->text() );
+ if ( !$title ) {
+ return '';
+ }
+
return Linker::linkKnown(
$title,
$this->msg( $desc )->escaped()
*
* @param string $name The name or path of a skin resource file
* @return string The fully resolved style path url including styleversion
+ * @throws MWException
*/
function getSkinStylePath( $name ) {
global $wgStylePath, $wgStyleVersion;
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0,
+ 'exists' => $title->isKnown(),
);
}
*/
function buildSidebar() {
global $wgMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
- wfProfileIn( __METHOD__ );
$key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() );
if ( $cachedsidebar ) {
Hooks::run( 'SidebarBeforeOutput', array( $this, &$cachedsidebar ) );
- wfProfileOut( __METHOD__ );
return $cachedsidebar;
}
}
Hooks::run( 'SidebarBeforeOutput', array( $this, &$bar ) );
- wfProfileOut( __METHOD__ );
return $bar;
}
private function getCachedNotice( $name ) {
global $wgRenderHashAppend, $parserMemc, $wgContLang;
- wfProfileIn( __METHOD__ );
-
$needParse = false;
if ( $name === 'default' ) {
global $wgSiteNotice;
$notice = $wgSiteNotice;
if ( empty( $notice ) ) {
- wfProfileOut( __METHOD__ );
return false;
}
} else {
$msg = $this->msg( $name )->inContentLanguage();
if ( $msg->isDisabled() ) {
- wfProfileOut( __METHOD__ );
return false;
}
$notice = $msg->plain();
$notice = Html::rawElement( 'div', array( 'id' => 'localNotice',
'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $notice );
- wfProfileOut( __METHOD__ );
return $notice;
}
* @return string HTML fragment
*/
function getNamespaceNotice() {
- wfProfileIn( __METHOD__ );
$key = 'namespacenotice-' . $this->getTitle()->getNsText();
$namespaceNotice = $this->getCachedNotice( $key );
$namespaceNotice = '';
}
- wfProfileOut( __METHOD__ );
return $namespaceNotice;
}
* @return string HTML fragment
*/
function getSiteNotice() {
- wfProfileIn( __METHOD__ );
$siteNotice = '';
if ( Hooks::run( 'SiteNoticeBefore', array( &$siteNotice, $this ) ) ) {
}
Hooks::run( 'SiteNoticeAfter', array( &$siteNotice, $this ) );
- wfProfileOut( __METHOD__ );
return $siteNotice;
}