$tpl->set( 'title', $wgOut->getPageTitle() );
$tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
$tpl->set( 'displaytitle', $wgOut->mPageLinkTitle );
+ $tpl->set( 'pageclass', Sanitizer::escapeClass( 'page-'.$wgTitle->getPrefixedText() ) );
$nsname = @$wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ];
if ( $nsname === NULL ) $nsname = $this->mTitle->getNsText();
-
+
$tpl->set( 'nscanonical', $nsname );
$tpl->set( 'nsnumber', $this->mTitle->getNamespace() );
$tpl->set( 'titleprefixeddbkey', $this->mTitle->getPrefixedDBKey() );
if( $wgOut->isSyndicated() ) {
$feeds = array();
foreach( $wgFeedClasses as $format => $class ) {
+ $linktext = $format;
+ if ( $format == "atom" ) {
+ $linktext = wfMsg( 'feed-atom' );
+ } else if ( $format == "rss" ) {
+ $linktext = wfMsg( 'feed-rss' );
+ }
$feeds[$format] = array(
- 'text' => $format,
+ 'text' => $linktext,
'href' => $wgRequest->appendQuery( "feed=$format" )
);
}
$personal_urls['logout'] = array(
'text' => wfMsg( 'userlogout' ),
'href' => self::makeSpecialUrl( 'Userlogout',
- $wgTitle->getNamespace() === NS_SPECIAL && $wgTitle->getText() === 'Preferences' ? '' : "returnto={$this->thisurl}"
+ $wgTitle->isSpecial( 'Preferences' ) ? '' : "returnto={$this->thisurl}"
)
);
} else {
$personal_urls['anonlogin'] = array(
'text' => wfMsg('userlogin'),
'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
- 'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
+ 'active' => $wgTitle->isSpecial( 'Userlogin' )
);
} else {
$personal_urls['login'] = array(
'text' => wfMsg('userlogin'),
'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
- 'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
+ 'active' => $wgTitle->isSpecial( 'Userlogin' )
);
}
}
);
}
if ( $this->mTitle->userCanMove()) {
- $moveTitle = Title::makeTitle( NS_SPECIAL, 'Movepage' );
+ $moveTitle = SpecialPage::getTitleFor( 'Movepage', $this->thispage );
$content_actions['move'] = array(
- 'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == NS_SPECIAL) ? 'selected' : false,
+ 'class' => $this->mTitle->isSpecial( 'Movepage' ) ? 'selected' : false,
'text' => wfMsg('move'),
- 'href' => $moveTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
+ 'href' => $moveTitle->getLocalUrl()
);
}
} else {
//article doesn't exist or is deleted
if( $wgUser->isAllowed( 'delete' ) ) {
if( $n = $this->mTitle->isDeleted() ) {
- $undelTitle = Title::makeTitle( NS_SPECIAL, 'Undelete' );
+ $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
$content_actions['undelete'] = array(
'class' => false,
'text' => wfMsgExt( 'undelete_short', array( 'parsemag' ), $n ),
} else {
/* show special page tab */
- $content_actions['article'] = array(
+ $content_actions[$this->mTitle->getNamespaceKey()] = array(
'class' => 'selected',
'text' => wfMsg('specialpage'),
'href' => $wgRequest->getRequestURL(), // @bug 2457, 2510
}
if( $this->mTitle->getNamespace() != NS_SPECIAL ) {
- $wlhTitle = Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' );
+ $wlhTitle = SpecialPage::getTitleFor( 'Whatlinkshere', $this->thispage );
$nav_urls['whatlinkshere'] = array(
- 'href' => $wlhTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
+ 'href' => $wlhTitle->getLocalUrl()
);
if( $this->mTitle->getArticleId() ) {
- $rclTitle = Title::makeTitle( NS_SPECIAL, 'Recentchangeslinked' );
+ $rclTitle = SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage );
$nav_urls['recentchangeslinked'] = array(
- 'href' => $rclTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
+ 'href' => $rclTitle->getLocalUrl()
);
}
if ($wgUseTrackbacks)
$siteargs .= '&ts=' . $wgUser->mTouched;
}
- if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css?1";' . "\n";
+ if( $wgContLang->isRTL() ) {
+ global $wgStyleVersion;
+ $sitecss .= "@import \"$wgStylePath/$this->stylename/rtl.css?$wgStyleVersion\";\n";
+ }
# If we use the site's dynamic CSS, throw that in, too
if ( $wgUseSiteCss ) {
}
/**
- * @public
+ * This returns MediaWiki:Common.js and MediaWiki:[Skinname].js concate-
+ * nated together. For some bizarre reason, it does *not* return any
+ * custom user JS from subpages. Huh?
+ *
+ * There's absolutely no reason to have separate Monobook/Common JSes.
+ * Any JS that cares can just check the skin variable generated at the
+ * top. For now Monobook.js will be maintained, but it should be consi-
+ * dered deprecated.
+ *
+ * @return string
*/
- function getUserJs() {
+ public function getUserJs() {
$fname = 'SkinTemplate::getUserJs';
wfProfileIn( $fname );
- global $wgStylePath;
- $s = '/* generated javascript */';
- $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
- $s .= '/* MediaWiki:'.ucfirst($this->skinname)." */\n";
+ $s = parent::getUserJs();
+ $s .= "\n\n/* MediaWiki:".ucfirst($this->skinname).".js (deprecated; migrate to Common.js!) */\n";
// avoid inclusion of non defined user JavaScript (with custom skins only)
// by checking for default message content