You are here

function theme_track_da_files_url_plain in Track da files 7

Returns plain URL to a file.

Parameters

array $variables: An associative array containing:

  • file: A file object to which the link will be created.
1 theme call to theme_track_da_files_url_plain()
track_da_files_field_formatter_view in ./track_da_files.module
Implements hook_field_formatter_view().

File

includes/track_da_files_formatter.inc, line 81
format_custom_link_text This file contains the specialized field formatters.

Code

function theme_track_da_files_url_plain($variables) {
  $file = $variables['file'];
  $url = track_da_files_create_url($file->uri);
  $options = array(
    'attributes' => array(
      'type' => $file->filemime . '; length=' . $file->filesize,
    ),
  );
  $options['query']['file'] = '1';
  if (isset($file->type)) {
    $options['query']['type'] = $file->type;
  }
  if (isset($file->id)) {
    $options['query']['id'] = $file->id;
  }
  return url($url, $options);
}