* 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)

This commit is contained in:
Klaus Leithoff 2011-12-27 11:08:41 +00:00
parent 7d5500d1dd
commit 3dbab868e2

View File

@ -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');