Language system setup and English translations

Covering top level and login so far only
This commit is contained in:
Matt Pass
2014-08-06 09:26:50 +01:00
parent 230e8a0983
commit 5de4cd657e
8 changed files with 224 additions and 96 deletions

View File

@@ -1,6 +1,7 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
$t = $text['editor'];
?>
<!DOCTYPE html>
@@ -67,40 +68,40 @@ h2 {color: rgba(0,198,255,0.7)}
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);">
<?php if ($ICEcoder['demoMode']) {?>
<div class="demoArrow"><b>Click icons<br>for help &amp;<br>usage info</b></div>
<div class="demoArrow"><?php echo $t['Click icons for...'];?></div>
<?php ;}; ?>
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
<div style="margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
<div style="float: left; width: 300px; margin-right: 50px">
<h2>server</h2>
<span class="heading">Server name, OS & IP:</span><br>
<h2><?php echo $t['server'];?></h2>
<span class="heading"><?php echo $t['Server name, OS...'];?></span><br>
<?php echo $_SERVER['SERVER_NAME']." &nbsp;&nbsp ".$_SERVER['SERVER_SOFTWARE']." &nbsp;&nbsp ".(isset($_SERVER['SERVER_ADDR'])?$_SERVER['SERVER_ADDR']:"Unknown");?><br><br>
<span class="heading">Root:</span><br>
<span class="heading"><?php echo $t['Root'];?></span><br>
<?php echo $docRoot;?><br><br>
<span class="heading">ICEcoder root:</span><br>
<span class="heading"><?php echo $t['ICEcoder root'];?></span><br>
<?php echo $docRoot.$iceRoot;?><br><br>
<span class="heading">PHP version:</span><br>
<span class="heading"><?php echo $t['PHP version'];?></span><br>
<?php echo phpversion();?><br><br>
<span class="heading">Date & time:</span><br>
<span class="heading"><?php echo $t['Date & time'];?></span><br>
<span id="serverDT"></span><br><br>
<h2>your device</h2>
<span class="heading">Browser:</span><br>
<h2><?php echo $t['your device'];?></h2>
<span class="heading"><?php echo $t['Browser'];?></span><br>
<?php echo xssClean($_SERVER['HTTP_USER_AGENT'],"html");?><br><br>
<span class="heading">Your IP:</span><br>
<span class="heading"><?php echo $t['Your IP'];?></span><br>
<?php echo $_SERVER['REMOTE_ADDR'];?><br><br>
</div>
<div style="float: left">
<h2>files</h2>
<span class="heading">Last 10 files opened:</span><br>
<h2><?php echo $t['files'];?></h2>
<span class="heading"><?php echo $t['Last 10 files...'];?></span><br>
<ul class="fileManager" style="margin-left: 0; line-height: 20px">
<?php
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
for ($i=0;$i<count($last10FilesArray);$i++) {
if ($ICEcoder["last10Files"]=="") {
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -4px">[none]</div><br><br>';
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -4px">'.$t['none'].'</div><br><br>';
} else {
$fileFolderName = str_replace("\\","/",$last10FilesArray[$i]);
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
@@ -133,18 +134,17 @@ h2 {color: rgba(0,198,255,0.7)}
</script>
<?php if(is_dir('test') && !$ICEcoder['demoMode']) {?>
<div style="float: left; margin-right: 50px">
<h2>test suite</h2>
<span class="heading">Run unit tests:</span><br>
<a nohref onclick="top.ICEcoder.filesFrame.contentWindow.frames['testControl'].location.href = 'test'" style="color: #fff; cursor: pointer">Run unit tests</a><div id="unitTestResults"></div>
<h2><?php echo $t['test suite'];?></h2>
<span class="heading"><?php echo $t['Run unit tests'];?></span><br>
<a nohref onclick="top.ICEcoder.filesFrame.contentWindow.frames['testControl'].location.href = 'test'" style="color: #fff; cursor: pointer"><?php echo $t['Run unit tests'];?></a><div id="unitTestResults"></div>
</div>
<?php
;};
?>
<div style="float: left">
<h2>dev mode <?php echo $ICEcoder['devMode'] ? "on" : "off";?></h2>
<span class="heading">Status:</span><br>
Using <?php echo $ICEcoder['devMode'] ? "ice-coder.js" : "ice-coder.min.js";?> <a title="You can switch dev mode on/off
in lib/config__settings.php" style="cursor: pointer">[?]</a>
<h2><?php echo $t['dev mode'];?> <?php echo $ICEcoder['devMode'] ? "on" : "off";?></h2>
<span class="heading"><?php echo $t['Status'];?>:</span><br>
<?php echo $t['Using']?> <?php echo $ICEcoder['devMode'] ? "ice-coder.js" : "ice-coder.min.js";?> <a title="<?php echo $t['You can switch...'];?>" style="cursor: pointer">[?]</a>
</div>
<div style="clear: both"></div>
</div>
@@ -230,7 +230,7 @@ function createNewCMInstance(num) {
top.ICEcoder.updateNestingIndicator();
if (top.ICEcoder.findMode) {
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
top.document.getElementById('results').innerHTML = top.ICEcoder.results.length + " results";
top.document.getElementById('results').innerHTML = top.ICEcoder.results.length + " <?php echo $t['results'];?>";
top.ICEcoder.findMode = false;
}
var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];

View File

@@ -1,6 +1,7 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
$t = $text['files'];
// Is our dir in the list of GitHub local paths?
$isGitHubRepoDir = in_array($ICEcoder["root"],$ICEcoder['githubLocalPaths']);
@@ -19,8 +20,8 @@ $isGitHubRepoDir = in_array($ICEcoder["root"],$ICEcoder['githubLocalPaths']);
<body onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);">
<div title="Lock" onClick="top.ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
<div title="<?php echo $t['Lock'];?>" onClick="top.ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
<div title="<?php echo $t['Refresh'];?>" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
<?php
$_SESSION['githubDiff'] = false;
if ($isGitHubRepoDir) {
@@ -33,7 +34,7 @@ if ($isGitHubRepoDir) {
?>
<ul class="fileManager">
<li class="pft-directory dirOpen"><a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" onClick="top.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="|">/ <?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?></span> <span style="color: #888; font-size: 8px" id="|_perms"><?php echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3) : "";?></span></a></li><?php
<li class="pft-directory dirOpen"><a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" onClick="top.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="|">/ <?php echo $iceRoot == "" ? $t['ROOT'] : trim($iceRoot,"/");?></span> <span style="color: #888; font-size: 8px" id="|_perms"><?php echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3) : "";?></span></a></li><?php
// tree file items generated by the iFrame 'fileControl' below which loads in the items at location=| (ie, the root)
?>
</ul>

133
index.php
View File

@@ -1,6 +1,7 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
$t = $text['index'];
// Check IP permissions
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
@@ -28,7 +29,7 @@ if ($ICEcoder["checkUpdates"]) {
$thisV = $ICEcoder["versionNo"];
if (strpos($thisV,"beta")>-1 && !strpos($icv,"beta") && str_replace(" beta","",$thisV) == $icv) {$thisV-=0.1;};
if ($thisV<$icv) {
$updateMsg = ";top.ICEcoder.dataMessage('<b>UPDATE INFO:</b> ICEcoder v ".$icv." now available. (Your version is v ".$ICEcoder["versionNo"].").<br><br><a onclick=\\'top.ICEcoder.update()\\' style=\\'color:#fff; background: #b00; padding: 5px; text-decoration: none; cursor: pointer\\'>Update now</a><br><br>".$icvI."');";
$updateMsg = ";top.ICEcoder.dataMessage('<b>".$t['UPDATE INFO'].":</b> ICEcoder v ".$icv." ".$t['now available'].". (".$t['Your version is']." v ".$ICEcoder["versionNo"].").<br><br><a onclick=\\'top.ICEcoder.update()\\' style=\\'color:#fff; background: #b00; padding: 5px; text-decoration: none; cursor: pointer\\'>".$t['Update now']."</a><br><br>".$icvI."');";
}
}
@@ -48,7 +49,7 @@ iceRoot = "<?php echo $ICEcoder['root']; ?>";
window.onbeforeunload = function() {
for(var i=1;i<=ICEcoder.savedPoints.length;i++) {
if (ICEcoder.savedPoints[i-1]!=top.ICEcoder.getcMInstance(i).changeGeneration()) {
return "You have some unsaved changes.";
return "<?php echo $t['You have some...'];?>.";
}
}
}
@@ -96,7 +97,7 @@ window.onbeforeunload = function() {
<div class="popupVCenter">
<div class="popup">
<div class="spinner"></div>
working...
<?php echo $t['working'];?>...
</div>
</div>
</div>
@@ -104,7 +105,7 @@ window.onbeforeunload = function() {
<div id="plugins" class="plugins" style="<?php echo $ICEcoder["pluginPanelAligned"];?>: 0" onMouseOver="top.ICEcoder.showHidePlugins('show')" onMouseOut="top.ICEcoder.showHidePlugins('hide')" onClick="top.ICEcoder.showHidePlugins('hide')">
<div style="padding: 15px">
<a nohref onClick="top.ICEcoder.showColorPicker(top.document.getElementById('color') ? top.document.getElementById('color').value : '#123456')" title="Farbtastic
Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Color Picker"></a><br><br>
<?php echo $t['Color picker'];?>"><img src="images/color-picker.png" style="cursor: pointer" alt="Color Picker"></a><br><br>
<div id="pluginsOptional"><?php echo $pluginsDisplay; ?></div>
<a nohref onclick="top.ICEcoder.pluginsManager()" title="Plugins Manager" style="color: #fff; cursor: pointer">+ / -</a>
</div>
@@ -112,10 +113,10 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');top.ICEcoder.hideFileMenu()" style="opacity: 0" onContextMenu="return false">
<span id="folderMenuItems">
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['New File'];?></a>
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['New Folder'];?></a>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<a href="javascript:top.ICEcoder.uploadFilesSelect(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Upload File(s)</a>
<a href="javascript:top.ICEcoder.uploadFilesSelect(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Upload File(s)'];?></a>
<div style="display: none">
<form enctype="multipart/form-data" id="uploadFilesForm" action="lib/file-control.php?action=upload&file=/uploaded" method="POST" target="fileControl">
<input type="hidden" name="folder" id="uploadDir" value="/">
@@ -124,17 +125,17 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>
</div>
<a href="javascript:top.ICEcoder.pasteFiles(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()" id="fmMenuPasteOption" style="display: none">Paste</a>
<a href="javascript:top.ICEcoder.pasteFiles(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()" id="fmMenuPasteOption" style="display: none"><?php echo $t['Paste'];?></a>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
</span>
<a href="javascript:top.ICEcoder.openFilesFromList(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Open</a>
<a href="javascript:top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
<a href="javascript:top.ICEcoder.duplicateFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Duplicate</a>
<a href="javascript:top.ICEcoder.deleteFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
<a href="javascript:top.ICEcoder.openFilesFromList(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Open'];?></a>
<a href="javascript:top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Copy'];?></a>
<a href="javascript:top.ICEcoder.duplicateFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Duplicate'];?></a>
<a href="javascript:top.ICEcoder.deleteFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Delete'];?></a>
<span id="singleFileMenuItems">
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Rename'];?></a>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<a nohref onClick="window.open(iceRoot + top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()" style="cursor: pointer">View Webpage</a>
<a nohref onClick="window.open(iceRoot + top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()" style="cursor: pointer"><?php echo $t['View Webpage'];?></a>
</span>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<?php
@@ -142,9 +143,9 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
echo '<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>'.PHP_EOL;
};
?>
<a href="javascript:top.ICEcoder.downloadFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Download</a>
<a href="javascript:top.ICEcoder.downloadFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Download'];?></a>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Properties'];?></a>
</div>
<div id="header" class="header" onContextMenu="return false"></div>
@@ -152,44 +153,44 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.ICEcoder.hideFileMenu();" onContextMenu="return false">
<div id="fileNav" class="fileNav">
<ul>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsFile')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsFile')}" id="optionsFileNav">File</a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsEdit')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsEdit')}" id="optionsEditNav">Edit</a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsRemote')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsRemote')}" id="optionsRemoteNav">Remote</a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsHelp')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsHelp')}" id="optionsHelpNav">Help</a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsFile')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsFile')}" id="optionsFileNav"><?php echo $t['File'];?></a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsEdit')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsEdit')}" id="optionsEditNav"><?php echo $t['Edit'];?></a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsRemote')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsRemote')}" id="optionsRemoteNav"><?php echo $t['Remote'];?></a></li>
<li><a nohref onclick="top.ICEcoder.canShowFMNav=true;top.ICEcoder.showHideFileNav('show','optionsHelp')" onmouseover="if(top.ICEcoder.canShowFMNav) {top.ICEcoder.showHideFileNav('show','optionsHelp')}" id="optionsHelpNav"><?php echo $t['Help'];?></a></li>
</ul>
</div>
<div class="options" id="fileOptions">
<div id="optionsFile" class="optionsList" onmouseover="top.ICEcoder.showHideFileNav('show',this.id)" onmouseout="top.ICEcoder.showHideFileNav('hide',this.id);top.ICEcoder.canShowFMNav=false">
<ul>
<li><a nohref onClick="ICEcoder.newFile()">New File...</a></li>
<li><a nohref onClick="ICEcoder.newFolder()">New Folder...</a></li>
<li><a nohref onClick="ICEcoder.openPrompt()">Open...</a></li>
<li><a nohref onClick="ICEcoder.saveFile()">Save</a></li>
<li><a nohref onclick="ICEcoder.saveFile('saveAs')">Save As...</a></li>
<li><a nohref onclick="ICEcoder.openPreviewWindow()">Live Preview</a></li>
<li><a nohref onclick="ICEcoder.downloadFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])">Download</a></li>
<li><a nohref onclick="ICEcoder.copyFiles(top.ICEcoder.selectedFiles)">Copy</a></li>
<li><a nohref onclick="ICEcoder.pasteFiles(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])">Paste</a></li>
<li><a nohref onclick="ICEcoder.deleteFiles(top.ICEcoder.selectedFiles)">Delete</a></li>
<li><a nohref onclick="ICEcoder.duplicateFiles(top.ICEcoder.selectedFiles)">Duplicate</a></li>
<li><a nohref onclick="ICEcoder.renameFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])">Rename</a></li>
<li><a nohref onclick="ICEcoder.uploadFilesSelect(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])">Upload...</a></li>
<li><a nohref onclick="ICEcoder.zipIt(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])">Zip</a></li>
<li><a nohref onclick="ICEcoder.propertiesScreen(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])">Properties...</a></li>
<li><a nohref onClick="ICEcoder.printCode()">Print...</a></li>
<li><a nohref onClick="ICEcoder.fullScreenSwitcher()">Fullscreen toggle</a></li>
<li><a nohref onClick="ICEcoder.logout()">Logout</a></li>
<li><a nohref onClick="ICEcoder.newFile()"><?php echo $t['New File'];?>...</a></li>
<li><a nohref onClick="ICEcoder.newFolder()"><?php echo $t['New Folder'];?>...</a></li>
<li><a nohref onClick="ICEcoder.openPrompt()"><?php echo $t['Open'];?>...</a></li>
<li><a nohref onClick="ICEcoder.saveFile()"><?php echo $t['Save'];?></a></li>
<li><a nohref onclick="ICEcoder.saveFile('saveAs')"><?php echo $t['Save As'];?>...</a></li>
<li><a nohref onclick="ICEcoder.openPreviewWindow()"><?php echo $t['Live Preview'];?></a></li>
<li><a nohref onclick="ICEcoder.downloadFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])"><?php echo $t['Download'];?></a></li>
<li><a nohref onclick="ICEcoder.copyFiles(top.ICEcoder.selectedFiles)"><?php echo $t['Copy'];?></a></li>
<li><a nohref onclick="ICEcoder.pasteFiles(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])"><?php echo $t['Paste'];?></a></li>
<li><a nohref onclick="ICEcoder.deleteFiles(top.ICEcoder.selectedFiles)"><?php echo $t['Delete'];?></a></li>
<li><a nohref onclick="ICEcoder.duplicateFiles(top.ICEcoder.selectedFiles)"><?php echo $t['Duplicate'];?></a></li>
<li><a nohref onclick="ICEcoder.renameFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])"><?php echo $t['Rename'];?></a></li>
<li><a nohref onclick="ICEcoder.uploadFilesSelect(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])"><?php echo $t['Upload'];?>...</a></li>
<li><a nohref onclick="ICEcoder.zipIt(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])"><?php echo $t['Zip'];?></a></li>
<li><a nohref onclick="ICEcoder.propertiesScreen(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])"><?php echo $t['Properties'];?>...</a></li>
<li><a nohref onClick="ICEcoder.printCode()"><?php echo $t['Print'];?>...</a></li>
<li><a nohref onClick="ICEcoder.fullScreenSwitcher()"><?php echo $t['Fullscreen toggle'];?></a></li>
<li><a nohref onClick="ICEcoder.logout()"><?php echo $t['Logout'];?></a></li>
</ul>
</div>
<div id="optionsEdit" class="optionsList" onmouseover="top.ICEcoder.showHideFileNav('show',this.id)" onmouseout="top.ICEcoder.showHideFileNav('hide',this.id);top.ICEcoder.canShowFMNav=false">
<ul>
<li><a nohref onclick="ICEcoder.undo()">Undo</a></li>
<li><a nohref onclick="ICEcoder.redo()">Redo</a></li>
<li><a nohref onclick="ICEcoder.indent('more')">Indent more</a></li>
<li><a nohref onclick="ICEcoder.indent('less')">Indent less</a></li>
<li><a nohref onclick="ICEcoder.autocomplete()">Autocomplete</a></li>
<li><a nohref onclick="ICEcoder.lineCommentToggle()">Comment/Uncomment</a></li>
<li><a nohref onclick="ICEcoder.jumpToDefinition()">Jump to Definition</a></li>
<li><a nohref onclick="ICEcoder.undo()"><?php echo $t['Undo'];?></a></li>
<li><a nohref onclick="ICEcoder.redo()"><?php echo $t['Redo'];?></a></li>
<li><a nohref onclick="ICEcoder.indent('more')"><?php echo $t['Indent more'];?></a></li>
<li><a nohref onclick="ICEcoder.indent('less')"><?php echo $t['Indent less'];?></a></li>
<li><a nohref onclick="ICEcoder.autocomplete()"><?php echo $t['Autocomplete'];?></a></li>
<li><a nohref onclick="ICEcoder.lineCommentToggle()"><?php echo $t['Comment/Uncomment'];?></a></li>
<li><a nohref onclick="ICEcoder.jumpToDefinition()"><?php echo $t['Jump to Definition'];?></a></li>
</ul>
</div>
<div id="optionsRemote" class="optionsList" onmouseover="top.ICEcoder.showHideFileNav('show',this.id)" onmouseout="top.ICEcoder.showHideFileNav('hide',this.id);top.ICEcoder.canShowFMNav=false">
@@ -205,11 +206,11 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
</div>
<div id="optionsHelp" class="optionsList" onmouseover="top.ICEcoder.showHideFileNav('show',this.id)" onmouseout="top.ICEcoder.showHideFileNav('hide',this.id);top.ICEcoder.canShowFMNav=false">
<ul>
<li><a nohref onclick="ICEcoder.showManual('<?php echo $ICEcoder["versionNo"];?>')">Manual</a></li>
<li><a nohref onClick="ICEcoder.helpScreen()">Shortcuts</a></li>
<li><a nohref onClick="ICEcoder.settingsScreen()">Settings</a></li>
<li><a nohref onclick="ICEcoder.searchForSelected()">Search for selected</a></li>
<li><a href="https://icecoder.net" target="_blank">ICEcoder website</a></li>
<li><a nohref onclick="ICEcoder.showManual('<?php echo $ICEcoder["versionNo"];?>')"><?php echo $t['Manual'];?></a></li>
<li><a nohref onClick="ICEcoder.helpScreen()"><?php echo $t['Shortcuts'];?></a></li>
<li><a nohref onClick="ICEcoder.settingsScreen()"><?php echo $t['Settings'];?></a></li>
<li><a nohref onclick="ICEcoder.searchForSelected()"><?php echo $t['Search for selected'];?></a></li>
<li><a href="https://icecoder.net" target="_blank">ICEcoder <?php echo $t['website'];?></a></li>
</ul>
</div>
</div>
@@ -219,8 +220,8 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<div id="editor" class="editor">
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
<a nohref onClick="top.ICEcoder.closeAllTabs()"><img src="images/nav-close-all.gif" class="closeAllTabs" title="Close all tabs"></a>
<a nohref onClick="top.ICEcoder.alphaTabs()"><img src="images/nav-alpha.png" class="alphaTabs" title="Alphabetize tabs"></a>
<a nohref onClick="top.ICEcoder.closeAllTabs()"><img src="images/nav-close-all.gif" class="closeAllTabs" title="<?php echo $t['Close all tabs'];?>"></a>
<a nohref onClick="top.ICEcoder.alphaTabs()"><img src="images/nav-alpha.png" class="alphaTabs" title="<?php echo $t['Alphabetize tabs'];?>"></a>
<?php
for ($i=1;$i<=100;$i++) {
echo '<div id="tab'.$i.'" class="tab" onMouseDown="ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3),10)) : ICEcoder.canSwitchTabs=true; thisColor=top.ICEcoder.tabFGselected; if (!top.ICEcoder.overCloseLink) {ICEcoder.tabDragStart(parseInt(this.id.slice(3),10))}; if (event.button==1) {ICEcoder.closeTab(parseInt(this.id.slice(3),10)); return false};" onMouseOver="thisColor=this.style.color;this.style.color=top.ICEcoder.tabFGselected" onMouseOut="this.style.color=thisColor"></div>';
@@ -230,20 +231,20 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<div id="findBar" class="findBar" onContextMenu="return false">
<form name="findAndReplace" onSubmit="ICEcoder.findReplace(top.document.getElementById('find').value,false,true);return false">
<div class="findReplace">
<div class="findText">Find</div>
<div class="findText"><?php echo $t['Find'];?></div>
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace(top.document.getElementById('find').value,true,false)">
<div class="selectWrapper" style="width: 41px">
<select name="connector" onChange="ICEcoder.findReplaceOptions()" style="width: 40px; margin-top: 4px">
<option>in</option>
<option>and</option>
<option><?php echo $t['in'];?></option>
<option><?php echo $t['and'];?></option>
</select>
</div>
<div class="replaceText" id="rText" style="display: none">
<div class="selectWrapper" style="width: 75px; overflow: visible">
<select name="replaceAction" style="width: 72px; margin-top: -2px">
<option>replace</option>
<option>replace all</option>
<option><?php echo $t['replace'];?></option>
<option><?php echo $t['replace all'];?></option>
</select>
</div>
with
@@ -252,10 +253,10 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<div class="targetText" id="rTarget" style="display: none">in</div>
<div class="selectWrapper" style="width: 104px">
<select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')" style="width: 101px; margin-top: 4px; margin-left: 2px">
<option>this document</option>
<option>open documents</option>
<option>all files</option>
<option>all filenames</option>
<option><?php echo $t['this document'];?></option>
<option><?php echo $t['open documents'];?></option>
<option><?php echo $t['all files'];?></option>
<option><?php echo $t['all filenames'];?></option>
</select>
</div>
<input type="submit" name="submit" value="&gt;&gt;" class="submit">
@@ -264,13 +265,13 @@ Color picker"><img src="images/color-picker.png" style="cursor: pointer" alt="Co
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>
<form onSubmit="return ICEcoder.goToLine()">
<div class="codeAssist" title="Turn on/off JS Hint &amp; CSS color previews">
<div class="codeAssist" title="<?php echo $t['Turn on/off...'];?>">
<input type="checkbox" name="codeAssist" id="codeAssist" class="codeAssistCheckbox" <?php if ($ICEcoder['codeAssist']) {echo 'checked ';};?>>
<span class="codeAssistDisplay" id="codeAssistDisplay" style="background-position: <?php echo $ICEcoder['codeAssist'] ? "0" : "-16";?> 0" onClick="top.ICEcoder.codeAssistToggle()"></span> Code Assist
<span class="codeAssistDisplay" id="codeAssistDisplay" style="background-position: <?php echo $ICEcoder['codeAssist'] ? "0" : "-16";?> 0" onClick="top.ICEcoder.codeAssistToggle()"></span> <?php echo $t['Code Assist'];?>
</div>
<div class="goLine">Go to Line <input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
<div class="view" title="View" onClick="top.ICEcoder.openPreviewWindow()" id="fMView"></div>
<div class="bug" title="Bug reporting not active" onClick="top.ICEcoder.openBugReport()" id="bugIcon"></div>
<div class="goLine"><?php echo $t['Go to Line'];?> <input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
<div class="view" title="<?php echo $t['View'];?>" onClick="top.ICEcoder.openPreviewWindow()" id="fMView"></div>
<div class="bug" title="<?php echo $t['Bug reporting not active'];?>" onClick="top.ICEcoder.openBugReport()" id="bugIcon"></div>
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>
</div>

122
lang/english.php Normal file
View File

@@ -0,0 +1,122 @@
<?php
// English language translation
// by: @mattpass (GitHub)
// @mattpass (Twitter)
// Please preserve formatting, line breaks, special characters, anything in <tags> and HTML equivalents (eg &amp;). Translations on right side.
$text = array(
// / [ROOT LEVEL]
"editor" =>
array(
"Click icons for..." => "<b>Click icons<br>for help &amp;<br>usage info</b>",
"server" => "server",
"Server name, OS..." => "Server name, OS & IP:",
"Root" => "Root:",
"ICEcoder root" => "ICEcoder root:",
"PHP version" => "PHP version:",
"Date & time" => "Date & time:",
"your device" => "your device",
"Browser" => "Browser:",
"Your IP" => "Your IP:",
"files" => "files",
"Last 10 files..." => "Last 10 files opened:",
"none" => "[none]",
"test suite" => "test suite",
"Run unit tests" => "Run unit tests",
"dev mode" => "dev mode",
"Status" => "Status",
"Using" => "Using",
"You can switch..." => "You can switch dev mode on/off
in lib/config__settings.php",
"results" => "results"
),
"files" =>
array(
"Lock" => "Lock",
"Refresh" => "Refresh",
"ROOT" => "[ROOT]"
),
"index" =>
array(
"UPDATE INFO" => "UPDATE INFO",
"now available" => "now available",
"Your version is" => "Your version is",
"Update now" => "Update now",
"You have some..." => "You have some unsaved changes",
"working" => "working",
"Color picker" => "Color picker",
"New File" => "New File",
"New Folder" => "New Folder",
"Upload File(s)" => "Upload File(s)",
"Paste" => "Paste",
"Open" => "Open",
"Copy" => "Copy",
"Duplicate" => "Duplicate",
"Delete" => "Delete",
"Rename" => "Rename",
"View Webpage" => "View Webpage",
"Download" => "Download",
"Properties" => "Properties",
"File" => "File",
"Edit" => "Edit",
"Remote" => "Remote",
"Help" => "Help",
"Save" => "Save",
"Save As" => "Save As",
"Live Preview" => "Live Preview",
"Upload" => "Upload",
"Zip" => "Zip",
"Print" => "Print",
"Fullscreen toggle" => "Fullscreen toggle",
"Logout" => "Logout",
"Undo" => "Undo",
"Redo" => "Redo",
"Indent more" => "Indent more",
"Indent less" => "Indent less",
"Autocomplete" => "Autocomplete",
"Comment/Uncomment" => "Comment/Uncomment",
"Jump to Definition" => "Jump to Definition",
"Manual" => "Manual",
"Shortcuts" => "Shortcuts",
"Settings" => "Settings",
"Search for selected" => "Search for selected",
"website" => "website",
"Close all tabs" => "Close all tabs",
"Alphabetize tabs" => "Alphabetize tabs",
"Find" => "Find",
"in" => "in",
"and" => "and",
"replace" => "replace",
"replace all" => "replace all",
"this document" => "this document",
"open documents" => "open documents",
"all files" => "all files",
"all filenames" => "all filenames",
"Turn on/off..." => "Turn on/off code assist",
"Code Assist" => "Code Assist",
"Go to Line" => "Go to Line",
"View" => "View",
"Bug reporting not active" => "Bug reporting not active"
),
// /LIB
"login" =>
array(
"set password" => "set password",
"login" => "login",
"To disable registration..." => "To disable registration mode, open the settings menu or open lib/config___settings.php and change enableRegistration to false then reload this page",
"Registration mode enabled" => "Registration mode enabled",
"auto-check for updates" => "auto-check for updates",
"To put into..." => "To put into multi-user mode, open the settings menu or open lib/config___settings.php and change multiUser to true then reload this page",
"multi-user" => "multi-user"
)
);
?>

View File

@@ -9,6 +9,6 @@ $ICEcoderSettings = array(
"loginRequired" => true,
"multiUser" => false,
"lineEnding" => "\n",
"enableRegistration" => true
"enableRegistration" => false
);
?>

View File

@@ -119,7 +119,7 @@ foreach($finalArray as $entry) {
if($_SESSION['bannedFiles'][$i] != "" && strpos($entry,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
}
if ("/".$entry == $ICEcoderDir) {
$canAdd = false;
//$canAdd = false;
}
if ($entry != "." && $entry != ".." && $canAdd) {
is_dir($docRoot.$iceRoot.$location."/".$entry)

View File

@@ -1,6 +1,7 @@
<?php
include("headers.php");
include("settings.php");
$t = $text['login'];
?>
<!DOCTYPE html>
@@ -27,17 +28,17 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
<form name="settingsUpdate" action="login.php" method="POST">
<?php if ($ICEcoder["multiUser"]) {echo ' <input type="text" name="username" class="password"><br><br>'.PHP_EOL;};?>
<input type="password" name="password" class="password"><br><br>
<input type="submit" name="submit" value="<?php if ($ICEcoder["multiUser"] && $ICEcoderSettings["enableRegistration"]) {echo "set password / login";} else {echo $ICEcoder["password"] == "" ? "set password" : "login";}; ?>" class="button">
<input type="submit" name="submit" value="<?php if ($ICEcoder["multiUser"] && $ICEcoderSettings["enableRegistration"]) {echo $t['set password']." / ".$t['login'];} else {echo $ICEcoder["password"] == "" ? $t['set password'] : $t['login'];}; ?>" class="button">
<?php
if($ICEcoder["multiUser"] && $ICEcoderSettings["enableRegistration"]){
echo '<div class="text"><a href="javascript:alert(\'To disable registration mode, open the settings menu or open lib/config___settings.php and change enableRegistration to false then reload this page\')">Registration mode enabled</a></div>';
echo '<div class="text"><a href="javascript:alert(\''.$t['To disable registration...'].'\')">'.$t['Registration mode enabled'].'</a></div>';
}
?>
<?php
if ($ICEcoder["password"] == "" || $ICEcoder["multiUser"]) {
echo '<div class="text"><input type="checkbox" name="checkUpdates" value="true" checked> auto-check for updates</div>';
echo '<div class="text"><input type="checkbox" name="checkUpdates" value="true" checked> '.$t['auto-check for updates'].'</div>';
}
if (!$ICEcoder["multiUser"]) { echo '<div class="text"><a href="javascript:alert(\'To put into multi-user mode, open the settings menu or open lib/config___settings.php and change multiUser to true then reload this page\')">multi-user?</a></div>';};
if (!$ICEcoder["multiUser"]) { echo '<div class="text"><a href="javascript:alert(\''.$t['To put into...'].'\')">'.$t['multi-user'].'?</a></div>';};
?>
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>

View File

@@ -39,6 +39,9 @@ If ($ICEcoderUserSettings["versionNo"] != $ICEcoderSettings["versionNo"]) {
// Join ICEcoder settings and user settings together to make our final ICEcoder array
$ICEcoder = $ICEcoderSettings + $ICEcoderUserSettings;
// Include language file
include(dirname(__FILE__)."/../lang/english.php");
// Login not required or we're in demo mode and have password set in our settings, log us straight in
if ((!$ICEcoder['loginRequired'] || $ICEcoder['demoMode']) && $ICEcoder['password']!="") {$_SESSION['loggedIn']=true;};
$demoMode = $ICEcoder['demoMode'];