From ab22ccef8e9d7bcdd758e5a0d6f45f2ca6dd063f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 29 Mar 2012 22:43:07 +0000 Subject: [PATCH] Allow multiple uploads if id ends with '/', mime filter as a legacy option --- etemplate/js/et2_widget_vfs.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_vfs.js b/etemplate/js/et2_widget_vfs.js index 2faf2ef06e..8d967300b4 100644 --- a/etemplate/js/et2_widget_vfs.js +++ b/etemplate/js/et2_widget_vfs.js @@ -393,13 +393,21 @@ et2_register_widget(et2_vfsUid, ["vfs-uid","vfs-gid"]); */ var et2_vfsUpload = et2_file.extend({ + legacyOptions: ["mime"], + asyncOptions: { url: egw_json_request.prototype._assembleAjaxUrl("etemplate_widget_vfs::ajax_upload::etemplate") }, - init: function() { + init: function(_parent, attrs) { this._super.apply(this, arguments); this.input.addClass("et2_vfs"); + + // If the ID is a directory, allow multiple uploads + if(this.options.id.substr(-1) == '/') + { + this.set_multiple(true); + } }, set_value: function(_value) {