* @return string
*/
function doAfterContent(){
- global $wgLang;
-
$s = "\n</div><br clear='all' />\n";
$s .= "\n<div id='footer'>";
$s .= '<td class="bottom">';
$s .= $this->bottomLinks();
- $s .= $wgLang->pipeList( array(
+ $s .= $this->getSkin()->getLang()->pipeList( array(
"\n<br />" . Linker::link(
Title::newMainPage(),
null,
* @return string
*/
function sysLinks() {
- global $wgUser, $wgLang;
$li = SpecialPage::getTitleFor( 'Userlogin' );
$lo = SpecialPage::getTitleFor( 'Userlogout' );
if( $this->extensionTabLinks() ) {
$s[] = $this->extensionTabLinks();
}
- if ( $wgUser->isLoggedIn() ) {
+ if ( $this->data['loggedin'] ) {
$s[] = Linker::linkKnown(
$lo,
wfMsg( 'logout' ),
);
}
- return $wgLang->pipeList( $s );
+ return $this->getSkin()->getLang()->pipeList( $s );
}
/**
* @return string
*/
function quickBar(){
- global $wgOut, $wgUser;
-
$tns = $this->getSkin()->getTitle()->getNamespace();
$s = "\n<div id='quickbar'>";
$barnumber++;
}
- if ( $wgOut->isArticle() ) {
+ if ( $this->data['isarticle'] ) {
$s .= $this->menuHead( 'qbedit' );
$s .= '<strong>' . $this->editThisPage() . '</strong>';
wfMsg( 'edithelp' )
);
- if( $wgUser->isLoggedIn() ) {
+ if( $this->data['loggedin'] ) {
$s .= $sep . $this->moveThisPage();
}
- if ( $wgUser->isAllowed( 'delete' ) ) {
+ if ( $this->getSkin()->getUser()->isAllowed( 'delete' ) ) {
$dtp = $this->deleteThisPage();
if ( $dtp != '' ) {
$s .= $sep . $dtp;
}
}
- if ( $wgUser->isAllowed( 'protect' ) ) {
+ if ( $this->getSkin()->getUser()->isAllowed( 'protect' ) ) {
$ptp = $this->protectThisPage();
if ( $ptp != '' ) {
$s .= $sep . $ptp;
$s .= $this->talkLink()
. $sep . $this->commentLink()
. $sep . $this->printableLink();
- if ( $wgUser->isLoggedIn() ) {
+ if ( $this->data['loggedin'] ) {
$s .= $sep . $this->watchThisPage();
}
}
$s .= $this->menuHead( 'qbmyoptions' );
- if ( $wgUser->isLoggedIn() ) {
+ if ( $this->data['loggedin'] ) {
$tl = Linker::link(
- $wgUser->getTalkPage(),
+ $this->getSkin()->getUser()->getTalkPage(),
wfMsg( 'mytalk' ),
array(),
array(),
array( 'known', 'noclasses' )
);
- if ( $wgUser->getNewtalk() ) {
+ if ( $this->getSkin()->getUser()->getNewtalk() ) {
$tl .= ' *';
}
$s .= Linker::link(
- $wgUser->getUserPage(),
+ $this->getSkin()->getUser()->getUserPage(),
wfMsg( 'mypage' ),
array(),
array(),
) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' )
. $sep .
Linker::link(
- SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
+ SpecialPage::getSafeTitleFor( 'Contributions', $this->getSkin()->getUser()->getName() ),
wfMsg( 'mycontris' ),
array(),
array(),
. Linker::specialLink( 'Newpages' )
. $sep . Linker::specialLink( 'Listfiles' )
. $sep . Linker::specialLink( 'Statistics' );
- if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+ if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) {
$s .= $sep . $this->getUploadLink();
}
* @return string
*/
function searchForm( $label = '' ) {
- global $wgRequest, $wgUseTwoButtonsSearchForm;
+ global $wgUseTwoButtonsSearchForm;
- $search = $wgRequest->getText( 'search' );
+ $search = $this->getSkin()->getRequest()->getText( 'search' );
$action = $this->data['searchaction'];
$s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
if( $label != '' ) {
*/
class ModernTemplate extends MonoBookTemplate {
- /**
- * @var Skin
- */
- var $skin;
/**
* Template filter callback for Modern skin.
* Takes an associative array of data set from a SkinTemplate-based
* @access private
*/
function execute() {
- $this->skin = $skin = $this->data['skin'];
-
// Suppress warnings to prevent notices about missing indexes in $this->data
wfSuppressWarnings();
<div id="mw_<?php echo htmlspecialchars($blockName); ?>">
<?php
foreach ( $footerIcons as $icon ) { ?>
- <?php echo $this->skin->makeFooterIcon( $icon, 'withoutImage' ); ?>
+ <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?>
<?php
} ?>
* @return string
*/
function topLinks() {
- global $wgOut, $wgUser;
$sep = " |\n";
$s = $this->getSkin()->mainPageLink() . $sep
. Linker::specialLink( 'Recentchanges' );
- if ( $wgOut->isArticle() ) {
+ if ( $this->data['isarticle'] ) {
$s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
$sep . $this->historyLink();
}
/* show links to different language variants */
$s .= $this->variantLinks();
$s .= $this->extensionTabLinks();
- if ( $wgUser->isAnon() ) {
+ if ( !$this->data['loggedin'] ) {
$s .= $sep . Linker::specialLink( 'Userlogin' );
} else {
/* show user page and user talk links */
- $s .= $sep . Linker::link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
- $s .= $sep . Linker::link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
- if ( $wgUser->getNewtalk() ) {
+ $s .= $sep . Linker::link( $this->getSkin()->getUser()->getUserPage(), wfMsgHtml( 'mypage' ) );
+ $s .= $sep . Linker::link( $this->getSkin()->getUser()->getTalkPage(), wfMsgHtml( 'mytalk' ) );
+ if ( $this->getSkin()->getUser()->getNewtalk() ) {
$s .= ' *';
}
/* show watchlist link */
$s .= $sep . Linker::specialLink( 'Watchlist' );
/* show my contributions link */
$s .= $sep . Linker::link(
- SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
+ SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ),
wfMsgHtml( 'mycontris' ) );
/* show my preferences link */
$s .= $sep . Linker::specialLink( 'Preferences' );
/* show upload file link */
- if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+ if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) {
$s .= $sep . $this->getUploadLink();
}
$out->addModuleStyles( 'skins.simple' );
/* Add some userprefs specific CSS styling */
- global $wgUser;
$rules = array();
$underline = "";
- if ( $wgUser->getOption( 'underline' ) < 2 ) {
- $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline !important' : 'none' . ";";
+ if ( $this->getSkin()->getUser()->getOption( 'underline' ) < 2 ) {
+ $underline = "text-decoration: " . $this->getSkin()->getUser()->getOption( 'underline' ) ? 'underline !important' : 'none' . ";";
}
/* Also inherits from resourceloader */
- if( !$wgUser->getOption( 'highlightbroken' ) ) {
+ if( !$this->getSkin()->getUser()->getOption( 'highlightbroken' ) ) {
$rules[] = "a.new, a.stub { color: inherit; text-decoration: inherit;}";
$rules[] = "a.new:after { color: #CC2200; $underline;}";
$rules[] = "a.stub:after { $underline; }";
* @return string
*/
function doAfterContent() {
- global $wgContLang, $wgLang;
+ global $wgContLang;
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__ . '-1' );
$s .= "<td class='bottom' align='$l' valign='top'>";
$s .= $this->bottomLinks();
- $s .= "\n<br />" . $wgLang->pipeList( array(
+ $s .= "\n<br />" . $this->getSkin()->getLang()->pipeList( array(
$this->getSkin()->mainPageLink(),
$this->getSkin()->aboutLink(),
Linker::specialLink( 'Recentchanges' ),
* @return string
*/
function quickBar() {
- global $wgOut, $wgUser, $wgRequest, $wgContLang;
+ global $wgContLang;
wfProfileIn( __METHOD__ );
- $action = $wgRequest->getText( 'action' );
- $wpPreview = $wgRequest->getBool( 'wpPreview' );
+ $action = $this->getSkin()->getRequest()->getText( 'action' );
+ $wpPreview = $this->getSkin()->getRequest()->getBool( 'wpPreview' );
$title = $this->getSkin()->getTitle();
$tns = $title->getNamespace();
}
if ( $barnumber == 1 ) {
// only show watchlist link if logged in
- if( $wgUser->isLoggedIn() ) {
+ if( $this->data['loggedin'] ) {
$s.= Linker::specialLink( 'Watchlist' ) ;
$s .= $sep . Linker::linkKnown(
SpecialPage::getTitleFor( 'Contributions' ),
wfMsg( 'mycontris' ),
array(),
- array( 'target' => $wgUser->getName() )
+ array( 'target' => $this->data['username'] )
);
}
}
$s .= "\n<hr class='sep' />";
$articleExists = $title->getArticleId();
- if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) {
- if( $wgOut->isArticle() ) {
+ if ( $this->data['isarticle'] || $action == 'edit' || $action == 'history' || $wpPreview ) {
+ if( $this->data['isarticle'] ) {
$s .= '<strong>' . $this->editThisPage() . '</strong>';
} else { # backlink to the article in edit or history mode
if( $articleExists ){ # no backlink if no article
}
# "Post a comment" link
- if( ( $title->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
+ if( ( $title->isTalkPage() || $this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
$s .= '<br />' . Linker::link(
$title,
wfMsg( 'postcomment' ),
article with "Watch this article" checkbox disabled, the article is transparently
unwatched. Therefore we do not show the "Watch this page" link in edit mode
*/
- if ( $wgUser->isLoggedIn() && $articleExists ) {
+ if ( $this->data['loggedin'] && $articleExists ) {
if( $action != 'edit' && $action != 'submit' ) {
$s .= $sep . $this->watchThisPage();
}
if ( $title->userCan( 'edit' ) )
$s .= $sep . $this->moveThisPage();
}
- if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
+ if ( $this->getSkin()->getUser()->isAllowed( 'delete' ) && $articleExists ) {
$s .= $sep . $this->deleteThisPage() .
$sep . $this->protectThisPage();
}
}
$s .= $sep . $this->whatLinksHere();
- if( $wgOut->isArticleRelated() ) {
+ if( $this->getSkin()->getOutput()->isArticleRelated() ) {
$s .= $sep . $this->watchPageLinksLink();
}
$s .= "\n<br /><hr class='sep' />";
}
- if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+ if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) {
$s .= $this->getUploadLink() . $sep;
}
* @param $out OutputPage object to initialize
*/
public function initPage( OutputPage $out ) {
- global $wgLocalStylePath, $wgRequest;
+ global $wgLocalStylePath;
parent::initPage( $out );
// Append CSS which includes IE only behavior fixes for hover support -
// this is better than including this in a CSS fille since it doesn't
// wait for the CSS file to load before fetching the HTC file.
- $min = $wgRequest->getFuzzyBool( 'debug' ) ? '' : '.min';
+ $min = $this->getRequest()->getFuzzyBool( 'debug' ) ? '' : '.min';
$out->addHeadItem( 'csshover',
'<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
htmlspecialchars( $wgLocalStylePath ) .
*/
class VectorTemplate extends BaseTemplate {
- /* Members */
-
- /**
- * @var Skin Cached skin object
- */
- var $skin;
-
/* Functions */
/**
* Outputs the entire contents of the (X)HTML page
*/
public function execute() {
- global $wgLang, $wgVectorUseIconWatch;
-
- $this->skin = $this->data['skin'];
+ global $wgVectorUseIconWatch;
// Build additional attributes for navigation urls
- //$nav = $this->skin->buildNavigationUrls();
$nav = $this->data['content_navigation'];
if ( $wgVectorUseIconWatch ) {
- $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
+ $mode = $this->getSkin()->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
if ( isset( $nav['actions'][$mode] ) ) {
$nav['views'][$mode] = $nav['actions'][$mode];
$nav['views'][$mode]['class'] = rtrim( 'icon ' . $nav['views'][$mode]['class'], ' ' );
$this->data['variant_urls'] = $nav['variants'];
// Reverse horizontally rendered navigation elements
- if ( $wgLang->isRTL() ) {
+ if ( $this->data['rtl'] ) {
$this->data['view_urls'] =
array_reverse( $this->data['view_urls'] );
$this->data['namespace_urls'] =
<?php foreach ( $footericons as $blockName => $footerIcons ): ?>
<li id="footer-<?php echo htmlspecialchars( $blockName ); ?>ico">
<?php foreach ( $footerIcons as $icon ): ?>
- <?php echo $this->skin->makeFooterIcon( $icon ); ?>
+ <?php echo $this->getSkin()->makeFooterIcon( $icon ); ?>
<?php endforeach; ?>
</li>
* @param $elements array
*/
private function renderNavigation( $elements ) {
- global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang;
+ global $wgVectorUseSimpleSearch, $wgVectorShowVariantName;
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
if ( !is_array( $elements ) ) {
$elements = array( $elements );
// If there's a series of elements, reverse them when in RTL mode
- } elseif ( $wgLang->isRTL() ) {
+ } elseif ( $this->data['rtl'] ) {
$elements = array_reverse( $elements );
}
// Render elements
<h5<?php $this->html( 'userlangattributes' ) ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
<form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
<input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
- <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?>
+ <?php if ( $wgVectorUseSimpleSearch && $this->getSkin()->getUser()->getOption( 'vector-simplesearch' ) ): ?>
<div id="simpleSearch">
<?php if ( $this->data['rtl'] ): ?>
- <?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->skin->getSkinStylePath( 'images/search-rtl.png' ) ) ); ?>
+ <?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->getSkin()->getSkinStylePath( 'images/search-rtl.png' ) ) ); ?>
<?php endif; ?>
<?php echo $this->makeSearchInput( array( 'id' => 'searchInput', 'type' => 'text' ) ); ?>
<?php if ( !$this->data['rtl'] ): ?>
- <?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->skin->getSkinStylePath( 'images/search-ltr.png' ) ) ); ?>
+ <?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->getSkin()->getSkinStylePath( 'images/search-ltr.png' ) ) ); ?>
<?php endif; ?>
</div>
<?php else: ?>