r94396 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94395‎ | r94396 | r94397 >
Date:23:16, 12 August 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r94394
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.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.21';
 53+ const VERSION = '0.5.22';
5454
5555 /**
5656 * @var DOMDocument
@@ -131,29 +131,31 @@
132132 $copyright = $skin->getCopyright();
133133 // Need to stash the results of the "wfMsg" call before the Output Buffering handler
134134 // because at this point the database connection is shut down, etc.
135 - self::$messages['mobile-frontend-show'] = wfMsg( 'mobile-frontend-show-button' );
136 - self::$messages['mobile-frontend-hide'] = wfMsg( 'mobile-frontend-hide-button' );
137 - self::$messages['mobile-frontend-back-to-top'] = wfMsg( 'mobile-frontend-back-to-top-of-section' );
138 - self::$messages['mobile-frontend-regular-site'] = wfMsg( 'mobile-frontend-regular-site' );
139 - self::$messages['mobile-frontend-perm-stop-redirect'] = wfMsg( 'mobile-frontend-perm-stop-redirect' );
140 - self::$messages['mobile-frontend-copyright'] = $copyright;
141 - self::$messages['mobile-frontend-home-button'] = wfMsg( 'mobile-frontend-home-button' );
142 - self::$messages['mobile-frontend-random-button'] = wfMsg( 'mobile-frontend-random-button' );
143 - self::$messages['mobile-frontend-are-you-sure'] = wfMsg( 'mobile-frontend-are-you-sure' );
144 - self::$messages['mobile-frontend-explain-disable'] = wfMsg( 'mobile-frontend-explain-disable' );
145 - self::$messages['mobile-frontend-disable-button'] = wfMsg( 'mobile-frontend-disable-button' );
146 - self::$messages['mobile-frontend-back-button'] = wfMsg( 'mobile-frontend-back-button' );
147 - self::$messages['mobile-frontend-opt-in-message'] = wfMsg( 'mobile-frontend-opt-in-message' );
148 - self::$messages['mobile-frontend-opt-in-yes-button'] = wfMsg( 'mobile-frontend-opt-in-yes-button' );
149 - self::$messages['mobile-frontend-opt-in-no-button'] = wfMsg( 'mobile-frontend-opt-in-no-button' );
150 - self::$messages['mobile-frontend-opt-in-title'] = wfMsg( 'mobile-frontend-opt-in-title' );
151 - self::$messages['mobile-frontend-opt-out-message'] = wfMsg( 'mobile-frontend-opt-out-message' );
152 - self::$messages['mobile-frontend-opt-out-yes-button'] = wfMsg( 'mobile-frontend-opt-out-yes-button' );
153 - self::$messages['mobile-frontend-opt-out-no-button'] = wfMsg( 'mobile-frontend-opt-out-no-button' );
154 - self::$messages['mobile-frontend-opt-out-title'] = wfMsg( 'mobile-frontend-opt-out-title' );
155 - self::$messages['mobile-frontend-opt-in-explain'] = wfMsg( 'mobile-frontend-opt-in-explain' );
156 - self::$messages['mobile-frontend-opt-out-explain'] = wfMsg( 'mobile-frontend-opt-out-explain' );
157 - self::$messages['mobile-frontend-disable-images'] = wfMsg( 'mobile-frontend-disable-images' );
 135+ self::$messages['mobile-frontend-show'] = wfMsg( 'mobile-frontend-show-button' );
 136+ self::$messages['mobile-frontend-hide'] = wfMsg( 'mobile-frontend-hide-button' );
 137+ self::$messages['mobile-frontend-back-to-top'] = wfMsg( 'mobile-frontend-back-to-top-of-section' );
 138+ self::$messages['mobile-frontend-regular-site'] = wfMsg( 'mobile-frontend-regular-site' );
 139+ self::$messages['mobile-frontend-perm-stop-redirect'] = wfMsg( 'mobile-frontend-perm-stop-redirect' );
 140+ self::$messages['mobile-frontend-copyright'] = $copyright;
 141+ self::$messages['mobile-frontend-home-button'] = wfMsg( 'mobile-frontend-home-button' );
 142+ self::$messages['mobile-frontend-random-button'] = wfMsg( 'mobile-frontend-random-button' );
 143+ self::$messages['mobile-frontend-are-you-sure'] = wfMsg( 'mobile-frontend-are-you-sure' );
 144+ self::$messages['mobile-frontend-explain-disable'] = wfMsg( 'mobile-frontend-explain-disable' );
 145+ self::$messages['mobile-frontend-disable-button'] = wfMsg( 'mobile-frontend-disable-button' );
 146+ self::$messages['mobile-frontend-back-button'] = wfMsg( 'mobile-frontend-back-button' );
 147+ self::$messages['mobile-frontend-opt-in-message'] = wfMsg( 'mobile-frontend-opt-in-message' );
 148+ self::$messages['mobile-frontend-opt-in-yes-button'] = wfMsg( 'mobile-frontend-opt-in-yes-button' );
 149+ self::$messages['mobile-frontend-opt-in-no-button'] = wfMsg( 'mobile-frontend-opt-in-no-button' );
 150+ self::$messages['mobile-frontend-opt-in-title'] = wfMsg( 'mobile-frontend-opt-in-title' );
 151+ self::$messages['mobile-frontend-opt-out-message'] = wfMsg( 'mobile-frontend-opt-out-message' );
 152+ self::$messages['mobile-frontend-opt-out-yes-button'] = wfMsg( 'mobile-frontend-opt-out-yes-button' );
 153+ self::$messages['mobile-frontend-opt-out-no-button'] = wfMsg( 'mobile-frontend-opt-out-no-button' );
 154+ self::$messages['mobile-frontend-opt-out-title'] = wfMsg( 'mobile-frontend-opt-out-title' );
 155+ self::$messages['mobile-frontend-opt-in-explain'] = wfMsg( 'mobile-frontend-opt-in-explain' );
 156+ self::$messages['mobile-frontend-opt-out-explain'] = wfMsg( 'mobile-frontend-opt-out-explain' );
 157+ self::$messages['mobile-frontend-disable-images'] = wfMsg( 'mobile-frontend-disable-images' );
 158+ self::$messages['mobile-frontend-wml-continue'] = wfMsg( 'mobile-frontend-wml-continue' );
 159+ self::$messages['mobile-frontend-wml-back'] = wfMsg( 'mobile-frontend-wml-back' );
158160
159161 self::$dir = $wgContLang->getDir();
160162 self::$code = $wgContLang->getCode();
@@ -265,6 +267,7 @@
266268
267269 if ( $mAction == 'opt_in_cookie' ) {
268270 $this->setOptInOutCookie( '1' );
 271+ $this->disableCaching();
269272 $location = Title::newMainPage()->getFullURL();
270273 header( 'Location: ' . $location );
271274 }
@@ -438,10 +441,10 @@
439442 private function headingTransformCallbackWML( $matches ) {
440443 static $headings = 0;
441444 ++$headings;
 445+
 446+ $base = $this->WMLSectionSeperator .
 447+ "<h2 class='section_heading' id='section_{$headings}'>{$matches[2]}</h2>";
442448
443 - $base = $this->WMLSectionSeperator .
444 - "<h2 class='section_heading' id='section_{$headings}'>{$matches[2]}</h2>";
445 -
446449 self::$headings = $headings;
447450
448451 return $base;
@@ -526,12 +529,12 @@
527530 $basePage = htmlspecialchars( $_SERVER['PHP_SELF'] );
528531
529532 if ( $idx < $segmentsCount ) {
530 - $card .= "<p><a href=\"{$basePage}?seg={$idx}{$useFormatParam}\">" . wfMsg( 'mobile-frontend-wml-continue' ) . "</a></p>";
 533+ $card .= "<p><a href=\"{$basePage}?seg={$idx}{$useFormatParam}\">" . self::$messages['mobile-frontend-wml-continue'] . "</a></p>";
531534 }
532535
533536 if ( $idx > 1 ) {
534537 $back_idx = $requestedSegment - 1;
535 - $card .= "<p><a href=\"{$basePage}?seg={$back_idx}{$useFormatParam}\">" . wfMsg( 'mobile-frontend-wml-back' ) . "</a></p>";
 538+ $card .= "<p><a href=\"{$basePage}?seg={$back_idx}{$useFormatParam}\">" . self::$messages['mobile-frontend-wml-back'] . "</a></p>";
536539 }
537540
538541 $card .= '</card>';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94394fix WML view (back|continue) links were using wfMsg which is not available in...preilly23:14, 12 August 2011

Status & tagging log