diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index 04fcd00..1172a6e 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -2078,7 +2078,6 @@ var ICEcoder = { let i, closeTabLink, fileName; if (newName && newName !== oldName) { - i = this.openFiles.indexOf(oldName.replace(/\|/g, "/")); if (this.ask("Are you sure you want to move file " + oldName + " to " + newName + " ?")){ this.serverQueue("add", iceLoc + "/lib/file-control.php?action=move&oldFileName=" + encodeURIComponent(oldName.replace(/\//g, "|")) + "&csrf=" + this.csrf, encodeURIComponent(newName.replace(/\//g, "|"))); this.serverMessage('' + t['Moving to'] + '
' + newName); diff --git a/lib/file-control.php b/lib/file-control.php index c6cc8fb..2c4e983 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -248,12 +248,15 @@ if (!$error && "move" === $_GET['action']) { $fileOrFolder = is_dir($docRoot . $fileLoc . "/" . $fileName) ? "folder" : "file"; $fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder); $doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};'; + $finalAction = "move"; + // Run any extra processes + $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName); + $doNext = $extraProcessesClass->onFileDirMove($doNext); + } else { + $doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');"; + $finalAction = "nothing"; } } - $finalAction = "move"; - // Run any extra processes - $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName); - $doNext = $extraProcessesClass->onFileDirMove($doNext); } else { $doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');"; $finalAction = "nothing"; @@ -290,12 +293,12 @@ if (!$error && "rename" === $_GET['action']) { $extraProcessesClass = new ExtraProcesses($fileLoc, $fileName); $doNext = $extraProcessesClass->onFileDirRename($doNext); } else { - $doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . $_GET['oldFileName'] . "\\\\n\\\\n" . $t['Maybe public write...'] . "');"; + $doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['does not seem...'] . "');"; $finalAction = "nothing"; } } } else { - $doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . $_GET['oldFileName'] . "\\\\n\\\\n" . $t['Maybe public write...'] . "');"; + $doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');"; $finalAction = "nothing"; } $doNext .= 'ICEcoder.serverMessage(); ICEcoder.serverQueue("del", 0);';