From: Aryeh Gregor Date: Fri, 20 Oct 2006 02:57:59 +0000 (+0000) Subject: (bug 5795) CSS class added to body based on page name for page-specific styling.... X-Git-Tag: 1.31.0-rc.0~55430 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=470cb09fbc099527873dd18af5e93c68212767aa;p=lhc%2Fweb%2Fwiklou.git (bug 5795) CSS class added to body based on page name for page-specific styling. Patch based on one by Ilmari Karonen. --- 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') ?>">