function theme_download_file_direct_download_thumbnail_image in DownloadFile 7.3
Same name and namespace in other branches
- 7.2 download_file.formatter.inc \theme_download_file_direct_download_thumbnail_image()
Theme function for the 'direct_download__thumbnail_image' multiple file formatter.
Parameters
$variables:
Return value
string A string containing the HTML output.
1 theme call to theme_download_file_direct_download_thumbnail_image()
- theme_download_file_formatter_direct_download_thumbnail_image in ./
download_file.formatter.inc - Theming function for link with a thumbnail to direct download the image.
File
- ./
download_file.formatter.inc, line 247
Code
function theme_download_file_direct_download_thumbnail_image($variables) {
$file = $variables['file'];
// Views may call this function with a NULL value, return an empty string.
if (empty($file->fid)) {
return '';
}
$image_url = $variables['file']->uri;
$image_alt = $variables['file']->alt;
$image_title = $variables['file']->title;
$style = 'thumbnail';
$image_path = image_style_url($style, $image_url);
$url = download_file_path($file->fid);
$image = "<img src='{$image_path}' alt='{$image_alt}' title='{$image_title}' />";
$options['html'] = TRUE;
return '<div class="download-file clear-block">' . l($image, $url, $options) . '</div>';
}