diff --git a/filemanager/js/filemanager.ts b/filemanager/js/filemanager.ts index 70e987b76a..cc29085310 100644 --- a/filemanager/js/filemanager.ts +++ b/filemanager/js/filemanager.ts @@ -1314,9 +1314,12 @@ export class filemanagerAPP extends EgwApp * Check if a row can have the Hidden Uploads action * Needs to be a directory */ - hidden_upload_enabled(_action: egwAction, _senders: egwActionObject[]) + hidden_upload_enabled(_action : egwAction, _senders : egwActionObject[]) { - if (_senders[0].id == 'nm') return false; + if(_senders[0].id == 'nm') + { + return false; + } let data = egw.dataGetUIDdata(_senders[0].id); let readonly = (data?.data.class || '').split(/ +/).indexOf('noEdit') >= 0; @@ -1324,6 +1327,12 @@ export class filemanagerAPP extends EgwApp return (!_senders[0].id || data.data.is_dir && !readonly); } + hiddenUploadOnOne(event) + { + let path = event.data?.options?.uploadPath || this.get_path() + "/Upload"; + this.upload(event, 1, '/Shared dir/Upload', 'rename', 'EGroupware\\Filemanager\\Sharing\\HiddenUpload::ajax_action'); + } + /** * View the link from an existing share * (EPL only) diff --git a/filemanager/src/Sharing/HiddenUpload.php b/filemanager/src/Sharing/HiddenUpload.php index 445daa1639..20c6282a49 100644 --- a/filemanager/src/Sharing/HiddenUpload.php +++ b/filemanager/src/Sharing/HiddenUpload.php @@ -49,8 +49,9 @@ class HiddenUpload extends AnonymousList // Take over upload, change target and conflict strategy $path = Vfs::concat(self::get_home_dir(), Sharing::HIDDEN_UPLOAD_DIR); - $target = str_replace('\\', '\\\\', __CLASS__); - $this->etemplate->setElementAttribute('nm[upload]', 'onFinishOne', "app.filemanager.upload(ev, 1, '$path', 'rename', '{$target}::ajax_action')"); + $this->etemplate->setElementAttribute('nm[upload]', 'onFinishOne', "app.filemanager.hiddenUploadOnOne"); + // Not a real attribute, but we need to make sure we always upload to the correct place + $this->etemplate->setElementAttribute('nm[upload]', 'uploadPath', $path); } return parent::listview($content, $msg);