index.php format overhauled

This commit is contained in:
mattpass
2020-06-04 20:25:48 +01:00
parent fda8f21806
commit d2293d8990

228
index.php
View File

@@ -1,14 +1,16 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
use ICEcoder\ExtraProcesses;
include "lib/headers.php";
include "lib/settings.php";
$t = $text['index'];
$updateMsg = '';
// Check for updates
if ($ICEcoder["checkUpdates"]) {
$icv_url = "https://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"];
$icvData = getData($icv_url,'curl',false,5);
if ($icvData == "no data") {
$icv_url = "https://icecoder.net/latest-version?thisVersion=" . $ICEcoder["versionNo"];
$icvData = getData($icv_url, 'curl', false, 5);
if ("" == $icvData) {
$icvData = "1.0\nICEcoder version placeholder";
}
$icvInfo = str_replace("\n", "", $icvData);
@@ -18,18 +20,24 @@ if ($ICEcoder["checkUpdates"]) {
0 => $icv,
1 => substr($icvInfo, strlen($matches[0]))
];
$icvI = str_replace('"','\\\'',$icvInfo[1]);
$icvI = str_replace('"', '\\\'', $icvInfo[1]);
$thisV = $ICEcoder["versionNo"];
if (strpos($thisV,"beta")>-1 && !strpos($icv,"beta") && str_replace(" beta","",$thisV) == $icv) {$thisV-=0.1;};
if ($thisV<$icv) {
$updateMsg = ";ICEcoder.dataMessage('<b>".$t['UPDATE INFO'].":</b> ICEcoder v ".$icv." ".$t['now available'].". (".$t['Your version is']." v ".$ICEcoder["versionNo"].").<br><br><a onclick=\\'ICEcoder.update()\\' style=\\'color:#fff; background: #b00; padding: 5px; text-decoration: none; cursor: pointer\\'>".$t['Update now']."</a><br><br>".$icvI."');";
if (-1 < strpos($thisV, "beta") && false === strpos($icv, "beta") && str_replace(" beta", "", $thisV) === $icv) {
$thisV-=0.1;
};
if ($thisV < $icv) {
$updateMsg =
";ICEcoder.dataMessage('<b>" . $t['UPDATE INFO'] .
":</b> ICEcoder v " . $icv." " . $t['now available'] . ". (" . $t['Your version is'] . " v " . $ICEcoder["versionNo"] .
").<br><br><a onclick=\\'ICEcoder.update()\\' style=\\'color:#fff; background: #b00; padding: 5px; text-decoration: none; cursor: pointer\\'>" .
$t['Update now'] . "</a><br><br>" . $icvI ."');";
}
}
$isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;
$isMac = false === strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh") ? true : false;
?>
<!DOCTYPE html>
<html onMouseDown="ICEcoder.mouseDown=true; ICEcoder.resetAutoLogoutTimer();" onMouseUp="ICEcoder.mouseDown=false; ICEcoder.resetAutoLogoutTimer(); ICEcoder.mouseDownInCM=false; if (!ICEcoder.overCloseLink) {ICEcoder.tabDragEnd()}" onMouseMove="if(ICEcoder) {ICEcoder.getMouseXY(event,'top'); ICEcoder.resetAutoLogoutTimer(); ICEcoder.canResizeFilesW()}" onMouseWheel="ICEcoder.resetAutoLogoutTimer(); if (ICEcoder.getcMInstance() && !ICEcoder.getcMInstance().hasFocus() && !ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? ICEcoder.nextTab() : ICEcoder.previousTab();}">
<html onmousedown="ICEcoder.mouseDown=true; ICEcoder.resetAutoLogoutTimer();" onmouseup="ICEcoder.mouseDown=false; ICEcoder.resetAutoLogoutTimer(); ICEcoder.mouseDownInCM=false; if (!ICEcoder.overCloseLink) {ICEcoder.tabDragEnd()}" onmousemove="if('undefined' !== typeof ICEcoder) {ICEcoder.getMouseXY(event,'top'); ICEcoder.resetAutoLogoutTimer(); ICEcoder.canResizeFilesW()}" onmousewheel="ICEcoder.resetAutoLogoutTimer(); if (ICEcoder.getcMInstance() && !ICEcoder.getcMInstance().hasFocus() && !ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? ICEcoder.nextTab() : ICEcoder.previousTab();}">
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
<!--Updated via settings so must remain 1st stylesheet//-->
@@ -39,9 +47,12 @@ $isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=0.5, user-scalable=no">
<link rel="stylesheet" type="text/css" href="<?php echo $iceURLPath;?>/assets/css/resets.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" type="text/css" href="<?php echo $iceURLPath;?>/assets/css/icecoder.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="<?php echo $iceURLPath . "/";
if ($ICEcoder["theme"]=="default") {echo 'assets/css/editor.css';} else {echo 'assets/css/theme/'.$ICEcoder["theme"].'.css';};
echo "default" === $ICEcoder["theme"]
? 'assets/css/editor.css'
: 'assets/css/theme/' . $ICEcoder["theme"] . '.css';
echo "?microtime=".microtime(true);
?>">
<link rel="icon" type="image/png" href="assets/images/favicon.png">
@@ -49,9 +60,9 @@ echo "?microtime=".microtime(true);
iceRoot = "<?php echo $ICEcoder['root']; ?>";
window.onbeforeunload = function() {
if(ICEcoder.autoLogoutTimer < ICEcoder.autoLogoutMins*60) {
for(var i=1;i<=ICEcoder.savedPoints.length;i++) {
if (ICEcoder.savedPoints[i-1]!=ICEcoder.getcMInstance(i).changeGeneration()) {
if(ICEcoder.autoLogoutTimer < ICEcoder.autoLogoutMins * 60) {
for(var i = 1; i <= ICEcoder.savedPoints.length; i++) {
if (ICEcoder.savedPoints[i - 1] != ICEcoder.getcMInstance(i).changeGeneration()) {
return "<?php echo $t['You have some...'];?>.";
}
}
@@ -65,9 +76,9 @@ t = {
$t = $text['icecoder'];
$tOutput = "";
foreach ($t as $key => $value) {
$tOutput .= '"'.$key.'" : "'.$value.'",'.PHP_EOL;
$tOutput .= '"' . $key . '" : "' . $value . '",' . PHP_EOL;
}
echo rtrim($tOutput,",".PHP_EOL).PHP_EOL;
echo rtrim($tOutput, "," . PHP_EOL) . PHP_EOL;
// Back to the lang array for index
$t = $text['index'];
@@ -81,55 +92,57 @@ $t = $text['index'];
<link rel="stylesheet" href="<?php echo $iceURLPath;?>/assets/css/farbtastic.css?microtime=<?php echo microtime(true);?>" type="text/css">
</head>
<body onLoad="<?php
echo "ICEcoder.versionNo = '".$ICEcoder["versionNo"]."';".
<body onload="<?php
echo "ICEcoder.versionNo = '" . $ICEcoder["versionNo"] . "';".
'ICEcoder.previousFiles = [';
if ($ICEcoder["previousFiles"]!="") {
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
echo "'".implode("','",$openFilesArray)."'";
if ($ICEcoder["previousFiles"] != "") {
$openFilesArray = explode(",", $ICEcoder["previousFiles"]);
echo "'" . implode("','", $openFilesArray) . "'";
}
echo "];";
echo "ICEcoder.theme = '".($ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"])."';".
"ICEcoder.autoLogoutMins = ".$ICEcoder["autoLogoutMins"].";".
"ICEcoder.fontSize = '".$ICEcoder["fontSize"]."';".
"ICEcoder.openLastFiles = ".($ICEcoder["openLastFiles"] ? 'true' : 'false').";".
"ICEcoder.updateDiffOnSave = ".($ICEcoder["updateDiffOnSave"] ? 'true' : 'false').";".
"ICEcoder.languageUser = '".$ICEcoder["languageUser"]."';".
"ICEcoder.codeAssist = ".($ICEcoder["codeAssist"] ? 'true' : 'false').";".
"ICEcoder.lockedNav = ".($ICEcoder["lockedNav"] ? 'true' : 'false').";".
"ICEcoder.lineWrapping = ".($ICEcoder["lineWrapping"] ? 'true' : 'false').";".
"ICEcoder.lineNumbers = ".($ICEcoder["lineNumbers"] ? 'true' : 'false').";".
"ICEcoder.showTrailingSpace = ".($ICEcoder["showTrailingSpace"] ? 'true' : 'false').";".
"ICEcoder.matchBrackets = ".($ICEcoder["matchBrackets"] ? 'true' : 'false').";".
"ICEcoder.autoCloseTags = ".($ICEcoder["autoCloseTags"] ? 'true' : 'false').";".
"ICEcoder.autoCloseBrackets = ".($ICEcoder["autoCloseBrackets"] ? 'true' : 'false').";".
"ICEcoder.indentWithTabs = ".($ICEcoder["indentWithTabs"] ? 'true' : 'false').";".
"ICEcoder.indentAuto = ".($ICEcoder["indentAuto"] ? 'true' : 'false').";".
"ICEcoder.indentSize = ".$ICEcoder["indentSize"].";".
"ICEcoder.scrollbarStyle = '".$ICEcoder["scrollbarStyle"]."';".
"ICEcoder.demoMode = ".($ICEcoder["demoMode"] ? 'true' : 'false').";".
"ICEcoder.tagWrapperCommand = '".$ICEcoder["tagWrapperCommand"]."';".
"ICEcoder.autoComplete = '".$ICEcoder["autoComplete"]."';".
"ICEcoder.bugFilePaths = ['".implode("','",$ICEcoder["bugFilePaths"])."'];".
"ICEcoder.bugFileCheckTimer = ".$ICEcoder["bugFileCheckTimer"].";".
"ICEcoder.bugFileMaxLines = ".$ICEcoder["bugFileMaxLines"].";".
"ICEcoder.fileDirResOutput = '".$ICEcoder["fileDirResOutput"]."';".
"ICEcoder.newDirPerms = ".$ICEcoder["newDirPerms"].";".
"ICEcoder.newFilePerms = ".$ICEcoder["newFilePerms"].";";
echo "ICEcoder.csrf = '".$_SESSION["csrf"]."';";
echo "ICEcoder.theme = '" . ("default" === $ICEcoder["theme"] ? 'icecoder' : $ICEcoder["theme"]) . "';" .
"ICEcoder.autoLogoutMins = " . $ICEcoder["autoLogoutMins"] . ";" .
"ICEcoder.fontSize = '" . $ICEcoder["fontSize"] . "';" .
"ICEcoder.openLastFiles = " . ($ICEcoder["openLastFiles"] ? 'true' : 'false') . ";" .
"ICEcoder.updateDiffOnSave = " . ($ICEcoder["updateDiffOnSave"] ? 'true' : 'false') . ";" .
"ICEcoder.languageUser = '".$ICEcoder["languageUser"] . "';" .
"ICEcoder.codeAssist = " . ($ICEcoder["codeAssist"] ? 'true' : 'false') . ";" .
"ICEcoder.lockedNav = " . ($ICEcoder["lockedNav"] ? 'true' : 'false') . ";" .
"ICEcoder.lineWrapping = " . ($ICEcoder["lineWrapping"] ? 'true' : 'false') . ";" .
"ICEcoder.lineNumbers = " . ($ICEcoder["lineNumbers"] ? 'true' : 'false') . ";" .
"ICEcoder.showTrailingSpace = " . ($ICEcoder["showTrailingSpace"] ? 'true' : 'false') . ";" .
"ICEcoder.matchBrackets = " . ($ICEcoder["matchBrackets"] ? 'true' : 'false') . ";" .
"ICEcoder.autoCloseTags = " . ($ICEcoder["autoCloseTags"] ? 'true' : 'false') . ";" .
"ICEcoder.autoCloseBrackets = " . ($ICEcoder["autoCloseBrackets"] ? 'true' : 'false') . ";" .
"ICEcoder.indentWithTabs = " . ($ICEcoder["indentWithTabs"] ? 'true' : 'false') . ";" .
"ICEcoder.indentAuto = " . ($ICEcoder["indentAuto"] ? 'true' : 'false') . ";" .
"ICEcoder.indentSize = " . $ICEcoder["indentSize"] . ";" .
"ICEcoder.scrollbarStyle = '" . $ICEcoder["scrollbarStyle"] . "';" .
"ICEcoder.demoMode = " . ($ICEcoder["demoMode"] ? 'true' : 'false') . ";" .
"ICEcoder.tagWrapperCommand = '" . $ICEcoder["tagWrapperCommand"] . "';" .
"ICEcoder.autoComplete = '" . $ICEcoder["autoComplete"] . "';" .
"ICEcoder.bugFilePaths = ['" . implode("','",$ICEcoder["bugFilePaths"]) . "'];" .
"ICEcoder.bugFileCheckTimer = ".$ICEcoder["bugFileCheckTimer"] . ";" .
"ICEcoder.bugFileMaxLines = " . $ICEcoder["bugFileMaxLines"] . ";" .
"ICEcoder.fileDirResOutput = '" . $ICEcoder["fileDirResOutput"] . "';" .
"ICEcoder.newDirPerms = " . $ICEcoder["newDirPerms"] . ";" .
"ICEcoder.newFilePerms = " . $ICEcoder["newFilePerms"] . ";";
echo "ICEcoder.csrf = '" . $_SESSION["csrf"] . "';";
if (true === $ICEcoder["tutorialOnLogin"]) {
echo "ICEcoder.viewTutorial(false, 700);";
}
?>ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>;ICEcoder.content.style.visibility='visible';ICEcoder.filesFrame.contentWindow.frames['processControl'].location.href = iceLoc+'/processes/on-load.php';<?php if(isset($_GET["display"]) && $_GET["display"] == "updated") {echo "ICEcoder.updated();";};?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="if('visible' === get('blackMask').style.visibility) {ICEcoder.handleModalKeyUp(event, 'modalGeneralCatch')}; ICEcoder.resetKeys(event);" onBlur="ICEcoder.resetKeys(event);">
$extraProcesses = new ExtraProcesses();
$onLoad = $extraProcesses->onLoad();
?>ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>;ICEcoder.content.style.visibility = 'visible';<?php echo $onLoad;?><?php if(true === isset($_GET["display"]) && "updated" === $_GET["display"]) {echo "ICEcoder.updated();";};?>" onresize="ICEcoder.setLayout()" onkeydown="return ICEcoder.interceptKeys('coder', event);" onkeyup="if('visible' === get('blackMask').style.visibility) {ICEcoder.handleModalKeyUp(event, 'modalGeneralCatch')}; ICEcoder.resetKeys(event);" onblur="ICEcoder.resetKeys(event);">
<div id="blackMask" class="blackMask" onClick="if (!ICEcoder.overPopup) {ICEcoder.showHide('hide',this)}" onContextMenu="return false">
<div id="blackMask" class="blackMask" onclick="if (!ICEcoder.overPopup) {ICEcoder.showHide('hide',this)}" oncontextmenu="return false">
<div class="popupVCenter">
<div class="popup" id="mediaContainer"></div>
</div>
<div class="floatingContainer" id="floatingContainer"></div>
</div>
<div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
<div id="loadingMask" class="blackMask" style="visibility: visible" oncontextmenu="return false">
<div class="popupVCenter">
<div class="popup">
<div class="spinner"></div>
@@ -143,65 +156,65 @@ $t = $text['index'];
<div id="infoMessage" class="infoMessage"></div>
</div>
<div id="plugins" class="plugins" style="<?php echo $ICEcoder["pluginPanelAligned"];?>: 0" onMouseOver="ICEcoder.showHidePlugins('show')" onMouseOut="ICEcoder.showHidePlugins('hide')" onClick="ICEcoder.showHidePlugins('hide')">
<div id="plugins" class="plugins" style="<?php echo $ICEcoder["pluginPanelAligned"];?>: 0" onmouseover="ICEcoder.showHidePlugins('show')" onmouseout="ICEcoder.showHidePlugins('hide')" onclick="ICEcoder.showHidePlugins('hide')">
<div style="padding: 15px">
<a nohref onClick="ICEcoder.showColorPicker(document.getElementById('color') ? document.getElementById('color').value : '#123456')" title="Farbtastic
<a nohref onclick="ICEcoder.showColorPicker(document.getElementById('color') ? document.getElementById('color').value : '#123456')" title="Farbtastic
<?php echo $t['Color picker'];?>"><img src="<?php echo $iceURLPath;?>/assets/images/color-picker.png" style="cursor: pointer" alt="Color Picker"></a><br><br>
<div id="pluginsOptional"><?php echo $pluginsDisplay; ?></div>
<a nohref onclick="ICEcoder.pluginsManager()" title="<?php echo $t['Plugins Manager'];?>" style="color: #fff; cursor: pointer">+ / -</a>
</div>
</div>
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');ICEcoder.hideFileMenu()" style="opacity: 0" onContextMenu="return false">
<div id="fileMenu" class="fileMenu" onmouseover="ICEcoder.changeFilesW('expand')" onmouseout="ICEcoder.changeFilesW('contract');ICEcoder.hideFileMenu()" style="opacity: 0" oncontextmenu="return false">
<span id="folderMenuItems">
<a href="javascript:ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['New File'];?></a>
<a href="javascript:ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['New Folder'];?></a>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<a href="javascript:ICEcoder.uploadFilesSelect(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Upload File(s)'];?></a>
<a href="javascript:ICEcoder.newFile()" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['New File'];?></a>
<a href="javascript:ICEcoder.newFolder()" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['New Folder'];?></a>
<div onmouseover="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<a href="javascript:ICEcoder.uploadFilesSelect(ICEcoder.selectedFiles[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="<?php echo $iceURLPath;?>/lib/file-control-xhr.php?action=upload&file=/uploaded" method="POST" target="fileControl">
<form enctype="multipart/form-data" id="uploadFilesForm" action="<?php echo $iceURLPath;?>/lib/file-control.php?action=upload&file=/uploaded" method="POST" target="fileControl">
<input type="hidden" name="folder" id="uploadDir" value="/">
<input type="file" name="filesInput[]" id="fileInput" onchange="ICEcoder.uploadFilesSubmit(this)" multiple>
<input type="submit" value="Upload File">
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>
</div>
<a href="javascript:ICEcoder.pasteFiles(ICEcoder.selectedFiles[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>
<a href="javascript:ICEcoder.pasteFiles(ICEcoder.selectedFiles[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:ICEcoder.openFilesFromList(ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Open'];?></a>
<a href="javascript:ICEcoder.copyFiles(ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Copy'];?></a>
<a href="javascript:ICEcoder.duplicateFiles(ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Duplicate'];?></a>
<a href="javascript:ICEcoder.deleteFiles(ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Delete'];?></a>
<a href="javascript:ICEcoder.openFilesFromList(ICEcoder.selectedFiles)" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['Open'];?></a>
<a href="javascript:ICEcoder.copyFiles(ICEcoder.selectedFiles)" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['Copy'];?></a>
<a href="javascript:ICEcoder.duplicateFiles(ICEcoder.selectedFiles)" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['Duplicate'];?></a>
<a href="javascript:ICEcoder.deleteFiles(ICEcoder.selectedFiles)" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['Delete'];?></a>
<span id="singleFileMenuItems">
<a href="javascript:ICEcoder.renameFile(ICEcoder.selectedFiles[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('//<?php echo $_SERVER['HTTP_HOST'];?>' + iceRoot + ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1].replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()" style="cursor: pointer"><?php echo $t['View Webpage'];?></a>
<a href="javascript:ICEcoder.renameFile(ICEcoder.selectedFiles[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('//<?php echo $_SERVER['HTTP_HOST'];?>' + iceRoot + ICEcoder.selectedFiles[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>
<div onmouseover="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<?php
if (file_exists(dirname(__FILE__)."/plugins/zip-it/index.php")) {
echo '<a href="javascript:ICEcoder.zipIt(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>'.PHP_EOL;
if (true === file_exists(dirname(__FILE__) . "/plugins/zip-it/index.php")) {
echo '<a href="javascript:ICEcoder.zipIt(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length - 1])" onmouseover="ICEcoder.showFileMenu()">Zip It!</a>' . PHP_EOL;
};
?>
<a href="javascript:ICEcoder.downloadFile(ICEcoder.selectedFiles[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:ICEcoder.propertiesScreen(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Properties'];?></a>
<a href="javascript:ICEcoder.downloadFile(ICEcoder.selectedFiles[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:ICEcoder.propertiesScreen(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])" onmouseover="ICEcoder.showFileMenu()"><?php echo $t['Properties'];?></a>
</div>
<div id="header" class="header" onContextMenu="return false"></div>
<div id="header" class="header" oncontextmenu="return false"></div>
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); ICEcoder.hideFileMenu();" onContextMenu="return false">
<div id="files" class="files" onmouseover="ICEcoder.changeFilesW('expand')" onmouseout="ICEcoder.changeFilesW('contract'); ICEcoder.hideFileMenu();" oncontextmenu="return false">
<div id="fileNav" class="fileNav">
<ul>
<li><a nohref onclick="ICEcoder.canShowFMNav=true;ICEcoder.showHideFileNav('show','optionsFile')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show','optionsFile')}" id="optionsFileNav"><?php echo $t['File'];?></a></li>
<li><a nohref onclick="ICEcoder.canShowFMNav=true;ICEcoder.showHideFileNav('show','optionsEdit')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show','optionsEdit')}" id="optionsEditNav"><?php echo $t['Edit'];?></a></li>
<li><a nohref onclick="ICEcoder.canShowFMNav=true;ICEcoder.showHideFileNav('show','optionsSource')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show','optionsSource')}" id="optionsSourceNav"><?php echo $t['Source'];?></a></li>
<li><a nohref onclick="ICEcoder.canShowFMNav=true;ICEcoder.showHideFileNav('show','optionsHelp')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show','optionsHelp')}" id="optionsHelpNav"><?php echo $t['Help'];?></a></li>
</ul>
<li><a nohref onclick="ICEcoder.canShowFMNav=true; ICEcoder.showHideFileNav('show','optionsFile')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show', 'optionsFile')}" id="optionsFileNav"><?php echo $t['File'];?></a></li>
<li><a nohref onclick="ICEcoder.canShowFMNav=true; ICEcoder.showHideFileNav('show','optionsEdit')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show', 'optionsEdit')}" id="optionsEditNav"><?php echo $t['Edit'];?></a></li>
<li><a nohref onclick="ICEcoder.canShowFMNav=true; ICEcoder.showHideFileNav('show','optionsSource')" onmouseover="if(ICEcoder.canShowFMNav) {ICEcoder.showHideFileNav('show', 'optionsSource')}" id="optionsSourceNav"><?php echo $t['Source'];?></a></li>
<li><a nohref onclick="ICEcoder.canShowFMNav=true; ICEcoder.showHideFileNav('show','optionsHelp')" onmouseover="if(ICEcoder.canShowFMNav) {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="ICEcoder.showHideFileNav('show',this.id)" onmouseout="ICEcoder.showHideFileNav('hide',this.id);ICEcoder.canShowFMNav=false">
<div id="optionsFile" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show', this.id)" onmouseout="ICEcoder.showHideFileNav('hide', this.id); ICEcoder.canShowFMNav = false">
<ul>
<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>
@@ -209,21 +222,21 @@ $t = $text['index'];
<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(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])"><?php echo $t['Download'];?></a></li>
<li><a nohref onclick="ICEcoder.downloadFile(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length - 1])"><?php echo $t['Download'];?></a></li>
<li><a nohref onclick="ICEcoder.copyFiles(ICEcoder.selectedFiles)"><?php echo $t['Copy'];?></a></li>
<li><a nohref onclick="ICEcoder.pasteFiles(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])"><?php echo $t['Paste'];?></a></li>
<li><a nohref onclick="ICEcoder.pasteFiles(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length - 1])"><?php echo $t['Paste'];?></a></li>
<li><a nohref onclick="ICEcoder.deleteFiles(ICEcoder.selectedFiles)"><?php echo $t['Delete'];?></a></li>
<li><a nohref onclick="ICEcoder.duplicateFiles(ICEcoder.selectedFiles)"><?php echo $t['Duplicate'];?></a></li>
<li><a nohref onclick="ICEcoder.renameFile(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])"><?php echo $t['Rename'];?></a></li>
<li><a nohref onclick="ICEcoder.renameFile(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length - 1])"><?php echo $t['Rename'];?></a></li>
<li><a nohref onclick="ICEcoder.uploadFilesSelect(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])"><?php echo $t['Upload'];?>...</a></li>
<li><a nohref onclick="ICEcoder.zipIt(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length-1])"><?php echo $t['Zip'];?></a></li>
<li><a nohref onclick="ICEcoder.zipIt(ICEcoder.selectedFiles[ICEcoder.selectedFiles.length - 1])"><?php echo $t['Zip'];?></a></li>
<li><a nohref onclick="ICEcoder.propertiesScreen(ICEcoder.selectedFiles[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="ICEcoder.showHideFileNav('show',this.id)" onmouseout="ICEcoder.showHideFileNav('hide',this.id);ICEcoder.canShowFMNav=false">
<div id="optionsEdit" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show', this.id)" onmouseout="ICEcoder.showHideFileNav('hide', this.id); ICEcoder.canShowFMNav = false">
<ul>
<li><a nohref onclick="ICEcoder.undo()"><?php echo $t['Undo'];?></a></li>
<li><a nohref onclick="ICEcoder.redo()"><?php echo $t['Redo'];?></a></li>
@@ -235,13 +248,13 @@ $t = $text['index'];
<li><a nohref onClick="ICEcoder.settingsScreen()"><?php echo $t['Settings'];?></a></li>
</ul>
</div>
<div id="optionsSource" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show',this.id)" onmouseout="ICEcoder.showHideFileNav('hide',this.id);ICEcoder.canShowFMNav=false">
<div id="optionsSource" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show',this.id)" onmouseout="ICEcoder.showHideFileNav('hide', this.id);ICEcoder.canShowFMNav = false">
<ul>
<li><a nohref onclick="ICEcoder.goLocalhostRoot()">Localhost</a></li>
<li><a nohref onclick="ICEcoder.ftpManager()">FTP</a></li>
</ul>
</div>
<div id="optionsHelp" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show',this.id)" onmouseout="ICEcoder.showHideFileNav('hide',this.id);ICEcoder.canShowFMNav=false">
<div id="optionsHelp" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show',this.id)" onmouseout="ICEcoder.showHideFileNav('hide', this.id);ICEcoder.canShowFMNav = false">
<ul>
<li><a nohref onclick="ICEcoder.viewTutorial(false, 500)">Tutorial</a></li>
<li><a nohref onclick="ICEcoder.showManual('<?php echo $ICEcoder["versionNo"];?>')"><?php echo $t['Manual'];?></a></li>
@@ -251,7 +264,7 @@ $t = $text['index'];
</ul>
</div>
</div>
<iframe id="filesFrame" class="frame" name="ff" src="<?php echo $iceURLPath;?>/files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){ICEcoder.mouseDown=false; ICEcoder.mouseDownInCM=false}"></iframe>
<iframe id="filesFrame" class="frame" name="ff" src="<?php echo $iceURLPath;?>/files.php" style="opacity: 0" onLoad="this.style.opacity = '1'; this.contentWindow.onscroll = function(){ICEcoder.mouseDown = false; ICEcoder.mouseDownInCM = false}"></iframe>
<div class="serverMessage" id="serverMessage"></div>
<div class="tools" id="tools">
@@ -263,25 +276,25 @@ $t = $text['index'];
</div>
<div id="editor" class="editor">
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
<div id="tabsBar" class="tabsBar" oncontextmenu="return false">
<a nohref onClick="ICEcoder.closeAllTabs()"><img src="<?php echo $iceURLPath;?>/assets/images/nav-close-all.gif" class="closeAllTabs" title="<?php echo $t['Close all tabs'];?>"></a>
<a nohref onClick="ICEcoder.alphaTabs()"><img src="<?php echo $iceURLPath;?>/assets/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=ICEcoder.tabFGselected; if (!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=ICEcoder.tabFGselected" onMouseOut="this.style.color=thisColor"></div>';
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 = ICEcoder.tabFGselected; if (!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 = ICEcoder.tabFGselected" onmouseout="this.style.color = thisColor"></div>';
}
?><div class="newTab" onClick="ICEcoder.newTab()" id="newTab">+</div>
</div>
<div id="findBar" class="findBar" onContextMenu="return false">
<form name="findAndReplace" onSubmit="ICEcoder.findReplace(document.getElementById('find').value,false,true);return false">
<div id="findBar" class="findBar" oncontextmenu="return false">
<form name="findAndReplace" onSubmit="ICEcoder.findReplace(document.getElementById('find').value, false, true); return false">
<div class="findReplace">
<div class="findText"><?php echo $t['Find'];?></div>
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace(document.getElementById('find').value,true,false,event.keyCode == 27);get('findReplaceSubmit').click();this.focus()">
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplaceKeyUp()">
<div class="selectWrapper" style="width: 41px">
<select name="connector" onChange="ICEcoder.findReplaceOptions()" style="width: 40px; margin-top: 4px">
<option><?php echo $t['in'];?></option>
<option><?php echo $t['and'];?></option>
<option><?php echo $t['in'];?></option>
<option><?php echo $t['and'];?></option>
</select>
</div>
<div class="replaceText" id="rText" style="display: none">
@@ -291,12 +304,12 @@ $t = $text['index'];
<option><?php echo $t['replace all'];?></option>
</select>
</div>
with
<div class="withText">with</div>
</div>
<input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none">
<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">
<select name="target" onChange="ICEcoder.updateResultsDisplay('this document' === this.value ? 'show' : 'hide')" style="width: 101px; margin-top: 4px; margin-left: 2px">
<option><?php echo $t['this document'];?></option>
<option><?php echo $t['open documents'];?></option>
<option><?php echo $t['all files'];?></option>
@@ -319,17 +332,16 @@ $t = $text['index'];
<pre id="output" class="output"><b>Output</b><br>via ICEcoder.output(message);<br><br></pre>
<iframe name="databaseFrame" id="database" src="<?php echo $iceURLPath;?>/lib/database.php" class="database"></iframe>
<div id="git" class="git" style="font-family: monospace"><?php
if (file_exists($docRoot.$ICEcoderDir."/data/git-diff.php")) {
if (file_exists($docRoot . $ICEcoderDir . "/data/git-diff.php")) {
echo "Looking for git status...";
} else {
echo "To provide git diff data to ICEcoder, please run...<br><br>sudo nohup php processes/system.php > data/nohup.log 2>&1 &<br><br>...to run as a background process";
echo "To provide git diff data to ICEcoder, please run...<br><br>sudo nohup php server/run-tasks.php > data/nohup.log 2>&1 &<br><br>...to run as a background process";
};?></div>
<iframe name="contentFrame" id="content" src="<?php echo $iceURLPath;?>/editor.php" class="code" scrolling="no"></iframe>
</div>
<div class="footer" id="footer" onContextMenu="return false">
<div class="nesting" id="nestValid"></div>
<div class="versionsDisplay" id="versionsDisplay" onclick="ICEcoder.versionsScreen(ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(/\//g,'|'))"></div>
<div class="footer" id="footer" oncontextmenu="return false">
<div class="versionsDisplay" id="versionsDisplay" onclick="ICEcoder.versionsScreen(ICEcoder.openFiles[ICEcoder.selectedTab - 1].replace(/\//g, '|'))"></div>
<div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="ICEcoder.setSplitPane('off')" style="opacity: 0.5"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="ICEcoder.setSplitPane('on')" style="opacity: 0.2"></div></div>
<div class="splitPaneNames" id="splitPaneNamesMain">Main Pane</div>
<div class="splitPaneNames" id="splitPaneNamesDiff">Diff Pane</div>
@@ -341,7 +353,7 @@ $t = $text['index'];
<script>
ICEcoder.initAliases();
ICEcoder.setLayout('dontSetEditor');
ICEcoder.setLayout(false);
</script>
</body>