From 3dbab868e2f99e486b017225174ee739d302bec0 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 27 Dec 2011 11:08:41 +0000 Subject: [PATCH] * filemanager: delete->reset any occasion where the delete action may be stored, as it may be ressurected out of the helpers by etemplate, which is quite unconvenient in certain conditions (delete a file, upload a file with the same name to this very folder, continue uploading files to that folder: this process may lead to the deletion of the former file while uploading other files) --- filemanager/inc/class.filemanager_ui.inc.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index c50a13c41b..67588de2fc 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -281,18 +281,34 @@ class filemanager_ui $content['nm']['msg'] = $msg; - if ($content['nm']['action'] || $content['nm']['rows']) + if (($content['nm']['action'] || $content['nm']['rows']) && (empty($content['button']) || !isset($content['button']))) { if ($content['nm']['action']) { $content['nm']['msg'] = self::action($content['nm']['action'],$content['nm']['selected'],$content['nm']['path']); - unset($content['nm']['action']); + // clean up after action + unset($content['nm']['selected']); + // reset any occasion where action may be stored, as it may be ressurected out of the helpers by etemplate, which is quite unconvenient in case of action delete + if (isset($content['nm']['action'])) unset($content['nm']['action']); + if (isset($content['nm']['nm_action'])) unset($content['nm']['nm_action']); + if (isset($content['nm_action'])) unset($content['nm_action']); + // we dont use ['nm']['rows']['delete'], so unset it, if it is present + if (isset($content['nm']['rows']['delete'])) unset($content['nm']['rows']['delete']); } elseif($content['nm']['rows']['delete']) { $content['nm']['msg'] = self::action('delete',array_keys($content['nm']['rows']['delete']),$content['nm']['path']); + // clean up after action + unset($content['nm']['rows']['delete']); + // reset any occasion where action may be stored, as we use ['nm']['rows']['delete'] anyhow + // we clean this up, as it may be ressurected out of the helpers by etemplate, which is quite unconvenient in case of action delete + if (isset($content['nm']['action'])) unset($content['nm']['action']); + if (isset($content['nm']['nm_action'])) unset($content['nm']['nm_action']); + if (isset($content['nm_action'])) unset($content['nm_action']); + if (isset($content['nm']['selected'])) unset($content['nm']['selected']); } unset($content['nm']['rows']); + egw_session::appsession('index','filemanager',$content['nm']); } $clipboard_files = egw_session::appsession('clipboard_files','filemanager'); $clipboard_type = egw_session::appsession('clipboard_type','filemanager');