r52683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52682‎ | r52683 | r52684 >
Date:09:27, 2 July 2009
Author:ialex
Status:ok (Comments)
Tags:
Comment:
(bug 19390) Omit the "printable version" link on the printable version to have links to &printable=yes&printable=yes...
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinTemplate.php
@@ -887,10 +887,12 @@
888888 // A print stylesheet is attached to all pages, but nobody ever
889889 // figures that out. :) Add a link...
890890 if( $this->iscontent && ( $action == 'view' || $action == 'purge' ) ) {
891 - $nav_urls['print'] = array(
892 - 'text' => wfMsg( 'printableversion' ),
893 - 'href' => $wgRequest->appendQuery( 'printable=yes' )
894 - );
 891+ if ( !$wgRequest->getBool( 'printable' ) ) {
 892+ $nav_urls['print'] = array(
 893+ 'text' => wfMsg( 'printableversion' ),
 894+ 'href' => $wgRequest->appendQuery( 'printable=yes' )
 895+ );
 896+ }
895897
896898 // Also add a "permalink" while we're at it
897899 if ( $this->mRevisionId ) {
Index: trunk/phase3/includes/Skin.php
@@ -1073,9 +1073,13 @@
10741074 function printableLink() {
10751075 global $wgOut, $wgFeedClasses, $wgRequest, $wgLang;
10761076
1077 - $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
 1077+ $s = array();
10781078
1079 - $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
 1079+ if ( !$wgRequest->getBool( 'printable' ) ) {
 1080+ $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
 1081+ $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
 1082+ }
 1083+
10801084 if( $wgOut->isSyndicated() ) {
10811085 foreach( $wgFeedClasses as $format => $class ) {
10821086 $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" );
Index: trunk/phase3/RELEASE-NOTES
@@ -220,6 +220,7 @@
221221 * (bug 19450) Use formatNum for "Number of edits" in Special:Preferences
222222 * (bug 11242) Check for MySQL storage engines during installation now checks
223223 whether the engines are actually available
 224+* (bug 19390) Omit the "printable version" link on the printable version
224225
225226 == API changes in 1.16 ==
226227

Follow-up revisions

RevisionCommit summaryAuthorDate
r55508Per Brion's comment on r52683: use $wgOut->isPrintable() rather than $wgReque...ialex22:26, 22 August 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   21:57, 22 August 2009

Should probably be using $wgOut->isPrintable() here rather than poking $wgRequest directly.

#Comment by IAlex (talk | contribs)   22:27, 22 August 2009

fixed in r55508.

Status & tagging log