fileLoc defined by saveType, error catching no /

If we're saving a new file, fileLoc is the file location otherwise it's
empty
Error catching given filenames not beginning with a / by prefixing with
one
This commit is contained in:
Matt Pass
2012-08-02 07:43:57 +01:00
parent 81fc8495b2
commit ef44be8240

View File

@@ -253,13 +253,13 @@ if (action=="load") {
if (action=="save") {
<?php
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
$saveLoc = $saveType=="saveAs" ? $fileLoc : "";
echo "fileLoc = '".$saveLoc."';"
if (strpos($fileName,"[NEW]")>0) {echo "fileLoc = '".$fileLoc."';";} else {echo "fileLoc = '';";};
?>
newFileName = top.ICEcoder.getInput(fileLoc != ""
? 'Enter filename to save at '+fileLoc
: 'Enter filename (including path, prefixed with /)'
,'');
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
if (newFileName) {
newFileName = fileLoc == "" ? newFileName : fileLoc + "/" + fileName;
}