]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Some tidying of file download manager functions.
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 24 Jun 2009 14:45:02 +0000 (14:45 +0000)
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 24 Jun 2009 14:45:02 +0000 (14:45 +0000)
git-svn-id: https://code.elgg.org/elgg/trunk@3351 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/filestore.php

index d073a70009c3e6523f54bfe33f9866a923f3498e..dacde7c901b6b638a724e8296be60cfa928cee78 100644 (file)
                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);
                        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);