function theme_file_entity_download_link

cis7 theme_file_entity_download_link($variables)
cle7 theme_file_entity_download_link($variables)
elmsmedia7 theme_file_entity_download_link($variables)
icor7 theme_file_entity_download_link($variables)
meedjum_blog7 theme_file_entity_download_link($variables)
mooc7 theme_file_entity_download_link($variables)

Copy of theme_file_file_link() for linking to the file download URL.

See also


2 string references to the theme hook from theme_file_entity_download_link()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

file_entity_field_formatter_view in sites/all/modules/ulmus/file_entity/
Implements hook_field_formatter_view().
file_entity_theme in sites/all/modules/ulmus/file_entity/file_entity.module
Implements hook_theme().


sites/all/modules/ulmus/file_entity/, line 45
Theme callbacks for the file entity module.


function theme_file_entity_download_link($variables) {
  $file = $variables['file'];
  $icon_directory = $variables['icon_directory'];

  $uri = file_entity_download_uri($file);
  $icon = theme('file_icon', array('file' => $file, 'icon_directory' => $icon_directory));

  // Set options as per anchor format described at
  $uri['options']['attributes']['type'] = $file->filemime . '; length=' . $file->filesize;

  // Provide the default link text.
  if (!isset($variables['text'])) {
    $variables['text'] = t('Download [file:name]');

  // Peform unsanitized token replacement if $uri['options']['html'] is empty
  // since then l() will escape the link text.
  $variables['text'] = token_replace($variables['text'], array('file' => $file), array('clear' => TRUE, 'sanitize' => empty($uri['options']['html'])));

  $output = '<span class="file">' . $icon . ' ' . l($variables['text'], $uri['path'], $uri['options']);
  $output .= ' ' . '<span class="file-size">(' . format_size($file->filesize) . ')</span>';
  $output .= '</span>';

  return $output;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.