You are here

public function location_handler_field_location_province::render in Location 7.3

Same name and namespace in other branches
  1. 6.3 handlers/location_handler_field_location_province.inc \location_handler_field_location_province::render()
  2. 7.5 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()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

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

Class

location_handler_field_location_province

Code

public 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 check_plain(location_province_name($values->{$this->aliases['country']}, $values->{$this->field_alias}));
    }
    else {
      return check_plain(strtoupper($values->{$this->field_alias}));
    }
  }
}