function cck_select_other_handler_field::render in CCK Select Other 7
Same name and namespace in other branches
- 6 views/cck_select_other_handler_field.inc \cck_select_other_handler_field::render()
- 7.2 views/cck_select_other_handler_field.inc \cck_select_other_handler_field::render()
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
File
- views/
cck_select_other_handler_field.inc, line 12
Class
- cck_select_other_handler_field
- Extension to the Content Field Handler class for CCK Select Other
Code
function render($values) {
$entity_type = $values->_field_cache[$this->field_alias]['entity_type'];
$field_name = $this->definition['field_name'];
$object = $values->_field_cache[$this->field_alias]['object'];
$instance = field_read_instance($entity_type, $field_name, $object->type);
$options = cck_select_other_options($instance);
$lang = $object->language;
$value = $object->{$field_name}[$lang][0]['value'];
return isset($options[$value]) ? $options[$value] : $value;
}