From 290187a99379900981584e08223f6b75fd583a4b Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 2 Jul 2009 09:27:33 +0000 Subject: [PATCH] (bug 19390) Omit the "printable version" link on the printable version to have links to &printable=yes&printable=yes... --- RELEASE-NOTES | 1 + includes/Skin.php | 8 ++++++-- includes/SkinTemplate.php | 10 ++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4c0cc95ece..db1ad7993b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -220,6 +220,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 19450) Use formatNum for "Number of edits" in Special:Preferences * (bug 11242) Check for MySQL storage engines during installation now checks whether the engines are actually available +* (bug 19390) Omit the "printable version" link on the printable version == API changes in 1.16 == diff --git a/includes/Skin.php b/includes/Skin.php index 6ff984b177..a6f024520d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1073,9 +1073,13 @@ END; function printableLink() { global $wgOut, $wgFeedClasses, $wgRequest, $wgLang; - $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' ); + $s = array(); + + if ( !$wgRequest->getBool( 'printable' ) ) { + $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' ); + $s[] = "" . wfMsg( 'printableversion' ) . ''; + } - $s[] = "" . wfMsg( 'printableversion' ) . ''; if( $wgOut->isSyndicated() ) { foreach( $wgFeedClasses as $format => $class ) { $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index f42a6c1145..2238f835c3 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -887,10 +887,12 @@ class SkinTemplate extends Skin { // A print stylesheet is attached to all pages, but nobody ever // figures that out. :) Add a link... if( $this->iscontent && ( $action == 'view' || $action == 'purge' ) ) { - $nav_urls['print'] = array( - 'text' => wfMsg( 'printableversion' ), - 'href' => $wgRequest->appendQuery( 'printable=yes' ) - ); + if ( !$wgRequest->getBool( 'printable' ) ) { + $nav_urls['print'] = array( + 'text' => wfMsg( 'printableversion' ), + 'href' => $wgRequest->appendQuery( 'printable=yes' ) + ); + } // Also add a "permalink" while we're at it if ( $this->mRevisionId ) { -- 2.20.1