Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | class PreferencesForm { |
29 | 29 | var $mQuickbar, $mOldpass, $mNewpass, $mRetypePass, $mStubs; |
30 | 30 | var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick; |
31 | | - var $mUserLanguage; |
| 31 | + var $mUserLanguage, $mUserVariant; |
32 | 32 | var $mSearch, $mRecent, $mHourDiff, $mSearchLines, $mSearchChars, $mAction; |
33 | 33 | var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize; |
34 | 34 | |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 1 : 0; |
55 | 55 | $this->mNick = $request->getVal( 'wpNick' ); |
56 | 56 | $this->mUserLanguage = $request->getVal( 'wpUserLanguage' ); |
| 57 | + $this->mUserVariant = $request->getVal( 'wpUserVariant' ); |
57 | 58 | $this->mSearch = $request->getVal( 'wpSearch' ); |
58 | 59 | $this->mRecent = $request->getVal( 'wpRecent' ); |
59 | 60 | $this->mHourDiff = $request->getVal( 'wpHourDiff' ); |
— | — | @@ -178,6 +179,7 @@ |
179 | 180 | $wgUser->setEmail( $this->mUserEmail ); |
180 | 181 | $wgUser->setRealName( $this->mRealName ); |
181 | 182 | $wgUser->setOption( 'language', $this->mUserLanguage ); |
| 183 | + $wgUser->setOption( 'variant', $this->mUserVariant ); |
182 | 184 | $wgUser->setOption( 'nickname', $this->mNick ); |
183 | 185 | $wgUser->setOption( 'quickbar', $this->mQuickbar ); |
184 | 186 | $wgUser->setOption( 'skin', $this->mSkin ); |
— | — | @@ -222,6 +224,7 @@ |
223 | 225 | $this->mUserEmail = $wgUser->getEmail(); |
224 | 226 | $this->mRealName = ($wgAllowRealName) ? $wgUser->getRealName() : ''; |
225 | 227 | $this->mUserLanguage = $wgUser->getOption( 'language'); |
| 228 | + $this->mUserVariant = $wgUser->getOption( 'variant'); |
226 | 229 | if ( 1 == $wgUser->getOption( 'disablemail' ) ) { $this->mEmailFlag = 1; } |
227 | 230 | else { $this->mEmailFlag = 0; } |
228 | 231 | $this->mNick = $wgUser->getOption( 'nickname' ); |
— | — | @@ -357,6 +360,7 @@ |
358 | 361 | $yem = wfMsg( 'youremail' ); |
359 | 362 | $yrn = ($wgAllowRealName) ? wfMsg( 'yourrealname' ) : ''; |
360 | 363 | $yl = wfMsg( 'yourlanguage' ); |
| 364 | + $yv = wfMsg( 'yourvariant' ); |
361 | 365 | $emf = wfMsg( 'emailflag' ); |
362 | 366 | $ynn = wfMsg( 'yournick' ); |
363 | 367 | $stt = wfMsg ( 'stubthreshold' ) ; |
— | — | @@ -398,6 +402,30 @@ |
399 | 403 | } |
400 | 404 | $wgOut->addHtml("</label></div>\n" ); |
401 | 405 | |
| 406 | + /* see if there are multiple language variants to choose from*/ |
| 407 | + $variants = $wgLang->getVariants(); |
| 408 | + $size=sizeof($variants); |
| 409 | + |
| 410 | + $variantArray=array(); |
| 411 | + foreach($variants as $v) { |
| 412 | + $v = str_replace( '_', '-', strtolower($v)); |
| 413 | + print "v=$v\n"; |
| 414 | + if($name=$wgLanguageNames[$v]) { |
| 415 | + $variantArray[$v] = $name; |
| 416 | + } |
| 417 | + } |
| 418 | + $size=sizeof($variantArray); |
| 419 | + |
| 420 | + if(sizeof($variantArray) > 1) { |
| 421 | + $wgOut->addHtml(" |
| 422 | + <div><label>$yv: <select name=\"wpUserVariant\" />\n"); |
| 423 | + foreach($variantArray as $code => $name) { |
| 424 | + $sel = ($code==$this->mUserVariant)? "selected" : ""; |
| 425 | + $wgOut->addHtml("\t<option value=\"$code\" $sel>$code - $name</option>\n"); |
| 426 | + } |
| 427 | + $wgOut->addHtml("</label></div>\n"); |
| 428 | + } |
| 429 | + |
402 | 430 | # Fields for changing password |
403 | 431 | # |
404 | 432 | $this->mOldpass = htmlspecialchars( $this->mOldpass ); |