(bug 5795) CSS class added to body based on page name for page-specific styling....
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 20 Oct 2006 02:57:59 +0000 (02:57 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 20 Oct 2006 02:57:59 +0000 (02:57 +0000)
RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php
skins/MonoBook.php

index 3f7b05b..d53b085 100644 (file)
@@ -55,10 +55,12 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 7581) Update language name for cbk-zam
 * (bug 7444) Update namespace translations for Telugu (te), kept old values as
   alias for compatibility
-* (bug 4525) Move section links down visually to same level as headings 
+* (bug 4525) Move section links down visually to same level as headings
   editsection links are now inside the heading elements)
 * (bug 7623) Validate custom HTML id's correctly in Monobook interface
 * (bug 2241) Fix collision of 'w' and 'd' accesskeys
+* (bug 5795) CSS class added to body based on page name for page-specific
+  styling
 
 == Languages updated ==
 
index 764817b..ea9dd21 100644 (file)
@@ -477,7 +477,8 @@ END;
                        }
                        $a['onload'] .= 'setupRightClickEdit()';
                }
-               $a['class'] = 'ns-'.$wgTitle->getNamespace().' '.($wgContLang->isRTL() ? "rtl" : "ltr");
+               $a['class'] = 'ns-'.$wgTitle->getNamespace().' '.($wgContLang->isRTL() ? "rtl" : "ltr").
+               ' page-'.Sanitizer::escapeId( $wgTitle->getPrefixedText() );
                return $a;
        }
 
index c7947ed..20d88ba 100644 (file)
@@ -190,10 +190,11 @@ class SkinTemplate extends Skin {
                $tpl->set( 'title', $wgOut->getPageTitle() );
                $tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
                $tpl->set( 'displaytitle', $wgOut->mPageLinkTitle );
+               $tpl->set( 'pageclass', 'page-'.Sanitizer::escapeId( $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() );
index 36c36e9..bf9e834 100644 (file)
@@ -89,7 +89,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') ?>">
+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?>">
        <div id="globalWrapper">
                <div id="column-content">
        <div id="content">