(bug 13970) Allow MonoBook-based skins to specify their own print stylesheet. Patch...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 6 May 2008 13:58:32 +0000 (13:58 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 6 May 2008 13:58:32 +0000 (13:58 +0000)
RELEASE-NOTES
includes/SkinTemplate.php
skins/MonoBook.php

index c3d2c50..4a376ff 100644 (file)
@@ -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 ===
 
index 4ba3f21..794e1f3 100644 (file)
@@ -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
index c97eea8..50348fc 100644 (file)
@@ -60,7 +60,7 @@ class MonoBookTemplate extends QuickTemplate {
                        @import "<?php $this->text('stylepath') ?>/common/shared.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";
                        @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";
                /*]]>*/</style>
-               <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
+               <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('printcss') ?>?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
                <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
                <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
                <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->