You are here

class location_handler_argument_location_province in Location 6.3

Same name and namespace in other branches
  1. 7.5 handlers/location_handler_argument_location_province.inc \location_handler_argument_location_province
  2. 7.3 handlers/location_handler_argument_location_province.inc \location_handler_argument_location_province
  3. 7.4 handlers/location_handler_argument_location_province.inc \location_handler_argument_location_province

Argument handler to accept a province code or name.

Hierarchy

Expanded class hierarchy of location_handler_argument_location_province

1 string reference to 'location_handler_argument_location_province'
location_views_data in ./location.views.inc
Implementation of hook_views_data().

File

handlers/location_handler_argument_location_province.inc, line 6

View source
class location_handler_argument_location_province extends views_handler_argument {

  /**
   * Override the behavior of title(). Get the province name.
   */
  function title() {
    if (isset($this->view->argument['country'])) {
      $country = $this->view->argument['country']->argument;
    }
    else {
      $country = variable_get('location_default_country', 'us');
    }
    return location_province_name($country, $this->argument);
  }
  function summary_name($data) {
    $value = $data->{$this->name_alias};
    if (empty($value)) {
      return t('Unknown');
    }
    if (isset($this->view->argument['country'])) {
      $country = $this->view->argument['country']->argument;
    }
    else {
      $country = variable_get('location_default_country', 'us');
    }
    return location_province_name($country, $value);
  }

}

Members