function views_handler_field_upload_description::render_link in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 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 62
Class
- views_handler_field_upload_description
- Field handler to provide a list of roles.
Code
function render_link($data, $values) {
$fid = $this
->get_value($values, 'fid');
if (!empty($this->options['link_to_file']) && $fid && $data !== NULL && $data !== '') {
$values = $this->items[$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;
}