From 7c13cb609ee20d298d6eb6af824edde5b0e76f9d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 22 Jun 2005 22:59:39 +0000 Subject: [PATCH] * (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. --- RELEASE-NOTES | 2 ++ includes/SkinTemplate.php | 12 +++++++++++- skins/MonoBook.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6072b11c49..07a9165497 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 47c4a18b06..6c732e8d99 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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; diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 7192947169..3a2dfb7212 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -57,7 +57,7 @@ class MonoBookTemplate extends QuickTemplate { html('headlinks') ?> <?php $this->text('pagetitle') ?> - + data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css" /> -- 2.20.1