You are here

function views_handler_field_upload_description::render_link in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 modules/upload/views_handler_field_upload_description.inc \views_handler_field_upload_description::render_link()

Render whatever the data is as a link to the file.

Data should be made XSS safe prior to calling this function.

1 call to views_handler_field_upload_description::render_link()
views_handler_field_upload_description::render in modules/upload/views_handler_field_upload_description.inc
Render the field.

File

modules/upload/views_handler_field_upload_description.inc, line 61

Class

views_handler_field_upload_description
Field handler to provide a list of roles.

Code

function render_link($data, $value) {
  if (!empty($this->options['link_to_file']) && $value->{$this->aliases['fid']} && $data !== NULL && $data !== '') {
    $values = $this->items[$value->{$this->aliases['fid']}];
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = file_create_url($values->filepath);
  }
  else {
    $this->options['alter']['make_link'] = FALSE;
  }
  return $data;
}