1 views_handler_field_file_filemime.inc views_handler_field_file_filemime::render($values)

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field_file::render

File

core/modules/file/views/views_handler_field_file_filemime.inc, line 28
Definition of views_handler_field_file_filemime.

Class

views_handler_field_file_filemime
Field handler to add rendering MIME type images as an option on the filemime field.

Code

function render($values) {
  $data = $values->{$this->field_alias};
  if (!empty($this->options['filemime_image']) && $data !== NULL && $data !== '') {
    $fake_file = new File();
    $fake_file->filemime = $data;
    $data = theme('file_icon', array('file' => $fake_file));
  }

  return $this->render_link($data, $values);
}