upload_link
modules/upload/upload.module, строка 34
- Версии
- 5 – 6
upload_link($type, $node = NULL, $teaser = FALSE)
Реализация hook_link()
.
Код
<?php
function upload_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
// Display a link with the number of attachments
if ($teaser && $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['upload_attachments'] = array(
'title' => format_plural($num_files, '1 attachment', '@count attachments'),
'href' => "node/$node->nid",
'attributes' => array('title' => t('Read full article to view attachments.')),
'fragment' => 'attachments'
);
}
}
return $links;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии