diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-18 10:51:13 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-22 15:33:53 +0100 |
commit | 8259768732e3456c5cc54cfe43975513881b6124 (patch) | |
tree | 06ae257185edd8a2bcf737893b53fe0ce3003ad0 /apps/files/js | |
parent | dfab3d3d7f0e42fde5de8a5438a97d6d428977a7 (diff) | |
download | nextcloud-server-8259768732e3456c5cc54cfe43975513881b6124.tar.gz nextcloud-server-8259768732e3456c5cc54cfe43975513881b6124.zip |
introduce option to disable download action
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/fileactions.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index f5ee363a4c8..5eac62440f4 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -147,15 +147,19 @@ $(document).ready(function () { } else { var downloadScope = 'file'; } - FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { - return OC.imagePath('core', 'actions/download'); - }, function (filename) { - window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val()); - }); - + + if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) { + FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { + return OC.imagePath('core', 'actions/download'); + }, function (filename) { + window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val()); + }); + } + $('#fileList tr').each(function(){ FileActions.display($(this).children('td.filename')); }); + }); FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () { |