}
$a['onload'] = $wgOut->getOnloadHandler();
$a['class'] =
- 'mediawiki ns-'.$wgTitle->getNamespace().
+ 'mediawiki' .
+ ' '.$this->getNamespaceClasses( $wgTitle ) .
' '.( $wgContLang->isRTL() ? "rtl" : "ltr" ).
' '.Sanitizer::escapeClass( 'page-'.$wgTitle->getPrefixedText() ).
- ' '. $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) .
' skin-'. Sanitizer::escapeClass( $this->getSkinName( ) );
return $a;
}
+
+ function getNamespaceClasses( $title ) {
+ $numeric = 'ns-'.$title->getNamespace();
+ if( $title->getNamespace() == NS_SPECIAL ) {
+ $type = "ns-special";
+ } elseif( $title->isTalkPage() ) {
+ $type = "ns-talk";
+ } else {
+ $type = "ns-subject";
+ }
+ return "$numeric $type";
+ }
/**
* URL to the logo
$tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
$tpl->set( 'displaytitle', $wgOut->mPageLinkTitle );
$tpl->set( 'pageclass', Sanitizer::escapeClass( 'page-'.$this->mTitle->getPrefixedText() ) );
- $tpl->set( 'talkclass', ( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) ) );
$tpl->set( 'skinnameclass', ( "skin-" . Sanitizer::escapeClass( $this->getSkinName ( ) ) ) );
$nsname = isset( $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] ) ?
$tpl->set( 'handheld', $wgRequest->getBool( 'handheld' ) );
$tpl->set( 'csslinks', $this->buildCssLinks() );
$tpl->setRef( 'loggedin', $this->loggedin );
- $tpl->set('nsclass', 'ns-'.$this->mTitle->getNamespace());
+ $tpl->set( 'nsclass', $this->getNamespaceClasses( $this->mTitle ) );
$tpl->set('notspecialpage', $this->mTitle->getNamespace() != NS_SPECIAL);
/* XXX currently unused, might get useful later
$tpl->set( "editable", ($this->mTitle->getNamespace() != NS_SPECIAL ) );
</head>
<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
<?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
- class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?> <?php $this->text('skinnameclass') ?>">
+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
<div id="globalWrapper">
<div id="column-content">
<div id="content">