You are here

cck_select_other_handler_field.inc in CCK Select Other 7.2

File

views/cck_select_other_handler_field.inc
View source
<?php

/**
 * @file
 */

/**
 * Extension to the Content Field Handler class for CCK Select Other
 */
class cck_select_other_handler_field extends views_handler_field_field {
  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;
  }

}

Classes

Namesort descending Description
cck_select_other_handler_field Extension to the Content Field Handler class for CCK Select Other