return $wgLogo;
}
- function getCategoryLinks() {
- global $wgOut, $wgUseCategoryBrowser;
- global $wgContLang, $wgUser;
+ /**
+ * The format without an explicit $out argument is deprecated
+ */
+ function getCategoryLinks( OutputPage $out=null ) {
+ global $wgUseCategoryBrowser, $wgContLang, $wgUser;
- if ( count( $wgOut->mCategoryLinks ) == 0 ) {
+ if ( is_null( $out ) ) {
+ // Backwards compatibility for when there was no $out arg
+ global $wgOut;
+ $out = $wgOut;
+ }
+
+ if ( count( $out->mCategoryLinks ) == 0 ) {
return '';
}
$embed = "<span dir='$dir'>";
$pop = '</span>';
- $allCats = $wgOut->getCategoryLinks();
+ $allCats = $out->getCategoryLinks();
$s = '';
$colon = wfMsgExt( 'colon-separator', 'escapenoentities' );
return $return;
}
- function getCategories() {
- $catlinks = $this->getCategoryLinks();
+ /**
+ * The ->getCategories() form is deprecated, please instead use
+ * the ->getCategories( $out ) form with whatout OutputPage is on hand
+ */
+ function getCategories( OutputPage $out=null ) {
+ if ( is_null( $out ) ) {
+ // Backwards compatibility for when there was no $out arg
+ global $wgOut;
+ $out = $wgOut;
+ }
+
+ $catlinks = $this->getCategoryLinks( $out );
$classes = 'catlinks';
- global $wgOut, $wgUser;
+ global $wgUser;
// Check what we're showing
- $allCats = $wgOut->getCategoryLinks();
+ $allCats = $out->getCategoryLinks();
$showHidden = $wgUser->getBoolOption( 'showhiddencats' ) ||
$this->mTitle->getNamespace() == NS_CATEGORY;
* area.
* @return String HTML containing debug data, if enabled (otherwise empty).
*/
- protected function generateDebugHTML() {
- global $wgShowDebug, $wgOut;
+ protected function generateDebugHTML( OutputPage $out ) {
+ global $wgShowDebug;
if ( $wgShowDebug ) {
- $listInternals = $this->formatDebugHTML( $wgOut->mDebugtext );
+ $listInternals = $this->formatDebugHTML( $out->mDebugtext );
return "\n<hr />\n<strong>Debug data:</strong><ul style=\"font-family:monospace;\" id=\"mw-debug-html\">" .
$listInternals . "</ul>\n";
}
return '';
}
- function subPageSubtitle() {
+ /**
+ * The format without an explicit $out argument is deprecated
+ */
+ function subPageSubtitle( OutputPage $out=null ) {
+ if ( is_null( $out ) ) {
+ // Backwards compatibility for when there was no $out arg
+ global $wgOut;
+ $out = $wgOut;
+ }
+
$subpages = '';
- if ( !wfRunHooks( 'SkinSubPageSubtitle', array( &$subpages, $this ) ) ) {
+ if ( !wfRunHooks( 'SkinSubPageSubtitle', array( &$subpages, $this, $out ) ) ) {
return $subpages;
}
- global $wgOut;
-
- if ( $wgOut->isArticle() && MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) {
+ if ( $out->isArticle() && MWNamespace::hasSubpages( $out->getTitle()->getNamespace() ) ) {
$ptext = $this->mTitle->getPrefixedText();
if ( preg_match( '/\//', $ptext ) ) {
$links = explode( '/', $ptext );
/**
* Gets new talk page messages for the current user.
* @return MediaWiki message or if no new talk page messages, nothing
+ * The format without an explicit $out argument is deprecated
*/
- function getNewtalks() {
- global $wgUser, $wgOut;
+ function getNewtalks( OutputPage $out=null ) {
+ global $wgUser;
+
+ if ( is_null( $out ) ) {
+ // Backwards compatibility for when there was no $out arg
+ global $wgOut;
+ $out = $wgOut;
+ }
$newtalks = $wgUser->getNewMessageLinks();
$ntl = '';
$userTitle = $this->mUser->getUserPage();
$userTalkTitle = $userTitle->getTalkPage();
- if ( !$userTalkTitle->equals( $this->mTitle ) ) {
+ if ( !$userTalkTitle->equals( $out->getTitle() ) ) {
$newMessagesLink = $this->link(
$userTalkTitle,
wfMsgHtml( 'newmessageslink' ),
$newMessagesDiffLink
);
# Disable Squid cache
- $wgOut->setSquidMaxage( 0 );
+ $out->setSquidMaxage( 0 );
}
} elseif ( count( $newtalks ) ) {
// _>" " for BC <= 1.16
}
$parts = implode( $sep, $msgs );
$ntl = wfMsgHtml( 'youhavenewmessagesmulti', $parts );
- $wgOut->setSquidMaxage( 0 );
+ $out->setSquidMaxage( 0 );
}
return $ntl;
$tpl->set( 'isarticle', $out->isArticle() );
$tpl->setRef( 'thispage', $this->thispage );
- $subpagestr = $this->subPageSubtitle();
+ $subpagestr = $this->subPageSubtitle( $out );
$tpl->set(
'subtitle', !empty( $subpagestr ) ?
'<span class="subpages">' . $subpagestr . '</span>' . $out->getSubtitle() :
''
);
- $tpl->set( 'catlinks', $this->getCategories() );
+ $tpl->set( 'catlinks', $this->getCategories( $out ) );
if( $out->isSyndicated() ) {
$feeds = array();
foreach( $out->getSyndicationLinks() as $format => $link ) {
}
}
- $newtalks = $this->getNewtalks();
+ $newtalks = $this->getNewtalks( $out );
wfProfileOut( __METHOD__ . '-stuff2' );
} else {
$tpl->set( 'copyright', false );
$tpl->set( 'viewcount', false );
- $tpl->set( 'lastmod', false );
+ $tpl->set( 'lastmod', false );
$tpl->set( 'credits', false );
$tpl->set( 'numberofwatchingusers', false );
}
$tpl->set( 'sitenotice', $this->getSiteNotice() );
$tpl->set( 'bottomscripts', $this->bottomScripts( $out ) );
+ // @todo Give printfooter userlangattributes
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
global $wgBetterDirectionality;
if ( $wgBetterDirectionality ) {
$realBodyAttribs = array( 'lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir() );
$out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
}
- $out->mBodytext .= $printfooter . $this->generateDebugHTML();
+ $out->mBodytext .= $printfooter . $this->generateDebugHTML( $out );
$tpl->setRef( 'bodytext', $out->mBodytext );
# Language links