diff options
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/public.js | 30 | ||||
-rw-r--r-- | apps/files_sharing/lib/cache.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 1 |
3 files changed, 27 insertions, 6 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index c1b7eee3fb7..06c168969de 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -1,3 +1,15 @@ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global OC, FileList, FileActions */ + // Override download path to files_sharing/public.php function fileDownloadPath(dir, file) { var url = $('#downloadURL').val(); @@ -28,12 +40,20 @@ $(document).ready(function() { // override since the format is different FileList.getDownloadUrl = function(filename, dir) { - // we use this because we need the service and token attributes - var tr = FileList.findFileEl(filename); - if (tr.length > 0) { - return $(tr).find('a.name').attr('href') + '&download'; + if ($.isArray(filename)) { + filename = JSON.stringify(filename); + } + var path = dir || FileList.getCurrentDirectory(); + var params = { + service: 'files', + t: $('#sharingToken').val(), + path: path, + download: null + }; + if (filename) { + params.files = filename; } - return null; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); }; } diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 7d63e7a4fe3..aadc54e4a7f 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -396,7 +396,7 @@ class Shared_Cache extends Cache { * use the one with the highest id gives the best result with the background scanner, since that is most * likely the folder where we stopped scanning previously * - * @return string|bool the path of the folder or false when no folder matched + * @return boolean the path of the folder or false when no folder matched */ public function getIncomplete() { return false; diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index ebd16f081ba..b922654e5ec 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -41,6 +41,7 @@ class Shared extends \OC\Files\Storage\Common { /** * @brief Get the source file path, permissions, and owner for a shared file * @param string Shared target file path + * @param string $target * @return Returns array with the keys path, permissions, and owner or false if not found */ public function getFile($target) { |