From 4df70c318e3d39d0ff6d1bf3afb826f52ac34625 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 24 Jun 2009 14:45:02 +0000 Subject: Some tidying of file download manager functions. git-svn-id: https://code.elgg.org/elgg/trunk@3351 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/filestore.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'engine/lib/filestore.php') diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index d073a7000..dacde7c90 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -1156,9 +1156,18 @@ forward($forward . $container->username); } - function file_manage_download($plugin) { + /** + * Manage a file download. + * + * @param unknown_type $plugin + * @param unknown_type $file_guid If not specified then file_guid will be found in input. + */ + function file_manage_download($plugin, $file_guid = "") { // Get the guid - $file_guid = get_input("file_guid"); + $file_guid = (int)$file_guid; + + if (!$file_guid) + $file_guid = (int)get_input("file_guid"); // Get the file $file = get_entity($file_guid); @@ -1183,9 +1192,18 @@ register_error(elgg_echo("$plugin:downloadfailed")); } - function file_manage_icon_download($plugin) { + /** + * Manage the download of a file icon. + * + * @param unknown_type $plugin + * @param unknown_type $file_guid The guid, if not specified this is obtained from the input. + */ + function file_manage_icon_download($plugin, $file_guid = "") { // Get the guid - $file_guid = get_input("file_guid"); + $file_guid = (int)$file_guid; + + if (!$file_guid) + $file_guid = (int)get_input("file_guid"); // Get the file $file = get_entity($file_guid); -- cgit v1.2.3