]> git.mjollnir.org Git - moodle.git/commitdiff
The list of countries has finally been moved into the language packs
authormoodler <moodler>
Fri, 26 Sep 2003 08:04:48 +0000 (08:04 +0000)
committermoodler <moodler>
Fri, 26 Sep 2003 08:04:48 +0000 (08:04 +0000)
so it can be translated.

There is now a new function get_list_of_countries() which will return a
sorted array of countries in the best current language.

get_string("AU", "countries")   will also work if needed

14 files changed:
admin/config.html
admin/config.php
admin/register.php
admin/user.php
lang/en/countries.php [new file with mode: 0644]
lib/countries.php [deleted file]
lib/moodlelib.php
login/signup.php
login/signup_form.html
user/edit.html
user/edit.php
user/index.php
user/lib.php
user/view.php

index cf2f53bdb3e65222d22d1d3c803972b9e18c4efe..b4ec01d17ce7b47d43d95d7bcd1623e8ecac01d2 100644 (file)
@@ -60,7 +60,7 @@
 </tr>
 <tr valign=top>
        <td align=right><p>country:</td>
-       <td><?php choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "") ?>
+       <td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
        </td>
     <td>
     <?php print_string("configcountry") ?>
index 2a5c754962a89ad05af919991bc0e3552258dbc6..d96939e953953d6706858366970f8cec3a8548e6 100644 (file)
@@ -2,7 +2,6 @@
        // config.php - allows admin to edit all configuration variables
 
     require_once("../config.php");
-       require_once("../lib/countries.php");
 
 
     if ($site = get_site()) {   // If false then this is a new installation
index 535fdbcc28efae9945254f2f7288189675d3cb2d..46bf5181f456dfa45eb4dcf4d09dac84c5144792 100644 (file)
@@ -2,7 +2,6 @@
        // register.php - allows admin to register their site on moodle.org
 
     include("../config.php");
-    require_once("../lib/countries.php");
 
     require_login();
 
@@ -81,7 +80,7 @@
     echo "<tr valign=top>\n";
     echo "<td align=right><p>".get_string("country").":</td>\n";
     echo "<td><p>";
-    choose_from_menu ($COUNTRIES, "country", $admin->country, get_string("selectacountry")."...", "", "");
+    choose_from_menu (get_list_of_countries(), "country", $admin->country, get_string("selectacountry")."...", "", "");
     echo "</td>\n";
     echo "</tr>\n";
 
index e481147cb3fa028d38a4f74495fb0b60b28eb310..1bd7f0c5c86f376d723c948eb2de2efc2069f671 100644 (file)
@@ -2,7 +2,6 @@
 
     require_once("../config.php");
     require_once("../user/lib.php");
-    require_once("../lib/countries.php");
 
     $recordsperpage = 30;
 
 
         flush();
 
+        $countries = get_list_of_countries();
+
         foreach ($users as $key => $user) {
             if (!empty($user->country)) {
-                $users[$key]->country = $COUNTRIES[$user->country];
+                $users[$key]->country = $countries[$user->country];
             }
         }
         if ($sort == "country") {  // Need to resort by full country name, not code
diff --git a/lang/en/countries.php b/lang/en/countries.php
new file mode 100644 (file)
index 0000000..dcc5503
--- /dev/null
@@ -0,0 +1,243 @@
+<?php // $id: countries.php;v 1.5 2003/08/07 15:23:10 moodler exp $
+
+$string['AF'] = "Afghanistan";
+$string['AL'] = "Albania";
+$string['DZ'] = "Algeria";
+$string['AS'] = "American Samoa";
+$string['AD'] = "Andorra";
+$string['AO'] = "Angola";
+$string['AI'] = "Anguilla";
+$string['AQ'] = "Antarctica";
+$string['AG'] = "Antigua and Barbuda";
+$string['AR'] = "Argentina";
+$string['AM'] = "Armenia";
+$string['AW'] = "Aruba";
+$string['AU'] = "Australia";
+$string['AT'] = "Austria";
+$string['AZ'] = "Azerbaijan";
+$string['BS'] = "Bahamas";
+$string['BH'] = "Bahrain";
+$string['BD'] = "Bangladesh";
+$string['BB'] = "Barbados";
+$string['BY'] = "Belarus";
+$string['BE'] = "Belgium";
+$string['BZ'] = "Belize";
+$string['BJ'] = "Benin";
+$string['BM'] = "Bermuda";
+$string['BT'] = "Bhutan";
+$string['BO'] = "Bolivia";
+$string['BA'] = "Bosnia and Herzegovina";
+$string['BW'] = "Botswana";
+$string['BV'] = "Bouvet Island";
+$string['BR'] = "Brazil";
+$string['IO'] = "British Indian Ocean Territory";
+$string['BN'] = "Brunei Darussalam";
+$string['BG'] = "Bulgaria";
+$string['BF'] = "Burkina Faso";
+$string['BI'] = "Burundi";
+$string['KH'] = "Cambodia";
+$string['CM'] = "Cameroon";
+$string['CA'] = "Canada";
+$string['CV'] = "Cape Verde";
+$string['KY'] = "Cayman Islands";
+$string['CF'] = "Central African Republic";
+$string['TD'] = "Chad";
+$string['CL'] = "Chile";
+$string['CN'] = "China";
+$string['CX'] = "Christmas Island";
+$string['CC'] = "Cocos (Keeling) Islands";
+$string['CO'] = "Colombia";
+$string['KM'] = "Comoros";
+$string['CG'] = "Congo";
+$string['CK'] = "Cook Islands";
+$string['CR'] = "Costa Rica";
+$string['CI'] = "Cote D'Ivoire";
+$string['HR'] = "Croatia (Hrvatska)";
+$string['CU'] = "Cuba";
+$string['CY'] = "Cyprus";
+$string['CZ'] = "Czech Republic";
+$string['DK'] = "Denmark";
+$string['DJ'] = "Djibouti";
+$string['DM'] = "Dominica";
+$string['DO'] = "Dominican Republic";
+$string['TP'] = "East Timor";
+$string['EC'] = "Ecuador";
+$string['EG'] = "Egypt";
+$string['SV'] = "El Salvador";
+$string['GQ'] = "Equatorial Guinea";
+$string['ER'] = "Eritrea";
+$string['EE'] = "Estonia";
+$string['ET'] = "Ethiopia";
+$string['FK'] = "Falkland Islands (Malvinas)";
+$string['FO'] = "Faroe Islands";
+$string['FJ'] = "Fiji";
+$string['FI'] = "Finland";
+$string['FR'] = "France";
+$string['FX'] = "France; Metropolitan";
+$string['GF'] = "French Guiana";
+$string['PF'] = "French Polynesia";
+$string['TF'] = "French Southern Territories";
+$string['GA'] = "Gabon";
+$string['GM'] = "Gambia";
+$string['GE'] = "Georgia";
+$string['DE'] = "Germany";
+$string['GH'] = "Ghana";
+$string['GI'] = "Gibraltar";
+$string['GR'] = "Greece";
+$string['GL'] = "Greenland";
+$string['GD'] = "Grenada";
+$string['GP'] = "Guadeloupe";
+$string['GU'] = "Guam";
+$string['GT'] = "Guatemala";
+$string['GN'] = "Guinea";
+$string['GW'] = "Guinea-Bissau";
+$string['GY'] = "Guyana";
+$string['HT'] = "Haiti";
+$string['HM'] = "Heard and Mc Donald Islands";
+$string['HN'] = "Honduras";
+$string['HK'] = "Hong Kong";
+$string['HU'] = "Hungary";
+$string['IS'] = "Iceland";
+$string['IN'] = "India";
+$string['ID'] = "Indonesia";
+$string['IR'] = "Iran (Islamic Republic of)";
+$string['IQ'] = "Iraq";
+$string['IE'] = "Ireland";
+$string['IL'] = "Israel";
+$string['IT'] = "Italy";
+$string['JM'] = "Jamaica";
+$string['JP'] = "Japan";
+$string['JO'] = "Jordan";
+$string['KZ'] = "Kazakhstan";
+$string['KE'] = "Kenya";
+$string['KI'] = "Kiribati";
+$string['KP'] = "Korea; Democratic People's Republic of";
+$string['KR'] = "Korea; Republic of";
+$string['KO'] = "Kosovo";
+$string['KW'] = "Kuwait";
+$string['KG'] = "Kyrgyzstan";
+$string['LA'] = "Lao People's Democratic Republic";
+$string['LV'] = "Latvia";
+$string['LB'] = "Lebanon";
+$string['LS'] = "Lesotho";
+$string['LR'] = "Liberia";
+$string['LY'] = "Libyan Arab Jamahiriya";
+$string['LI'] = "Liechtenstein";
+$string['LT'] = "Lithuania";
+$string['LU'] = "Luxembourg";
+$string['MO'] = "Macau";
+$string['MK'] = "Macedonia; Former Yugoslav Republic of";
+$string['MG'] = "Madagascar";
+$string['MW'] = "Malawi";
+$string['MY'] = "Malaysia";
+$string['MV'] = "Maldives";
+$string['ML'] = "Mali";
+$string['MT'] = "Malta";
+$string['MH'] = "Marshall Islands";
+$string['MQ'] = "Martinique";
+$string['MR'] = "Mauritania";
+$string['MU'] = "Mauritius";
+$string['YT'] = "Mayotte";
+$string['MX'] = "Mexico";
+$string['FM'] = "Micronesia; Federated States of";
+$string['MD'] = "Moldova; Republic of";
+$string['MC'] = "Monaco";
+$string['MN'] = "Mongolia";
+$string['MS'] = "Montserrat";
+$string['MA'] = "Morocco";
+$string['MZ'] = "Mozambique";
+$string['MM'] = "Myanmar";
+$string['NA'] = "Namibia";
+$string['NR'] = "Nauru";
+$string['NP'] = "Nepal";
+$string['NL'] = "Netherlands";
+$string['AN'] = "Netherlands Antilles";
+$string['NC'] = "New Caledonia";
+$string['NZ'] = "New Zealand";
+$string['NI'] = "Nicaragua";
+$string['NE'] = "Niger";
+$string['NG'] = "Nigeria";
+$string['NU'] = "Niue";
+$string['NF'] = "Norfolk Island";
+$string['MP'] = "Northern Mariana Islands";
+$string['NO'] = "Norway";
+$string['OM'] = "Oman";
+$string['PK'] = "Pakistan";
+$string['PW'] = "Palau";
+$string['PA'] = "Panama";
+$string['PG'] = "Papua New Guinea";
+$string['PY'] = "Paraguay";
+$string['PE'] = "Peru";
+$string['PH'] = "Philippines";
+$string['PN'] = "Pitcairn";
+$string['PL'] = "Poland";
+$string['PT'] = "Portugal";
+$string['PR'] = "Puerto Rico";
+$string['QA'] = "Qatar";
+$string['RE'] = "Reunion";
+$string['RO'] = "Romania";
+$string['RU'] = "Russian Federation";
+$string['RW'] = "Rwanda";
+$string['KN'] = "Saint Kitts and Nevis";
+$string['LC'] = "Saint Lucia";
+$string['VC'] = "Saint Vincent and the Grenadines";
+$string['WS'] = "Samoa";
+$string['SM'] = "San Marino";
+$string['ST'] = "Sao Tome and Principe";
+$string['SA'] = "Saudi Arabia";
+$string['SN'] = "Senegal";
+$string['CS'] = "Serbia and Montenegro";
+$string['SC'] = "Seychelles";
+$string['SL'] = "Sierra Leone";
+$string['SG'] = "Singapore";
+$string['SK'] = "Slovakia (Slovak Republic)";
+$string['SI'] = "Slovenia";
+$string['SB'] = "Solomon Islands";
+$string['SO'] = "Somalia";
+$string['ZA'] = "South Africa";
+$string['ES'] = "Spain";
+$string['LK'] = "Sri Lanka";
+$string['SH'] = "St. Helena";
+$string['PM'] = "St. Pierre and Miquelon";
+$string['SD'] = "Sudan";
+$string['SR'] = "Suriname";
+$string['SJ'] = "Svalbard and Jan Mayen Islands";
+$string['SZ'] = "Swaziland";
+$string['SE'] = "Sweden";
+$string['CH'] = "Switzerland";
+$string['SY'] = "Syrian Arab Republic";
+$string['TW'] = "Taiwan";
+$string['TJ'] = "Tajikistan";
+$string['TZ'] = "Tanzania; United Republic of";
+$string['TH'] = "Thailand";
+$string['TG'] = "Togo";
+$string['TK'] = "Tokelau";
+$string['TO'] = "Tonga";
+$string['TT'] = "Trinidad and Tobago";
+$string['TN'] = "Tunisia";
+$string['TR'] = "Turkey";
+$string['TM'] = "Turkmenistan";
+$string['TC'] = "Turks and Caicos Islands";
+$string['TV'] = "Tuvalu";
+$string['UG'] = "Uganda";
+$string['UA'] = "Ukraine";
+$string['AE'] = "United Arab Emirates";
+$string['GB'] = "United Kingdom";
+$string['US'] = "United States of America";
+$string['UY'] = "Uruguay";
+$string['UZ'] = "Uzbekistan";
+$string['VU'] = "Vanuatu";
+$string['VA'] = "Vatican City State (Holy See)";
+$string['VE'] = "Venezuela";
+$string['VN'] = "Vietnam";
+$string['VG'] = "Virgin Islands (British)";
+$string['VI'] = "Virgin Islands (U.S.)";
+$string['WA'] = "Wales";
+$string['WF'] = "Wallis And Futuna Islands";
+$string['EH'] = "Western Sahara";
+$string['YE'] = "Yemen";
+$string['ZR'] = "Zaire";
+$string['ZM'] = "Zambia";
+$string['ZW'] = "Zimbabwe";
+
+?>
diff --git a/lib/countries.php b/lib/countries.php
deleted file mode 100644 (file)
index c3d2936..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-<?PHP // $Id$
-
-$COUNTRIES = array (
-"AF" => "Afghanistan",
-"AL" => "Albania",
-"DZ" => "Algeria",
-"AS" => "American Samoa",
-"AD" => "Andorra",
-"AO" => "Angola",
-"AI" => "Anguilla",
-"AQ" => "Antarctica",
-"AG" => "Antigua and Barbuda",
-"AR" => "Argentina",
-"AM" => "Armenia",
-"AW" => "Aruba",
-"AU" => "Australia",
-"AT" => "Austria",
-"AZ" => "Azerbaijan",
-"BS" => "Bahamas",
-"BH" => "Bahrain",
-"BD" => "Bangladesh",
-"BB" => "Barbados",
-"BY" => "Belarus",
-"BE" => "Belgium",
-"BZ" => "Belize",
-"BJ" => "Benin",
-"BM" => "Bermuda",
-"BT" => "Bhutan",
-"BO" => "Bolivia",
-"BA" => "Bosnia and Herzegovina",
-"BW" => "Botswana",
-"BV" => "Bouvet Island",
-"BR" => "Brazil",
-"IO" => "British Indian Ocean Territory",
-"BN" => "Brunei Darussalam",
-"BG" => "Bulgaria",
-"BF" => "Burkina Faso",
-"BI" => "Burundi",
-"KH" => "Cambodia",
-"CM" => "Cameroon",
-"CA" => "Canada",
-"CV" => "Cape Verde",
-"KY" => "Cayman Islands",
-"CF" => "Central African Republic",
-"TD" => "Chad",
-"CL" => "Chile",
-"CN" => "China",
-"CX" => "Christmas Island",
-"CC" => "Cocos (Keeling) Islands",
-"CO" => "Colombia",
-"KM" => "Comoros",
-"CG" => "Congo",
-"CK" => "Cook Islands",
-"CR" => "Costa Rica",
-"CI" => "Cote D'Ivoire",
-"HR" => "Croatia (Hrvatska)",
-"CU" => "Cuba",
-"CY" => "Cyprus",
-"CZ" => "Czech Republic",
-"DK" => "Denmark",
-"DJ" => "Djibouti",
-"DM" => "Dominica",
-"DO" => "Dominican Republic",
-"TP" => "East Timor",
-"EC" => "Ecuador",
-"EG" => "Egypt",
-"SV" => "El Salvador",
-"GQ" => "Equatorial Guinea",
-"ER" => "Eritrea",
-"EE" => "Estonia",
-"ET" => "Ethiopia",
-"FK" => "Falkland Islands (Malvinas)",
-"FO" => "Faroe Islands",
-"FJ" => "Fiji",
-"FI" => "Finland",
-"FR" => "France",
-"FX" => "France, Metropolitan",
-"GF" => "French Guiana",
-"PF" => "French Polynesia",
-"TF" => "French Southern Territories",
-"GA" => "Gabon",
-"GM" => "Gambia",
-"GE" => "Georgia",
-"DE" => "Germany",
-"GH" => "Ghana",
-"GI" => "Gibraltar",
-"GR" => "Greece",
-"GL" => "Greenland",
-"GD" => "Grenada",
-"GP" => "Guadeloupe",
-"GU" => "Guam",
-"GT" => "Guatemala",
-"GN" => "Guinea",
-"GW" => "Guinea-Bissau",
-"GY" => "Guyana",
-"HT" => "Haiti",
-"HM" => "Heard and Mc Donald Islands",
-"HN" => "Honduras",
-"HK" => "Hong Kong",
-"HU" => "Hungary",
-"IS" => "Iceland",
-"IN" => "India",
-"ID" => "Indonesia",
-"IR" => "Iran (Islamic Republic of)",
-"IQ" => "Iraq",
-"IE" => "Ireland",
-"IL" => "Israel",
-"IT" => "Italy",
-"JM" => "Jamaica",
-"JP" => "Japan",
-"JO" => "Jordan",
-"KZ" => "Kazakhstan",
-"KE" => "Kenya",
-"KI" => "Kiribati",
-"KP" => "Korea, Democratic People's Republic of",
-"KR" => "Korea, Republic of",
-"KO" => "Kosovo",
-"KW" => "Kuwait",
-"KG" => "Kyrgyzstan",
-"LA" => "Lao People's Democratic Republic",
-"LV" => "Latvia",
-"LB" => "Lebanon",
-"LS" => "Lesotho",
-"LR" => "Liberia",
-"LY" => "Libyan Arab Jamahiriya",
-"LI" => "Liechtenstein",
-"LT" => "Lithuania",
-"LU" => "Luxembourg",
-"MO" => "Macau",
-"MK" => "Macedonia, Former Yugoslav Republic of",
-"MG" => "Madagascar",
-"MW" => "Malawi",
-"MY" => "Malaysia",
-"MV" => "Maldives",
-"ML" => "Mali",
-"MT" => "Malta",
-"MH" => "Marshall Islands",
-"MQ" => "Martinique",
-"MR" => "Mauritania",
-"MU" => "Mauritius",
-"YT" => "Mayotte",
-"MX" => "Mexico",
-"FM" => "Micronesia, Federated States of",
-"MD" => "Moldova, Republic of",
-"MC" => "Monaco",
-"MN" => "Mongolia",
-"MS" => "Montserrat",
-"MA" => "Morocco",
-"MZ" => "Mozambique",
-"MM" => "Myanmar",
-"NA" => "Namibia",
-"NR" => "Nauru",
-"NP" => "Nepal",
-"NL" => "Netherlands",
-"AN" => "Netherlands Antilles",
-"NC" => "New Caledonia",
-"NZ" => "New Zealand",
-"NI" => "Nicaragua",
-"NE" => "Niger",
-"NG" => "Nigeria",
-"NU" => "Niue",
-"NF" => "Norfolk Island",
-"MP" => "Northern Mariana Islands",
-"NO" => "Norway",
-"OM" => "Oman",
-"PK" => "Pakistan",
-"PW" => "Palau",
-"PA" => "Panama",
-"PG" => "Papua New Guinea",
-"PY" => "Paraguay",
-"PE" => "Peru",
-"PH" => "Philippines",
-"PN" => "Pitcairn",
-"PL" => "Poland",
-"PT" => "Portugal",
-"PR" => "Puerto Rico",
-"QA" => "Qatar",
-"RE" => "Reunion",
-"RO" => "Romania",
-"RU" => "Russian Federation",
-"RW" => "Rwanda",
-"KN" => "Saint Kitts and Nevis",
-"LC" => "Saint Lucia",
-"VC" => "Saint Vincent and the Grenadines",
-"WS" => "Samoa",
-"SM" => "San Marino",
-"ST" => "Sao Tome and Principe",
-"SA" => "Saudi Arabia",
-"SN" => "Senegal",
-"CS" => "Serbia and Montenegro",
-"SC" => "Seychelles",
-"SL" => "Sierra Leone",
-"SG" => "Singapore",
-"SK" => "Slovakia (Slovak Republic)",
-"SI" => "Slovenia",
-"SB" => "Solomon Islands",
-"SO" => "Somalia",
-"ZA" => "South Africa",
-"ES" => "Spain",
-"LK" => "Sri Lanka",
-"SH" => "St. Helena",
-"PM" => "St. Pierre and Miquelon",
-"SD" => "Sudan",
-"SR" => "Suriname",
-"SJ" => "Svalbard and Jan Mayen Islands",
-"SZ" => "Swaziland",
-"SE" => "Sweden",
-"CH" => "Switzerland",
-"SY" => "Syrian Arab Republic",
-"TW" => "Taiwan",
-"TJ" => "Tajikistan",
-"TZ" => "Tanzania, United Republic of",
-"TH" => "Thailand",
-"TG" => "Togo",
-"TK" => "Tokelau",
-"TO" => "Tonga",
-"TT" => "Trinidad and Tobago",
-"TN" => "Tunisia",
-"TR" => "Turkey",
-"TM" => "Turkmenistan",
-"TC" => "Turks and Caicos Islands",
-"TV" => "Tuvalu",
-"UG" => "Uganda",
-"UA" => "Ukraine",
-"AE" => "United Arab Emirates",
-"GB" => "United Kingdom",
-"US" => "United States of America",
-"UY" => "Uruguay",
-"UZ" => "Uzbekistan",
-"VU" => "Vanuatu",
-"VA" => "Vatican City State (Holy See)",
-"VE" => "Venezuela",
-"VN" => "Vietnam",
-"VG" => "Virgin Islands (British)",
-"VI" => "Virgin Islands (U.S.)",
-"WA" => "Wales",
-"WF" => "Wallis And Futuna Islands",
-"EH" => "Western Sahara",
-"YE" => "Yemen",
-"ZR" => "Zaire",
-"ZM" => "Zambia",
-"ZW" => "Zimbabwe");
-
index 66e65c2e7972989677f113d77ccc51c224d15e3e..e5d29bb988f91bcd4c82e38eb26c6c1c5f8f8a3a 100644 (file)
@@ -1284,6 +1284,23 @@ function get_list_of_languages() {
     return $languages;
 }
 
+function get_list_of_countries() {
+/// Returns a list of country names in the current language
+    global $CFG, $USER;
+
+    $lang = current_language();
+
+    if (!file_exists("$CFG->dirroot/lang/$lang/countries.php")) {
+        $lang = "en";  // countries.php must exist in this pack
+    }
+
+    include("$CFG->dirroot/lang/$lang/countries.php"); 
+
+    asort($string);
+
+    return $string;
+}
+
 function document_file($file, $include=true) {
 /// Can include a given document file (depends on second
 /// parameter) or just return info about it
index 26a15d486b5991bcdfca5d7503c936399f0d61f2..3721c8b3ddcbfb60a4351200ea896afcf67cd43c 100644 (file)
@@ -1,7 +1,6 @@
 <?PHP // $Id$
 
     require_once("../config.php");
-    require_once("../lib/countries.php");
     require_once("../auth/$CFG->auth/lib.php");
 
     if ($user = data_submitted()) {
index b5f3da563a96dfdb2f7bfa626fc0136e2742c7b7..53e7f446ef51be1b3d6c74ca1a77c5550fdddb80 100644 (file)
@@ -73,7 +73,7 @@
 </tr>\r
 <tr valign="top">\r
        <td><p><?php print_string("country") ?>:</p></td>\r
-       <td><?php choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry"), "", "") ?>\r
+       <td><?php choose_from_menu (get_list_of_countries(), "country", $user->country, get_string("selectacountry"), "", "") ?>\r
        <?php if (!empty($err->country)) { formerr($err->country);} ?>\r
        </td>\r
 </tr>\r
index 44c65750a3a434f33b9ccc72247cd6be14eccea0..9fb983489a52d1136c2aa9996046f69d8a1c9a16 100644 (file)
@@ -118,7 +118,7 @@ if (isadmin()) {
         $user->country = $CFG->country;
     }
     
-    choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?>
+    choose_from_menu (get_list_of_countries(), "country", $user->country, get_string("selectacountry")."...", "", "") ?>
     <?php if (isset($err["country"])) formerr($err["country"]); ?>
     </td>
 </tr>
index 0bda8b761fded0214fd080500be6444adcace49a..b9c7fbc263217105dcea99e0dc535c2644a85dee 100644 (file)
@@ -1,7 +1,6 @@
 <?PHP // $Id$
 
     require_once("../config.php");
-    require_once("../lib/countries.php");
     require_once("lib.php");
 
     require_variable($id);       // user id
index 185b540e61818489b6d2801a18fd5105dc0bd95a..e46dcd3bc9c3244acd8560fce2259702aac521ad 100644 (file)
@@ -3,7 +3,6 @@
 //  Lists all the users within a given course
 
     require_once("../config.php");
-    require_once("../lib/countries.php");
     require_once("lib.php");
 
     require_variable($id);   //course
@@ -40,6 +39,8 @@
     $string->sec         = get_string("sec");
     $string->secs        = get_string("secs");
 
+    $countries = get_list_of_countries();
+
     $loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
 
     $showteachers = ($page == 0 and $sort == "lastaccess" and $dir == "desc");
@@ -65,7 +66,7 @@
             echo "<h2 align=center>$course->teachers</h2>";
             foreach ($teachers as $teacher) {
                 if ($teacher->authority > 0) {    // Don't print teachers with no authority
-                    print_user($teacher, $course, $string);
+                    print_user($teacher, $course, $string, $countries);
                 }
             }
         }
@@ -87,7 +88,7 @@
 
         if ($students = get_course_students($course->id, $dsort, $dir)) {
             foreach ($students as $student) {
-                print_user($student, $course, $string);
+                print_user($student, $course, $string, $countries);
             }
         }
 
         }
 
         foreach ($students as $key => $student) {
-            $students[$key]->country = $COUNTRIES[$student->country];
+            $students[$key]->country = $countries[$student->country];
         }
         if ($sort == "country") {  // Need to re-sort by full country name, not code
             foreach ($students as $student) {
index 4f54d4b4af09fbe7d3041352b02a7d460290aeba..de31c6c7d47fff584dc315de9292f3f84e5e98c9 100644 (file)
@@ -170,9 +170,9 @@ function save_user_image($userid, $filename) {
 }
 
 
-function print_user($user, $course, $string) {
+function print_user($user, $course, $string, $countries) {
 
-    global $USER, $COUNTRIES;
+    global $USER;
     
     echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
     echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=5 CELLSPACING=0><TR>";
@@ -189,7 +189,7 @@ function print_user($user, $course, $string) {
     if ($user->maildisplay == 1 or ($user->maildisplay == 2 and $course->category) or isteacher($course->id)) {
         echo "$string->email: <A HREF=\"mailto:$user->email\">$user->email</A><BR>";
     }
-    echo "$string->location: $user->city, ".$COUNTRIES["$user->country"]."<BR>";
+    echo "$string->location: $user->city, ".$countries["$user->country"]."<BR>";
     if ($user->lastaccess) {
         echo "$string->lastaccess: ".userdate($user->lastaccess);
         echo "&nbsp (".format_time(time() - $user->lastaccess, $string).")";
index 23a201136e6f2637fc6df47510181164a1123f81..488b725ebe2b01bfea564b2e5f10e06cee5e23ac 100644 (file)
@@ -3,7 +3,6 @@
 //  Display profile for a particular user
 
     require_once("../config.php");
-    require_once("../lib/countries.php");
     require_once("../mod/forum/lib.php");
     require_once("lib.php");
 
@@ -23,6 +22,8 @@
         require_login($course->id);
     }
 
+    $countries = get_list_of_countries();
+
     add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
 
     $fullname = "$user->firstname $user->lastname";
         echo "<P>".text_to_html($user->description)."</P><HR>";
     }
 
-
     // Print all the little details in a list
 
     echo "<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=2";
 
     if ($user->city or $user->country) {
-        print_row(get_string("location").":", "$user->city, ".$COUNTRIES["$user->country"]);
+        print_row(get_string("location").":", "$user->city, ".$countries["$user->country"]);
     }
 
     if (isteacher($course->id)) {