mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 10:40:40 -04:00
Merge pull request #9015 from owncloud/stable6-downloadwithdisabledzip
[stable6] Fix public download link when zip download is disabled
This commit is contained in:
commit
04817fb0f3
2 changed files with 14 additions and 5 deletions
|
|
@ -163,13 +163,18 @@ var FileActions = {
|
|||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
var hasDownloadAction = false;
|
||||
var downloadScope;
|
||||
if ($('#allowZipDownload').val() == 1) {
|
||||
var downloadScope = 'all';
|
||||
downloadScope = 'all';
|
||||
} else {
|
||||
var downloadScope = 'file';
|
||||
downloadScope = 'file';
|
||||
}
|
||||
|
||||
if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) {
|
||||
hasDownloadAction = FileActions.actions[downloadScope] && FileActions.actions[downloadScope].Download;
|
||||
|
||||
// do not override download action if it exists (might have been registered by an app already)
|
||||
if ((typeof disableDownloadActions == 'undefined' || !disableDownloadActions) && !hasDownloadAction) {
|
||||
FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
|
||||
return OC.imagePath('core', 'actions/download');
|
||||
}, function (filename) {
|
||||
|
|
|
|||
|
|
@ -25,13 +25,17 @@ $(document).ready(function() {
|
|||
window.location = $(tr).find('a.name').attr('href');
|
||||
}
|
||||
});
|
||||
FileActions.register('file', 'Download', OC.PERMISSION_READ, '', function(filename) {
|
||||
FileActions.register('file', 'Download', OC.PERMISSION_READ, function() {
|
||||
return OC.imagePath('core', 'actions/download');
|
||||
}, function(filename) {
|
||||
var tr = FileList.findFileEl(filename);
|
||||
if (tr.length > 0) {
|
||||
window.location = $(tr).find('a.name').attr('href');
|
||||
}
|
||||
});
|
||||
FileActions.register('dir', 'Download', OC.PERMISSION_READ, '', function(filename) {
|
||||
FileActions.register('dir', 'Download', OC.PERMISSION_READ, function() {
|
||||
return OC.imagePath('core', 'actions/download');
|
||||
}, function(filename) {
|
||||
var tr = FileList.findFileEl(filename);
|
||||
if (tr.length > 0) {
|
||||
window.location = $(tr).find('a.name').attr('href')+'&download';
|
||||
|
|
|
|||
Loading…
Reference in a new issue