* (bug 1577) Add 'printable version' tab in MonoBook for people who don't
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 22 Jun 2005 22:59:39 +0000 (22:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 22 Jun 2005 22:59:39 +0000 (22:59 +0000)
  realize you can just hit print to get a nicely formatted printable page.

RELEASE-NOTES
includes/SkinTemplate.php
skins/MonoBook.php

index 6072b11..07a9165 100644 (file)
@@ -324,6 +324,8 @@ Various bugfixes, small features, and a few experimental things:
 * (bug 2178) Fix temp dir check again
 * (bug 2488) Format 'deletedtext' message as wikitext
 * (bug 750) Keep line endings consistent in LocalSettings.php
+* (bug 1577) Add 'printable version' tab in MonoBook for people who don't
+  realize you can just hit print to get a nicely formatted printable page.
 
 
 === Caveats ===
index 47c4a18..6c732e8 100644 (file)
@@ -224,6 +224,7 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'wgScript', $wgScript );
                $tpl->setRef( 'skinname', $this->skinname );
                $tpl->setRef( 'stylename', $this->stylename );
+               $tpl->set( 'printable', $wgRequest->getBool( 'printable' ) );
                $tpl->setRef( 'loggedin', $this->loggedin );
                $tpl->set('nsclass', 'ns-'.$this->mTitle->getNamespace());
                $tpl->set('notspecialpage', $this->mTitle->getNamespace() != NS_SPECIAL);
@@ -702,7 +703,16 @@ class SkinTemplate extends Skin {
                                        );
                                $vcount ++;
                        }
-               }               
+               }
+               
+               // A print stylesheet is attached to all pages, but nobody ever
+               // figures that out. :)  Add a link...
+               if( $this->iscontent && ($action == '' || $action == 'view' || $action == 'purge' ) ) {
+                       $content_actions['print'] = array(
+                               'class' => false,
+                               'text' => wfMsg( 'printableversion' ),
+                               'href' => $wgRequest->appendQuery( 'printable=yes' ) );
+               }
 
                wfProfileOut( $fname );
                return $content_actions;
index 7192947..3a2dfb7 100644 (file)
@@ -57,7 +57,7 @@ class MonoBookTemplate extends QuickTemplate {
     <?php $this->html('headlinks') ?>
     <title><?php $this->text('pagetitle') ?></title>
     <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css"; /*]]>*/</style>
-    <link rel="stylesheet" type="text/css" media="print" href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
+    <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
     <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
     <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
     <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->