You are here

function countries_options_list in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.fields.inc \countries_options_list()

Implements hook_options_list().

1 call to countries_options_list()
_countries_devel_generate in ./countries.devel_generate.inc
Implements hook_devel_generate().

File

./countries.fields.inc, line 384
All field related code.

Code

function countries_options_list($field) {
  $function = !empty($field['settings']['options_list_callback']) ? $field['settings']['options_list_callback'] : 'countries_allowed_values';
  $field['settings'] += array(
    'countries' => array(),
  );
  if (!isset($field['#filters'])) {
    $filters = array(
      'countries' => array_filter($field['settings']['countries']),
      'continents' => array_filter($field['settings']['continents']),
      'enabled' => $field['settings']['enabled'],
    );
    $field['#filters'] = $filters;
  }
  return $function($field);
}