From bcf096cfcc972476e1f4c2de577af4309a593db4 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 13 Jun 2008 01:04:10 +0000 Subject: [PATCH] Also omit rtl.css when appropriate. Would be good to do this for main.css too for Myskin (although of course that one should be included by default, not excluded). --- RELEASE-NOTES | 2 +- includes/SkinTemplate.php | 10 +++++----- skins/MonoBook.php | 12 ++++++------ skins/Simple.php | 1 + 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e80d114c2e..d621d0d2cc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -369,7 +369,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN recent changes page. * (bug 14511) MediaWiki:Delete-legend is no longer double escaped * Generate correct section anchors for numeric headers -* (bug 14520) Don't load nonexistent CSS fix files for Chick, Myskin, Simple +* (bug 14520) Don't load nonexistent CSS files for Chick/Myskin/Simple skins === API changes in 1.13 === diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 042dc29ac1..c60cfb4e7b 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -88,10 +88,10 @@ class SkinTemplate extends Skin { var $template; /** - * An array of CSS fixes files to load for IE, in conditional comments. - * May include: 'IE', 'IE50', 'IE55', 'IE60', 'IE70'. + * An array of strings representing extra CSS files to load. May include: + * 'IE', 'IE50', 'IE55', 'IE60', 'IE70', 'rtl'. */ - var $fixfiles; + var $cssfiles; /**#@-*/ @@ -107,7 +107,7 @@ class SkinTemplate extends Skin { $this->skinname = 'monobook'; $this->stylename = 'monobook'; $this->template = 'QuickTemplate'; - $this->fixfiles = array(); + $this->cssfiles = array(); } /** @@ -991,7 +991,7 @@ class SkinTemplate extends Skin { $siteargs .= '&ts=' . $wgUser->mTouched; } - if( $wgContLang->isRTL() ) { + if( $wgContLang->isRTL() && in_array( 'rtl', $this->cssfiles ) ) { global $wgStyleVersion; $sitecss .= "@import \"$wgStylePath/$this->stylename/rtl.css?$wgStyleVersion\";\n"; } diff --git a/skins/MonoBook.php b/skins/MonoBook.php index f6f97c0237..5fb397f95e 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -27,7 +27,7 @@ class SkinMonoBook extends SkinTemplate { $this->template = 'MonoBookTemplate'; # Bug 14520: skins that just include this file shouldn't load nonexis- # tent CSS fix files. - $this->fixfiles = array( 'IE', 'IE50', 'IE55', 'IE60', 'IE70' ); + $this->cssfiles = array( 'IE', 'IE50', 'IE55', 'IE60', 'IE70', 'rtl' ); } } @@ -65,11 +65,11 @@ class MonoBookTemplate extends QuickTemplate { @import "text('stylepath') ?>/text('stylename') ?>/main.css?"; /*]]>*/ data['printable']) ) { ?>media="print" href="text('printcss') ?>?" /> - fixfiles ) ) { ?> - fixfiles ) ) { ?> - fixfiles ) ) { ?> - fixfiles ) ) { ?> - + cssfiles ) ) { ?> + cssfiles ) ) { ?> + cssfiles ) ) { ?> + data ); ?> diff --git a/skins/Simple.php b/skins/Simple.php index 92aa19ebac..db64e48b41 100644 --- a/skins/Simple.php +++ b/skins/Simple.php @@ -23,6 +23,7 @@ class SkinSimple extends SkinTemplate { $this->skinname = 'simple'; $this->stylename = 'simple'; $this->template = 'MonoBookTemplate'; + $this->cssfiles = array( 'rtl' ); } function reallyDoGetUserStyles() { -- 2.20.1