r94707 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94706‎ | r94707 | r94708 >
Date:23:22, 16 August 2011
Author:preilly
Status:ok
Tags:
Comment:
push variable assignment into templates
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/_footmenu_default.html.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/application.html.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/application.wml.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.30';
 53+ const VERSION = '0.5.31';
5454
5555 /**
5656 * @var DOMDocument
@@ -378,21 +378,11 @@
379379 private function renderOptInMobileSiteXHTML() {
380380 if ( $this->contentFormat == 'XHTML' ) {
381381 $this->getMsg();
382 - $dir = self::$dir;
383 - $code = self::$code;
384 - $regularSite = self::$messages['mobile-frontend-regular-site'];
385 - $permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect'];
386 - $copyright = self::$messages['mobile-frontend-copyright'];
387 - $homeButton = self::$messages['mobile-frontend-home-button'];
388 - $randomButton = self::$messages['mobile-frontend-random-button'];
389382 $yesButton = self::$messages['mobile-frontend-opt-in-yes-button'];
390383 $noButton = self::$messages['mobile-frontend-opt-in-no-button'];
391384 $htmlTitle = self::$messages['mobile-frontend-opt-in-title'];
392385 $explainOptIn = self::$messages['mobile-frontend-opt-in-explain'];
393 - $disableImages = self::$messages['mobile-frontend-disable-images'];
394 - $enableImages = self::$messages['mobile-frontend-enable-images'];
395386 $optInMessage = self::$messages['mobile-frontend-opt-in-message'];
396 - $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
397387 require( 'views/layout/_search_webkit.html.php' );
398388 require( 'views/layout/_footmenu_default.html.php' );
399389 require( 'views/information/optin.html.php' );
@@ -406,21 +396,11 @@
407397 private function renderOptOutMobileSiteXHTML() {
408398 if ( $this->contentFormat == 'XHTML' ) {
409399 $this->getMsg();
410 - $dir = self::$dir;
411 - $code = self::$code;
412 - $regularSite = self::$messages['mobile-frontend-regular-site'];
413 - $permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect'];
414 - $copyright = self::$messages['mobile-frontend-copyright'];
415 - $homeButton = self::$messages['mobile-frontend-home-button'];
416 - $randomButton = self::$messages['mobile-frontend-random-button'];
417400 $yesButton = self::$messages['mobile-frontend-opt-out-yes-button'];
418401 $noButton = self::$messages['mobile-frontend-opt-out-no-button'];
419402 $htmlTitle = self::$messages['mobile-frontend-opt-out-title'];
420403 $explainOptOut = self::$messages['mobile-frontend-opt-out-explain'];
421404 $optOutMessage = self::$messages['mobile-frontend-opt-out-message'];
422 - $disableImages = self::$messages['mobile-frontend-disable-images'];
423 - $enableImages = self::$messages['mobile-frontend-enable-images'];
424 - $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
425405 require( 'views/layout/_search_webkit.html.php' );
426406 require( 'views/layout/_footmenu_default.html.php' );
427407 require( 'views/information/optout.html.php' );
@@ -434,22 +414,12 @@
435415 private function renderDisableMobileSiteXHTML() {
436416 if ( $this->contentFormat == 'XHTML' ) {
437417 $this->getMsg();
438 - $dir = self::$dir;
439 - $code = self::$code;
440 - $regularSite = self::$messages['mobile-frontend-regular-site'];
441 - $permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect'];
442 - $copyright = self::$messages['mobile-frontend-copyright'];
443 - $homeButton = self::$messages['mobile-frontend-home-button'];
444 - $randomButton = self::$messages['mobile-frontend-random-button'];
445418 $areYouSure = self::$messages['mobile-frontend-are-you-sure'];
446419 $explainDisable = self::$messages['mobile-frontend-explain-disable'];
447420 $disableButton = self::$messages['mobile-frontend-disable-button'];
448421 $backButton = self::$messages['mobile-frontend-back-button'];
449 - $disableImages = self::$messages['mobile-frontend-disable-images'];
450 - $enableImages = self::$messages['mobile-frontend-enable-images'];
451422 $htmlTitle = $areYouSure;
452423 $title = $areYouSure;
453 - $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
454424 require( 'views/layout/_search_webkit.html.php' );
455425 require( 'views/layout/_footmenu_default.html.php' );
456426 require( 'views/information/disable.html.php' );
@@ -712,21 +682,9 @@
713683 $contentHtml = $this->DOMParseMainPage( $contentHtml );
714684 }
715685
716 - $dir = self::$dir;
717 - $code = self::$code;
718 - $regularSite = self::$messages['mobile-frontend-regular-site'];
719 - $permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect'];
720 - $copyright = self::$messages['mobile-frontend-copyright'];
721 - $homeButton = self::$messages['mobile-frontend-home-button'];
722 - $randomButton = self::$messages['mobile-frontend-random-button'];
723 - $disableImages = self::$messages['mobile-frontend-disable-images'];
724 - $enableImages = self::$messages['mobile-frontend-enable-images'];
725 -
726686 $title = htmlspecialchars( self::$title->getText() );
727687 $htmlTitle = htmlspecialchars( self::$htmlTitle );
728688
729 - $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
730 -
731689 if ( strlen( $contentHtml ) > 4000 && $this->contentFormat == 'XHTML'
732690 && self::$device['supports_javascript'] === true
733691 && empty( self::$search ) ) {
Index: trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php
@@ -5,6 +5,8 @@
66
77 $mainPageUrl = self::$mainPageUrl;
88 $randomPageUrl = self::$randomPageUrl;
 9+$homeButton = self::$messages['mobile-frontend-home-button'];
 10+$randomButton = self::$messages['mobile-frontend-random-button'];
911
1012 $scriptUrl = wfScript();
1113
Index: trunk/extensions/MobileFrontend/views/layout/application.wml.php
@@ -1,6 +1,8 @@
22 <?php
33 $mainPageUrl = self::$mainPageUrl;
44 $randomPageUrl = self::$randomPageUrl;
 5+$dir = self::$dir;
 6+$code = self::$code;
57
68 $applicationHtml = <<<EOT
79 <?xml version='1.0' encoding='utf-8' ?>
Index: trunk/extensions/MobileFrontend/views/layout/_footmenu_default.html.php
@@ -1,5 +1,11 @@
22 <?php
33
 4+$regularSite = self::$messages['mobile-frontend-regular-site'];
 5+$permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect'];
 6+$copyright = self::$messages['mobile-frontend-copyright'];
 7+$disableImages = self::$messages['mobile-frontend-disable-images'];
 8+$enableImages = self::$messages['mobile-frontend-enable-images'];
 9+
410 if ( self::$disableImages == 0 ) {
511 $imagesToggle = $disableImages;
612 $imagesURL = '?disableImages=1';
Index: trunk/extensions/MobileFrontend/views/layout/application.html.php
@@ -1,12 +1,17 @@
22 <?php
33 global $wgExtensionAssetsPath, $wgAppleTouchIcon;
44
 5+$dir = self::$dir;
 6+$code = self::$code;
 7+
58 if( $wgAppleTouchIcon !== false ) {
69 $appleTouchIconTag = Html::element( 'link', array( 'rel' => 'apple-touch-icon', 'href' => $wgAppleTouchIcon ) );
710 } else {
811 $appleTouchIconTag = "";
912 }
1013
 14+$cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
 15+
1116 $applicationHtml = <<<EOT
1217 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1318 <html lang='{$code}' dir='{$dir}' xml:lang='{$code}' xmlns='http://www.w3.org/1999/xhtml'>

Follow-up revisions

RevisionCommit summaryAuthorDate
r94708mft r94707preilly23:24, 16 August 2011

Status & tagging log