function location_get_iso3166_list in Location 7.3
Same name and namespace in other branches
- 5.3 location.inc \location_get_iso3166_list()
- 5 location.inc \location_get_iso3166_list()
- 6.3 location.inc \location_get_iso3166_list()
- 7.5 location.inc \location_get_iso3166_list()
- 7.4 location.inc \location_get_iso3166_list()
The following is an array of all.
countrycode => country-name pairs as layed out in ISO 3166-1 alpha-2
12 calls to location_get_iso3166_list()
- google_geocode_country_list in geocoding/
google.inc - Return the list of ISO3166 codes supported by this geocoder.
- location_admin_settings in ./
location.admin.inc - Admin settings form.
- location_country_name in ./
location.inc - Get the translated name of a country code.
- location_generate_node_presave in contrib/
location_generate/ location_generate.module - Implements hook_node_presave().
- location_geocoding_parameters_page in ./
location.module - Page callback.
File
- ./
location.inc, line 802 - Public API for the Location module.
Code
function location_get_iso3166_list($upper = FALSE) {
include_once DRUPAL_ROOT . '/includes/locale.inc';
// Statically cache a version of the core Drupal list of countries
// with lower case country codes for use by this module.
$countries =& drupal_static(__FUNCTION__);
if ($upper) {
// Drupal core stores ISO 3166-1 alpha2 codes in upper case, as
// per the ISO standard.
return country_get_list();
}
elseif (!isset($countries)) {
// Location module uses lower-case ISO 3166-1 alpha2 codes, so we need
// to convert.
$countries = array_change_key_case(country_get_list(), CASE_LOWER);
}
return $countries;
}