You are here

function filefield_meta_handler_field_samplerate::render in FileField 6.3

File

filefield_meta/includes/filefield_meta_handler_field_samplerate.inc, line 44
A special handler that properly formats bit rate fields as kHz.

Class

filefield_meta_handler_field_samplerate
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('filefield_meta_samplerate', $value);
  }
  return check_plain($this->options['prefix']) . $output . check_plain($this->options['suffix']);
}