public function views_handler_field_file::render_link in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 6.3 modules/system/views_handler_field_file.inc \views_handler_field_file::render_link()
- 6.2 modules/system/views_handler_field_file.inc \views_handler_field_file::render_link()
Render whatever the data is as a link to the file.
Data should be made XSS safe prior to calling this function.
3 calls to views_handler_field_file::render_link()
- views_handler_field_file::render in modules/
system/ views_handler_field_file.inc - Render the field.
- views_handler_field_file_filemime::render in modules/
system/ views_handler_field_file_filemime.inc - Render the field.
- views_handler_field_file_uri::render in modules/
system/ views_handler_field_file_uri.inc - Render the field.
File
- modules/
system/ views_handler_field_file.inc, line 52 - Definition of views_handler_field_file.
Class
- views_handler_field_file
- Field handler to provide simple renderer that allows linking to a file.
Code
public function render_link($data, $values) {
if (!empty($this->options['link_to_file']) && $data !== NULL && $data !== '') {
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = file_create_url($this
->get_value($values, 'uri'));
}
return $data;
}