summaryrefslogtreecommitdiff
path: root/modules/upload/upload.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-16 22:05:51 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-16 22:05:51 +0000
commit18d22419f3da39ca4bf92f46d605a25957f311be (patch)
treed72732b1a23d479c4f2adc4d671d8ec901e2a187 /modules/upload/upload.module
parent9fe9144ae7804e3b80c0ffd8444b0448261f4436 (diff)
downloadbrdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.gz
brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.bz2
- Patch #339929 by Moshe et al: move node links into ->content.
Diffstat (limited to 'modules/upload/upload.module')
-rw-r--r--modules/upload/upload.module14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 518c90115..65cd225bd 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -56,13 +56,13 @@ function upload_perm() {
}
/**
- * Implementation of hook_link().
+ * Inject links into $node for attachments.
*/
-function upload_link($type, $node = NULL, $teaser = FALSE) {
+function upload_nodeapi_links($node, $teaser) {
$links = array();
// Display a link with the number of attachments
- if ($teaser && $type == 'node' && isset($node->files) && user_access('view uploaded files')) {
+ if ($teaser && isset($node->files) && user_access('view uploaded files')) {
$num_files = 0;
foreach ($node->files as $file) {
if ($file->list) {
@@ -76,10 +76,12 @@ function upload_link($type, $node = NULL, $teaser = FALSE) {
'attributes' => array('title' => t('Read full article to view attachments.')),
'fragment' => 'attachments'
);
+ $node->content['links']['upload_attachments'] = array(
+ '#type' => 'node_links',
+ '#value' => $links,
+ );
}
}
-
- return $links;
}
/**
@@ -323,6 +325,8 @@ function upload_nodeapi_view($node, $teaser, $page) {
);
}
}
+
+ upload_nodeapi_links($node, $teaser);
}
}