You are here

function getid3_handler_field_bitrate::render in getID3() 7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field_numeric::render

File

includes/getid3_handler_field_bitrate.inc, line 43
A special handler that properly formats bit rate fields as Kbps.

Class

getid3_handler_field_bitrate
Render a field as a readable value in hours, minutes, and seconds.

Code

function render($values) {
  $value = $values->{$this->field_alias};

  // Check to see if hiding should happen before adding prefix and suffix.
  if ($this->options['hide_empty'] && empty($value) && ($value !== 0 || $this->options['empty_zero'])) {
    return '';
  }
  switch ($this->options['format']) {
    case 'raw':
      $output = $value;
      break;
    default:
      $output = theme('getid3_bitrate', array(
        'bitrate' => $value,
      ));
  }
  return check_plain($this->options['prefix']) . $output . check_plain($this->options['suffix']);
}