You are here

function views_handler_filter_countries_list::get_value_options in Countries 8

Same name and namespace in other branches
  1. 7.2 views/views_handler_filter_countries_list.inc \views_handler_filter_countries_list::get_value_options()

File

views/views_handler_filter_countries_list.inc, line 83
Views module filter handler class.

Class

views_handler_filter_countries_list
Filter by ISO Code 2.

Code

function get_value_options() {
  $options = array();
  switch ($this->options['configuration']) {
    case COUNTRIES_VIEWS_WIDGET_FIELD:
      if (isset($this->options['relationship'])) {
        if ($field = field_info_field(substr($this->options['relationship'], 0, -5))) {
          $options = $field['settings'];
        }
      }
      break;
    case COUNTRIES_VIEWS_WIDGET_CUSTOM:
      $options = $this->options['filter'];
      break;
  }
  $property = isset($this->definition['property']) ? $this->definition['property'] : 'name';
  $this->value_options = countries_filter(countries_get_countries($property), $options);
  uasort($this->value_options, 'countries_sort');
}