From e3cb1b3d0d079fda5df1a2482fbc01d867a28d3d Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 15 Jun 2008 20:30:52 +0000 Subject: [PATCH] (bug 2889) MediaWiki:Print.css now applies to the printable version --- RELEASE-NOTES | 1 + includes/Skin.php | 5 +++-- includes/SkinTemplate.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c928bdfdce..8c46064e6c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -155,6 +155,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN external links. * (bug 14132) Allow user to disable bot edits from being output to UDP. * (bug 14328) jsMsg() within Wikibits now accepts a DOM object, not just a string +* (bug 2889) MediaWiki:Print.css applies to the printable version === Bug fixes in 1.13 === diff --git a/includes/Skin.php b/includes/Skin.php index 3f8c6b983f..a406c979e2 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -416,7 +416,7 @@ class Skin extends Linker { # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way) function getUserStylesheet() { - global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion; + global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion, $wgOut; $sheet = $this->getStylesheet(); $s = "@import \"$wgStylePath/common/shared.css?$wgStyleVersion\";\n"; $s .= "@import \"$wgStylePath/common/oldshared.css?$wgStyleVersion\";\n"; @@ -428,6 +428,7 @@ class Skin extends Linker { '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n"; $s .= $this->doGetUserStyles(); + if($wgOut->isPrintable()) $s .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ) . "\";\n"; return $s."\n"; } @@ -528,7 +529,7 @@ END; } return $s; } - + function getBodyOptions() { global $wgUser, $wgTitle, $wgOut, $wgRequest, $wgContLang; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c60cfb4e7b..187d9a8409 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -962,7 +962,8 @@ class SkinTemplate extends Skin { function setupUserCss() { wfProfileIn( __METHOD__ ); - global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; + global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, + $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser, $wgOut; $sitecss = ''; $usercss = ''; @@ -1005,6 +1006,7 @@ class SkinTemplate extends Skin { $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n"; $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n"; $sitecss .= '@import "' . self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ) . '";' . "\n"; + if( $wgOut->isPrintable()) $sitecss .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI) . '";' . "\n"; } # If we use any dynamic CSS, make a little CDATA block out of it. -- 2.20.1