From: Björn Schießle Date: Fri, 18 Jan 2013 09:51:13 +0000 (+0100) Subject: introduce option to disable download action X-Git-Tag: v5.0.0alpha1~166^2~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8259768732e3456c5cc54cfe43975513881b6124;p=nextcloud-server.git introduce option to disable download action --- 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 () {