summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/iso.inc476
-rw-r--r--includes/locale.inc207
-rw-r--r--install.php16
-rw-r--r--modules/openid/openid.module23
-rw-r--r--modules/system/system.admin.inc26
-rw-r--r--modules/system/system.install2
-rw-r--r--modules/system/system.js2
-rw-r--r--modules/system/system.module10
-rw-r--r--modules/user/user.install2
9 files changed, 555 insertions, 209 deletions
diff --git a/includes/iso.inc b/includes/iso.inc
new file mode 100644
index 000000000..0468be5f2
--- /dev/null
+++ b/includes/iso.inc
@@ -0,0 +1,476 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Provides a list of countries and languages based on ISO standards.
+ */
+
+/**
+ * Get an array of all country code => country name pairs.
+ *
+ * Get an array of all country code => country name pairs as layed out
+ * in ISO 3166-1 alpha-2.
+ * Grabbed from location project (http://drupal.org/project/location).
+ * @return
+ * An array of all country code => country name pairs.
+ */
+function _country_get_predefined_list() {
+ static $countries;
+
+ if (isset($countries)) {
+ return $countries;
+ }
+ $t = get_t();
+
+ $countries = array(
+ 'AD' => $t('Andorra'),
+ 'AE' => $t('United Arab Emirates'),
+ 'AF' => $t('Afghanistan'),
+ 'AG' => $t('Antigua and Barbuda'),
+ 'AI' => $t('Anguilla'),
+ 'AL' => $t('Albania'),
+ 'AM' => $t('Armenia'),
+ 'AN' => $t('Netherlands Antilles'),
+ 'AO' => $t('Angola'),
+ 'AQ' => $t('Antarctica'),
+ 'AR' => $t('Argentina'),
+ 'AS' => $t('American Samoa'),
+ 'AT' => $t('Austria'),
+ 'AU' => $t('Australia'),
+ 'AW' => $t('Aruba'),
+ 'AX' => $t('Aland Islands'),
+ 'AZ' => $t('Azerbaijan'),
+ 'BA' => $t('Bosnia and Herzegovina'),
+ 'BB' => $t('Barbados'),
+ 'BD' => $t('Bangladesh'),
+ 'BE' => $t('Belgium'),
+ 'BF' => $t('Burkina Faso'),
+ 'BG' => $t('Bulgaria'),
+ 'BH' => $t('Bahrain'),
+ 'BI' => $t('Burundi'),
+ 'BJ' => $t('Benin'),
+ 'BL' => $t('Saint Barthélemy'),
+ 'BM' => $t('Bermuda'),
+ 'BN' => $t('Brunei'),
+ 'BO' => $t('Bolivia'),
+ 'BR' => $t('Brazil'),
+ 'BS' => $t('Bahamas'),
+ 'BT' => $t('Bhutan'),
+ 'BV' => $t('Bouvet Island'),
+ 'BW' => $t('Botswana'),
+ 'BY' => $t('Belarus'),
+ 'BZ' => $t('Belize'),
+ 'CA' => $t('Canada'),
+ 'CC' => $t('Cocos (Keeling) Islands'),
+ 'CD' => $t('Congo (Kinshasa)'),
+ 'CF' => $t('Central African Republic'),
+ 'CG' => $t('Congo (Brazzaville)'),
+ 'CH' => $t('Switzerland'),
+ 'CI' => $t('Ivory Coast'),
+ 'CK' => $t('Cook Islands'),
+ 'CL' => $t('Chile'),
+ 'CM' => $t('Cameroon'),
+ 'CN' => $t('China'),
+ 'CO' => $t('Colombia'),
+ 'CR' => $t('Costa Rica'),
+ 'CS' => $t('Serbia And Montenegro'),
+ 'CU' => $t('Cuba'),
+ 'CV' => $t('Cape Verde'),
+ 'CX' => $t('Christmas Island'),
+ 'CY' => $t('Cyprus'),
+ 'CZ' => $t('Czech Republic'),
+ 'DE' => $t('Germany'),
+ 'DJ' => $t('Djibouti'),
+ 'DK' => $t('Denmark'),
+ 'DM' => $t('Dominica'),
+ 'DO' => $t('Dominican Republic'),
+ 'DZ' => $t('Algeria'),
+ 'EC' => $t('Ecuador'),
+ 'EE' => $t('Estonia'),
+ 'EG' => $t('Egypt'),
+ 'EH' => $t('Western Sahara'),
+ 'ER' => $t('Eritrea'),
+ 'ES' => $t('Spain'),
+ 'ET' => $t('Ethiopia'),
+ 'FI' => $t('Finland'),
+ 'FJ' => $t('Fiji'),
+ 'FK' => $t('Falkland Islands'),
+ 'FM' => $t('Micronesia'),
+ 'FO' => $t('Faroe Islands'),
+ 'FR' => $t('France'),
+ 'GA' => $t('Gabon'),
+ 'GD' => $t('Grenada'),
+ 'GE' => $t('Georgia'),
+ 'GF' => $t('French Guiana'),
+ 'GG' => $t('Guernsey'),
+ 'GH' => $t('Ghana'),
+ 'GI' => $t('Gibraltar'),
+ 'GL' => $t('Greenland'),
+ 'GM' => $t('Gambia'),
+ 'GN' => $t('Guinea'),
+ 'GP' => $t('Guadeloupe'),
+ 'GQ' => $t('Equatorial Guinea'),
+ 'GR' => $t('Greece'),
+ 'GS' => $t('South Georgia and the South Sandwich Islands'),
+ 'GT' => $t('Guatemala'),
+ 'GU' => $t('Guam'),
+ 'GW' => $t('Guinea-Bissau'),
+ 'GY' => $t('Guyana'),
+ 'HK' => $t('Hong Kong S.A.R., China'),
+ 'HM' => $t('Heard Island and McDonald Islands'),
+ 'HN' => $t('Honduras'),
+ 'HR' => $t('Croatia'),
+ 'HT' => $t('Haiti'),
+ 'HU' => $t('Hungary'),
+ 'ID' => $t('Indonesia'),
+ 'IE' => $t('Ireland'),
+ 'IL' => $t('Israel'),
+ 'IM' => $t('Isle of Man'),
+ 'IN' => $t('India'),
+ 'IO' => $t('British Indian Ocean Territory'),
+ 'IQ' => $t('Iraq'),
+ 'IR' => $t('Iran'),
+ 'IS' => $t('Iceland'),
+ 'IT' => $t('Italy'),
+ 'JE' => $t('Jersey'),
+ 'JM' => $t('Jamaica'),
+ 'JO' => $t('Jordan'),
+ 'JP' => $t('Japan'),
+ 'KE' => $t('Kenya'),
+ 'KG' => $t('Kyrgyzstan'),
+ 'KH' => $t('Cambodia'),
+ 'KI' => $t('Kiribati'),
+ 'KM' => $t('Comoros'),
+ 'KN' => $t('Saint Kitts and Nevis'),
+ 'KP' => $t('North Korea'),
+ 'KR' => $t('South Korea'),
+ 'KW' => $t('Kuwait'),
+ 'KY' => $t('Cayman Islands'),
+ 'KZ' => $t('Kazakhstan'),
+ 'LA' => $t('Laos'),
+ 'LB' => $t('Lebanon'),
+ 'LC' => $t('Saint Lucia'),
+ 'LI' => $t('Liechtenstein'),
+ 'LK' => $t('Sri Lanka'),
+ 'LR' => $t('Liberia'),
+ 'LS' => $t('Lesotho'),
+ 'LT' => $t('Lithuania'),
+ 'LU' => $t('Luxembourg'),
+ 'LV' => $t('Latvia'),
+ 'LY' => $t('Libya'),
+ 'MA' => $t('Morocco'),
+ 'MC' => $t('Monaco'),
+ 'MD' => $t('Moldova'),
+ 'ME' => $t('Montenegro'),
+ 'MF' => $t('Saint Martin (French part)'),
+ 'MG' => $t('Madagascar'),
+ 'MH' => $t('Marshall Islands'),
+ 'MK' => $t('Macedonia'),
+ 'ML' => $t('Mali'),
+ 'MM' => $t('Myanmar'),
+ 'MN' => $t('Mongolia'),
+ 'MO' => $t('Macao S.A.R., China'),
+ 'MP' => $t('Northern Mariana Islands'),
+ 'MQ' => $t('Martinique'),
+ 'MR' => $t('Mauritania'),
+ 'MS' => $t('Montserrat'),
+ 'MT' => $t('Malta'),
+ 'MU' => $t('Mauritius'),
+ 'MV' => $t('Maldives'),
+ 'MW' => $t('Malawi'),
+ 'MX' => $t('Mexico'),
+ 'MY' => $t('Malaysia'),
+ 'MZ' => $t('Mozambique'),
+ 'NA' => $t('Namibia'),
+ 'NC' => $t('New Caledonia'),
+ 'NE' => $t('Niger'),
+ 'NF' => $t('Norfolk Island'),
+ 'NG' => $t('Nigeria'),
+ 'NI' => $t('Nicaragua'),
+ 'NL' => $t('Netherlands'),
+ 'NO' => $t('Norway'),
+ 'NP' => $t('Nepal'),
+ 'NR' => $t('Nauru'),
+ 'NU' => $t('Niue'),
+ 'NZ' => $t('New Zealand'),
+ 'OM' => $t('Oman'),
+ 'PA' => $t('Panama'),
+ 'PE' => $t('Peru'),
+ 'PF' => $t('French Polynesia'),
+ 'PG' => $t('Papua New Guinea'),
+ 'PH' => $t('Philippines'),
+ 'PK' => $t('Pakistan'),
+ 'PL' => $t('Poland'),
+ 'PM' => $t('Saint Pierre and Miquelon'),
+ 'PN' => $t('Pitcairn'),
+ 'PR' => $t('Puerto Rico'),
+ 'PS' => $t('Palestinian Territory'),
+ 'PT' => $t('Portugal'),
+ 'PW' => $t('Palau'),
+ 'PY' => $t('Paraguay'),
+ 'QA' => $t('Qatar'),
+ 'RE' => $t('Reunion'),
+ 'RO' => $t('Romania'),
+ 'RS' => $t('Serbia'),
+ 'RU' => $t('Russia'),
+ 'RW' => $t('Rwanda'),
+ 'SA' => $t('Saudi Arabia'),
+ 'SB' => $t('Solomon Islands'),
+ 'SC' => $t('Seychelles'),
+ 'SD' => $t('Sudan'),
+ 'SE' => $t('Sweden'),
+ 'SG' => $t('Singapore'),
+ 'SH' => $t('Saint Helena'),
+ 'SI' => $t('Slovenia'),
+ 'SJ' => $t('Svalbard and Jan Mayen'),
+ 'SK' => $t('Slovakia'),
+ 'SL' => $t('Sierra Leone'),
+ 'SM' => $t('San Marino'),
+ 'SN' => $t('Senegal'),
+ 'SO' => $t('Somalia'),
+ 'SR' => $t('Suriname'),
+ 'ST' => $t('Sao Tome and Principe'),
+ 'SV' => $t('El Salvador'),
+ 'SY' => $t('Syria'),
+ 'SZ' => $t('Swaziland'),
+ 'TC' => $t('Turks and Caicos Islands'),
+ 'TD' => $t('Chad'),
+ 'TF' => $t('French Southern Territories'),
+ 'TG' => $t('Togo'),
+ 'TH' => $t('Thailand'),
+ 'TJ' => $t('Tajikistan'),
+ 'TK' => $t('Tokelau'),
+ 'TL' => $t('East Timor'),
+ 'TM' => $t('Turkmenistan'),
+ 'TN' => $t('Tunisia'),
+ 'TO' => $t('Tonga'),
+ 'TR' => $t('Turkey'),
+ 'TT' => $t('Trinidad and Tobago'),
+ 'TV' => $t('Tuvalu'),
+ 'TW' => $t('Taiwan'),
+ 'TZ' => $t('Tanzania'),
+ 'UA' => $t('Ukraine'),
+ 'UG' => $t('Uganda'),
+ 'UK' => $t('United Kingdom'),
+ 'UM' => $t('United States Minor Outlying Islands'),
+ 'US' => $t('United States'),
+ 'UY' => $t('Uruguay'),
+ 'UZ' => $t('Uzbekistan'),
+ 'VA' => $t('Vatican'),
+ 'VC' => $t('Saint Vincent and the Grenadines'),
+ 'VE' => $t('Venezuela'),
+ 'VG' => $t('British Virgin Islands'),
+ 'VI' => $t('U.S. Virgin Islands'),
+ 'VN' => $t('Vietnam'),
+ 'VU' => $t('Vanuatu'),
+ 'WF' => $t('Wallis and Futuna'),
+ 'WS' => $t('Samoa'),
+ 'YE' => $t('Yemen'),
+ 'YT' => $t('Mayotte'),
+ 'ZA' => $t('South Africa'),
+ 'ZM' => $t('Zambia'),
+ 'ZW' => $t('Zimbabwe'),
+ );
+
+ // Sort the list.
+ natcasesort($countries);
+
+ return $countries;
+}
+
+/**
+ * @ingroup locale-api-predefined List of predefined languages
+ * @{
+ */
+
+/**
+ * Some of the common languages with their English and native names
+ *
+ * Based on ISO 639 and http://people.w3.org/rishida/names/languages.html
+ */
+function _locale_get_predefined_list() {
+ return array(
+ "aa" => array("Afar"),
+ "ab" => array("Abkhazian", "аҧсуа бызшәа"),
+ "ae" => array("Avestan"),
+ "af" => array("Afrikaans"),
+ "ak" => array("Akan"),
+ "am" => array("Amharic", "አማርኛ"),
+ "ar" => array("Arabic", /* Left-to-right marker "‭" */ "العربية", LANGUAGE_RTL),
+ "as" => array("Assamese"),
+ "av" => array("Avar"),
+ "ay" => array("Aymara"),
+ "az" => array("Azerbaijani", "azərbaycan"),
+ "ba" => array("Bashkir"),
+ "be" => array("Belarusian", "Беларуская"),
+ "bg" => array("Bulgarian", "Български"),
+ "bh" => array("Bihari"),
+ "bi" => array("Bislama"),
+ "bm" => array("Bambara", "Bamanankan"),
+ "bn" => array("Bengali"),
+ "bo" => array("Tibetan"),
+ "br" => array("Breton"),
+ "bs" => array("Bosnian", "Bosanski"),
+ "ca" => array("Catalan", "Català"),
+ "ce" => array("Chechen"),
+ "ch" => array("Chamorro"),
+ "co" => array("Corsican"),
+ "cr" => array("Cree"),
+ "cs" => array("Czech", "Čeština"),
+ "cu" => array("Old Slavonic"),
+ "cv" => array("Chuvash"),
+ "cy" => array("Welsh", "Cymraeg"),
+ "da" => array("Danish", "Dansk"),
+ "de" => array("German", "Deutsch"),
+ "dv" => array("Maldivian"),
+ "dz" => array("Bhutani"),
+ "ee" => array("Ewe", "Ɛʋɛ"),
+ "el" => array("Greek", "Ελληνικά"),
+ "en" => array("English"),
+ "eo" => array("Esperanto"),
+ "es" => array("Spanish", "Español"),
+ "et" => array("Estonian", "Eesti"),
+ "eu" => array("Basque", "Euskera"),
+ "fa" => array("Persian", /* Left-to-right marker "‭" */ "فارسی", LANGUAGE_RTL),
+ "ff" => array("Fulah", "Fulfulde"),
+ "fi" => array("Finnish", "Suomi"),
+ "fj" => array("Fiji"),
+ "fo" => array("Faeroese"),
+ "fr" => array("French", "Français"),
+ "fy" => array("Frisian", "Frysk"),
+ "ga" => array("Irish", "Gaeilge"),
+ "gd" => array("Scots Gaelic"),
+ "gl" => array("Galician", "Galego"),
+ "gn" => array("Guarani"),
+ "gu" => array("Gujarati"),
+ "gv" => array("Manx"),
+ "ha" => array("Hausa"),
+ "he" => array("Hebrew", /* Left-to-right marker "‭" */ "עברית", LANGUAGE_RTL),
+ "hi" => array("Hindi", "हिन्दी"),
+ "ho" => array("Hiri Motu"),
+ "hr" => array("Croatian", "Hrvatski"),
+ "hu" => array("Hungarian", "Magyar"),
+ "hy" => array("Armenian", "Հայերեն"),
+ "hz" => array("Herero"),
+ "ia" => array("Interlingua"),
+ "id" => array("Indonesian", "Bahasa Indonesia"),
+ "ie" => array("Interlingue"),
+ "ig" => array("Igbo"),
+ "ik" => array("Inupiak"),
+ "is" => array("Icelandic", "Íslenska"),
+ "it" => array("Italian", "Italiano"),
+ "iu" => array("Inuktitut"),
+ "ja" => array("Japanese", "日本語"),
+ "jv" => array("Javanese"),
+ "ka" => array("Georgian"),
+ "kg" => array("Kongo"),
+ "ki" => array("Kikuyu"),
+ "kj" => array("Kwanyama"),
+ "kk" => array("Kazakh", "Қазақ"),
+ "kl" => array("Greenlandic"),
+ "km" => array("Cambodian"),
+ "kn" => array("Kannada", "ಕನ್ನಡ"),
+ "ko" => array("Korean", "한국어"),
+ "kr" => array("Kanuri"),
+ "ks" => array("Kashmiri"),
+ "ku" => array("Kurdish", "Kurdî"),
+ "kv" => array("Komi"),
+ "kw" => array("Cornish"),
+ "ky" => array("Kirghiz", "Кыргыз"),
+ "la" => array("Latin", "Latina"),
+ "lb" => array("Luxembourgish"),
+ "lg" => array("Luganda"),
+ "ln" => array("Lingala"),
+ "lo" => array("Laothian"),
+ "lt" => array("Lithuanian", "Lietuvių"),
+ "lv" => array("Latvian", "Latviešu"),
+ "mg" => array("Malagasy"),
+ "mh" => array("Marshallese"),
+ "mi" => array("Maori"),
+ "mk" => array("Macedonian", "Македонски"),
+ "ml" => array("Malayalam", "മലയാളം"),
+ "mn" => array("Mongolian"),
+ "mo" => array("Moldavian"),
+ "mr" => array("Marathi"),
+ "ms" => array("Malay", "Bahasa Melayu"),
+ "mt" => array("Maltese", "Malti"),
+ "my" => array("Burmese"),
+ "na" => array("Nauru"),
+ "nd" => array("North Ndebele"),
+ "ne" => array("Nepali"),
+ "ng" => array("Ndonga"),
+ "nl" => array("Dutch", "Nederlands"),
+ "nb" => array("Norwegian Bokmål", "Bokmål"),
+ "nn" => array("Norwegian Nynorsk", "Nynorsk"),
+ "nr" => array("South Ndebele"),
+ "nv" => array("Navajo"),
+ "ny" => array("Chichewa"),
+ "oc" => array("Occitan"),
+ "om" => array("Oromo"),
+ "or" => array("Oriya"),
+ "os" => array("Ossetian"),
+ "pa" => array("Punjabi"),
+ "pi" => array("Pali"),
+ "pl" => array("Polish", "Polski"),
+ "ps" => array("Pashto", /* Left-to-right marker "‭" */ "پښتو", LANGUAGE_RTL),
+ "pt-pt" => array("Portuguese, Portugal", "Português"),
+ "pt-br" => array("Portuguese, Brazil", "Português"),
+ "qu" => array("Quechua"),
+ "rm" => array("Rhaeto-Romance"),
+ "rn" => array("Kirundi"),
+ "ro" => array("Romanian", "Română"),
+ "ru" => array("Russian", "Русский"),
+ "rw" => array("Kinyarwanda"),
+ "sa" => array("Sanskrit"),
+ "sc" => array("Sardinian"),
+ "sd" => array("Sindhi"),
+ "se" => array("Northern Sami"),
+ "sg" => array("Sango"),
+ "sh" => array("Serbo-Croatian"),
+ "si" => array("Singhalese"),
+ "sk" => array("Slovak", "Slovenčina"),
+ "sl" => array("Slovenian", "Slovenščina"),
+ "sm" => array("Samoan"),
+ "sn" => array("Shona"),
+ "so" => array("Somali"),
+ "sq" => array("Albanian", "Shqip"),
+ "sr" => array("Serbian", "Српски"),
+ "ss" => array("Siswati"),
+ "st" => array("Sesotho"),
+ "su" => array("Sudanese"),
+ "sv" => array("Swedish", "Svenska"),
+ "sw" => array("Swahili", "Kiswahili"),
+ "ta" => array("Tamil", "தமிழ்"),
+ "te" => array("Telugu", "తెలుగు"),
+ "tg" => array("Tajik"),
+ "th" => array("Thai", "ภาษาไทย"),
+ "ti" => array("Tigrinya"),
+ "tk" => array("Turkmen"),
+ "tl" => array("Tagalog"),
+ "tn" => array("Setswana"),
+ "to" => array("Tonga"),
+ "tr" => array("Turkish", "Türkçe"),
+ "ts" => array("Tsonga"),
+ "tt" => array("Tatar", "Tatarça"),
+ "tw" => array("Twi"),
+ "ty" => array("Tahitian"),
+ "ug" => array("Uighur"),
+ "uk" => array("Ukrainian", "Українська"),
+ "ur" => array("Urdu", /* Left-to-right marker "‭" */ "اردو", LANGUAGE_RTL),
+ "uz" => array("Uzbek", "o'zbek"),
+ "ve" => array("Venda"),
+ "vi" => array("Vietnamese", "Tiếng Việt"),
+ "wo" => array("Wolof"),
+ "xh" => array("Xhosa", "isiXhosa"),
+ "yi" => array("Yiddish"),
+ "yo" => array("Yoruba", "Yorùbá"),
+ "za" => array("Zhuang"),
+ "zh-hans" => array("Chinese, Simplified", "简体中文"),
+ "zh-hant" => array("Chinese, Traditional", "繁體中文"),
+ "zu" => array("Zulu", "isiZulu"),
+ );
+}
+/**
+ * @} End of "locale-api-languages-predefined"
+ */
diff --git a/includes/locale.inc b/includes/locale.inc
index 322b5f7d1..bdf420c48 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -302,6 +302,7 @@ function locale_languages_predefined_form_validate($form, &$form_state) {
if (!isset($form_state['values']['name'])) {
// Predefined language selection.
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
$predefined = _locale_get_predefined_list();
if (!isset($predefined[$langcode])) {
form_set_error('langcode', t('Invalid language code.'));
@@ -325,6 +326,7 @@ function locale_languages_predefined_form_submit($form, &$form_state) {
}
else {
// Predefined language selection.
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
$predefined = _locale_get_predefined_list();
locale_add_language($langcode);
drupal_set_message(t('The language %language has been created and can now be used. More information is available on the <a href="@locale-help">help screen</a>.', array('%language' => t($predefined[$langcode][0]), '@locale-help' => url('admin/help/locale'))));
@@ -736,6 +738,7 @@ function locale_translate_import_form_submit($form, &$form_state) {
$languages = language_list('language', TRUE);
$langcode = $form_state['values']['langcode'];
if (!isset($languages[$langcode])) {
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
$predefined = _locale_get_predefined_list();
locale_add_language($langcode);
drupal_set_message(t('The language %language has been created.', array('%language' => t($predefined[$langcode][0]))));
@@ -1059,6 +1062,7 @@ function locale_add_language($langcode, $name = NULL, $native = NULL, $direction
// If name was not set, we add a predefined language.
if (!isset($name)) {
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
$predefined = _locale_get_predefined_list();
$name = $predefined[$langcode][0];
$native = isset($predefined[$langcode][1]) ? $predefined[$langcode][1] : $predefined[$langcode][0];
@@ -2371,6 +2375,7 @@ function _locale_translate_language_list($translation, $limit_language) {
* Prepares the language code list for a select form item with only the unsupported ones
*/
function _locale_prepare_predefined_list() {
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
$languages = language_list();
$predefined = _locale_get_predefined_list();
foreach ($predefined as $key => $value) {
@@ -2392,193 +2397,6 @@ function _locale_prepare_predefined_list() {
}
/**
- * Some of the common languages with their English and native names
- *
- * Based on ISO 639 and http://people.w3.org/rishida/names/languages.html
- */
-function _locale_get_predefined_list() {
- return array(
- "aa" => array("Afar"),
- "ab" => array("Abkhazian", "аҧсуа бызшәа"),
- "ae" => array("Avestan"),
- "af" => array("Afrikaans"),
- "ak" => array("Akan"),
- "am" => array("Amharic", "አማርኛ"),
- "ar" => array("Arabic", /* Left-to-right marker "‭" */ "العربية", LANGUAGE_RTL),
- "as" => array("Assamese"),
- "av" => array("Avar"),
- "ay" => array("Aymara"),
- "az" => array("Azerbaijani", "azərbaycan"),
- "ba" => array("Bashkir"),
- "be" => array("Belarusian", "Беларуская"),
- "bg" => array("Bulgarian", "Български"),
- "bh" => array("Bihari"),
- "bi" => array("Bislama"),
- "bm" => array("Bambara", "Bamanankan"),
- "bn" => array("Bengali"),
- "bo" => array("Tibetan"),
- "br" => array("Breton"),
- "bs" => array("Bosnian", "Bosanski"),
- "ca" => array("Catalan", "Català"),
- "ce" => array("Chechen"),
- "ch" => array("Chamorro"),
- "co" => array("Corsican"),
- "cr" => array("Cree"),
- "cs" => array("Czech", "Čeština"),
- "cu" => array("Old Slavonic"),
- "cv" => array("Chuvash"),
- "cy" => array("Welsh", "Cymraeg"),
- "da" => array("Danish", "Dansk"),
- "de" => array("German", "Deutsch"),
- "dv" => array("Maldivian"),
- "dz" => array("Bhutani"),
- "ee" => array("Ewe", "Ɛʋɛ"),
- "el" => array("Greek", "Ελληνικά"),
- "en" => array("English"),
- "eo" => array("Esperanto"),
- "es" => array("Spanish", "Español"),
- "et" => array("Estonian", "Eesti"),
- "eu" => array("Basque", "Euskera"),
- "fa" => array("Persian", /* Left-to-right marker "‭" */ "فارسی", LANGUAGE_RTL),
- "ff" => array("Fulah", "Fulfulde"),
- "fi" => array("Finnish", "Suomi"),
- "fj" => array("Fiji"),
- "fo" => array("Faeroese"),
- "fr" => array("French", "Français"),
- "fy" => array("Frisian", "Frysk"),
- "ga" => array("Irish", "Gaeilge"),
- "gd" => array("Scots Gaelic"),
- "gl" => array("Galician", "Galego"),
- "gn" => array("Guarani"),
- "gu" => array("Gujarati"),
- "gv" => array("Manx"),
- "ha" => array("Hausa"),
- "he" => array("Hebrew", /* Left-to-right marker "‭" */ "עברית", LANGUAGE_RTL),
- "hi" => array("Hindi", "हिन्दी"),
- "ho" => array("Hiri Motu"),
- "hr" => array("Croatian", "Hrvatski"),
- "hu" => array("Hungarian", "Magyar"),
- "hy" => array("Armenian", "Հայերեն"),
- "hz" => array("Herero"),
- "ia" => array("Interlingua"),
- "id" => array("Indonesian", "Bahasa Indonesia"),
- "ie" => array("Interlingue"),
- "ig" => array("Igbo"),
- "ik" => array("Inupiak"),
- "is" => array("Icelandic", "Íslenska"),
- "it" => array("Italian", "Italiano"),
- "iu" => array("Inuktitut"),
- "ja" => array("Japanese", "日本語"),
- "jv" => array("Javanese"),
- "ka" => array("Georgian"),
- "kg" => array("Kongo"),
- "ki" => array("Kikuyu"),
- "kj" => array("Kwanyama"),
- "kk" => array("Kazakh", "Қазақ"),
- "kl" => array("Greenlandic"),
- "km" => array("Cambodian"),
- "kn" => array("Kannada", "ಕನ್ನಡ"),
- "ko" => array("Korean", "한국어"),
- "kr" => array("Kanuri"),
- "ks" => array("Kashmiri"),
- "ku" => array("Kurdish", "Kurdî"),
- "kv" => array("Komi"),
- "kw" => array("Cornish"),
- "ky" => array("Kirghiz", "Кыргыз"),
- "la" => array("Latin", "Latina"),
- "lb" => array("Luxembourgish"),
- "lg" => array("Luganda"),
- "ln" => array("Lingala"),
- "lo" => array("Laothian"),
- "lt" => array("Lithuanian", "Lietuvių"),
- "lv" => array("Latvian", "Latviešu"),
- "mg" => array("Malagasy"),
- "mh" => array("Marshallese"),
- "mi" => array("Maori"),
- "mk" => array("Macedonian", "Македонски"),
- "ml" => array("Malayalam", "മലയാളം"),
- "mn" => array("Mongolian"),
- "mo" => array("Moldavian"),
- "mr" => array("Marathi"),
- "ms" => array("Malay", "Bahasa Melayu"),
- "mt" => array("Maltese", "Malti"),
- "my" => array("Burmese"),
- "na" => array("Nauru"),
- "nd" => array("North Ndebele"),
- "ne" => array("Nepali"),
- "ng" => array("Ndonga"),
- "nl" => array("Dutch", "Nederlands"),
- "nb" => array("Norwegian Bokmål", "Bokmål"),
- "nn" => array("Norwegian Nynorsk", "Nynorsk"),
- "nr" => array("South Ndebele"),
- "nv" => array("Navajo"),
- "ny" => array("Chichewa"),
- "oc" => array("Occitan"),
- "om" => array("Oromo"),
- "or" => array("Oriya"),
- "os" => array("Ossetian"),
- "pa" => array("Punjabi"),
- "pi" => array("Pali"),
- "pl" => array("Polish", "Polski"),
- "ps" => array("Pashto", /* Left-to-right marker "‭" */ "پښتو", LANGUAGE_RTL),
- "pt-pt" => array("Portuguese, Portugal", "Português"),
- "pt-br" => array("Portuguese, Brazil", "Português"),
- "qu" => array("Quechua"),
- "rm" => array("Rhaeto-Romance"),
- "rn" => array("Kirundi"),
- "ro" => array("Romanian", "Română"),
- "ru" => array("Russian", "Русский"),
- "rw" => array("Kinyarwanda"),
- "sa" => array("Sanskrit"),
- "sc" => array("Sardinian"),
- "sd" => array("Sindhi"),
- "se" => array("Northern Sami"),
- "sg" => array("Sango"),
- "sh" => array("Serbo-Croatian"),
- "si" => array("Singhalese"),
- "sk" => array("Slovak", "Slovenčina"),
- "sl" => array("Slovenian", "Slovenščina"),
- "sm" => array("Samoan"),
- "sn" => array("Shona"),
- "so" => array("Somali"),
- "sq" => array("Albanian", "Shqip"),
- "sr" => array("Serbian", "Српски"),
- "ss" => array("Siswati"),
- "st" => array("Sesotho"),
- "su" => array("Sudanese"),
- "sv" => array("Swedish", "Svenska"),
- "sw" => array("Swahili", "Kiswahili"),
- "ta" => array("Tamil", "தமிழ்"),
- "te" => array("Telugu", "తెలుగు"),
- "tg" => array("Tajik"),
- "th" => array("Thai", "ภาษาไทย"),
- "ti" => array("Tigrinya"),
- "tk" => array("Turkmen"),
- "tl" => array("Tagalog"),
- "tn" => array("Setswana"),
- "to" => array("Tonga"),
- "tr" => array("Turkish", "Türkçe"),
- "ts" => array("Tsonga"),
- "tt" => array("Tatar", "Tatarça"),
- "tw" => array("Twi"),
- "ty" => array("Tahitian"),
- "ug" => array("Uighur"),
- "uk" => array("Ukrainian", "Українська"),
- "ur" => array("Urdu", /* Left-to-right marker "‭" */ "اردو", LANGUAGE_RTL),
- "uz" => array("Uzbek", "o'zbek"),
- "ve" => array("Venda"),
- "vi" => array("Vietnamese", "Tiếng Việt"),
- "wo" => array("Wolof"),
- "xh" => array("Xhosa", "isiXhosa"),
- "yi" => array("Yiddish"),
- "yo" => array("Yoruba", "Yorùbá"),
- "za" => array("Zhuang"),
- "zh-hans" => array("Chinese, Simplified", "简体中文"),
- "zh-hant" => array("Chinese, Traditional", "繁體中文"),
- "zu" => array("Zulu", "isiZulu"),
- );
-}
-/**
* @} End of "locale-api-languages-predefined"
*/
@@ -2736,3 +2554,18 @@ function _locale_batch_language_finished($success, $results) {
/**
* @} End of "locale-autoimport"
*/
+
+/**
+ * Get list of all predefined and custom countries.
+ *
+ * @return
+ * An array of all country code => country name pairs.
+ */
+function country_get_list() {
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
+ $countries = _country_get_predefined_list();
+ // Allow other modules to modify the country list.
+ drupal_alter('countries', $countries);
+ return $countries;
+}
+
diff --git a/install.php b/install.php
index 17b02e119..e0d7698fb 100644
--- a/install.php
+++ b/install.php
@@ -567,7 +567,7 @@ function install_select_locale($profilename) {
* Form API array definition for language selection.
*/
function install_select_locale_form(&$form_state, $locales) {
- include_once DRUPAL_ROOT . '/includes/locale.inc';
+ include_once DRUPAL_ROOT . '/includes/iso.inc';
$languages = _locale_get_predefined_list();
foreach ($locales as $locale) {
// Try to use verbose locale name
@@ -953,6 +953,7 @@ function install_task_list($active = NULL) {
* Form API array definition for site configuration.
*/
function install_configure_form(&$form_state, $url) {
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
$form['intro'] = array(
'#markup' => st('To configure your website, please provide the following information.'),
@@ -1016,6 +1017,18 @@ function install_configure_form(&$form_state, $url) {
'#title' => st('Server settings'),
'#collapsible' => FALSE,
);
+
+ $countries = country_get_list();
+ $countries = array_merge(array('' => st('No default country')), $countries);
+ $form['server_settings']['site_default_country'] = array(
+ '#type' => 'select',
+ '#title' => t('Default country'),
+ '#default_value' => variable_get('site_default_country', ''),
+ '#options' => $countries,
+ '#description' => st('Select the default country for the site.'),
+ '#weight' => 0,
+ );
+
$form['server_settings']['date_default_timezone'] = array(
'#type' => 'select',
'#title' => st('Default time zone'),
@@ -1089,6 +1102,7 @@ function install_configure_form_submit($form, &$form_state) {
variable_set('site_name', $form_state['values']['site_name']);
variable_set('site_mail', $form_state['values']['site_mail']);
variable_set('date_default_timezone', $form_state['values']['date_default_timezone']);
+ variable_set('site_default_country', $form_state['values']['site_default_country']);
// Enable update.module if this option was selected.
if ($form_state['values']['update_status_module'][1]) {
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 65f1a5170..5b8968fa0 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -346,10 +346,12 @@ function openid_association($op_endpoint) {
module_load_include('inc', 'openid');
// Remove Old Associations:
- db_query("DELETE FROM {openid_association} WHERE created + expires_in < %d", REQUEST_TIME);
+ db_delete('openid_association')
+ ->condition('created + expires_in', REQUEST_TIME, '<')
+ ->execute();
// Check to see if we have an association for this IdP already
- $assoc_handle = db_result(db_query("SELECT assoc_handle FROM {openid_association} WHERE idp_endpoint_uri = '%s'", $op_endpoint));
+ $assoc_handle = db_query("SELECT assoc_handle FROM {openid_association} WHERE idp_endpoint_uri = :endpoint", array(':endpoint' => $op_endpoint))->fetchField();
if (empty($assoc_handle)) {
$mod = OPENID_DH_DEFAULT_MOD;
$gen = OPENID_DH_DEFAULT_GEN;
@@ -381,12 +383,19 @@ function openid_association($op_endpoint) {
$shared = bcpowmod($spub, $private, $mod);
$assoc_response['mac_key'] = base64_encode(_openid_dh_xorsecret($shared, $enc_mac_key));
}
- db_query("INSERT INTO {openid_association} (idp_endpoint_uri, session_type, assoc_handle, assoc_type, expires_in, mac_key, created) VALUES('%s', '%s', '%s', '%s', %d, '%s', %d)",
- $op_endpoint, $assoc_response['session_type'], $assoc_response['assoc_handle'], $assoc_response['assoc_type'], $assoc_response['expires_in'], $assoc_response['mac_key'], REQUEST_TIME);
-
+ db_insert('openid_association')
+ ->fields(array(
+ 'idp_endpoint_uri' => $op_endpoint,
+ 'session_type' => $assoc_response['session_type'],
+ 'assoc_handle' => $assoc_response['assoc_handle'],
+ 'assoc_type' => $assoc_response['assoc_type'],
+ 'expires_in' => $assoc_response['expires_in'],
+ 'mac_key' => $assoc_response['mac_key'],
+ 'created' => REQUEST_TIME,
+ ))
+ ->execute();
$assoc_handle = $assoc_response['assoc_handle'];
}
-
return $assoc_handle;
}
@@ -512,7 +521,7 @@ function openid_verify_assertion($op_endpoint, $response) {
$valid = FALSE;
- $association = db_fetch_object(db_query("SELECT * FROM {openid_association} WHERE assoc_handle = '%s'", $response['openid.assoc_handle']));
+ $association = db_query("SELECT * FROM {openid_association} WHERE assoc_handle = :assoc_handle", array(':assoc_handle' => $response['openid.assoc_handle']))->fetchObject();
if ($association && isset($association->session_type)) {
$keys_to_sign = explode(',', $response['openid.signed']);
$self_sig = _openid_signature($association, $response, $keys_to_sign);
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 2e24cf8d3..8b9a844d5 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1524,11 +1524,16 @@ function system_rss_feeds_settings() {
*
* @ingroup forms
* @see system_settings_form()
- * @see system_date_time_settings_submit()
+ * @see system_regional_settings_submit()
*/
-function system_date_time_settings() {
+function system_regional_settings() {
drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
- drupal_add_js(array('dateTime' => array('lookup' => url('admin/settings/date-time/lookup'))), 'setting');
+ drupal_add_js(array('dateTime' => array('lookup' => url('admin/settings/regional-settings/lookup'))), 'setting');
+
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
+ $countries = country_get_list();
+ // Add a 'No default country' option to the start of the list.
+ $countries = array_merge(array('' => t('No default country')), $countries);
// Date settings:
$zones = system_time_zones();
@@ -1563,12 +1568,21 @@ function system_date_time_settings() {
'#title' => t('Locale settings'),
);
+ $form['locale']['site_default_country'] = array(
+ '#type' => 'select',
+ '#title' => t('Default country'),
+ '#default_value' => variable_get('site_default_country', ''),
+ '#options' => $countries,
+ '#description' => t('Select the default country for the site.'),
+ '#attributes' => array('class' => 'country-detect'),
+ );
+
$form['locale']['date_default_timezone'] = array(
'#type' => 'select',
'#title' => t('Default time zone'),
'#default_value' => variable_get('date_default_timezone', date_default_timezone_get()),
'#options' => $zones,
- '#description' => t('Select the default site time zone.')
+ '#description' => t('Select the default time zone for the site.'),
);
$form['locale']['date_first_day'] = array(
@@ -1696,9 +1710,9 @@ function system_date_time_settings() {
}
/**
- * Process system_date_time_settings form submissions.
+ * Process system_regional_settings form submissions.
*/
-function system_date_time_settings_submit($form, &$form_state) {
+function system_regional_settings_submit($form, &$form_state) {
if ($form_state['values']['date_format_short'] == 'custom') {
$form_state['values']['date_format_short'] = $form_state['values']['date_format_short_custom'];
}
diff --git a/modules/system/system.install b/modules/system/system.install
index faef5d4ad..c1c625298 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -3116,7 +3116,7 @@ function system_update_7013() {
$timezone = 'UTC';
}
variable_set('date_default_timezone', $timezone);
- drupal_set_message('The default time zone has been set to <em>' . check_plain($timezone) . '</em>. Please check the ' . l('date and time configuration page', 'admin/settings/date-time') . ' to configure it correctly.', 'warning');
+ drupal_set_message('The default time zone has been set to <em>' . check_plain($timezone) . '</em>. Please check the ' . l('date and time configuration page', 'admin/settings/regional-settings') . ' to configure it correctly.', 'warning');
return $ret;
}
diff --git a/modules/system/system.js b/modules/system/system.js
index 221b03b23..c6b6fc4ee 100644
--- a/modules/system/system.js
+++ b/modules/system/system.js
@@ -99,7 +99,7 @@ Drupal.behaviors.copyFieldValue = {
};
/**
- * Show/hide custom format sections on the date-time settings page.
+ * Show/hide custom format sections on the regional settings page.
*/
Drupal.behaviors.dateTime = {
attach: function(context, settings) {
diff --git a/modules/system/system.module b/modules/system/system.module
index c2e33fb19..2111fdce9 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -70,7 +70,7 @@ function system_help($path, $arg) {
$output .= '<li>' . t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) . '</li>';
$output .= '<li>' . t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/settings/performance'))) . '</li>';
$output .= '<li>' . t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '</li>';
- $output .= '<li>' . t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily offline.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) . '</li></ul>';
+ $output .= '<li>' . t('basic configuration options for your site, including <a href="@regional-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily offline.', array('@regional-settings' => url('admin/settings/regional-settings'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) . '</li></ul>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '</p>';
return $output;
case 'admin/by-module':
@@ -677,14 +677,14 @@ function system_menu() {
'page arguments' => array('system_rss_feeds_settings'),
'access arguments' => array('administer site configuration'),
);
- $items['admin/settings/date-time'] = array(
- 'title' => 'Date and time',
+ $items['admin/settings/regional-settings'] = array(
+ 'title' => 'Regional settings',
'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
'page callback' => 'drupal_get_form',
- 'page arguments' => array('system_date_time_settings'),
+ 'page arguments' => array('system_regional_settings'),
'access arguments' => array('administer site configuration'),
);
- $items['admin/settings/date-time/lookup'] = array(
+ $items['admin/settings/regional-settings/lookup'] = array(
'title' => 'Date and time lookup',
'type' => MENU_CALLBACK,
'page callback' => 'system_date_time_lookup',
diff --git a/modules/user/user.install b/modules/user/user.install
index d172e8c6d..11f4eb243 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -351,7 +351,7 @@ function user_update_7002(&$sandbox) {
$ret[] = array('success' => TRUE, 'query' => "Migrate user time zones.");
if ($sandbox['user_not_migrated'] > 0) {
variable_set('empty_timezone_message', 1);
- drupal_set_message('Some user time zones have been emptied and need to be set to the correct values. Use the new ' . l('time zone options', 'admin/settings/date-time') . ' to choose whether to remind users at login to set the correct time zone.', 'warning');
+ drupal_set_message('Some user time zones have been emptied and need to be set to the correct values. Use the new ' . l('time zone options', 'admin/settings/regional-settings') . ' to choose whether to remind users at login to set the correct time zone.', 'warning');
}
}
}