upload_link
- Versions
- 4.6 – 4.7
upload_link($type, $node = 0,$main= 0)- 5 – 6
upload_link($type, $node = NULL, $teaser = FALSE)
Implementation of hook_link().
Code
modules/upload.module, line 43
<?php
function upload_link($type, $node = 0, $main = 0) {
$links = array();
// Display a link with the number of attachments
if ($main && $type == 'node' && isset($node->files) && user_access('view uploaded files')) {
$num_files = 0;
foreach ($node->files as $file) {
if ($file->list) {
$num_files++;
}
}
if ($num_files) {
$links[] = l(format_plural($num_files, '1 attachment', '%count attachments'), "node/$node->nid", array('title' => t('Read full article to view attachments.')), NULL, 'attachments');
}
}
return $links;
}
?>Login or register to post comments 