Bug 15079, 'Add class="ns-talk" / "ns-subject" to <body>', also added ns-special...
authorSQL <sql@users.mediawiki.org>
Sun, 10 Aug 2008 08:29:05 +0000 (08:29 +0000)
committerSQL <sql@users.mediawiki.org>
Sun, 10 Aug 2008 08:29:05 +0000 (08:29 +0000)
RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php
skins/Modern.php
skins/MonoBook.php

index 2d6400c..10b0acf 100644 (file)
@@ -89,6 +89,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   entirely, not just the display of it.
 * (bug 6387) Introduced new setting $wgCategoryPrefixedDefaultSortkey which
   allows having the unprefixed page title as the default category sortkey
+* (bug 15079) Add class="ns-talk" / "ns-subject" to <body>. Also added ns-special to 
+  special pages.
 
 === API changes in 1.14 ===
 
index 39d5c57..6bb0dc0 100644 (file)
@@ -589,8 +589,9 @@ END;
                $a['onload'] = $wgOut->getOnloadHandler();
                $a['class'] =
                        'mediawiki ns-'.$wgTitle->getNamespace().
-                       ' '.($wgContLang->isRTL() ? "rtl" : "ltr").
-                       ' '.Sanitizer::escapeClass( 'page-'.$wgTitle->getPrefixedText() );
+                       ' '.( $wgContLang->isRTL() ? "rtl" : "ltr" ).
+                       ' '.Sanitizer::escapeClass( 'page-'.$wgTitle->getPrefixedText() ).
+                       ' '.( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) ) );
                return $a;
        }
 
index d1b2af6..85871dc 100644 (file)
@@ -192,6 +192,7 @@ class SkinTemplate extends Skin {
                $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" ) ) );
 
                $nsname = isset( $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] ) ?
                          $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] :
index a7c29a5..b0194d6 100644 (file)
@@ -95,7 +95,7 @@ class ModernTemplate extends QuickTemplate {
        </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') ?>">
+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?>">
 
        <!-- heading -->
        <div id="mw_header"><h1 id="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1></div>
index a79825f..bfbc6c6 100644 (file)
@@ -104,7 +104,7 @@ class MonoBookTemplate extends QuickTemplate {
        </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') ?>">
+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?>">
        <div id="globalWrapper">
                <div id="column-content">
        <div id="content">