r94529 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94528‎ | r94529 | r94530 >
Date:17:39, 15 August 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r94528
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_footmenu_default.html.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -49,7 +49,7 @@
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
5252 class ExtMobileFrontend {
53 - const VERSION = '0.5.22';
 53+ const VERSION = '0.5.23';
5454
5555 /**
5656 * @var DOMDocument
@@ -78,6 +78,7 @@
7979 public static $callback;
8080 public static $useFormat;
8181 public static $disableImages;
 82+ public static $enableImages;
8283
8384 public $itemsToRemove = array(
8485 '#contentSub', # redirection notice
@@ -156,6 +157,7 @@
157158 self::$messages['mobile-frontend-disable-images'] = wfMsg( 'mobile-frontend-disable-images' );
158159 self::$messages['mobile-frontend-wml-continue'] = wfMsg( 'mobile-frontend-wml-continue' );
159160 self::$messages['mobile-frontend-wml-back'] = wfMsg( 'mobile-frontend-wml-back' );
 161+ self::$messages['mobile-frontend-enable-images'] = wfMsg( 'mobile-frontend-enable-images' );
160162
161163 self::$dir = $wgContLang->getDir();
162164 self::$code = $wgContLang->getCode();
@@ -211,6 +213,7 @@
212214 $mAction = $wgRequest->getText( 'mAction' );
213215 $action = $wgRequest->getText( 'action' );
214216 self::$disableImages = $wgRequest->getText( 'disableImages', 0 );
 217+ self::$enableImages = $wgRequest->getText( 'enableImages', 0 );
215218
216219 if ( self::$disableImages == 1 ) {
217220 $wgRequest->response()->setcookie( 'disableImages', 1 );
@@ -223,6 +226,14 @@
224227 }
225228 }
226229
 230+ if ( self::$enableImages == 1 ) {
 231+ $disableImages = $wgRequest->getCookie( 'disableImages' );
 232+ if ( $disableImages ) {
 233+ $wgRequest->response()->setcookie( 'disableImages', '' );
 234+ }
 235+ }
 236+
 237+
227238 self::$useFormat = $wgRequest->getText( 'useFormat' );
228239 self::$format = $wgRequest->getText( 'format' );
229240 self::$requestedSegment = $wgRequest->getText( 'seg', 0 );
@@ -371,6 +382,7 @@
372383 $htmlTitle = self::$messages['mobile-frontend-opt-in-title'];
373384 $explainOptIn = self::$messages['mobile-frontend-opt-in-explain'];
374385 $disableImages = self::$messages['mobile-frontend-disable-images'];
 386+ $enableImages = self::$messages['mobile-frontend-enable-images'];
375387 $optInMessage = self::$messages['mobile-frontend-opt-in-message'];
376388 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
377389 require( 'views/layout/_search_webkit.html.php' );
@@ -399,6 +411,7 @@
400412 $explainOptOut = self::$messages['mobile-frontend-opt-out-explain'];
401413 $optOutMessage = self::$messages['mobile-frontend-opt-out-message'];
402414 $disableImages = self::$messages['mobile-frontend-disable-images'];
 415+ $enableImages = self::$messages['mobile-frontend-enable-images'];
403416 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
404417 require( 'views/layout/_search_webkit.html.php' );
405418 require( 'views/layout/_footmenu_default.html.php' );
@@ -425,6 +438,7 @@
426439 $disableButton = self::$messages['mobile-frontend-disable-button'];
427440 $backButton = self::$messages['mobile-frontend-back-button'];
428441 $disableImages = self::$messages['mobile-frontend-disable-images'];
 442+ $enableImages = self::$messages['mobile-frontend-enable-images'];
429443 $htmlTitle = $areYouSure;
430444 $title = $areYouSure;
431445 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
@@ -659,6 +673,7 @@
660674 $homeButton = self::$messages['mobile-frontend-home-button'];
661675 $randomButton = self::$messages['mobile-frontend-random-button'];
662676 $disableImages = self::$messages['mobile-frontend-disable-images'];
 677+ $enableImages = self::$messages['mobile-frontend-enable-images'];
663678
664679 $title = htmlspecialchars( self::$title->getText() );
665680 $htmlTitle = htmlspecialchars( self::$htmlTitle );
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_footmenu_default.html.php
@@ -1,10 +1,18 @@
22 <?php
33
 4+if ( self::$disableImages == 0 ) {
 5+ $imagesToggle = $disableImages;
 6+ $imagesURL = '?disableImages=1';
 7+} else {
 8+ $imagesToggle = $enableImages;
 9+ $imagesURL = '?enableImages=1';
 10+}
 11+
412 $footerHtml = <<<EOD
513 <div id='footer'>
614 <div class='nav' id='footmenu'>
715 <div class='mwm-notice'>
8 - <a href="?mAction=view_normal_site">{$regularSite}</a> | <a href="?disableImages=1">{$disableImages}</a>
 16+ <a href="?mAction=view_normal_site">{$regularSite}</a> | <a href="{$imagesURL}">{$imagesToggle}</a>
917 <div id="perm">
1018 <a href="?mAction=disable_mobile_site">{$permStopRedirect}</a>
1119 </div>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94528add ability to re-enable images once disabledpreilly17:38, 15 August 2011

Status & tagging log