From 470cb09fbc099527873dd18af5e93c68212767aa Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 20 Oct 2006 02:57:59 +0000 Subject: [PATCH] (bug 5795) CSS class added to body based on page name for page-specific styling. Patch based on one by Ilmari Karonen. --- RELEASE-NOTES | 4 +++- includes/Skin.php | 3 ++- includes/SkinTemplate.php | 3 ++- skins/MonoBook.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3f7b05b819..d53b085dcf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Skin.php b/includes/Skin.php index 764817ba78..ea9dd2152a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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; } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c7947eddef..20d88ba6f2 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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() ); diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 36c36e9798..bf9e834309 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -89,7 +89,7 @@ class MonoBookTemplate extends QuickTemplate { data['body_ondblclick']) { ?>ondblclick="text('body_ondblclick') ?>" data['body_onload' ]) { ?>onload="text('body_onload') ?>" - class="mediawiki text('nsclass') ?> text('dir') ?>"> + class="mediawiki text('nsclass') ?> text('dir') ?> text('pageclass') ?>">
-- 2.20.1