From 4f984fb87ed283ba85fa4db1ce02298ed610a5de Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 23 Oct 2005 10:47:43 +0000 Subject: [PATCH] Added @import for [[MediaWiki:Common.css]] to all skins --- RELEASE-NOTES | 2 +- includes/Skin.php | 7 ++++--- includes/SkinTemplate.php | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5d750c86ea..b7d93af57e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -165,7 +165,7 @@ fully support the editing toolbar, but was found to be too confusing. * Avoid notice warning on edit with no User-Agent header * Various fixes * Fix wfMsg*() replacements; args containing literal $[2-9] were wiped - +* Added @import for [[MediaWiki:Common.css]] to all skins === Caveats === diff --git a/includes/Skin.php b/includes/Skin.php index 4902c460b6..9f723ba57a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -253,10 +253,11 @@ class Skin extends Linker { * Some styles that are set by user through the user settings interface. */ function doGetUserStyles() { - global $wgUser, $wgContLang; + global $wgUser, $wgContLang, $wgSquidMaxage; - $csspage = $wgContLang->getNsText( NS_MEDIAWIKI ) . ':' . $this->getSkinName() . '.css'; - $s = '@import "'.$this->makeUrl($csspage, 'action=raw&ctype=text/css')."\";\n"; + $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; + $s = '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" . + '@import "'.$this->makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n"; return $s . $this->reallyDoGetUserStyles(); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 4e1e3c7385..812d94e501 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -940,7 +940,9 @@ class SkinTemplate extends Skin { # If we use the site's dynamic CSS, throw that in, too if ( $wgUseSiteCss ) { - $sitecss .= '@import "' . $this->makeNSUrl(ucfirst($this->skinname) . '.css', 'action=raw&ctype=text/css&smaxage=' . $wgSquidMaxage, NS_MEDIAWIKI) . '";' . "\n"; + $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; + $sitecss .= '@import "' . $this->makeNSUrl('Common.css', $query, NS_MEDIAWIKI) . '";' . "\n"; + $sitecss .= '@import "' . $this->makeNSUrl(ucfirst($this->skinname) . '.css', $query, NS_MEDIAWIKI) . '";' . "\n"; $sitecss .= '@import "' . $this->makeUrl('-','action=raw&gen=css' . $siteargs) . '";' . "\n"; } -- 2.20.1