Per Brion's comment on r52683: use $wgOut->isPrintable() rather than $wgRequest-...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 22 Aug 2009 22:26:31 +0000 (22:26 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 22 Aug 2009 22:26:31 +0000 (22:26 +0000)
includes/Skin.php
includes/SkinTemplate.php

index 1ac24ac..ab41d29 100644 (file)
@@ -1104,7 +1104,7 @@ END;
 
                $s = array();
 
-               if ( !$wgRequest->getBool( 'printable' ) ) {
+               if ( !$wgOut->isPrintable() ) {
                        $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
                        $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
                }
index c9bec3b..2161962 100644 (file)
@@ -256,7 +256,7 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'skinname', $this->skinname );
                $tpl->set( 'skinclass', get_class( $this ) );
                $tpl->setRef( 'stylename', $this->stylename );
-               $tpl->set( 'printable', $wgRequest->getBool( 'printable' ) );
+               $tpl->set( 'printable', $out->isPrintable() );
                $tpl->set( 'handheld', $wgRequest->getBool( 'handheld' ) );
                $tpl->setRef( 'loggedin', $this->loggedin );
                $tpl->set( 'notspecialpage', $this->mTitle->getNamespace() != NS_SPECIAL );
@@ -904,7 +904,7 @@ 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' ) ) {
-                       if ( !$wgRequest->getBool( 'printable' ) ) {
+                       if ( !$wgOut->isPrintable() ) {
                                $nav_urls['print'] = array(
                                        'text' => wfMsg( 'printableversion' ),
                                        'href' => $wgRequest->appendQuery( 'printable=yes' )