]> source.dussan.org Git - nextcloud-server.git/commitdiff
introduce option to disable download action
authorBjörn Schießle <schiessle@owncloud.com>
Fri, 18 Jan 2013 09:51:13 +0000 (10:51 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Tue, 22 Jan 2013 14:33:53 +0000 (15:33 +0100)
apps/files/js/fileactions.js

index f5ee363a4c82e7fd2da9107c6105a03eb98482f5..5eac62440f4c493e33037f4303d07a0db28f2aab 100644 (file)
@@ -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 () {