From df2224b7bae4b9a4d4b62e97d288386d0d2799ba Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Tue, 6 May 2008 13:58:32 +0000 Subject: [PATCH] (bug 13970) Allow MonoBook-based skins to specify their own print stylesheet. Patch by Gernot Hillier, with modifications. --- RELEASE-NOTES | 3 ++- includes/SkinTemplate.php | 16 +++++++++++++--- skins/MonoBook.php | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c3d2c505ff..4a376fff95 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -101,7 +101,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12542) Added hooks for expansion of Special:Listusers * Drop-down AJAX search suggestions (turn on $wgEnableMWSuggest) * More relevant search snippets (turn on $wgAdvancedSearchHighlighting) -* (bug 13950) Allow users to watch the user/user talk pages of users they block. +* (bug 13950) Allow users to watch the user/talk pages of users they block. +* (bug 13970) Allow MonoBook-based skins to specify their own print stylesheet === Bug fixes in 1.13 === diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 4ba3f21222..794e1f30c5 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -269,6 +269,7 @@ class SkinTemplate extends Skin { $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href']); $tpl->set( 'userlang', $wgLang->getCode() ); $tpl->set( 'pagecss', $this->setupPageCss() ); + $tpl->set( 'printcss', $this->getPrintCss() ); $tpl->setRef( 'usercss', $this->usercss); $tpl->setRef( 'userjs', $this->userjs); $tpl->setRef( 'userjsprev', $this->userjsprev); @@ -1056,10 +1057,8 @@ class SkinTemplate extends Skin { /** * returns css with user-specific options - * @public */ - - function getUserStylesheet() { + public function getUserStylesheet() { $fname = 'SkinTemplate::getUserStylesheet'; wfProfileIn( $fname ); @@ -1069,6 +1068,17 @@ class SkinTemplate extends Skin { return $s; } + /** + * Returns the print stylesheet for this skin. In all default skins this + * is just commonPrint.css, but third-party skins may want to modify it. + * + * @return string + */ + public function getPrintCss() { + global $wgStylePath; + return $wgStylePath . "/common/commonPrint.css"; + } + /** * This returns MediaWiki:Common.js and MediaWiki:[Skinname].js concate- * nated together. For some bizarre reason, it does *not* return any diff --git a/skins/MonoBook.php b/skins/MonoBook.php index c97eea8eb6..50348fc0f3 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -60,7 +60,7 @@ class MonoBookTemplate extends QuickTemplate { @import "text('stylepath') ?>/common/shared.css?"; @import "text('stylepath') ?>/text('stylename') ?>/main.css?"; /*]]>*/ - data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css?" /> + data['printable']) ) { ?>media="print" href="text('printcss') ?>?" /> -- 2.20.1