mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-05 00:04:00 +01:00
Remove stray old code, error if fail to move or rename
This commit is contained in:
@@ -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('<b>' + t['Moving to'] + '</b><br>' + newName);
|
||||
|
||||
@@ -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);';
|
||||
|
||||
Reference in New Issue
Block a user