(bug 19390) Omit the "printable version" link on the printable version to have links...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 2 Jul 2009 09:27:33 +0000 (09:27 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 2 Jul 2009 09:27:33 +0000 (09:27 +0000)
RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php

index 4c0cc95..db1ad79 100644 (file)
@@ -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 ==
 
index 6ff984b..a6f0245 100644 (file)
@@ -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[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
+               }
 
-               $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
                if( $wgOut->isSyndicated() ) {
                        foreach( $wgFeedClasses as $format => $class ) {
                                $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" );
index f42a6c1..2238f83 100644 (file)
@@ -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 ) {