r5263 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5262‎ | r5263 | r5264 >
Date:15:09, 17 September 2004
Author:zhengzhu
Status:old
Tags:
Comment:
Choose userLanguage from the list of language names from Names.php
Modified paths:
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPreferences.php
@@ -5,6 +5,9 @@
66 * @subpackage SpecialPage
77 */
88
 9+/* to get a list of languages in setting user's language preference */
 10+require_once("Names.php");
 11+
912 /**
1013 * Entry point that create the "Preferences" object
1114 */
@@ -303,10 +306,13 @@
304307 /**
305308 * @access private
306309 */
 310+
307311 function mainPrefsForm( $err ) {
308312 global $wgUser, $wgOut, $wgLang, $wgUseDynamicDates, $wgValidSkinNames;
309313 global $wgAllowRealName, $wgImageLimits;
310 -
 314+
 315+ global $wgLanguageNames;
 316+
311317 $wgOut->setPageTitle( wfMsg( 'preferences' ) );
312318 $wgOut->setArticleRelated( false );
313319 $wgOut->setRobotpolicy( 'noindex,nofollow' );
@@ -384,8 +390,14 @@
385391 <div><label>$yem: <input type='text' name=\"wpUserEmail\" value=\"{$this->mUserEmail}\" size='20' /></label></div>
386392 <div><label><input type='checkbox' $emfc value=\"1\" name=\"wpEmailFlag\" /> $emf</label></div>
387393 <div><label>$ynn: <input type='text' name=\"wpNick\" value=\"{$this->mNick}\" size='12' /></label></div>
388 - <div><label>$yl: <input type='text' name=\"wpUserLanguage\" value=\"{$this->mUserLanguage}\" size='8' /></label></div>\n" );
 394+ <div><label>$yl: <select name=\"wpUserLanguage\" />\n");
389395
 396+ foreach($wgLanguageNames as $code => $name) {
 397+ $sel = ($code == $this->mUserLanguage)? "selected" : "";
 398+ $wgOut->addHtml("\t<option value=\"$code\" $sel>$code - $name</option>\n");
 399+ }
 400+ $wgOut->addHtml("</label></div>\n" );
 401+
390402 # Fields for changing password
391403 #
392404 $this->mOldpass = htmlspecialchars( $this->mOldpass );

Status & tagging log