Try at fixing bug 15052 - Skins should add their name as a class in <body>
authorSQL <sql@users.mediawiki.org>
Sun, 10 Aug 2008 09:22:27 +0000 (09:22 +0000)
committerSQL <sql@users.mediawiki.org>
Sun, 10 Aug 2008 09:22:27 +0000 (09:22 +0000)
RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php
skins/Modern.php
skins/MonoBook.php

index 10b0acf..b144477 100644 (file)
@@ -91,6 +91,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   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.
+* (bug 15052) Skins should add their name as a class in <body>
 
 === API changes in 1.14 ===
 
index 6bb0dc0..92e593c 100644 (file)
@@ -591,7 +591,8 @@ END;
                        'mediawiki ns-'.$wgTitle->getNamespace().
                        ' '.( $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" ) ) );
+                       ' '.( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) ) ).
+                       ' skin-'. Sanitizer::escapeClass( $this->getSkinName( ) );
                return $a;
        }
 
index 85871dc..cbe7a71 100644 (file)
@@ -193,6 +193,7 @@ class SkinTemplate extends Skin {
                $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() ] ) ?
                          $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] :
index b0194d6..381de4e 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') ?> <?php $this->text('talkclass') ?>">
+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?> <?php $this->text('skinnameclass') ?>">
 
        <!-- heading -->
        <div id="mw_header"><h1 id="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1></div>
index bfbc6c6..fc37c99 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') ?> <?php $this->text('talkclass') ?>">
+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?> <?php $this->text('skinnameclass') ?>">
        <div id="globalWrapper">
                <div id="column-content">
        <div id="content">