You are here

uc_views_handler_filter_country.inc in Ubercart Views 6.3

Same filename and directory in other branches
  1. 6.2 views/uc_views_handler_filter_country.inc

File

views/uc_views_handler_filter_country.inc
View source
<?php

/**
 * Filter by country code
 */
class uc_views_handler_filter_country extends views_handler_filter_in_operator {
  function get_value_options() {
    if (!isset($this->value_options)) {
      $this->value_title = t('Country');
      $result = db_query("SELECT country_id,country_name FROM {uc_countries} WHERE version > 0 ORDER BY country_name");
      while ($country = db_fetch_array($result)) {
        $options[$country['country_id']] = $country['country_name'];
      }
      if (count($options) == 0) {
        $options[] = t('No countries found.');
      }
      $this->value_options = $options;
    }
  }

}

Classes

Namesort descending Description
uc_views_handler_filter_country Filter by country code