aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/file/actions/download.php16
-rw-r--r--mod/file/start.php5
-rw-r--r--mod/file/views/default/file/file.php5
3 files changed, 23 insertions, 3 deletions
diff --git a/mod/file/actions/download.php b/mod/file/actions/download.php
new file mode 100644
index 000000000..4ea08ae84
--- /dev/null
+++ b/mod/file/actions/download.php
@@ -0,0 +1,16 @@
+<?php
+ /**
+ * Elgg file browser download action.
+ *
+ * @package ElggFile
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+
+ $file_guid = get_input("file_guid");
+
+
+ echo "$file_guid";
+?> \ No newline at end of file
diff --git a/mod/file/start.php b/mod/file/start.php
index adf446cb5..2783e6e64 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -90,6 +90,7 @@
// Draw file
return elgg_view("file/file", array(
+ "file_guid" => $file->guid,
"tags" => $tags,
"title" => $file->title,
"description" => $file->description,
@@ -123,6 +124,8 @@
// Make sure test_init is called on initialisation
register_event_handler('init','system','file_init');
- // Register an action
+ // Register actions
register_action("file/upload", false, $CONFIG->pluginspath . "file/actions/upload.php");
+ register_action("file/download", false, $CONFIG->pluginspath. "file/actions/download.php");
+
?> \ No newline at end of file
diff --git a/mod/file/views/default/file/file.php b/mod/file/views/default/file/file.php
index 7b6213684..d2efa1b0c 100644
--- a/mod/file/views/default/file/file.php
+++ b/mod/file/views/default/file/file.php
@@ -11,6 +11,7 @@
global $CONFIG;
+ $file_guid = $vars['file_guid'];
$tags = $vars['tags'];
$title = $vars['title'];
$desc = $vars['description'];
@@ -21,9 +22,9 @@
<div class="file">
<table width="100%">
<tr>
- <td valign="top">
+ <td valign="top" width="100">
<div class="file_icon">
- <?php echo elgg_view("file/icon", array("mimetype" => $mime)); ?>
+ <a href="<?php echo $vars['url']; ?>action/file/download?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_view("file/icon", array("mimetype" => $mime)); ?></a>
</div>
</td>
<td valign="top">