Index: modules/contact_dir/fields.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/contact_dir/fields.inc,v
retrieving revision 1.4
diff -u -r1.4 fields.inc
--- modules/contact_dir/fields.inc	1 Mar 2005 20:58:26 -0000	1.4
+++ modules/contact_dir/fields.inc	16 Mar 2005 16:59:22 -0000
@@ -1,6 +1,6 @@
 <?php
 /**
- * Contact Fileds
+ * Contact Fields
  *
  * Specifies any fields that are applicable for contacts.
  *
@@ -24,8 +24,8 @@
 	$fields = array();
 	$access = user_access('administer contacts') || user_access('manage contacts') || user_access('use contacts');
 
-	// Default fileds
-	$fileds['category'] = array(
+	// Default fields
+	$fields['category'] = array(
 		'select',					// field type
 		t('Primary category'), 				// display name
 		true, 						// required
@@ -38,7 +38,7 @@
 		t('contact\'s primary category'), 	// Help Text
 		NULL);						// extra
 
-	$fileds['first_name'] = array(
+	$fields['first_name'] = array(
 		'textfield',        	// Field type
 		t('First name'),      	// Display name
 		true,              		// Required field
@@ -51,7 +51,7 @@
 		t('contact\'s first name'),	// Help text
 		NULL);
 
-	$fileds['middle_name'] = array(
+	$fields['middle_name'] = array(
 		'textfield',        	// Field type
 		t('Middle name'),      	// Display name
 		false,              	// Required field
@@ -64,7 +64,7 @@
 		t('contact\'s middle name'),	// Help text
 		NULL);
 
-	$fileds['last_name'] = array(
+	$fields['last_name'] = array(
 		'textfield',        	// Field type
 		t('Last name'),      	// Display name
 		true,              		// Required field
@@ -77,7 +77,7 @@
 		t('contct\'s last name'),	// Help text
 		NULL);
 
-	$fileds['mail'] = array(
+	$fields['mail'] = array(
 		'textfield',        	// Field type
 		t('E-mail'),      		// Display name
 		true,              		// Required field
@@ -90,7 +90,7 @@
 		t('contact\'s e-mail address'),	// Help text
 		NULL);
 
-	$fileds['company'] = array(
+	$fields['company'] = array(
 		'textfield',        	// Field type
 		t('Company'),      		// Display name
 		true,              		// Required field
@@ -103,7 +103,7 @@
 		t('contact\'s company name'),	// Help text
 		NULL);
 
-	$fileds['country'] = array(
+	$fields['country'] = array(
 		'select',				// field type
 		t('Country'), 			// display name
 		true, 					// required
@@ -116,7 +116,7 @@
 		t('contact\'s country'), 		// Help Text
 		NULL);					// extra
 
-	$fileds['state'] = array(
+	$fields['state'] = array(
 		'select',				// field type
 		t('State'), 			// display name
 		true, 					// required
@@ -129,7 +129,7 @@
 		t('contact\'s state'), 		// Help Text
 		NULL);					// extra
 
-	$fileds['city'] = array(
+	$fields['city'] = array(
 		'textfield',        	// Field type
 		t('City'),      		// Display name
 		true,              		// Required field
@@ -142,7 +142,7 @@
 		t('contact\'s city'),	// Help text
 		NULL);
 
-	$fileds['address'] = array(
+	$fields['address'] = array(
 		'textfield',        	// Field type
 		t('Address'),      		// Display name
 		false,              	// Required field
@@ -155,7 +155,7 @@
 		t('contact\'s address'),	// Help text
 		NULL);
 
-	$fileds['zip'] = array(
+	$fields['zip'] = array(
 		'textfield',        	// Field type
 		t('Zip'),      			// Display name
 		false,             		// Required field
@@ -168,9 +168,9 @@
 		t('contact\'s zip code'),	// Help text
 		NULL);
 
-	$fileds['phone'] = array(
+	$fields['phone'] = array(
 		'textfield',        	// Field type
-		t('phone'),      		// Display name
+		t('Phone'),      		// Display name
 		false,             		// Required field
 		true,               	// Store in separate database field
 		array(true, ''),       	// Show in view
@@ -181,9 +181,9 @@
 		t('contact\'s phone number'),	// Help text
 		NULL);
 
-	$fileds['fax'] = array(
+	$fields['fax'] = array(
 		'textfield',        	// Field type
-		t('fax'),      			// Display name
+		t('Fax'),      			// Display name
 		false,             		// Required field
 		true,               	// Store in separate database field
 		array(true, ''),       	// Show in view
@@ -194,7 +194,7 @@
 		t('contact\'s fax number'),	// Help text
 		NULL);
 
-	$fileds['url'] = array(
+	$fields['url'] = array(
 		'url',        			// Field type
 		t('Url'),      			// Display name
 		false,             		// Required field
@@ -207,7 +207,7 @@
 		t('contact\'s url'),	// Help text
 		NULL);
 
-	$fileds['job'] = array(
+	$fields['job'] = array(
 		'textfield',       		// Field type
 		t('Job'),      			// Display name
 		false,             		// Required field
@@ -220,7 +220,7 @@
 		t('contact\'s job/occupation'),	// Help text
 		NULL);
 
-	$fileds['description'] = array(
+	$fields['description'] = array(
 		'textarea',       		// Field type
 		t('Description'),      	// Display name
 		false,             		// Required field
@@ -233,21 +233,256 @@
 		t('contact\'s description/services (max 1000 chars)'),	// Help text
 		NULL);
 
-	return $fileds;
+	return $fields;
 }
 
 
 /**
- * Returns a list of countries as an array
+ * Returns a list of country-code => country-name pairs (as in ISO 3166-1 alpha-2) as an array
  */
 function _get_contact_country_list() {
-	$countries = array();
-
-	$countries['0'] = '[Select]';
-	$countries['UNITED STATES'] = 'UNITED STATES';
-	$countries['CANADA'] = 'CANADA';
-
-	return $countries;
+  return array('0' => '[Select]',
+               'ad' => 'Andorra',
+               'ae' => 'United Arab Emirates',
+               'af' => 'Afghanistan',
+               'ag' => 'Antigua and Barbuda',
+               'ai' => 'Anguilla',
+               'al' => 'Albania',
+               'am' => 'Armenia',
+               'an' => 'Netherlands Antilles',
+               'ao' => 'Angola',
+               'aq' => 'Antarctica',
+               'ar' => 'Argentina',
+               'as' => 'American Samoa',
+               'at' => 'Austria',
+               'au' => 'Australia',
+               'aw' => 'Aruba',
+               'ax' => 'Aland Islands',
+               'az' => 'Azerbaijan',
+               'ba' => 'Bosnia and Herzegovina',
+               'bb' => 'Barbados',
+               'bd' => 'Bangladesh',
+               'be' => 'Belgium',
+               'bf' => 'Burkina Faso',
+               'bg' => 'Bulgaria',
+               'bh' => 'Bahrain',
+               'bi' => 'Burundi',
+               'bj' => 'Benin',
+               'bm' => 'Bermuda',
+               'bn' => 'Brunei Darussalam',
+               'bo' => 'Bolivia',
+               'br' => 'Brazil',
+               'bs' => 'Bahamas',
+               'bt' => 'Bhutan',
+               'bv' => 'Bouvet Island',
+               'bw' => 'Botswana',
+               'by' => 'Belarus',
+               'bz' => 'Belize',
+               'ca' => 'Canada',
+               'cc' => 'Cocos (Keeling) Islands',
+               'cd' => 'Democratic Republic of the Congo (formerly Zaire)',
+               'cf' => 'Central African Republic',
+               'cg' => 'Congo (Republic of the Congo)',
+               'ch' => 'Switzerland (Confoederatio Helvetica)',
+               'ci' => 'Cote d\'Ivoire (Ivory Coast)',
+               'ck' => 'Cook Islands',
+               'cl' => 'Chile',
+               'cm' => 'Cameroon',
+               'cn' => 'China',
+               'co' => 'Colombia',
+               'cr' => 'Costa Rica',
+               'cs' => 'Serbia and Montenegro',
+               'cu' => 'Cuba',
+               'cv' => 'Cape Verde',
+               'cx' => 'Christmas Island',
+               'cy' => 'Cyprus',
+               'cz' => 'Czech Republic',
+               'de' => 'Germany (Deutschland)',
+               'dj' => 'Djibouti',
+               'dk' => 'Denmark',
+               'dm' => 'Dominica',
+               'do' => 'Dominican Republic',
+               'dz' => 'Algeria',
+               'ec' => 'Ecuador',
+               'ee' => 'Estonia',
+               'eg' => 'Egypt',
+               'eh' => 'Western Sahara (formerly Spanish Sahara)',
+               'er' => 'Eritrea',
+               'es' => 'Spain (Espana)',
+               'et' => 'Ethiopia',
+               'fi' => 'Finland',
+               'fj' => 'Fiji',
+               'fk' => 'Falkland Islands',
+               'fm' => 'Federated States of Micronesia',
+               'fo' => 'Faroe Islands',
+               'fr' => 'France',
+               'ga' => 'Gabon',
+               'gb' => 'United Kingdom',
+               'gd' => 'Grenada',
+               'ge' => 'Georgia',
+               'gf' => 'French Guiana',
+               'gd' => 'Ghana',
+               'gi' => 'Gibraltar',
+               'gl' => 'Greenland',
+               'gm' => 'Gambia',
+               'gn' => 'Guinea',
+               'gp' => 'Guadeloupe',
+               'gq' => 'Equatorial Guinea',
+               'gr' => 'Greece',
+               'gs' => 'South Georgia and the South Sandwich Islands',
+               'gt' => 'Guatemala',
+               'gu' => 'Guam',
+               'gw' => 'Guinea-Bissau',
+               'gy' => 'Guyana',
+               'hk' => 'Hong Kong',
+               'hm' => 'Heard Island and McDonald Islands',
+               'hn' => 'Honduras',
+               'hr' => 'Croatia (Hrvatska)',
+               'ht' => 'Haiti',
+               'hu' => 'Hungary',
+               'id' => 'Indonesia',
+               'ie' => 'Ireland',
+               'il' => 'Israel',
+               'in' => 'India',
+               'io' => 'British Indian Ocean Territory (including Diego Garcia)',
+               'iq' => 'Iraq',
+               'ir' => 'Iran',
+               'is' => 'Iceland',
+               'it' => 'Italy',
+               'jm' => 'Jamaica',
+               'jo' => 'Jordan',
+               'jp' => 'Japan',
+               'ke' => 'Kenya',
+               'kg' => 'Kyrgyzstan',
+               'kh' => 'Cambodia',
+               'ki' => 'Kiribati',
+               'km' => 'Comoros',
+               'kn' => 'Saint Kitts and Nevis',
+               'kp' => 'North Korea',
+               'kr' => 'South Korea',
+               'kw' => 'Kuwait',
+               'ky' => 'Cayman Islands',
+               'kz' => 'Kazakhstan',
+               'la' => 'Laos',
+               'lb' => 'Lebanon',
+               'lc' => 'Saint Lucia',
+               'li' => 'Liechtenstein',
+               'lk' => 'Sri Lanka',
+               'lr' => 'Liberia',
+               'ls' => 'Lesotho',
+               'lt' => 'Lithuania',
+               'lu' => 'Luxembourg',
+               'lv' => 'Latvia',
+               'ly' => 'Libya',
+               'ma' => 'Morocco',
+               'mc' => 'Monaco',
+               'md' => 'Moldova',
+               'mg' => 'Madagascar',
+               'mh' => 'Marshall Islands',
+               'mk' => 'Former Yugoslav Republic of Macedonia',
+               'ml' => 'Mali',
+               'mm' => 'Myanmar (Burma)',
+               'mn' => 'Mongolia',
+               'mo' => 'Macao (Macau)',
+               'mp' => 'Northern Mariana Islands',
+               'mq' => 'Martinique',
+               'mr' => 'Mauritania',
+               'ms' => 'Montserrat',
+               'mt' => 'Malta',
+               'mu' => 'Mauritius',
+               'mv' => 'Maldives',
+               'mw' => 'Malawi',
+               'mx' => 'Mexico',
+               'my' => 'Malaysia',
+               'mz' => 'Mozambique',
+               'na' => 'Namibia',
+               'nc' => 'New Caledonia',
+               'ne' => 'Niger',
+               'nf' => 'Norfolk Island',
+               'ng' => 'Nigeria',
+               'ni' => 'Nicaragua',
+               'nl' => 'Netherlands',
+               'no' => 'Norway',
+               'np' => 'Nepal',
+               'nr' => 'Nauru',
+               'nu' => 'Niue',
+               'nz' => 'New Zealand',
+               'om' => 'Oman',
+               'pa' => 'Panama',
+               'pe' => 'Peru',
+               'pf' => 'French Polynesia',
+               'pg' => 'Papua New Guinea',
+               'ph' => 'Philippines',
+               'pk' => 'Pakistan',
+               'pl' => 'Poland',
+               'pm' => 'Saint-Pierre and Miquelon',
+               'pn' => 'Pitcairn Islands',
+               'pr' => 'Puerto Rico',
+               'ps' => 'Palestinian Territories (West Bank and Gaza Strip)',
+               'pt' => 'Portugal',
+               'pw' => 'Palau',
+               'py' => 'Paraguay',
+               'qa' => 'Qatar',
+               're' => 'Reunion',
+               'ro' => 'Romania',
+               'ru' => 'Russia',
+               'rw' => 'Rwanda',
+               'sa' => 'Saudi Arabia',
+               'sb' => 'Solomon Islands',
+               'sc' => 'Seychelles',
+               'sd' => 'Sudan',
+               'se' => 'Sweden',
+               'sg' => 'Singapore',
+               'sh' => 'Saint Helena',
+               'si' => 'Slovenia',
+               'sj' => 'Svalbard and Jan Mayen Islands',
+               'sk' => 'Slovakia',
+               'sl' => 'Sierra Leone',
+               'sm' => 'San Marino',
+               'sn' => 'Senegal',
+               'so' => 'Somalia',
+               'sr' => 'Suriname',
+               'st' => 'Sao Tome and Principe',
+               'sv' => 'El Salvador',
+               'sy' => 'Syria',
+               'sz' => 'Swaziland',
+               'tc' => 'Turks and Caicos Islands',
+               'td' => 'Chad (Tchad)',
+               'tf' => 'French Southern Territories',
+               'tg' => 'Togo',
+               'th' => 'Thailand',
+               'tj' => 'Tajikistan',
+               'tk' => 'Tokelau',
+               'tl' => 'Timor-Leste (East Timor)',
+               'tm' => 'Turkmenistan',
+               'tn' => 'Tunisia',
+               'to' => 'Tonga',
+               'tr' => 'Turkey',
+               'tt' => 'Trinidad and Tobago',
+               'tv' => 'Tuvalu',
+               'tw' => 'Taiwan',
+               'tz' => 'Tanzania',
+               'ua' => 'Ukraine',
+               'ug' => 'Uganda',
+               'um' => 'United States Minor Outlying Islands',
+               'us' => 'United States',
+               'uy' => 'Uruguay',
+               'uz' => 'Uzbekistan',
+               'va' => 'Vatican City',
+               'vc' => 'Saint Vincent and the Grenadines',
+               've' => 'Venezuela',
+               'vg' => 'British Virgin Islands',
+               'vi' => 'U.S. Virgin Islands',
+               'vn' => 'Vietnam',
+               'vu' => 'Vanuatu',
+               'wf' => 'Wallis and Futuna',
+               'ws' => 'Samoa',
+               'ye' => 'Yemen',
+               'yt' => 'Mayotte',
+               'za' => 'South Africa',
+               'zm' => 'Zambia',
+               'zw' => 'Zimbabwe'
+              );
 }
 
 /**
@@ -257,6 +492,7 @@
 	$states = array();
 
 	$states['0'] = '[Select]';
+	$states['xx'] = 'Outside USA';
 	$states['AK'] = 'AK';
 	$states['AS'] = 'AS';
 	$states['AZ'] = 'AZ';
@@ -315,7 +551,6 @@
 	$states['WV'] = 'WV';
 	$states['WI'] = 'WI';
 	$states['WY'] = 'WY';
-	$states['OUTSIDE USA'] = 'OUTSIDE USA';
 
 	return $states;
 }
