function views_handler_field_file_filemime::render

Overrides views_handler_field_file::render

File

modules/system/views_handler_field_file_filemime.inc, line 39

Class

views_handler_field_file_filemime
Add rendering MIME type images as an option on the 'filemime' field.

Code

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