You are here

class content_handler_argument_many_to_one in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 includes/views/handlers/content_handler_argument_many_to_one.inc \content_handler_argument_many_to_one

@file Handler for 'content_handler_argument_many_to_one' style.

Hierarchy

Expanded class hierarchy of content_handler_argument_many_to_one

2 string references to 'content_handler_argument_many_to_one'
number_field_settings in modules/number/number.module
Implementation of hook_field_settings().
text_field_settings in modules/text/text.module
Implementation of hook_field_settings().

File

includes/views/handlers/content_handler_argument_many_to_one.inc, line 7
Handler for 'content_handler_argument_many_to_one' style.

View source
class content_handler_argument_many_to_one extends views_handler_argument_many_to_one {
  var $content_field;
  function construct() {
    parent::construct();
    $this->content_field = content_fields($this->definition['content_field_name']);
    $this->additional_fields = $this->definition['additional fields'];
  }
  function summary_name($data) {
    $options = $this
      ->allowed_values();
    $value = $data->{$this->name_alias};
    if (isset($options[$value])) {
      $value = $options[$value];
    }
    else {
      $value = parent::summary_name($data);
    }
    return $value;
  }
  function title_query() {
    $options = $this
      ->allowed_values();
    $values = $this->value;
    foreach ($values as $key => $value) {
      if (isset($options[$value])) {
        $values[$key] = $options[$value];
      }
    }
    return $values;
  }
  function allowed_values() {
    $field = $this->content_field;
    $function = $field['module'] . '_allowed_values';
    $options = function_exists($function) ? $function($field) : content_allowed_values($field);
    return (array) $options;
  }

}

Members