From 4fac5baedd9770c49919d55daf0a9558ff5f8514 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 18 Jul 2013 20:14:10 +0200 Subject: [PATCH] Updates packaged download extension. --- src/_h5ai/client/js/inc/ext/download.js | 28 ++++---- src/_h5ai/conf/options.json | 6 +- src/_h5ai/server/php/inc/Api.php | 6 +- src/_h5ai/server/php/inc/Archive.php | 86 +++++++++++++------------ 4 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/_h5ai/client/js/inc/ext/download.js b/src/_h5ai/client/js/inc/ext/download.js index 6b5cf4e9..cc9cd736 100644 --- a/src/_h5ai/client/js/inc/ext/download.js +++ b/src/_h5ai/client/js/inc/ext/download.js @@ -3,8 +3,7 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co var settings = _.extend({ enabled: false, - execution: 'php', - format: 'zip', + type: 'php-tar', packageName: 'package' }, allsettings.download), @@ -50,7 +49,7 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co server.request({ action: 'createArchive', - execution: settings.execution, + type: settings.type, format: settings.format, hrefs: hrefsStr }, handleResponse); @@ -72,21 +71,16 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co onClick = function (event) { - var exe = settings.execution.toUpperCase(); + var type = settings.type, + extension = type === 'shell-zip' ? 'zip' : 'tar', + query = '?action=passArchive' + + '&as=' + encodeURIComponent((settings.packageName || location.getItem().label) + '.' + extension) + + '&type=' + type + + '&hrefs=' + encodeURIComponent(selectedHrefsStr), + $iframe = $('