Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' ); |
51 | 51 | |
52 | 52 | class ExtMobileFrontend { |
53 | | - const VERSION = '0.5.22'; |
| 53 | + const VERSION = '0.5.23'; |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @var DOMDocument |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | public static $callback; |
80 | 80 | public static $useFormat; |
81 | 81 | public static $disableImages; |
| 82 | + public static $enableImages; |
82 | 83 | |
83 | 84 | public $itemsToRemove = array( |
84 | 85 | '#contentSub', # redirection notice |
— | — | @@ -156,6 +157,7 @@ |
157 | 158 | self::$messages['mobile-frontend-disable-images'] = wfMsg( 'mobile-frontend-disable-images' ); |
158 | 159 | self::$messages['mobile-frontend-wml-continue'] = wfMsg( 'mobile-frontend-wml-continue' ); |
159 | 160 | self::$messages['mobile-frontend-wml-back'] = wfMsg( 'mobile-frontend-wml-back' ); |
| 161 | + self::$messages['mobile-frontend-enable-images'] = wfMsg( 'mobile-frontend-enable-images' ); |
160 | 162 | |
161 | 163 | self::$dir = $wgContLang->getDir(); |
162 | 164 | self::$code = $wgContLang->getCode(); |
— | — | @@ -211,6 +213,7 @@ |
212 | 214 | $mAction = $wgRequest->getText( 'mAction' ); |
213 | 215 | $action = $wgRequest->getText( 'action' ); |
214 | 216 | self::$disableImages = $wgRequest->getText( 'disableImages', 0 ); |
| 217 | + self::$enableImages = $wgRequest->getText( 'enableImages', 0 ); |
215 | 218 | |
216 | 219 | if ( self::$disableImages == 1 ) { |
217 | 220 | $wgRequest->response()->setcookie( 'disableImages', 1 ); |
— | — | @@ -223,6 +226,14 @@ |
224 | 227 | } |
225 | 228 | } |
226 | 229 | |
| 230 | + if ( self::$enableImages == 1 ) { |
| 231 | + $disableImages = $wgRequest->getCookie( 'disableImages' ); |
| 232 | + if ( $disableImages ) { |
| 233 | + $wgRequest->response()->setcookie( 'disableImages', '' ); |
| 234 | + } |
| 235 | + } |
| 236 | + |
| 237 | + |
227 | 238 | self::$useFormat = $wgRequest->getText( 'useFormat' ); |
228 | 239 | self::$format = $wgRequest->getText( 'format' ); |
229 | 240 | self::$requestedSegment = $wgRequest->getText( 'seg', 0 ); |
— | — | @@ -371,6 +382,7 @@ |
372 | 383 | $htmlTitle = self::$messages['mobile-frontend-opt-in-title']; |
373 | 384 | $explainOptIn = self::$messages['mobile-frontend-opt-in-explain']; |
374 | 385 | $disableImages = self::$messages['mobile-frontend-disable-images']; |
| 386 | + $enableImages = self::$messages['mobile-frontend-enable-images']; |
375 | 387 | $optInMessage = self::$messages['mobile-frontend-opt-in-message']; |
376 | 388 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
377 | 389 | require( 'views/layout/_search_webkit.html.php' ); |
— | — | @@ -399,6 +411,7 @@ |
400 | 412 | $explainOptOut = self::$messages['mobile-frontend-opt-out-explain']; |
401 | 413 | $optOutMessage = self::$messages['mobile-frontend-opt-out-message']; |
402 | 414 | $disableImages = self::$messages['mobile-frontend-disable-images']; |
| 415 | + $enableImages = self::$messages['mobile-frontend-enable-images']; |
403 | 416 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
404 | 417 | require( 'views/layout/_search_webkit.html.php' ); |
405 | 418 | require( 'views/layout/_footmenu_default.html.php' ); |
— | — | @@ -425,6 +438,7 @@ |
426 | 439 | $disableButton = self::$messages['mobile-frontend-disable-button']; |
427 | 440 | $backButton = self::$messages['mobile-frontend-back-button']; |
428 | 441 | $disableImages = self::$messages['mobile-frontend-disable-images']; |
| 442 | + $enableImages = self::$messages['mobile-frontend-enable-images']; |
429 | 443 | $htmlTitle = $areYouSure; |
430 | 444 | $title = $areYouSure; |
431 | 445 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
— | — | @@ -659,6 +673,7 @@ |
660 | 674 | $homeButton = self::$messages['mobile-frontend-home-button']; |
661 | 675 | $randomButton = self::$messages['mobile-frontend-random-button']; |
662 | 676 | $disableImages = self::$messages['mobile-frontend-disable-images']; |
| 677 | + $enableImages = self::$messages['mobile-frontend-enable-images']; |
663 | 678 | |
664 | 679 | $title = htmlspecialchars( self::$title->getText() ); |
665 | 680 | $htmlTitle = htmlspecialchars( self::$htmlTitle ); |
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_footmenu_default.html.php |
— | — | @@ -1,10 +1,18 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +if ( self::$disableImages == 0 ) { |
| 5 | + $imagesToggle = $disableImages; |
| 6 | + $imagesURL = '?disableImages=1'; |
| 7 | +} else { |
| 8 | + $imagesToggle = $enableImages; |
| 9 | + $imagesURL = '?enableImages=1'; |
| 10 | +} |
| 11 | + |
4 | 12 | $footerHtml = <<<EOD |
5 | 13 | <div id='footer'> |
6 | 14 | <div class='nav' id='footmenu'> |
7 | 15 | <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> |
9 | 17 | <div id="perm"> |
10 | 18 | <a href="?mAction=disable_mobile_site">{$permStopRedirect}</a> |
11 | 19 | </div> |