You are here

function location_handler_field_location_province::render in Location 6.3

Same name and namespace in other branches
  1. 7.5 handlers/location_handler_field_location_province.inc \location_handler_field_location_province::render()
  2. 7.3 handlers/location_handler_field_location_province.inc \location_handler_field_location_province::render()
  3. 7.4 handlers/location_handler_field_location_province.inc \location_handler_field_location_province::render()

File

handlers/location_handler_field_location_province.inc, line 33
Province field handler.

Class

location_handler_field_location_province
@file Province field handler.

Code

function render($values) {
  if ($this->options['style'] == 'name') {
    return t(check_plain(location_province_name($values->{$this->aliases['country']}, $values->{$this->field_alias})));
  }
  else {

    //If we get a number for the province, there is not a "proper" code, we must us it's name.
    if (is_numeric($values->{$this->field_alias})) {
      return t(check_plain(location_province_name($values->{$this->aliases['country']}, $values->{$this->field_alias})));
    }
    else {
      return check_plain(strtoupper($values->{$this->field_alias}));
    }
  }
}