r108834 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108833‎ | r108834 | r108835 >
Date:20:00, 13 January 2012
Author:preilly
Status:ok
Tags:
Comment:
1.18wmf1: MFT r108589 - 108831
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.i18n.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccessTemplate.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class ExtZeroRatedMobileAccess {
5 - const VERSION = '0.0.7';
 5+ const VERSION = '0.0.8';
66
77 public static $renderZeroRatedLandingPage;
88 public static $renderZeroRatedBanner;
@@ -24,10 +24,13 @@
2525 * @return bool
2626 */
2727 public function beforePageDisplayHTML( &$out, &$text ) {
28 - global $wgRequest, $wgConf, $wgDBname, $wgEnableZeroRatedMobileAccessTesting;
 28+ global $wgRequest, $wgConf, $wgEnableZeroRatedMobileAccessTesting;
2929 wfProfileIn( __METHOD__ );
3030
31 - list( $site, $lang ) = $wgConf->siteFromDB( $wgDBname );
 31+ $DB = wfGetDB( DB_MASTER );
 32+ $DBName = $DB->getDBname();
 33+
 34+ list( $site, $lang ) = $wgConf->siteFromDB( $DBName );
3235 if ( $site == 'wikipedia' || $wgEnableZeroRatedMobileAccessTesting ) {
3336
3437 $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ? $_SERVER['HTTP_X_DEVICE'] : '';
@@ -39,8 +42,7 @@
4043 return true;
4144 }
4245
43 - $output = Html::openElement( 'div',
44 - array( 'id' => 'zero-landing-page' ) );
 46+ $output = '';
4547
4648 self::$renderZeroRatedLandingPage = $wgRequest->getFuzzyBool( 'renderZeroRatedLandingPage' );
4749 self::$renderZeroRatedBanner = $wgRequest->getFuzzyBool( 'renderZeroRatedBanner' );
@@ -48,7 +50,7 @@
4951 self::$forceClickToViewImages = $wgRequest->getFuzzyBool( 'forceClickToViewImages' );
5052 self::$acceptBilling = $wgRequest->getVal( 'acceptbilling' );
5153 self::$title = $out->getTitle();
52 -
 54+
5355 $carrier = $wgRequest->getHeader( 'HTTP_X_CARRIER' );
5456 if ( $carrier !== '(null)' && $carrier ) {
5557 self::$renderZeroRatedBanner = true;
@@ -74,45 +76,38 @@
7577
7678 if ( self::$isFilePage && self::$acceptBilling !== 'yes' ) {
7779 $acceptBillingYes = Html::rawElement( 'a',
78 - array('href' => $wgRequest->appendQuery( 'renderZeroRatedBanner=true&acceptbilling=yes' ) ),
 80+ array( 'href' => $wgRequest->appendQuery( 'renderZeroRatedBanner=true&acceptbilling=yes' ) ),
7981 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-yes' ) );
8082 $referrer = $wgRequest->getHeader( 'referer' );
8183 $acceptBillingNo = Html::rawElement( 'a',
82 - array('href' => $wgRequest->appendQuery( 'acceptbilling=no&returnto=' . urlencode( $referrer ) ) ),
 84+ array( 'href' => $wgRequest->appendQuery( 'acceptbilling=no&returnto=' . urlencode( $referrer ) ) ),
8385 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-no' ) );
8486 $bannerText = Html::rawElement( 'h3',
8587 array( 'id' => 'zero-rated-banner-text' ),
8688 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges', $acceptBillingYes, $acceptBillingNo ) );
8789 $banner = Html::rawElement( 'div',
88 - array( 'style' => 'display:none;',
89 - 'id' => 'zero-rated-banner-red' ),
90 - $bannerText
91 - );
 90+ array( 'style' => 'display:none;', 'id' => 'zero-rated-banner-red' ), $bannerText );
9291 $output .= $banner;
9392 $out->clearHTML();
9493 $out->setPageTitle( null );
9594 } elseif ( self::$renderZeroRatedRedirect === true ) {
9695 $returnto = $wgRequest->getVal( 'returnto' );
9796 $acceptBillingYes = Html::rawElement( 'a',
98 - array('href' => $wgRequest->appendQuery( 'renderZeroRatedBanner=true&acceptbilling=yes&returnto=' . urlencode( $returnto ) ) ),
 97+ array( 'href' => $wgRequest->appendQuery( 'renderZeroRatedBanner=true&acceptbilling=yes&returnto=' . urlencode( $returnto ) ) ),
9998 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-yes' ) );
10099 $referrer = $wgRequest->getHeader( 'referer' );
101100 $acceptBillingNo = Html::rawElement( 'a',
102 - array('href' => $wgRequest->appendQuery( 'acceptbilling=no&returnto=' . urlencode( $referrer ) ) ),
 101+ array( 'href' => $wgRequest->appendQuery( 'acceptbilling=no&returnto=' . urlencode( $referrer ) ) ),
103102 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-no' ) );
104103 $bannerText = Html::rawElement( 'h3',
105104 array( 'id' => 'zero-rated-banner-text' ),
106105 wfMsg( 'zero-rated-mobile-access-banner-text-data-charges', $acceptBillingYes, $acceptBillingNo ) );
107106 $banner = Html::rawElement( 'div',
108 - array( 'style' => 'display:none;',
109 - 'id' => 'zero-rated-banner-red' ),
110 - $bannerText
111 - );
 107+ array( 'style' => 'display:none;', 'id' => 'zero-rated-banner-red' ), $bannerText );
112108 $output .= $banner;
113109 $out->clearHTML();
114110 $out->setPageTitle( null );
115111 } elseif ( self::$renderZeroRatedBanner === true ) {
116 - // a2enmod headers >>> .htaccess >>> RequestHeader set HTTP_CARRIER Verizon
117112 self::$carrier = $this->lookupCarrier( $carrier );
118113 if ( isset( self::$carrier['name'] ) ) {
119114 $html = $out->getHTML();
@@ -120,14 +115,11 @@
121116 $out->clearHTML();
122117 $out->addHTML( $parsedHtml );
123118 $carrierLink = ( isset( self::$carrier['link'] ) ) ? self::$carrier['link'] : '';
124 - $bannerText = Html::rawElement( 'h3',
 119+ $bannerText = Html::rawElement( 'span',
125120 array( 'id' => 'zero-rated-banner-text' ),
126121 wfMsg( 'zero-rated-mobile-access-banner-text', $carrierLink ) );
127122 $banner = Html::rawElement( 'div',
128 - array( 'style' => 'display:none;',
129 - 'id' => 'zero-rated-banner' ),
130 - $bannerText
131 - );
 123+ array( 'style' => 'display:none;', 'id' => 'zero-rated-banner' ), $bannerText );
132124 $output .= $banner;
133125 }
134126 }
@@ -146,19 +138,18 @@
147139 'FRANCE' => '90.6.70.28',
148140 );
149141 $ip = ( strpos( $ip, '192.168.' ) === 0 ) ? $countryIps['THAILAND'] : $ip;
150 - if ( IP::isValid( $ip ) ) {
151 - // If no country was passed, try to do GeoIP lookup
152 - // 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
153145 if ( !$country && function_exists( 'geoip_country_code_by_name' ) ) {
154146 $country = geoip_country_code_by_name( $ip );
155147 }
156148 self::addDebugOutput( $country );
157149 }
158150 $languageOptions = self::createLanguageOptionsFromWikiText();
159 - //self::$displayDebugOutput = true;
 151+ // self::$displayDebugOutput = true;
160152 $languagesForCountry = ( isset( $languageOptions[self::getFullCountryNameFromCode( $country )] ) ) ?
161153 $languageOptions[self::getFullCountryNameFromCode( $country )] : null;
162 - //self::addDebugOutput( $languageOptions );
163154 self::addDebugOutput( self::getFullCountryNameFromCode( $country ) );
164155 self::addDebugOutput( $languagesForCountry );
165156 self::writeDebugOutput();
@@ -169,10 +160,7 @@
170161 $languageName = $languageNames[$languagesForCountry[$i]['language']];
171162 $languageCode = $languagesForCountry[$i]['language'];
172163 $output .= Html::element( 'hr' );
173 - $output .= Html::element( 'h3',
174 - array( 'id' => 'lang_' . $languageCode ),
175 - $languageName
176 - );
 164+ $output .= Html::element( 'h3', array( 'id' => 'lang_' . $languageCode ), $languageName );
177165 if ( $i == 0 ) {
178166 $output .= self::getSearchFormHtml( $languageCode );
179167 } else {
@@ -207,8 +195,8 @@
208196 $output .= Html::closeElement( 'select' );
209197 }
210198
211 - $output .= Html::closeElement( 'div' );
212 - if ( $output != '<div id="zero-landing-page"></div>' ) {
 199+ if ( $output ) {
 200+ $output = Html::openElement( 'div', array( 'id' => 'zero-landing-page' ) ) . $output . Html::closeElement( 'div' );
213201 $out->addHTML( $output );
214202 }
215203 }
@@ -218,7 +206,7 @@
219207
220208 /**
221209 * Returns information about carrier
222 - *
 210+ *
223211 * @param String $carrier: Name of carrier e.g., "Verizon Wireless"
224212 * @return Array
225213 */
@@ -241,7 +229,7 @@
242230
243231 /**
244232 * Returns the Html of a page with the various links appended with zeropartner parameter
245 - *
 233+ *
246234 * @param String $html: Html of current page
247235 * @return String
248236 */
@@ -278,11 +266,9 @@
279267 foreach ( $zeroRatedLinks as $zeroRatedLink ) {
280268 $zeroRatedLinkHref = $zeroRatedLink->getAttribute( 'href' );
281269 if ( $zeroRatedLinkHref && substr( $zeroRatedLinkHref, 0, 1 ) !== '#' ) {
282 - $zeroPartnerUrl = $this->appendQueryString( $zeroRatedLinkHref,
283 - array( array( 'name' => 'zeropartner',
284 - 'value' => ( isset( self::$carrier['partnerId'] ) ) ? self::$carrier['partnerId'] : 0 ),
285 - array('name' => 'renderZeroRatedBanner',
286 - 'value' => 'true') ) );
 270+ $partnerId = isset( self::$carrier['partnerId'] ) ? self::$carrier['partnerId'] : 0;
 271+ $zeroPartnerUrl = wfAppendQuery( $zeroRatedLinkHref,
 272+ array( 'zeropartner' => $partnerId, 'renderZeroRatedBanner' => 'true' ) );
287273 if ( $zeroPartnerUrl ) {
288274 $zeroRatedLink->setAttribute( 'href', $zeroPartnerUrl );
289275 }
@@ -293,13 +279,11 @@
294280 foreach ( $zeroRatedExternalLinks as $zeroRatedExternalLink ) {
295281 $zeroRatedExternalLinkHref = $zeroRatedExternalLink->getAttribute( 'href' );
296282 if ( $zeroRatedExternalLinkHref && substr( $zeroRatedExternalLinkHref, 0, 1 ) !== '#' ) {
297 - $zeroPartnerUrl = $this->appendQueryString( $zeroRatedLinkHref,
298 - array( array( 'name' => 'zeropartner',
299 - 'value' => ( isset( self::$carrier['partnerId'] ) ) ? self::$carrier['partnerId'] : 0 ),
300 - array('name' => 'renderZeroRatedBanner',
301 - 'value' => 'true') ) );
 283+ $partnerId = isset( self::$carrier['partnerId'] ) ? self::$carrier['partnerId'] : 0;
 284+ $zeroPartnerUrl = wfAppendQuery( $zeroRatedLinkHref,
 285+ array( 'zeropartner' => $partnerId, 'renderZeroRatedBanner' => 'true' ) );
302286 if ( $zeroPartnerUrl ) {
303 - $zeroRatedExternalLink->setAttribute( 'href', '?renderZeroRatedRedirect=true&returnto=' . urlencode($zeroRatedExternalLinkHref) );
 287+ $zeroRatedExternalLink->setAttribute( 'href', '?renderZeroRatedRedirect=true&returnto=' . urlencode( $zeroRatedExternalLinkHref ) );
304288 }
305289 }
306290 }
@@ -310,58 +294,8 @@
311295 }
312296
313297 /**
314 - * Returns the url with querystring parameters appended
315 - *
316 - * @param String $url: valid url to append querystring
317 - * @param Array $queryStringParameters: array of parameters to add to querystring
318 - * @return String
319 - */
320 - private function appendQueryString( $url, $queryStringParameters ) {
321 - wfProfileIn( __METHOD__ );
322 - $parsedUrl = parse_url( $url );
323 - if ( isset( $parsedUrl['query'] ) ) {
324 - parse_str( $parsedUrl['query'], $queryString );
325 - foreach ( $queryStringParameters as $queryStringParameter ) {
326 - $queryString[$queryStringParameter['name']] = $queryStringParameter['value'];
327 - }
328 - $parsedUrl['query'] = http_build_query( $queryString );
329 - } else {
330 - $parsedUrl['query'] = '';
331 - foreach ( $queryStringParameters as $queryStringParameter ) {
332 - $parsedUrl['query'] .= "{$queryStringParameter['name']}={$queryStringParameter['value']}&";
333 - }
334 - if ( substr( $parsedUrl['query'], -1, 1 ) === '&' ) {
335 - $parsedUrl['query'] = substr( $parsedUrl['query'], 0, -1 );
336 - }
337 - }
338 - wfProfileOut( __METHOD__ );
339 - return $this->unParseUrl( $parsedUrl );
340 - }
341 -
342 - /**
343 - * Returns the full url
344 - *
345 - * @param Array $parsedUrl: the array returned from parse_url
346 - * @return String
347 - */
348 - private function unParseUrl( $parsedUrl ) {
349 - wfProfileIn( __METHOD__ );
350 - $scheme = isset( $parsedUrl['scheme'] ) ? $parsedUrl['scheme'] . '://' : '';
351 - $host = isset( $parsedUrl['host'] ) ? $parsedUrl['host'] : '';
352 - $port = isset( $parsedUrl['port'] ) ? ':' . $parsedUrl['port'] : '';
353 - $user = isset( $parsedUrl['user'] ) ? $parsedUrl['user'] : '';
354 - $pass = isset( $parsedUrl['pass'] ) ? ':' . $parsedUrl['pass'] : '';
355 - $pass = ( $user || $pass ) ? "$pass@" : '';
356 - $path = isset( $parsedUrl['path'] ) ? $parsedUrl['path'] : '';
357 - $query = isset( $parsedUrl['query'] ) ? '?' . $parsedUrl['query'] : '';
358 - $fragment = isset( $parsedUrl['fragment'] ) ? '#' . $parsedUrl['fragment'] : '';
359 - wfProfileOut( __METHOD__ );
360 - return "$scheme$user$pass$host$port$path$query$fragment";
361 - }
362 -
363 - /**
364298 * Adds object to debugOutput Array
365 - *
 299+ *
366300 * @param Object $object: any valid PHP object
367301 * @return bool
368302 */
@@ -376,14 +310,14 @@
377311
378312 /**
379313 * Writes objects from the debugOutput Array to buffer
380 - *
 314+ *
381315 * @return bool
382316 */
383317 private static function writeDebugOutput() {
384318 wfProfileIn( __METHOD__ );
385319 if ( self::$debugOutput && self::$displayDebugOutput === true ) {
386320 echo "<pre>";
387 - foreach( self::$debugOutput as $debugOutput ) {
 321+ foreach ( self::$debugOutput as $debugOutput ) {
388322 var_dump( $debugOutput );
389323 }
390324 echo "</pre>";
@@ -392,16 +326,21 @@
393327 return true;
394328 }
395329
 330+ /**
 331+ * Returns the carrier options array parsed from a valid wiki page
 332+ *
 333+ * @return Array
 334+ */
396335 private static function createCarrierOptionsFromWikiText() {
397336 global $wgMemc;
398337 wfProfileIn( __METHOD__ );
399 - $carrierOptionsWikiPage = wfMsg( 'zero-rated-mobile-access-carrier-options-wiki-page' );
400 - $title = Title::newFromText( $carrierOptionsWikiPage, NS_MEDIAWIKI );
401 - // Use the revision directly to prevent other hooks to be called
402 - $rev = Revision::newFromTitle( $title );
 338+
 339+ $carrierOptionsWikiPage = wfMsgForContent( 'zero-rated-mobile-access-carrier-options-wiki-page' );
 340+
 341+ list( $revId, $rev ) = self::getOptionsFromForeignWiki( $carrierOptionsWikiPage );
 342+
403343 if ( $rev ) {
404 - $sha1OfRev = $rev->getSize();
405 - $key = wfMemcKey( 'zero-rated-mobile-access-carrier-options', $sha1OfRev );
 344+ $key = wfMemcKey( 'zero-rated-mobile-access-carrier-options', $revId );
406345 $carrierOptions = $wgMemc->get( $key );
407346 } else {
408347 $carrierOptions = null;
@@ -411,7 +350,7 @@
412351 $carrierOptions = array();
413352 $lines = array();
414353 if ( $rev ) {
415 - $lines = explode( "\n", $rev->getRawText() );
 354+ $lines = explode( "\n", $rev );
416355 }
417356 if ( $lines && count( $lines ) > 0 ) {
418357 $sizeOfLines = sizeof( $lines );
@@ -426,7 +365,7 @@
427366 if ( $i % 3 === 1 ) {
428367 $carrierOptions[$carrierName]['url'] = trim( str_replace( '** ', '', $line ) );
429368 $carrierLink = Html::rawElement( 'a',
430 - array('href' => $carrierOptions[$carrierName]['url'] ),
 369+ array( 'href' => $carrierOptions[$carrierName]['url'] ),
431370 $carrierOptions[$carrierName]['name'] );
432371 $carrierOptions[$carrierName]['link'] = $carrierLink;
433372 } elseif ( $i % 3 === 2 ) {
@@ -442,20 +381,79 @@
443382 }
444383
445384 /**
446 - * Returns the language options array parsed from a valid Wiki page
447 - *
 385+ * Returns the foreign wiki options array from a valid wiki page
 386+ *
448387 * @return Array
449388 */
 389+ private static function getOptionsFromForeignWiki( $pageName ) {
 390+ global $wgMemc;
 391+ wfProfileIn( __METHOD__ );
 392+
 393+ $key = null;
 394+ $rev = null;
 395+
 396+ if ( $pageName ) {
 397+
 398+ $memcKey = wfMemcKey( 'zero-rated-mobile-access-foreign-options-', md5( $pageName ) );
 399+ $foreignOptions = $wgMemc->get( $memcKey );
 400+
 401+ if ( !$foreignOptions ) {
 402+ $options = array();
 403+ $options['method'] = 'GET';
 404+ $url = 'http://en.wikipedia.org/w/api.php?action=query&prop=revisions&&rvlimit=1&rvprop=content&format=json&titles=MediaWiki:' . $pageName;
 405+ $req = ( class_exists( 'MWHttpRequest' ) ) ? MWHttpRequest::factory( $url, $options ) : HttpRequest::factory( $url, $options );
 406+
 407+ $status = $req->execute();
 408+
 409+ if ( !$status->isOK() ) {
 410+ $error = $req->getContent();
 411+ wfProfileOut( __METHOD__ );
 412+ return array( $key, $rev );
 413+ }
 414+
 415+ $ret = $req->getContent();
 416+
 417+ $jsonData = FormatJson::decode( $ret, true );
 418+
 419+ if ( isset( $jsonData['query']['pages'] ) ) {
 420+ $key = key( $jsonData['query']['pages'] );
 421+ if ( !is_int( $key ) ) {
 422+ $key = null;
 423+ }
 424+
 425+ foreach ( $jsonData['query']['pages'] as $pages ) {
 426+ if ( isset( $pages['revisions'][0]['*'] ) ) {
 427+ $rev = $pages['revisions'][0]['*'];
 428+ }
 429+ }
 430+ }
 431+
 432+ if ( $key && $rev ) {
 433+ $wgMemc->set( $memcKey, array( $key, $rev ), self::getMaxAge() );
 434+ }
 435+ } else {
 436+ list ( $key, $rev ) = $foreignOptions;
 437+ }
 438+ }
 439+
 440+ wfProfileOut( __METHOD__ );
 441+ return array( $key, $rev );
 442+ }
 443+
 444+ /**
 445+ * Returns the language options array parsed from a valid wiki page
 446+ *
 447+ * @return Array
 448+ */
450449 private static function createLanguageOptionsFromWikiText() {
451450 global $wgMemc;
452451 wfProfileIn( __METHOD__ );
453452 $languageOptionsWikiPage = wfMsgForContent( 'zero-rated-mobile-access-language-options-wiki-page' );
454 - $title = Title::newFromText( $languageOptionsWikiPage, NS_MEDIAWIKI );
455 - // Use the revision directly to prevent other hooks to be called
456 - $rev = Revision::newFromTitle( $title );
 453+
 454+ list( $revId, $rev ) = self::getOptionsFromForeignWiki( $languageOptionsWikiPage );
 455+
457456 if ( $rev ) {
458 - $sha1OfRev = $rev->getSize();
459 - $key = wfMemcKey( 'zero-rated-mobile-access-language-options', $sha1OfRev );
 457+ $key = wfMemcKey( 'zero-rated-mobile-access-language-options', $revId );
460458 $languageOptions = $wgMemc->get( $key );
461459 } else {
462460 $languageOptions = null;
@@ -465,7 +463,7 @@
466464 $languageOptions = array();
467465 $lines = array();
468466 if ( $rev ) {
469 - $lines = explode( "\n", $rev->getRawText() );
 467+ $lines = explode( "\n", $rev );
470468 }
471469 if ( $lines && count( $lines ) > 0 ) {
472470 $sizeOfLines = sizeof( $lines );
@@ -475,13 +473,13 @@
476474 $countryName = strtoupper( str_replace( '* ', '', $line ) );
477475 $languageOptions[$countryName] = '';
478476 } elseif ( strpos( $line, '**' ) === 0 && $i > 0 ) {
479 - $lineParts = explode('#', $line);
480 - $language = ( isset( $lineParts[0] ) ) ?
 477+ $lineParts = explode( '#', $line );
 478+ $language = ( isset( $lineParts[0] ) ) ?
481479 trim( str_replace( '** ', '', $lineParts[0] ) ) :
482480 trim( str_replace( '** ', '', $line ) ) ;
483481 if ( $language !== 'portal' && $language !== 'other' ) {
484482 $languageOptions[$countryName][] = ( isset( $lineParts[1] ) ) ?
485 - array( 'language' => $language,
 483+ array( 'language' => $language,
486484 'percentage' => intval( str_replace( '%', '', trim( $lineParts[1] ) ) ) ) :
487485 $language;
488486 }
@@ -496,7 +494,7 @@
497495
498496 /**
499497 * Returns the Unix timestamp of current day's first second
500 - *
 498+ *
501499 * @return int: Timestamp
502500 */
503501 private static function todaysStart() {
@@ -519,7 +517,7 @@
520518
521519 /**
522520 * Returns the number of seconds an item should stay in cache
523 - *
 521+ *
524522 * @return int: Time in seconds
525523 */
526524 private static function getMaxAge() {
@@ -532,7 +530,7 @@
533531
534532 /**
535533 * Get full country name from code
536 - *
 534+ *
537535 * @param string $code: alpha-2 code ISO 3166 country code
538536 * @return String
539537 */
@@ -786,7 +784,7 @@
787785
788786 /**
789787 * Search form for various languages
790 - *
 788+ *
791789 * @param string $langCode: alpha-2 code for language
792790 * @return String
793791 */
@@ -799,7 +797,7 @@
800798 <div id="sq" class="divclearable">
801799 <input type="text" name="search" id="search" size="22" value="" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024">
802800 <div class="clearlink" id="clearsearch" title="Clear"></div>
803 - </div>
 801+ </div>
804802 <button id="goButton" type="submit">{$searchValue}</button>
805803 </form>
806804 HTML;
Index: branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccessTemplate.php
@@ -24,7 +24,7 @@
2525 * @param $options array
2626 */
2727 public function setByArray( $options ) {
28 - foreach ($options as $name => $value ) {
 28+ foreach ( $options as $name => $value ) {
2929 $this->set( $name, $value );
3030 }
3131 }
Index: branches/wmf/1.18wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.i18n.php
@@ -35,7 +35,6 @@
3636 $messages['qqq'] = array(
3737 'zero-rated-mobile-access-desc' => '{{desc}}',
3838 'zero-rated-mobile-access-search' => 'Text for search action on the search button',
39 - 'zero-rated-mobile-access-language-options-wiki-page' => 'The name of the wiki page in the MediaWiki namespace to store the country language data',
4039 'zero-rated-mobile-access-language-selection' => 'Text to show the user when they select a language option',
4140 'zero-rated-mobile-access-home-page-selection' => 'Name of language followed by text to show user in local link to Wikipedia',
4241 'zero-rated-mobile-access-home-page-selection-text' => 'Text to show user prior to selection of language option',
@@ -48,11 +47,135 @@
4948 'zero-rated-mobile-access-click-to-view-image' => 'Text for viewing an image link',
5049 );
5150
 51+/** German (Deutsch)
 52+ * @author Kghbln
 53+ */
 54+$messages['de'] = array(
 55+ 'zero-rated-mobile-access-desc' => 'Stellt Mobilfunkanbietern Funktionen bereit, mit denen diese kostenfreien Zugriff auf das Wiki ermöglichen können',
 56+ 'zero-rated-mobile-access-search' => 'Suche',
 57+ 'zero-rated-mobile-access-language-selection' => 'Alle Sprachen',
 58+ 'zero-rated-mobile-access-home-page-selection' => '$1 Startseite',
 59+ 'zero-rated-mobile-access-home-page-selection-text' => 'Oder besuche die Startseite in der folgenden Sprache:',
 60+ 'zero-rated-mobile-access-banner-text' => 'Kostenloser Zugriff auf Wikipedia über $1',
 61+ 'zero-rated-mobile-access-banner-text-data-charges' => 'Datenübertragungsgebühren können anwendbar sein: $1 oder $2',
 62+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Ja',
 63+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'Nein',
 64+ 'zero-rated-mobile-access-click-to-view-image' => 'Hier klicken, um das Bild von „$1“ zu sehen …',
 65+);
 66+
 67+/** German (formal address) (‪Deutsch (Sie-Form)‬)
 68+ * @author Kghbln
 69+ */
 70+$messages['de-formal'] = array(
 71+ 'zero-rated-mobile-access-home-page-selection-text' => 'Oder besuchen Sie die Startseite in der folgenden Sprache:',
 72+);
 73+
 74+/** Lower Sorbian (Dolnoserbski)
 75+ * @author Michawiki
 76+ */
 77+$messages['dsb'] = array(
 78+ 'zero-rated-mobile-access-desc' => 'Staja póbitowarjam mobilneje telefonije funkcije k dispoziciji, kótarež zmóžnjaju dermotny pśistup',
 79+ 'zero-rated-mobile-access-search' => 'Pytaś',
 80+ 'zero-rated-mobile-access-language-selection' => 'Wšykne rěcy',
 81+ 'zero-rated-mobile-access-home-page-selection' => '$1 startowy bok',
 82+ 'zero-rated-mobile-access-home-page-selection-text' => 'Abo źi k startowemu bokoju w slědujucej rěcy:',
 83+ 'zero-rated-mobile-access-banner-text' => 'Lichotna Wikipedija wót $1',
 84+ 'zero-rated-mobile-access-banner-text-data-charges' => 'Pśi pśenjasenju datow mógu se płaśonki wuběraś: $1 abo $2',
 85+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Jo',
 86+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'Ně',
 87+ 'zero-rated-mobile-access-click-to-view-image' => 'Klikni how, aby wobraz wót "$1" wiźeł...',
 88+);
 89+
 90+/** French (Français)
 91+ * @author Gomoko
 92+ */
 93+$messages['fr'] = array(
 94+ 'zero-rated-mobile-access-desc' => 'Fournit les fonctionnalités pour les fournisseurs de mobile qui proposent un accès libre',
 95+ 'zero-rated-mobile-access-search' => 'Rechercher',
 96+ 'zero-rated-mobile-access-language-selection' => 'Toutes les langues',
 97+ 'zero-rated-mobile-access-home-page-selection' => "page d'accueil $1",
 98+ 'zero-rated-mobile-access-home-page-selection-text' => "Ou allez à la page d'accueil dans la langue suivante:",
 99+ 'zero-rated-mobile-access-banner-text' => 'Wikipedia libre depuis $1',
 100+ 'zero-rated-mobile-access-banner-text-data-charges' => "Les frais de données peuvent s'appliquer de façon permanente: $1 ou $2",
 101+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Oui',
 102+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'Non',
 103+ 'zero-rated-mobile-access-click-to-view-image' => 'Cliquez pour voir l\'image de, "$1"...',
 104+);
 105+
 106+/** Upper Sorbian (Hornjoserbsce)
 107+ * @author Michawiki
 108+ */
 109+$messages['hsb'] = array(
 110+ 'zero-rated-mobile-access-desc' => 'Staja poskićowarjam mobilneho škričkowanja funkcije k dispoziciji, kotrež darmotny přistup zmóžnjeja',
 111+ 'zero-rated-mobile-access-search' => 'Pytać',
 112+ 'zero-rated-mobile-access-language-selection' => 'Wšě rěče',
 113+ 'zero-rated-mobile-access-home-page-selection' => '$1 startowa strona',
 114+ 'zero-rated-mobile-access-home-page-selection-text' => 'Abo wopytaj startowu stronu w slědowacej rěči:',
 115+ 'zero-rated-mobile-access-banner-text' => 'Swobodna Wikipedija wot $1',
 116+ 'zero-rated-mobile-access-banner-text-data-charges' => 'Při přenjesenju datow móža so popłatki zběrać: $1 abo $2',
 117+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Haj',
 118+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'Ně',
 119+ 'zero-rated-mobile-access-click-to-view-image' => 'Klikń tu, zo by wobraz wot "$1" widźał...',
 120+);
 121+
 122+/** Interlingua (Interlingua)
 123+ * @author McDutchie
 124+ */
 125+$messages['ia'] = array(
 126+ 'zero-rated-mobile-access-desc' => 'Provide functionalitate pro fornitores mobile que offere accesso libere',
 127+ 'zero-rated-mobile-access-search' => 'Cercar',
 128+ 'zero-rated-mobile-access-language-selection' => 'Tote le linguas',
 129+ 'zero-rated-mobile-access-home-page-selection' => 'Pagina principal in $1',
 130+ 'zero-rated-mobile-access-home-page-selection-text' => 'O va al pagina principal in lingua:',
 131+ 'zero-rated-mobile-access-banner-text' => 'Wikipedia gratuite de $1',
 132+ 'zero-rated-mobile-access-banner-text-data-charges' => 'Costos de datos pote esser applicate. Continuar ($1 o $2)?',
 133+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Si',
 134+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'No',
 135+ 'zero-rated-mobile-access-click-to-view-image' => 'Clicca pro vider le imagine de "$1"...',
 136+);
 137+
52138 /** Japanese (日本語)
53139 * @author Patrick Reilly
54140 */
55 -$messages['ja'] = array (
 141+$messages['ja'] = array(
56142 'zero-rated-mobile-access-desc' => 'ゼロ格モバイルアクセス',
57143 'zero-rated-mobile-access-search' => '検索する',
58144 );
59145
 146+/** Macedonian (Македонски)
 147+ * @author Bjankuloski06
 148+ */
 149+$messages['mk'] = array(
 150+ 'zero-rated-mobile-access-desc' => 'Овозможува функции за мобилни оператори што даваат бесплатен пристап',
 151+ 'zero-rated-mobile-access-search' => 'Пребарај',
 152+ 'zero-rated-mobile-access-language-selection' => 'Сите јазици',
 153+ 'zero-rated-mobile-access-home-page-selection' => 'Главна страница на $1',
 154+ 'zero-rated-mobile-access-home-page-selection-text' => 'Или пак посетете ја главната страница на следниов јазик:',
 155+ 'zero-rated-mobile-access-banner-text' => 'Бесплатна Википедија од $1',
 156+ 'zero-rated-mobile-access-banner-text-data-charges' => 'Може да ви биде побарана доплата за податоците. Сакате да продолжите? $1 / $2',
 157+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Да',
 158+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'Не',
 159+ 'zero-rated-mobile-access-click-to-view-image' => 'Стиснете за да ја погледате сликата на „$1“...',
 160+);
 161+
 162+/** Dutch (Nederlands)
 163+ * @author Siebrand
 164+ */
 165+$messages['nl'] = array(
 166+ 'zero-rated-mobile-access-search' => 'Zoeken',
 167+ 'zero-rated-mobile-access-language-selection' => 'Alle talen',
 168+ 'zero-rated-mobile-access-banner-text' => 'Gratis Wikipedia van $1',
 169+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Ja',
 170+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'Nee',
 171+);
 172+
 173+/** Telugu (తెలుగు)
 174+ * @author Veeven
 175+ */
 176+$messages['te'] = array(
 177+ 'zero-rated-mobile-access-search' => 'వెతుకు',
 178+ 'zero-rated-mobile-access-language-selection' => 'అన్ని భాషలు',
 179+ 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'అవును',
 180+ 'zero-rated-mobile-access-banner-text-data-charges-no' => 'కాదు',
 181+);
 182+

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108589remove unneeded commentpreilly01:51, 11 January 2012

Status & tagging log