r107034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107033‎ | r107034 | r107035 >
Date:01:41, 22 December 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
clean up
Modified paths:
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.i18n.php (modified) (history)
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php
@@ -43,7 +43,7 @@
4444 $wgHooks['BeforePageDisplay'][] = array( &$wgExtZeroRatedMobileAccess, 'beforePageDisplayHTML' );
4545
4646 class ExtZeroRatedMobileAccess {
47 - const VERSION = '0.0.3';
 47+ const VERSION = '0.0.4';
4848
4949 public static $renderZeroRatedLandingPage;
5050 private static $debugOutput = array();
@@ -98,20 +98,20 @@
9999 echo self::getSearchFormHtml( $language['language'] );
100100 }
101101 }
 102+ $output = Html::openElement( 'select',
 103+ array( 'id' => 'languageselection',
 104+ 'onchange' => 'javascript:window.location = this.options[this.selectedIndex].value;' ) );
 105+ foreach ( $languageNames as $languageCode => $languageName ) {
 106+ $output .= Html::element( 'option',
 107+ array( 'value' => '//' . $languageCode . '.m.wikipedia.org/' ),
 108+ $languageName );
 109+ }
 110+ $output .= Html::closeElement( 'select', array() );
 111+ echo $output;
 112+ exit();
102113 }
103 - $output = Html::openElement( 'select',
104 - array( 'id' => 'languageselection',
105 - 'onchange' => 'javascript:window.location = this.options[this.selectedIndex].value;' ) );
106 - foreach ( $languageNames as $languageCode => $languageName ) {
107 - $output .= Html::element( 'option',
108 - array( 'value' => '//' . $languageCode . '.m.wikipedia.org/' ),
109 - $languageName );
110 - }
111 - $output .= Html::closeElement( 'select', array() );
112 - echo $output;
113114
114115 wfProfileOut( __METHOD__ );
115 - exit();
116116 return true;
117117 }
118118
@@ -419,6 +419,7 @@
420420 }
421421
422422 private static function getSearchFormHtml( $langCode ) {
 423+ $searchValue = wfMsg( 'zero-rated-mobile-access-search' );
423424 $formHtml = <<<HTML
424425 <form action="//{$langCode}.wikipedia.org/w/index.php" class="search_bar" method="get">
425426 <input type="hidden" value="Special:Search" name="title">
@@ -426,7 +427,7 @@
427428 <input type="text" name="search" id="search" size="22" value="" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024">
428429 <div class="clearlink" id="clearsearch" title="Clear"></div>
429430 </div>
430 - <button id="goButton" type="submit">Search</button>
 431+ <button id="goButton" type="submit">{$searchValue}</button>
431432 </form>
432433 HTML;
433434 return $formHtml;
Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.i18n.php
@@ -14,6 +14,7 @@
1515 // en translation
1616 $messages['en'] = array (
1717 'zero-rated-mobile-access-desc' => 'Zero Rated Mobile Access',
 18+ 'zero-rated-mobile-access-search' => 'Search',
1819 );
1920
2021 $messages['qqq'] = array(

Comments

#Comment by Nikerabbit (talk | contribs)   14:03, 23 December 2011

$searchValue should be html escaped.

#Comment by MaxSem (talk | contribs)   14:11, 23 December 2011

Resolved in a later revision.

Status & tagging log