r108700 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108699‎ | r108700 | r108701 >
Date:00:08, 12 January 2012
Author:preilly
Status:ok
Tags:
Comment:
spacing fixes
Modified paths:
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -50,7 +50,7 @@
5151 self::$forceClickToViewImages = $wgRequest->getFuzzyBool( 'forceClickToViewImages' );
5252 self::$acceptBilling = $wgRequest->getVal( 'acceptbilling' );
5353 self::$title = $out->getTitle();
54 -
 54+
5555 $carrier = $wgRequest->getHeader( 'HTTP_X_CARRIER' );
5656 if ( $carrier !== '(null)' && $carrier ) {
5757 self::$renderZeroRatedBanner = true;
@@ -86,10 +86,7 @@
8787 array( 'id' => 'zero-rated-banner-text' ),
8888 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges', $acceptBillingYes, $acceptBillingNo ) );
8989 $banner = Html::rawElement( 'div',
90 - array( 'style' => 'display:none;',
91 - 'id' => 'zero-rated-banner-red' ),
92 - $bannerText
93 - );
 90+ array( 'style' => 'display:none;', 'id' => 'zero-rated-banner-red' ), $bannerText );
9491 $output .= $banner;
9592 $out->clearHTML();
9693 $out->setPageTitle( null );
@@ -106,10 +103,7 @@
107104 array( 'id' => 'zero-rated-banner-text' ),
108105 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges', $acceptBillingYes, $acceptBillingNo ) );
109106 $banner = Html::rawElement( 'div',
110 - array( 'style' => 'display:none;',
111 - 'id' => 'zero-rated-banner-red' ),
112 - $bannerText
113 - );
 107+ array( 'style' => 'display:none;', 'id' => 'zero-rated-banner-red' ), $bannerText );
114108 $output .= $banner;
115109 $out->clearHTML();
116110 $out->setPageTitle( null );
@@ -125,10 +119,7 @@
126120 array( 'id' => 'zero-rated-banner-text' ),
127121 wfMsg( 'zero-rated-mobile-access-banner-text', $carrierLink ) );
128122 $banner = Html::rawElement( 'div',
129 - array( 'style' => 'display:none;',
130 - 'id' => 'zero-rated-banner' ),
131 - $bannerText
132 - );
 123+ array( 'style' => 'display:none;', 'id' => 'zero-rated-banner' ), $bannerText );
133124 $output .= $banner;
134125 }
135126 }
@@ -147,9 +138,9 @@
148139 'FRANCE' => '90.6.70.28',
149140 );
150141 $ip = ( strpos( $ip, '192.168.' ) === 0 ) ? $countryIps['THAILAND'] : $ip;
151 - if ( IP::isValid( $ip ) ) {
152 - // If no country was passed, try to do GeoIP lookup
153 - // Requires php5-geoip package
 142+ if ( IP::isValid( $ip ) ) {
 143+ // If no country was passed, try to do GeoIP lookup
 144+ // Requires php5-geoip package
154145 if ( !$country && function_exists( 'geoip_country_code_by_name' ) ) {
155146 $country = geoip_country_code_by_name( $ip );
156147 }
@@ -159,7 +150,6 @@
160151 //self::$displayDebugOutput = true;
161152 $languagesForCountry = ( isset( $languageOptions[self::getFullCountryNameFromCode( $country )] ) ) ?
162153 $languageOptions[self::getFullCountryNameFromCode( $country )] : null;
163 - //self::addDebugOutput( $languageOptions );
164154 self::addDebugOutput( self::getFullCountryNameFromCode( $country ) );
165155 self::addDebugOutput( $languagesForCountry );
166156 self::writeDebugOutput();
@@ -170,10 +160,7 @@
171161 $languageName = $languageNames[$languagesForCountry[$i]['language']];
172162 $languageCode = $languagesForCountry[$i]['language'];
173163 $output .= Html::element( 'hr' );
174 - $output .= Html::element( 'h3',
175 - array( 'id' => 'lang_' . $languageCode ),
176 - $languageName
177 - );
 164+ $output .= Html::element( 'h3', array( 'id' => 'lang_' . $languageCode ), $languageName );
178165 if ( $i == 0 ) {
179166 $output .= self::getSearchFormHtml( $languageCode );
180167 } else {
@@ -323,7 +310,7 @@
324311
325312 /**
326313 * Writes objects from the debugOutput Array to buffer
327 - *
 314+ *
328315 * @return bool
329316 */
330317 private static function writeDebugOutput() {
@@ -347,7 +334,7 @@
348335 private static function createCarrierOptionsFromWikiText() {
349336 global $wgMemc;
350337 wfProfileIn( __METHOD__ );
351 -
 338+
352339 $carrierOptionsWikiPage = wfMsgForContent( 'zero-rated-mobile-access-carrier-options-wiki-page' );
353340
354341 list( $revId, $rev ) = self::getOptionsFromForeignWiki( $carrierOptionsWikiPage );
@@ -406,7 +393,7 @@
407394 $rev = null;
408395
409396 if ( $pageName ) {
410 -
 397+
411398 $memcKey = wfMemcKey( 'zero-rated-mobile-access-foreign-options-', md5( $pageName ) );
412399 $foreignOptions = $wgMemc->get( $memcKey );
413400
@@ -455,7 +442,7 @@
456443
457444 /**
458445 * Returns the language options array parsed from a valid wiki page
459 - *
 446+ *
460447 * @return Array
461448 */
462449 private static function createLanguageOptionsFromWikiText() {
@@ -487,12 +474,12 @@
488475 $languageOptions[$countryName] = '';
489476 } elseif ( strpos( $line, '**' ) === 0 && $i > 0 ) {
490477 $lineParts = explode('#', $line);
491 - $language = ( isset( $lineParts[0] ) ) ?
 478+ $language = ( isset( $lineParts[0] ) ) ?
492479 trim( str_replace( '** ', '', $lineParts[0] ) ) :
493480 trim( str_replace( '** ', '', $line ) ) ;
494481 if ( $language !== 'portal' && $language !== 'other' ) {
495482 $languageOptions[$countryName][] = ( isset( $lineParts[1] ) ) ?
496 - array( 'language' => $language,
 483+ array( 'language' => $language,
497484 'percentage' => intval( str_replace( '%', '', trim( $lineParts[1] ) ) ) ) :
498485 $language;
499486 }
@@ -507,7 +494,7 @@
508495
509496 /**
510497 * Returns the Unix timestamp of current day's first second
511 - *
 498+ *
512499 * @return int: Timestamp
513500 */
514501 private static function todaysStart() {
@@ -530,7 +517,7 @@
531518
532519 /**
533520 * Returns the number of seconds an item should stay in cache
534 - *
 521+ *
535522 * @return int: Time in seconds
536523 */
537524 private static function getMaxAge() {
@@ -543,7 +530,7 @@
544531
545532 /**
546533 * Get full country name from code
547 - *
 534+ *
548535 * @param string $code: alpha-2 code ISO 3166 country code
549536 * @return String
550537 */
@@ -797,7 +784,7 @@
798785
799786 /**
800787 * Search form for various languages
801 - *
 788+ *
802789 * @param string $langCode: alpha-2 code for language
803790 * @return String
804791 */
@@ -810,7 +797,7 @@
811798 <div id="sq" class="divclearable">
812799 <input type="text" name="search" id="search" size="22" value="" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024">
813800 <div class="clearlink" id="clearsearch" title="Clear"></div>
814 - </div>
 801+ </div>
815802 <button id="goButton" type="submit">{$searchValue}</button>
816803 </form>
817804 HTML;

Status & tagging log