You are here

function countries_get_continents in Countries 7.2

Same name and namespace in other branches
  1. 8 countries.module \countries_get_continents()
  2. 7 countries.module \countries_get_continents()

Gets a list of all continents currently enabled.

Note that it is possible to have continent codes that are not present in this array if the user has overridden the variable setting "countries_continents".

Return value

array An array of continents indexed by their continent code.

See also

countries_get_default_continents()

6 calls to countries_get_continents()
countries_admin_form in ./countries.admin.inc
Generate a country form.
countries_field_widget_form in ./countries.fields.inc
Implements hook_field_widget_form().
countries_filter_options_form in ./countries.fields.inc
Wrapper for the filter form options that are shared with other fields.
country_property in ./countries.module
Helper function to help standardise the display of the core properties.
views_handler_field_countries_continent::render in views/views_handler_field_countries_continent.inc
Render contient as human readable name or continent code

... See full list

2 string references to 'countries_get_continents'
countries_clear_caches in ./countries.module
Helper function to clear various caches.
countries_views_data in views/countries.views.inc
Implements hook_views_data().

File

./countries.module, line 451
Defines the field and entity information for countries.

Code

function countries_get_continents() {
  $continents =& drupal_static(__FUNCTION__, array());
  if (empty($continents)) {
    $continents = variable_get('countries_continents', countries_get_default_continents());
    $known = countries_known_continents();
    $continents = array_intersect_key($known, $continents) + array_diff_key($continents, $known);
    uasort($continents, 'countries_sort');
  }
  return $continents;
}