wfProfileIn( __METHOD__ . '-init' );
$this->initPage( $out );
- $this->setMembers();
$tpl = $this->setupTemplate( $this->template, 'skins' );
-
- #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
- $tpl->setTranslator( new MediaWiki_I18N() );
- #}
wfProfileOut( __METHOD__ . '-init' );
wfProfileIn( __METHOD__ . '-stuff' );
- $this->thispage = $this->mTitle->getPrefixedDBkey();
- $this->thisurl = $this->mTitle->getPrefixedURL();
+ $this->thispage = $this->getTitle()->getPrefixedDBkey();
+ $this->thisurl = $this->getTitle()->getPrefixedURL();
$query = array();
if ( !$wgRequest->wasPosted() ) {
$query = $wgRequest->getValues();
}
$this->thisquery = wfUrlencode( wfArrayToCGI( $query ) );
$this->loggedin = $wgUser->isLoggedIn();
- $this->iscontent = ( $this->mTitle->getNamespace() != NS_SPECIAL );
+ $this->iscontent = ( $this->getTitle()->getNamespace() != NS_SPECIAL );
$this->iseditable = ( $this->iscontent and !( $action == 'edit' or $action == 'submit' ) );
$this->username = $wgUser->getName();
$this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
}
- $this->titletxt = $this->mTitle->getPrefixedText();
+ $this->titletxt = $this->getTitle()->getPrefixedText();
wfProfileOut( __METHOD__ . '-stuff' );
wfProfileIn( __METHOD__ . '-stuff-head' );
$tpl->setRef( 'usercss', $this->usercss );
$this->userjs = $this->userjsprev = false;
+ # FIXME: this is the only use of OutputPage::isUserJsAllowed() anywhere; can we
+ # get rid of it? For that matter, why is any of this here at all?
$this->setupUserJs( $out->isUserJsAllowed() );
$tpl->setRef( 'userjs', $this->userjs );
$tpl->setRef( 'userjsprev', $this->userjsprev );
$tpl->set( 'title', $out->getPageTitle() );
$tpl->set( 'pagetitle', $out->getHTMLTitle() );
$tpl->set( 'displaytitle', $out->mPageLinkTitle );
- $tpl->set( 'pageclass', $this->getPageClasses( $this->mTitle ) );
+ $tpl->set( 'pageclass', $this->getPageClasses( $this->getTitle() ) );
$tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
- $nsname = MWNamespace::exists( $this->mTitle->getNamespace() ) ?
- MWNamespace::getCanonicalName( $this->mTitle->getNamespace() ) :
- $this->mTitle->getNsText();
+ $nsname = MWNamespace::exists( $this->getTitle()->getNamespace() ) ?
+ MWNamespace::getCanonicalName( $this->getTitle()->getNamespace() ) :
+ $this->getTitle()->getNsText();
$tpl->set( 'nscanonical', $nsname );
- $tpl->set( 'nsnumber', $this->mTitle->getNamespace() );
- $tpl->set( 'titleprefixeddbkey', $this->mTitle->getPrefixedDBKey() );
- $tpl->set( 'titletext', $this->mTitle->getText() );
- $tpl->set( 'articleid', $this->mTitle->getArticleId() );
- $tpl->set( 'currevisionid', $this->mTitle->getLatestRevID() );
+ $tpl->set( 'nsnumber', $this->getTitle()->getNamespace() );
+ $tpl->set( 'titleprefixeddbkey', $this->getTitle()->getPrefixedDBKey() );
+ $tpl->set( 'titletext', $this->getTitle()->getText() );
+ $tpl->set( 'articleid', $this->getTitle()->getArticleId() );
+ $tpl->set( 'currevisionid', $this->getTitle()->getLatestRevID() );
$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 ) {
$tpl->set( 'printable', $out->isPrintable() );
$tpl->set( 'handheld', $wgRequest->getBool( 'handheld' ) );
$tpl->setRef( 'loggedin', $this->loggedin );
- $tpl->set( 'notspecialpage', $this->mTitle->getNamespace() != NS_SPECIAL );
+ $tpl->set( 'notspecialpage', $this->getTitle()->getNamespace() != NS_SPECIAL );
/* XXX currently unused, might get useful later
- $tpl->set( 'editable', ( $this->mTitle->getNamespace() != NS_SPECIAL ) );
- $tpl->set( 'exists', $this->mTitle->getArticleID() != 0 );
- $tpl->set( 'watch', $this->mTitle->userIsWatching() ? 'unwatch' : 'watch' );
- $tpl->set( 'protect', count( $this->mTitle->isProtected() ) ? 'unprotect' : 'protect' );
+ $tpl->set( 'editable', ( $this->getTitle()->getNamespace() != NS_SPECIAL ) );
+ $tpl->set( 'exists', $this->getTitle()->getArticleID() != 0 );
+ $tpl->set( 'watch', $this->getTitle()->userIsWatching() ? 'unwatch' : 'watch' );
+ $tpl->set( 'protect', count( $this->getTitle()->isProtected() ) ? 'unprotect' : 'protect' );
$tpl->set( 'helppage', wfMsg( 'helppage' ) );
*/
$tpl->set( 'searchaction', $this->escapeSearchLink() );
// The content of SpecialPages should be presented in the
// user's language. Content of regular pages should not be touched.
- if( $this->mTitle->isSpecialPage() ) {
+ if( $this->getTitle()->isSpecialPage() ) {
$tpl->set( 'specialpageattributes', $attrs );
}
}
- $newtalks = $this->getNewtalks();
+ $newtalks = $this->getNewtalks( $out );
wfProfileOut( __METHOD__ . '-stuff2' );
$tpl->setRef( 'skin', $this );
$tpl->set( 'logo', $this->logoText() );
if ( $out->isArticle() && ( !isset( $oldid ) || isset( $diff ) ) &&
- $this->mTitle->exists() )
+ $this->getTitle()->exists() )
{
- $article = new Article( $this->mTitle, 0 );
+ $article = new Article( $this->getTitle(), 0 );
if ( !$wgDisableCounters ) {
$viewcount = $wgLang->formatNum( $article->getCount() );
if ( $viewcount ) {
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'watchlist',
array( 'COUNT(*) AS n' ),
- array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ),
+ array( 'wl_title' => $dbr->strencode( $this->getTitle()->getDBkey() ), 'wl_namespace' => $this->getTitle()->getNamespace() ),
__METHOD__
);
$x = $dbr->fetchObject( $res );
} 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( 'reporttime', wfReportTime() );
- $tpl->set( 'sitenotice', wfGetSiteNotice() );
+ $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
$personal_urls = array();
$page = $wgRequest->getVal( 'returnto', $this->thisurl );
$query = $wgRequest->getVal( 'returntoquery', $this->thisquery );
- $returnto = "returnto=$page";
+ $returnto = wfArrayToCGI( array( 'returnto' => $page ) );
if( $this->thisquery != '' ) {
$returnto .= "&returntoquery=$query";
}
'active' => ( $pageurl == $href )
);
$personal_urls['anonlogin'] = $login_url;
- if ( isset($createaccount_url) ) {
- $personal_urls['createaccount'] = $createaccount_url;
- }
} else {
$personal_urls['login'] = $login_url;
}
+ if ( isset($createaccount_url) ) {
+ $personal_urls['createaccount'] = $createaccount_url;
+ }
}
wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title ) );
wfProfileIn( __METHOD__ );
$title = $this->getRelevantTitle(); // Display tabs for the relevant title rather than always the title itself
- $onPage = $title->equals($this->mTitle);
+ $onPage = $title->equals($this->getTitle());
$content_navigation = array(
'namespaces' => array(),
if ( $title->quickUserCan( 'move' ) ) {
$moveTitle = SpecialPage::getTitleFor( 'Movepage', $title->getPrefixedDBkey() );
$content_navigation['actions']['move'] = array(
- 'class' => $this->mTitle->isSpecial( 'Movepage' ) ? 'selected' : false,
+ 'class' => $this->getTitle()->isSpecial( 'Movepage' ) ? 'selected' : false,
'text' => wfMessageFallback( "$skname-action-move", 'move' )->text(),
'href' => $moveTitle->getLocalURL()
);
// If the user can't undelete but can view deleted history show them a "View .. deleted" tab instead
$msgKey = $wgUser->isAllowed( 'undelete' ) ? 'undelete' : 'viewdeleted';
$content_navigation['actions']['undelete'] = array(
- 'class' => $this->mTitle->isSpecial( 'Undelete' ) ? 'selected' : false,
+ 'class' => $this->getTitle()->isSpecial( 'Undelete' ) ? 'selected' : false,
'text' => wfMessageFallback( "$skname-action-$msgKey", "{$msgKey}_short" )
->params( $wgLang->formatNum( $n ) )->text(),
'href' => $undelTitle->getLocalURL( array( 'target' => $title->getPrefixedDBkey() ) )
$content_actions = array();
- foreach ( $content_navigation as $section => $links ) {
+ foreach ( $content_navigation as $links ) {
foreach ( $links as $key => $value ) {
if ( !$out->isPrintable() ) {
$nav_urls['print'] = array(
'text' => wfMsg( 'printableversion' ),
- 'href' => $wgRequest->appendQuery( 'printable=yes' )
+ 'href' => $this->getTitle()->getLocalURL( $wgRequest->appendQueryValue( 'printable', 'yes', true ) )
);
}
wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( &$this, &$nav_urls, &$revid, &$revid ) );
}
- if( $this->mTitle->getNamespace() != NS_SPECIAL ) {
+ if( $this->getTitle()->getNamespace() != NS_SPECIAL ) {
$wlhTitle = SpecialPage::getTitleFor( 'Whatlinkshere', $this->thispage );
$nav_urls['whatlinkshere'] = array(
'href' => $wlhTitle->getLocalUrl()
);
- if( $this->mTitle->getArticleId() ) {
+ if( $this->getTitle()->getArticleId() ) {
$rclTitle = SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage );
$nav_urls['recentchangeslinked'] = array(
'href' => $rclTitle->getLocalUrl()
);
}
- if ( $user = $this->getRelevantUser() ) {
+ $user = $this->getRelevantUser();
+ if ( $user ) {
$id = $user->getID();
$ip = $user->isAnon();
$rootUser = $user->getName();
if ( $wgUser->isAllowed( 'block' ) ) {
$nav_urls['blockip'] = array(
- 'href' => self::makeSpecialUrlSubpage( 'Blockip', $rootUser )
+ 'href' => self::makeSpecialUrlSubpage( 'Block', $rootUser )
);
} else {
$nav_urls['blockip'] = false;
* @private
*/
function getNameSpaceKey() {
- return $this->mTitle->getNamespaceKey();
+ return $this->getTitle()->getNamespaceKey();
}
/**
* @private
+ * FIXME: why is this duplicated in/from OutputPage::getHeadScripts()??
*/
function setupUserJs( $allowUserJs ) {
global $wgRequest, $wgJsMimeType;
$action = $wgRequest->getVal( 'action', 'view' );
if( $allowUserJs && $this->loggedin ) {
- if( $this->mTitle->isJsSubpage() and $this->userCanPreview( $action ) ) {
+ if( $this->getTitle()->isJsSubpage() and $this->userCanPreview( $action ) ) {
# XXX: additional security check/prompt?
$this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText( 'wpTextbox1' ) . ' /*]]>*/';
} else {
if ( $option == 'icononly' ) {
// Unset any icons which don't have an image
- foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) {
+ foreach ( $footericons as &$footerIconsBlock ) {
foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) {
if ( !is_string( $footerIcon ) && !isset( $footerIcon['src'] ) ) {
unset( $footerIconsBlock[$footerIconKey] );