function views_handler_field_boolean::render

3.x views_handler_field_boolean.inc views_handler_field_boolean::render($values)
2.x views_handler_field_boolean.inc views_handler_field_boolean::render($values)

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field_boolean.inc, line 94
Definition of views_handler_field_boolean.

Class

views_handler_field_boolean
A handler to provide proper displays for booleans.

Code

function render($values) {
  $value = $this->get_value($values);
  if (!empty($this->options['not'])) {
    $value = !$value;
  }

  if ($this->options['type'] == 'custom') {
    return $value ? filter_xss_admin($this->options['type_custom_true']) : filter_xss_admin($this->options['type_custom_false']);
  }
  else if (isset($this->formats[$this->options['type']])) {
    return $value ? $this->formats[$this->options['type']][0] : $this->formats[$this->options['type']][1];
  }
  else {
    return $value ? $this->formats['yes-no'][0] : $this->formats['yes-no'][1];
  }
}