summaryrefslogtreecommitdiff
path: root/modules/upload/upload.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-09-17 18:08:28 +0000
committerDries Buytaert <dries@buytaert.net>2004-09-17 18:08:28 +0000
commit3ffde628c54cc24ec7855001e9f4d89d80097a5d (patch)
tree84114fc5f98b0baf4270d9915941f3a54fedbbc3 /modules/upload/upload.module
parent2f0221e9dd3436bff6ab0a37740913d4e951fbfa (diff)
downloadbrdo-3ffde628c54cc24ec7855001e9f4d89d80097a5d.tar.gz
brdo-3ffde628c54cc24ec7855001e9f4d89d80097a5d.tar.bz2
- Patch #8179 by JonBob: the legacy handlers and file upload previews were mistakenly cached when they cannot be. Attached patch fixes this as well as a reference to an undefined constant in legacy_menu().
Diffstat (limited to 'modules/upload/upload.module')
-rw-r--r--modules/upload/upload.module18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 0d1092ba6..6cc4585a5 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -25,6 +25,14 @@ function upload_menu($may_cache) {
$items = array();
if ($may_cache) {
+ $items[] = array(
+ 'path' => 'admin/upload', 'title' => t('uploads'),
+ 'callback' => 'upload_admin',
+ 'access' => user_access('access administration pages'),
+ 'type' => MENU_NORMAL_ITEM
+ );
+ }
+ else {
// Add handlers for previewing new uploads.
if ($_SESSION['file_uploads']) {
foreach ($_SESSION['file_uploads'] as $key => $file) {
@@ -32,18 +40,12 @@ function upload_menu($may_cache) {
$items[] = array(
'path' => $filename, 'title' => t('file download'),
'callback' => 'upload_download',
- 'access' => true,
- 'type' => MENU_DYNAMIC_ITEM & MENU_HIDDEN
+ 'access' => TRUE,
+ 'type' => MENU_CALLBACK
);
$_SESSION['file_uploads'][$key]->_filename = $filename;
}
}
- $items[] = array(
- 'path' => 'admin/upload', 'title' => t('uploads'),
- 'callback' => 'upload_admin',
- 'access' => user_access('access administration pages'),
- 'type' => MENU_NORMAL_ITEM
- );
}
return $items;