From a1b958aa71841e879817b7ef521f4827669bf24d Mon Sep 17 00:00:00 2001 From: Zheng Zhu Date: Mon, 27 Sep 2004 15:10:26 +0000 Subject: [PATCH] Formatting fix (tab instead of space) --- includes/SpecialPreferences.php | 79 ++++++++++++++++----------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index f45b93fe5a..ee38e53bf5 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -311,9 +311,8 @@ class PreferencesForm { */ function mainPrefsForm( $err ) { global $wgUser, $wgOut, $wgLang, $wgContLang, $wgUseDynamicDates, $wgValidSkinNames; - global $wgAllowRealName, $wgImageLimits; - - global $wgLanguageNames; + global $wgAllowRealName, $wgImageLimits; + global $wgLanguageNames; $wgOut->setPageTitle( wfMsg( 'preferences' ) ); $wgOut->setArticleRelated( false ); @@ -359,7 +358,7 @@ class PreferencesForm { $yem = wfMsg( 'youremail' ); $yrn = ($wgAllowRealName) ? wfMsg( 'yourrealname' ) : ''; $yl = wfMsg( 'yourlanguage' ); - $yv = wfMsg( 'yourvariant' ); + $yv = wfMsg( 'yourvariant' ); $emf = wfMsg( 'emailflag' ); $ynn = wfMsg( 'yournick' ); $stt = wfMsg ( 'stubthreshold' ) ; @@ -386,48 +385,48 @@ class PreferencesForm { $wgOut->addHTML( "
".wfMsg('prefs-personal').""); - if ($wgAllowRealName) { - $wgOut->addHTML("
"); + if ($wgAllowRealName) { + $wgOut->addHTML("
"); } - $wgOut->addHTML(" + $wgOut->addHTML("
\n" ); - - /* see if there are multiple language variants to choose from*/ - $variants = $wgContLang->getVariants(); - $size=sizeof($variants); - - $variantArray=array(); - foreach($variants as $v) { - $v = str_replace( '_', '-', strtolower($v)); - if($name=$wgLanguageNames[$v]) { - $variantArray[$v] = $name; - } - } - $size=sizeof($variantArray); - - if(sizeof($variantArray) > 1) { - $wgOut->addHtml(" -
\n"); - } + foreach($wgLanguageNames as $code => $name) { + global $IP; + /* only add languages that have a file */ + $langfile="$IP/languages/Language".str_replace('-', '_', ucfirst($code)).".php"; + if(file_exists($langfile)) { + $sel = ($code == $this->mUserLanguage)? "selected" : ""; + $wgOut->addHtml("\t\n"); + } + } + $wgOut->addHtml("\n" ); + + /* see if there are multiple language variants to choose from*/ + $variants = $wgContLang->getVariants(); + $size=sizeof($variants); + + $variantArray=array(); + foreach($variants as $v) { + $v = str_replace( '_', '-', strtolower($v)); + if($name=$wgLanguageNames[$v]) { + $variantArray[$v] = $name; + } + } + $size=sizeof($variantArray); + + if(sizeof($variantArray) > 1) { + $wgOut->addHtml(" +
\n"); + } # Fields for changing password # -- 2.20.1