function theme_webform_protected_downloads_mail_token_file_list in Webform Protected Downloads 6
Same name and namespace in other branches
- 7 webform_protected_downloads.module \theme_webform_protected_downloads_mail_token_file_list()
Theme function for the file list that may be included in the confirmation mail which is send to the user.
Parameters
array $files :
boolean $checksum :
Return value
string
1 theme call to theme_webform_protected_downloads_mail_token_file_list()
- webform_protected_downloads_token_values in ./
webform_protected_downloads.module - Implementation of hook_token_values().
File
- ./
webform_protected_downloads.module, line 1018 - This file contains hook declarations and functions for the Webform Protected Downloads module.
Code
function theme_webform_protected_downloads_mail_token_file_list($files, $checksum = FALSE) {
$rendered_files = array();
foreach ($files as $file) {
if (!webform_protected_downloads_file_is_protected($file->nid, $file->fid)) {
continue;
}
$args = array(
'!filename' => $file->filename,
'!size' => format_size($file->filesize),
'!type' => $file->filemime,
);
if ($checksum === FALSE) {
$rendered_files[] = t('!filename (!size, !type)', $args);
}
else {
$args['!checksum'] = md5_file($file->filepath);
$rendered_files[] = t('!filename (!size, !type, checksum: !checksum)', $args);
}
}
return count($rendered_files) ? implode("\n", $rendered_files) : '';
}