You are here

function theme_uc_file_downloads_token in Ubercart 5

Same name and namespace in other branches
  1. 8.4 uc_file/uc_file.tokens.inc \theme_uc_file_downloads_token()
  2. 6.2 uc_file/uc_file.module \theme_uc_file_downloads_token()
  3. 7.3 uc_file/uc_file.tokens.inc \theme_uc_file_downloads_token()

Theme file download links token

1 theme call to theme_uc_file_downloads_token()
uc_file_token_values in uc_file/uc_file.module
Implementation of hook_token_values().

File

uc_file/uc_file.module, line 317
Allows products to be associated with downloadable files.

Code

function theme_uc_file_downloads_token($file_downloads) {
  $output = '';
  foreach ($file_downloads as $file_download) {
    $filename = basename(db_result(db_query("SELECT filename FROM {uc_files} WHERE fid = %d", $file_download->fid)));
    $download_url = url('download/' . $file_download->fid . '/' . $file_download->file_key, NULL, NULL, TRUE);
    $output .= '<a href="' . $download_url . '">' . $download_url . "</a>\n";
  }
  return $output;
}