r94668 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94667‎ | r94668 | r94669 >
Date:17:51, 16 August 2011
Author:preilly
Status:ok
Tags:
Comment:
fix for r94564
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/information/optin.html.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/information/optout.html.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/_footmenu_default.html.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -49,7 +49,7 @@
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
5252 class ExtMobileFrontend {
53 - const VERSION = '0.5.28';
 53+ const VERSION = '0.5.29';
5454
5555 /**
5656 * @var DOMDocument
@@ -119,7 +119,7 @@
120120 public function addMobileFooter( &$obj, &$tpl ) {
121121 global $wgRequest;
122122 $footerlinks = $tpl->data['footerlinks'];
123 - $mobileViewUrl = $wgRequest->escapeAppendQuery( 'useFormat=mobile' );
 123+ $mobileViewUrl = $wgRequest->escapeAppendQuery( 'useformat=mobile' );
124124
125125 $tpl->set('mobileview', "<a href='{$mobileViewUrl}'>".wfMsg( 'mobile-frontend-view')."</a>");
126126 $footerlinks['places'][] = 'mobileview';
@@ -219,7 +219,7 @@
220220 // Thus, globalized objects will not be available as expected in the function.
221221 // This is stated to be intended behavior, as per the following: [http://bugs.php.net/bug.php?id=40104]
222222
223 - $mAction = $wgRequest->getText( 'mAction' );
 223+ $mobileAction = $wgRequest->getText( 'mobileaction' );
224224 $action = $wgRequest->getText( 'action' );
225225 self::$disableImages = $wgRequest->getText( 'disableImages', 0 );
226226 self::$enableImages = $wgRequest->getText( 'enableImages', 0 );
@@ -243,7 +243,7 @@
244244 }
245245
246246
247 - self::$useFormat = $wgRequest->getText( 'useFormat' );
 247+ self::$useFormat = $wgRequest->getText( 'useformat' );
248248 self::$format = $wgRequest->getText( 'format' );
249249 self::$requestedSegment = $wgRequest->getText( 'seg', 0 );
250250 self::$search = $wgRequest->getText( 'search' );
@@ -264,51 +264,38 @@
265265 $this->contentFormat = 'WML';
266266 }
267267
268 - if ( $mAction == 'disable_mobile_site' ) {
 268+ if ( $mobileAction == 'disable_mobile_site' ) {
269269 if ( $this->contentFormat == 'XHTML' ) {
270270 echo $this->renderDisableMobileSiteXHTML();
271271 exit();
272272 }
273273 }
274274
275 - if ( $mAction == 'opt_in_mobile_site' ) {
 275+ if ( $mobileAction == 'opt_in_mobile_site' ) {
276276 if ( $this->contentFormat == 'XHTML' ) {
277277 echo $this->renderOptInMobileSiteXHTML();
278278 exit();
279279 }
280280 }
281281
282 - if ( $mAction == 'opt_out_mobile_site' ) {
 282+ if ( $mobileAction == 'opt_out_mobile_site' ) {
283283 if ( $this->contentFormat == 'XHTML' ) {
284284 echo $this->renderOptOutMobileSiteXHTML();
285285 exit();
286286 }
287287 }
288288
289 - if ( $mAction == 'opt_in_cookie' ) {
 289+ if ( $mobileAction == 'opt_in_cookie' ) {
290290 $this->setOptInOutCookie( '1' );
291291 $this->disableCaching();
292292 $location = Title::newMainPage()->getFullURL();
293293 header( 'Location: ' . $location );
294294 }
295295
296 - if ( $mAction == 'opt_out_cookie' ) {
 296+ if ( $mobileAction == 'opt_out_cookie' ) {
297297 $this->setOptInOutCookie( '' );
298298 }
299299
300 - // Note: Temporarily disabling this section for trial deployment
301 - // if ( is_array($props) &&
302 - // $mAction != 'view_normal_site' &&
303 - // $props['is_wireless_device'] === 'true' &&
304 - // $props['is_tablet'] === 'false' ) {
305 - // $this->disableCaching();
306 - // ob_start( array( $this, 'DOMParse' ) );
307 - // } elseif (self::$useFormat === 'mobile' ||
308 - // self::$useFormat === 'mobile-wap' ) {
309 - // $this->disableCaching();
310 - // ob_start( array( $this, 'DOMParse' ) );
311 - // }
312 -
313300 // WURFL documentation: http://wurfl.sourceforge.net/help_doc.php
314301 // Determine the kind of markup
315302 if( is_array( $props ) && $props['preferred_markup'] ) {
@@ -338,7 +325,7 @@
339326 self::$useFormat === 'mobile-wap' ||
340327 !empty( $xDevice ) ) {
341328 if ( $action !== 'edit' &&
342 - $mAction !== 'view_normal_site' ) {
 329+ $mobileAction !== 'view_normal_site' ) {
343330 $this->getMsg();
344331 $this->disableCaching();
345332 $this->sendXDeviceVaryHeader();
@@ -558,7 +545,7 @@
559546 $segmentsCount = count($segments);
560547 $card .= "<p>" . $idx . "/" . $segmentsCount . "</p>";
561548
562 - $useFormatParam = ( isset( self::$useFormat ) ) ? '&' . 'useFormat=' . self::$useFormat : '';
 549+ $useFormatParam = ( isset( self::$useFormat ) ) ? '&' . 'useformat=' . self::$useFormat : '';
563550
564551 $basePage = htmlspecialchars( $_SERVER['PHP_SELF'] );
565552
Index: trunk/extensions/MobileFrontend/views/information/optin.html.php
@@ -8,7 +8,7 @@
99 </p>
1010 <div id='disableButtons'>
1111 <form action='/' method='get'>
12 - <input name='mAction' type='hidden' value='opt_in_cookie' />
 12+ <input name='mobileaction' type='hidden' value='opt_in_cookie' />
1313 <button id='disableButton' type='submit'>{$yesButton}</button>
1414 </form>
1515 <form action='/' method='get'>
Index: trunk/extensions/MobileFrontend/views/information/optout.html.php
@@ -8,7 +8,7 @@
99 </p>
1010 <div id='disableButtons'>
1111 <form action='/' method='get'>
12 - <input name='mAction' type='hidden' value='opt_out_cookie' />
 12+ <input name='mobileaction' type='hidden' value='opt_out_cookie' />
1313 <button id='disableButton' type='submit'>{$yesButton}</button>
1414 </form>
1515 <form action='/' method='get'>
Index: trunk/extensions/MobileFrontend/views/layout/_footmenu_default.html.php
@@ -12,9 +12,9 @@
1313 <div id='footer'>
1414 <div class='nav' id='footmenu'>
1515 <div class='mwm-notice'>
16 - <a href="?mAction=view_normal_site">{$regularSite}</a> | <a href="{$imagesURL}">{$imagesToggle}</a>
 16+ <a href="?mobileaction=view_normal_site">{$regularSite}</a> | <a href="{$imagesURL}">{$imagesToggle}</a>
1717 <div id="perm">
18 - <a href="?mAction=disable_mobile_site">{$permStopRedirect}</a>
 18+ <a href="?mobileaction=disable_mobile_site">{$permStopRedirect}</a>
1919 </div>
2020 </div>
2121 </div>

Follow-up revisions

RevisionCommit summaryAuthorDate
r94669mft r94668preilly17:53, 16 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94564add support to render the main page content in a sane waypreilly20:53, 15 August 2011

Status & tagging log