]> 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>
Fri, 18 Jan 2013 09:51:13 +0000 (10:51 +0100)
apps/files/js/fileactions.js

index 80b9c01f83887176e554ebb72ef29513a88ede99..093b6204c3e729d6b3d1da679ee9b5c900f498dc 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 () {