function getlocations_fields_handler_field_country::render in Get Locations 7.2
Same name and namespace in other branches
- 7 modules/getlocations_fields/handlers/getlocations_fields_handler_field_country.inc \getlocations_fields_handler_field_country::render()
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
File
- modules/
getlocations_fields/ handlers/ getlocations_fields_handler_field_country.inc, line 29 - getlocations_fields_handler_field_country.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Class
- getlocations_fields_handler_field_country
- @file getlocations_fields_handler_field_country.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function render($values) {
if ($this->options['style'] == 'name') {
if (drupal_strlen($values->{$this->field_alias}) == 2) {
return check_plain(getlocations_get_country_name($values->{$this->field_alias}));
}
else {
return check_plain($values->{$this->field_alias});
}
}
else {
if (drupal_strlen($values->{$this->field_alias}) == 2) {
return check_plain(drupal_strtoupper($values->{$this->field_alias}));
}
else {
return check_plain(drupal_strtoupper(getlocations_get_country_id($values->{$this->field_alias})));
}
}
}