mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-18 14:27:10 +01:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14fe45bda8 | ||
|
|
72ff461b45 | ||
|
|
96fe7d46ba | ||
|
|
d40cdeb65e | ||
|
|
4130df7bf9 | ||
|
|
6e176cdda7 | ||
|
|
bdb171dc6d | ||
|
|
801471a105 | ||
|
|
f86cb53bd9 | ||
|
|
435e1b3b4b | ||
|
|
4b17d76144 | ||
|
|
d96ebe4282 | ||
|
|
e5c5e7dc5e | ||
|
|
fe593dcb09 | ||
|
|
b1056a19a3 | ||
|
|
048c47f7f3 | ||
|
|
a4bb1605ce | ||
|
|
c4d24c0a4c | ||
|
|
99dedb61cb | ||
|
|
702c3d069f | ||
|
|
8ec8efe967 | ||
|
|
4aa0260399 | ||
|
|
f24aaf1396 | ||
|
|
00ddd056af | ||
|
|
2438fbb13d | ||
|
|
20832c3dcc | ||
|
|
725461f04e | ||
|
|
a3edd7bdf9 | ||
|
|
8d9d330678 | ||
|
|
d46fa3012b | ||
|
|
75e9f916ec | ||
|
|
f71277008f | ||
|
|
184a9d223b | ||
|
|
b4c45e33e9 | ||
|
|
eea960bcbd | ||
|
|
609e4397db | ||
|
|
b8bfbc5f6a | ||
|
|
4b274f959e | ||
|
|
e66811a4e2 | ||
|
|
139bfe775c | ||
|
|
feb26af4bf | ||
|
|
27d75f810a | ||
|
|
bc251d8c2b | ||
|
|
bde9010000 | ||
|
|
91314f423f | ||
|
|
2bb0a361aa | ||
|
|
5517bf80f9 | ||
|
|
f141e6f7a7 | ||
|
|
7220288460 | ||
|
|
d9f4955736 | ||
|
|
13255bc58b | ||
|
|
2988de5501 | ||
|
|
70a69f1c3b | ||
|
|
7cce0bf865 | ||
|
|
16e3e92c4a | ||
|
|
5f1b78ea1d | ||
|
|
9f36a8e5f8 | ||
|
|
89a2212408 | ||
|
|
9ed344d22d | ||
|
|
642db4c5b9 | ||
|
|
2a93778df7 |
File diff suppressed because one or more lines are too long
4
CodeMirror-2.36/lib/codemirror-compressed.js
Normal file
4
CodeMirror-2.36/lib/codemirror-compressed.js
Normal file
File diff suppressed because one or more lines are too long
@@ -80,6 +80,7 @@
|
|||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-wrap pre {
|
.CodeMirror-wrap pre {
|
||||||
83
CodeMirror-2.36/theme/ambiance.css
Normal file
83
CodeMirror-2.36/theme/ambiance.css
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/* ambiance theme for codemirror */
|
||||||
|
|
||||||
|
/* Color scheme */
|
||||||
|
|
||||||
|
.cm-s-ambiance .cm-keyword { color: #cda869; }
|
||||||
|
.cm-s-ambiance .cm-atom { color: #CF7EA9; }
|
||||||
|
.cm-s-ambiance .cm-number { color: #78CF8A; }
|
||||||
|
.cm-s-ambiance .cm-def { color: #aac6e3; }
|
||||||
|
.cm-s-ambiance .cm-variable { color: #ffb795; }
|
||||||
|
.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
|
||||||
|
.cm-s-ambiance .cm-variable-3 { color: #faded3; }
|
||||||
|
.cm-s-ambiance .cm-property { color: #eed1b3; }
|
||||||
|
.cm-s-ambiance .cm-operator {color: #fa8d6a;}
|
||||||
|
.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
|
||||||
|
.cm-s-ambiance .cm-string { color: #8f9d6a; }
|
||||||
|
.cm-s-ambiance .cm-string-2 { color: #9d937c; }
|
||||||
|
.cm-s-ambiance .cm-meta { color: #D2A8A1; }
|
||||||
|
.cm-s-ambiance .cm-error { color: #AF2018; }
|
||||||
|
.cm-s-ambiance .cm-qualifier { color: yellow; }
|
||||||
|
.cm-s-ambiance .cm-builtin { color: #9999cc; }
|
||||||
|
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
|
||||||
|
.cm-s-ambiance .cm-tag { color: #fee4ff }
|
||||||
|
.cm-s-ambiance .cm-attribute { color: #9B859D; }
|
||||||
|
.cm-s-ambiance .cm-header {color: blue;}
|
||||||
|
.cm-s-ambiance .cm-quote { color: #24C2C7; }
|
||||||
|
.cm-s-ambiance .cm-hr { color: pink; }
|
||||||
|
.cm-s-ambiance .cm-link { color: #F4C20B; }
|
||||||
|
.cm-s-ambiance .cm-special { color: #FF9D00; }
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
|
||||||
|
.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-selected {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
}
|
||||||
|
.CodeMirror-focused .cm-s-ambiance .CodeMirror-selected {
|
||||||
|
background: rgba(255, 255, 255, 0.10);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Editor styling */
|
||||||
|
|
||||||
|
.cm-s-ambiance {
|
||||||
|
line-height: 1.40em;
|
||||||
|
font-family: Monaco, Menlo,"Andale Mono","lucida console","Courier New",monospace !important;
|
||||||
|
color: #E6E1DC;
|
||||||
|
background-color: #202020;
|
||||||
|
-webkit-box-shadow: inset 0 0 10px black;
|
||||||
|
-moz-box-shadow: inset 0 0 10px black;
|
||||||
|
-o-box-shadow: inset 0 0 10px black;
|
||||||
|
box-shadow: inset 0 0 10px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-gutter {
|
||||||
|
background: #3D3D3D;
|
||||||
|
padding: 0 5px;
|
||||||
|
text-shadow: #333 1px 1px;
|
||||||
|
border-right: 1px solid #4D4D4D;
|
||||||
|
box-shadow: 0 10px 20px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-gutter .CodeMirror-gutter-text {
|
||||||
|
text-shadow: 0px 1px 1px #4d4d4d;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-lines {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor {
|
||||||
|
border-left: 1px solid #7991E8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .activeline {
|
||||||
|
background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance {
|
||||||
|
background: #202020;
|
||||||
|
}
|
||||||
|
.cm-s-ambiance .CodeMirror-gutter {
|
||||||
|
background: #3d3d3d;
|
||||||
|
}
|
||||||
26
CodeMirror-2.36/theme/twilight.css
Normal file
26
CodeMirror-2.36/theme/twilight.css
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
.cm-s-twilight { background: #141414; color: #f7f7f7; } /**/
|
||||||
|
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
|
||||||
|
|
||||||
|
.cm-s-twilight .CodeMirror-gutter { background: #222; border-right: 1px solid #aaa; }
|
||||||
|
.cm-s-twilight .CodeMirror-gutter-text { color: #aaa; }
|
||||||
|
.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||||
|
|
||||||
|
.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
|
||||||
|
.cm-s-twilight .cm-atom { color: #FC0; }
|
||||||
|
.cm-s-twilight .cm-number { color: #ca7841; } /**/
|
||||||
|
.cm-s-twilight .cm-def { color: #8DA6CE; }
|
||||||
|
.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
|
||||||
|
.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
|
||||||
|
.cm-s-twilight .cm-operator { color: #cda869; } /**/
|
||||||
|
.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
|
||||||
|
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
|
||||||
|
.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
|
||||||
|
.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
|
||||||
|
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
|
||||||
|
.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
|
||||||
|
.cm-s-twilight .cm-tag { color: #997643; } /**/
|
||||||
|
.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
|
||||||
|
.cm-s-twilight .cm-header { color: #FF6400; }
|
||||||
|
.cm-s-twilight .cm-hr { color: #AEAEAE; }
|
||||||
|
.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; font-underline:none; } /**/
|
||||||
|
|
||||||
46
CodeMirror-2.36/theme/xq-dark.css
Normal file
46
CodeMirror-2.36/theme/xq-dark.css
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2011 by MarkLogic Corporation
|
||||||
|
Author: Mike Brevoort <mike@brevoort.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
.cm-s-xq-dark { background: #0a001f; color: #f8f8f8; }
|
||||||
|
.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
|
||||||
|
.cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
||||||
|
.cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; }
|
||||||
|
.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||||
|
|
||||||
|
.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
|
||||||
|
.cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
|
||||||
|
.cm-s-xq-dark span.cm-number {color: #164;}
|
||||||
|
.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
|
||||||
|
.cm-s-xq-dark span.cm-variable {color: #FFF;}
|
||||||
|
.cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
|
||||||
|
.cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
|
||||||
|
.cm-s-xq-dark span.cm-property {}
|
||||||
|
.cm-s-xq-dark span.cm-operator {}
|
||||||
|
.cm-s-xq-dark span.cm-comment {color: gray;}
|
||||||
|
.cm-s-xq-dark span.cm-string {color: #9FEE00;}
|
||||||
|
.cm-s-xq-dark span.cm-meta {color: yellow;}
|
||||||
|
.cm-s-xq-dark span.cm-error {color: #f00;}
|
||||||
|
.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
|
||||||
|
.cm-s-xq-dark span.cm-builtin {color: #30a;}
|
||||||
|
.cm-s-xq-dark span.cm-bracket {color: #cc7;}
|
||||||
|
.cm-s-xq-dark span.cm-tag {color: #FFBD40;}
|
||||||
|
.cm-s-xq-dark span.cm-attribute {color: #FFF700;}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
#ICEcoder v0.9.0 alpha
|
#ICEcoder
|
||||||
##Web based IDE for smart web development
|
##Web based IDE for smart web development
|
||||||
|
|
||||||
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||||
|
|
||||||
|
<img src="http://icecoder.net/images/ice-coder-web-ide.jpg" alt="ICEcoder web IDE">
|
||||||
|
|
||||||
###Features you'd expect
|
###Features you'd expect
|
||||||
* Context aware code highlighting
|
* Context aware code highlighting
|
||||||
* Supports HTML, CSS, LESS, JavaScript, CoffeeScript, PHP & Ruby
|
* Supports HTML, CSS, LESS, JavaScript, CoffeeScript, PHP & Ruby
|
||||||
|
|||||||
19
editor.php
19
editor.php
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> alpha editor</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||||
<!--
|
<!--
|
||||||
@@ -18,7 +18,7 @@ if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder
|
|||||||
$activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000";
|
$activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000";
|
||||||
?>">
|
?>">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; top: 0px; width: 100%; z-index: 1}
|
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; top: 0px; width: 100%; font-size: 13px; z-index: 1}
|
||||||
.CodeMirror-scroll {height: auto; overflow: visible}
|
.CodeMirror-scroll {height: auto; overflow: visible}
|
||||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||||
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
||||||
@@ -92,16 +92,16 @@ span.CodeMirror-matchhighlight {background: #555}
|
|||||||
<script>
|
<script>
|
||||||
function createNewCMInstance(num) {
|
function createNewCMInstance(num) {
|
||||||
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||||
top.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%';
|
top.ICEcoder.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%';
|
||||||
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,top.foldStyle);
|
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,top.ICEcoder.foldStyle);
|
||||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,top.foldStyle);
|
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,top.ICEcoder.foldStyle);
|
||||||
|
|
||||||
window['cM'+num] = CodeMirror(document.body, {
|
window['cM'+num] = CodeMirror(document.body, {
|
||||||
mode: "application/x-httpd-php",
|
mode: "application/x-httpd-php",
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
lineWrapping: true,
|
lineWrapping: true,
|
||||||
indentUnit: top.tabWidth,
|
indentUnit: top.ICEcoder.tabWidth,
|
||||||
tabSize: top.tabWidth,
|
tabSize: top.ICEcoder.tabWidth,
|
||||||
indentWithTabs: true,
|
indentWithTabs: true,
|
||||||
electricChars: false,
|
electricChars: false,
|
||||||
onCursorActivity: function(thisCM) {
|
onCursorActivity: function(thisCM) {
|
||||||
@@ -173,9 +173,12 @@ function createNewCMInstance(num) {
|
|||||||
};
|
};
|
||||||
lastKeyCode = e.keyCode;
|
lastKeyCode = e.keyCode;
|
||||||
},
|
},
|
||||||
|
onScroll: function() {
|
||||||
|
top.ICEcoder.mouseDown=false;
|
||||||
|
},
|
||||||
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
|
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
"Tab": function(cm) {CodeMirror.commands[top.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||||
"Shift-Tab": "indentLess",
|
"Shift-Tab": "indentLess",
|
||||||
"Ctrl-Up": function() {},
|
"Ctrl-Up": function() {},
|
||||||
"Ctrl-Down": function() {}
|
"Ctrl-Down": function() {}
|
||||||
|
|||||||
BIN
favicon.png
Normal file
BIN
favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 255 B |
23
files.php
23
files.php
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> alpha file manager</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||||
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
||||||
<script src="lib/coder.js" type="text/javascript"></script>
|
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||||
@@ -31,8 +31,23 @@ class SortingIterator implements IteratorAggregate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
|
||||||
|
function getChildren() {
|
||||||
|
try {
|
||||||
|
if (!isset($GLOBALS['ICEcoder']['bannedPaths']) ||
|
||||||
|
!in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) {
|
||||||
|
return parent::getChildren();
|
||||||
|
} else {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
} catch(UnexpectedValueException $e) {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get a full list of dirs & files and begin sorting using above class & function
|
// Get a full list of dirs & files and begin sorting using above class & function
|
||||||
$objectList = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
|
$objectList = new SortingIterator(new RecursiveIteratorIterator(new IgnorantRecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
|
||||||
|
|
||||||
// With that done, create arrays for out final ordered list and a temp container of files
|
// With that done, create arrays for out final ordered list and a temp container of files
|
||||||
$finalArray = $tempArray = array();
|
$finalArray = $tempArray = array();
|
||||||
@@ -66,7 +81,7 @@ for ($i=0;$i<count($tempArray);$i++) {
|
|||||||
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
||||||
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
||||||
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
||||||
strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0) {
|
(strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0 && substr($finalArray[$j],strlen(dirname($tempArray[$i])),1)=="/")) {
|
||||||
$insertAt++;
|
$insertAt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
images/nest-tag-bg.gif
Normal file
BIN
images/nest-tag-bg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 B |
73
index.php
73
index.php
@@ -1,23 +1,17 @@
|
|||||||
<?php
|
<?php include("lib/settings.php");
|
||||||
include("lib/settings.php");
|
|
||||||
|
|
||||||
// Check IP permissions
|
// Check IP permissions
|
||||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||||
header('Location: /');
|
header('Location: /');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$updateMsg = '';
|
||||||
// Check for updates
|
// Check for updates
|
||||||
if ($ICEcoder["checkUpdates"]) {
|
if ($ICEcoder["checkUpdates"]) {
|
||||||
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
|
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
|
||||||
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
||||||
if ($ICEcoder["versionNo"]<$icv) {
|
if ($ICEcoder["versionNo"]<$icv) {
|
||||||
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
|
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
|
||||||
} else {
|
|
||||||
$cmv = json_encode(file_get_contents("http://codemirror.net/latest-version.txt"));
|
|
||||||
$cmv = rtrim(ltrim($cmv,'"'),'"\\n');
|
|
||||||
if ($ICEcoder["cMThisVer"]<$cmv) {
|
|
||||||
$updateMsg = ';top.ICEcoder.message(\'CodeMirror '.$cmv.' now released\n\nPlease upgrade\')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -25,15 +19,12 @@ if ($ICEcoder["checkUpdates"]) {
|
|||||||
|
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> alpha</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" type="text/css" href="lib/coder.css">
|
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css">
|
||||||
|
<link rel="icon" type="image/png" href="favicon.png">
|
||||||
<script>
|
<script>
|
||||||
theme = "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>";
|
|
||||||
tabsIndent = <?php echo $ICEcoder["tabsIndent"] ? 'true' : 'false';?>;
|
|
||||||
openLastFiles = <?php echo $ICEcoder["openLastFiles"] ? 'true' : 'false';?>;
|
|
||||||
tabWidth = <?php echo $ICEcoder["tabWidth"]; ?>;
|
|
||||||
iceRoot = "<?php echo $ICEcoder["root"]; ?>";
|
iceRoot = "<?php echo $ICEcoder["root"]; ?>";
|
||||||
|
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
@@ -42,20 +33,26 @@ window.onbeforeunload = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
previousFiles = [<?php
|
</script>
|
||||||
|
<script language="JavaScript" src="lib/ice-coder.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onLoad="<?php
|
||||||
|
echo 'top.ICEcoder.previousFiles = [';
|
||||||
if ($ICEcoder["previousFiles"]!="") {
|
if ($ICEcoder["previousFiles"]!="") {
|
||||||
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
||||||
echo "'".implode("','",$openFilesArray)."'";
|
echo "'".implode("','",$openFilesArray)."'";
|
||||||
}
|
}
|
||||||
?>];
|
echo "];top.ICEcoder.theme = '";
|
||||||
showFileMenu = function() {
|
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
||||||
document.getElementById('fileMenu').style.display='inline-block';
|
echo "'";
|
||||||
}
|
echo ';top.ICEcoder.tabsIndent = ';
|
||||||
</script>
|
echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
|
||||||
<script language="JavaScript" src="lib/coder.js"></script>
|
echo ';top.ICEcoder.openLastFiles = ';
|
||||||
</head>
|
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||||
|
echo ';top.ICEcoder.tabWidth = ';
|
||||||
<body onLoad="ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
echo $ICEcoder["tabWidth"];
|
||||||
|
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||||
|
|
||||||
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
|
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
|
||||||
<div class="popupVCenter">
|
<div class="popupVCenter">
|
||||||
@@ -76,23 +73,25 @@ showFileMenu = function() {
|
|||||||
|
|
||||||
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false">
|
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false">
|
||||||
<span id="folderMenuItems">
|
<span id="folderMenuItems">
|
||||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="showFileMenu()">New File</a>
|
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
|
||||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="showFileMenu()">New Folder</a>
|
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
|
||||||
|
<a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Paste</a>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Delete</a>
|
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||||
<span id="singleFileMenuItems">
|
<span id="singleFileMenuItems">
|
||||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Rename</a>
|
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
|
||||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">View Webpage</a>
|
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
||||||
|
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Zip It!</a>
|
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>
|
||||||
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Properties</a>
|
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="header" class="header" onContextMenu="return false">
|
<div id="header" class="header" onContextMenu="return false">
|
||||||
<div class="plugins" id="pluginsContainer">
|
<div class="plugins" id="pluginsContainer">
|
||||||
<?php echo $pluginsDisplay; ?>
|
<?php echo $pluginsDisplay; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?> alpha</div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||||
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
|
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -110,20 +109,20 @@ showFileMenu = function() {
|
|||||||
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1'"></iframe>
|
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){top.ICEcoder.mouseDown=false}"></iframe>
|
||||||
<div class="serverMessage" id="serverMessage"></div>
|
<div class="serverMessage" id="serverMessage"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="editor" class="editor">
|
<div id="editor" class="editor">
|
||||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||||
<?php
|
<?php
|
||||||
for ($i=1;$i<=10;$i++) {
|
for ($i=1;$i<=100;$i++) {
|
||||||
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>';
|
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>';
|
||||||
}
|
}
|
||||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||||
<form name="findAndReplace">
|
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
||||||
<div class="findReplace">
|
<div class="findReplace">
|
||||||
<div class="findText">Find</div>
|
<div class="findText">Find</div>
|
||||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
||||||
@@ -147,7 +146,7 @@ showFileMenu = function() {
|
|||||||
<option>all files</option>
|
<option>all files</option>
|
||||||
<option>all filenames</option>
|
<option>all filenames</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="button" name="submit" value=">>" class="submit" onClick="ICEcoder.findReplace('findReplace',false,true)">
|
<input type="submit" name="submit" value=">>" class="submit">
|
||||||
<div class="results" id="results"></div>
|
<div class="results" id="results"></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -161,7 +160,7 @@ showFileMenu = function() {
|
|||||||
|
|
||||||
<div class="footer" id="footer" onContextMenu="return false">
|
<div class="footer" id="footer" onContextMenu="return false">
|
||||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
<div class="nesting" id="nestValid">Nesting OK</div>
|
||||||
<div class="nestLoc">Cursor nest location</div>
|
<div class="nestLoc">cursor nest location</div>
|
||||||
<div class="nestDisplay" id="nestDisplay"></div>
|
<div class="nestDisplay" id="nestDisplay"></div>
|
||||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ $ICEcoder = array(
|
|||||||
"lockedNav" => true,
|
"lockedNav" => true,
|
||||||
"accountPassword" => "",
|
"accountPassword" => "",
|
||||||
"bannedFiles" => array("_coder","ICEcoder"),
|
"bannedFiles" => array("_coder","ICEcoder"),
|
||||||
|
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
||||||
"allowedIPs" => array("*"),
|
"allowedIPs" => array("*"),
|
||||||
"plugins" => array(
|
"plugins" => array(
|
||||||
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
|
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
|
||||||
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30"),
|
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30"),
|
||||||
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank","")
|
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||||
|
array("Terminal","plugins/terminal/icon.gif","margin-top: 3px","plugins/terminal","_blank","")
|
||||||
),
|
),
|
||||||
"theme" => "default",
|
"theme" => "default",
|
||||||
"tabWidth" => 4,
|
"tabWidth" => 4,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php include("settings.php");?>
|
<?php include("settings.php");?>
|
||||||
<?php
|
<?php
|
||||||
// Get the save type if any
|
// Get the save type if any
|
||||||
|
$saveType = "";
|
||||||
if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);};
|
if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);};
|
||||||
|
|
||||||
// Establish the filename/new filename
|
// Establish the filename/new filename
|
||||||
@@ -19,12 +20,9 @@ $fileName = basename($file);
|
|||||||
if ($_GET['action']=="load") {
|
if ($_GET['action']=="load") {
|
||||||
echo '<script>action="load";</script>';
|
echo '<script>action="load";</script>';
|
||||||
|
|
||||||
// Determine what to do based on filename
|
// Determine what to do based on mime type
|
||||||
// Everything is opened as text in the editor unless specified otherwise
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$fileType="text";
|
if (strpos(finfo_file($finfo, $file),"text")===0) {
|
||||||
if (strpos($fileName,".jpg")>0||strpos($fileName,".jpeg")>0||strpos($fileName,".gif")>0||strpos($fileName,".png")>0) {$fileType="image";};
|
|
||||||
|
|
||||||
if ($fileType=="text") {
|
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
echo '<script>fileType="text";';
|
echo '<script>fileType="text";';
|
||||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||||
@@ -34,16 +32,17 @@ if ($_GET['action']=="load") {
|
|||||||
} else {
|
} else {
|
||||||
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
||||||
}
|
}
|
||||||
};
|
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
||||||
|
|
||||||
if ($fileType=="image") {
|
|
||||||
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||||
|
} else {
|
||||||
|
echo '<script>fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');</script>';
|
||||||
};
|
};
|
||||||
|
finfo_close($finfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
// If we're due to add a new folder...
|
// If we're due to add a new folder...
|
||||||
if ($_GET['action']=="newFolder") {
|
if ($_GET['action']=="newFolder") {
|
||||||
if (is_writable($docRoot.$fileLoc)) {
|
if (!$demoMode && is_writable($docRoot.$fileLoc)) {
|
||||||
mkdir($file, 0705);
|
mkdir($file, 0705);
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
|
||||||
@@ -53,9 +52,39 @@ if ($_GET['action']=="newFolder") {
|
|||||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we're due to paste a new file...
|
||||||
|
if ($_GET['action']=="paste") {
|
||||||
|
$source = $file;
|
||||||
|
$dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source);
|
||||||
|
if (!$demoMode && is_writable(dirname($dest))) {
|
||||||
|
if (is_dir($source)) {
|
||||||
|
if (!is_dir($dest)) {
|
||||||
|
mkdir($dest, 0705);
|
||||||
|
}
|
||||||
|
foreach ($iterator = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||||
|
RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||||
|
) {
|
||||||
|
if ($item->isDir()) {
|
||||||
|
mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705);
|
||||||
|
} else {
|
||||||
|
copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
copy($source, $dest);
|
||||||
|
}
|
||||||
|
// Reload file manager
|
||||||
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.$fileName.'\');action="pasteFile";</script>';
|
||||||
|
} else {
|
||||||
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy \\n".str_replace($docRoot,"",$source)."\\n into \\n".str_replace($docRoot,"",$dest)."')</script>";
|
||||||
|
}
|
||||||
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
|
}
|
||||||
|
|
||||||
// If we're due to rename a file/folder...
|
// If we're due to rename a file/folder...
|
||||||
if ($_GET['action']=="rename") {
|
if ($_GET['action']=="rename") {
|
||||||
if (is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||||
@@ -68,7 +97,7 @@ if ($_GET['action']=="rename") {
|
|||||||
|
|
||||||
// If we're due to replace text in a file...
|
// If we're due to replace text in a file...
|
||||||
if ($_GET['action']=="replaceText") {
|
if ($_GET['action']=="replaceText") {
|
||||||
if (is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = file_get_contents($file);
|
||||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||||
@@ -84,7 +113,7 @@ if ($_GET['action']=="replaceText") {
|
|||||||
|
|
||||||
// If we're due to change permissions on a file/folder...
|
// If we're due to change permissions on a file/folder...
|
||||||
if ($_GET['action']=="perms") {
|
if ($_GET['action']=="perms") {
|
||||||
if (is_writable($file)) {
|
if (!$demoMode && is_writable($file)) {
|
||||||
chmod($file,octdec(numClean($_GET['perms'])));
|
chmod($file,octdec(numClean($_GET['perms'])));
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
||||||
@@ -97,9 +126,9 @@ if ($_GET['action']=="perms") {
|
|||||||
|
|
||||||
// If we're due to delete a file...
|
// If we're due to delete a file...
|
||||||
if ($_GET['action']=="delete") {
|
if ($_GET['action']=="delete") {
|
||||||
$filesArray = split(";",$file); // May contain more than one file here
|
$filesArray = explode(";",$file); // May contain more than one file here
|
||||||
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||||
if (is_writable($iceRoot.$filesArray[$i])) {
|
if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) {
|
||||||
is_dir($iceRoot.$filesArray[$i])
|
is_dir($iceRoot.$filesArray[$i])
|
||||||
? rrmdir($iceRoot.$filesArray[$i])
|
? rrmdir($iceRoot.$filesArray[$i])
|
||||||
: unlink($iceRoot.$filesArray[$i]);
|
: unlink($iceRoot.$filesArray[$i]);
|
||||||
@@ -134,7 +163,7 @@ if ($_GET['action']=="save") {
|
|||||||
echo '<script>action="save";</script>';
|
echo '<script>action="save";</script>';
|
||||||
// on the form posting via a reload, save the file
|
// on the form posting via a reload, save the file
|
||||||
if (isset($_POST['contents'])) {
|
if (isset($_POST['contents'])) {
|
||||||
if ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
|
||||||
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||||
fwrite($fh, $_POST['contents']);
|
fwrite($fh, $_POST['contents']);
|
||||||
@@ -147,7 +176,7 @@ if ($_GET['action']=="save") {
|
|||||||
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
|
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
|
||||||
}
|
}
|
||||||
// Reload stickytab window
|
// Reload stickytab window
|
||||||
echo '<script>if (top.ICEcoder.stickyTabWindow.location) {top.ICEcoder.stickyTabWindow.location.reload()};action="doneSave";</script>';
|
echo '<script>if (top.ICEcoder.stickyTab.location) {top.ICEcoder.stickyTab.location.reload()};action="doneSave";</script>';
|
||||||
} else {
|
} else {
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = file_get_contents($file);
|
||||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>ICE Coder <?php echo $ICEcoder["versionNo"];?> alpha help</title>
|
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" type="text/css" href="help.css">
|
<link rel="stylesheet" type="text/css" href="help.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -90,16 +90,16 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
||||||
.files .button:hover {background-color: #222; color: #eee}
|
.files .button:hover {background-color: #222; color: #eee}
|
||||||
.files .frame {display: inline-block; width: 250px}
|
.files .frame {display: inline-block; width: 250px}
|
||||||
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
.files .serverMessage {position: absolute; display: none; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||||
-webkit-transition: all 0.2s;
|
-webkit-transition: opacity 0.2s;
|
||||||
-moz-transition: all 0.2s;
|
-moz-transition: opacity 0.2s;
|
||||||
transition: all 0.2s;
|
transition: opacity 0.2s;
|
||||||
}
|
}
|
||||||
.files .serverMessage b {font-size: 10px}
|
.files .serverMessage b {font-size: 10px}
|
||||||
|
|
||||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888;}
|
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888;}
|
||||||
.tabsBar .tab {display: inline-block; display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #fff; border-right: solid 1px #777; color: #fff; cursor: pointer;
|
.tabsBar .tab {display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #fff; border-right: solid 1px #777; color: #fff; cursor: pointer;
|
||||||
-webkit-transition: all 0.15s;
|
-webkit-transition: all 0.15s;
|
||||||
-moz-transition: all 0.15s;
|
-moz-transition: all 0.15s;
|
||||||
transition: all 0.15s;
|
transition: all 0.15s;
|
||||||
@@ -110,12 +110,13 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.findBar .findReplace {position: absolute; z-index: 1}
|
.findBar .findReplace {position: absolute; z-index: 1}
|
||||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||||
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
||||||
.findReplace .find {position: relative; width: 120px; height: 14px; border: 0; top: -2px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
||||||
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
||||||
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px}
|
||||||
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 1px solid #bbb; background-color: #f8f8f8; font-size: 10px; cursor: pointer}
|
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
|
||||||
|
.findReplace .submit:hover {background-color: #2187e7; color: #eee}
|
||||||
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
||||||
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
||||||
.findBar .codeAssist input {margin-top: -1px}
|
.findBar .codeAssist input {margin-top: -1px}
|
||||||
@@ -126,8 +127,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
|
|
||||||
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
||||||
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
|
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
|
||||||
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 3px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
|
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 2px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
|
||||||
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 255px; font-size: 12px; color: #fff; text-align: right}
|
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 0px; left: 255px; font-size: 12px; color: #fff; text-align: right}
|
||||||
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
|
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
|
||||||
|
|
||||||
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
||||||
@@ -142,4 +143,4 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
|
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
|
||||||
.screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px}
|
.screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px}
|
||||||
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
|
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
|
||||||
.screenCenter .button:hover {background-color: #333; color: #eee}
|
.screenCenter .button:hover {background-color: #2187e7; color: #eee}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> alpha multiple results screen</title>
|
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" type="text/css" href="multiple-results.css">
|
<link rel="stylesheet" type="text/css" href="multiple-results.css">
|
||||||
</head>
|
</head>
|
||||||
@@ -16,14 +16,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php if (isset($_GET['replace'])) { ?>
|
<?php if (isset($_GET['replace'])) { ?>
|
||||||
<div class="replaceAll" id="replaceAll" onClick="<?php
|
<div class="replaceAll" id="replaceAll" onClick="<?php
|
||||||
if (strpos($_GET['target'],"filenames")) {
|
if (isset($_GET['target']) && strpos($_GET['target'],"filenames")) {
|
||||||
echo 'renameAll()';
|
echo 'renameAll()';
|
||||||
} else if (strpos($_GET['target'],"files")) {
|
} else if (isset($_GET['target']) && strpos($_GET['target'],"files")) {
|
||||||
echo 'replaceInFilesAll()';
|
echo 'replaceInFilesAll()';
|
||||||
} else {
|
} else {
|
||||||
echo 'replaceAll()';
|
echo 'replaceAll()';
|
||||||
}
|
}
|
||||||
?>" style="opacity: 0.1"><?php echo strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
|
?>" style="opacity: 0.1"><?php echo isset($_GET['target']) && strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
|
||||||
<?php ;}; ?>
|
<?php ;}; ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -34,7 +34,7 @@ var resultsDisplay = "";
|
|||||||
var foundArray = [];
|
var foundArray = [];
|
||||||
foundInSelected = false;
|
foundInSelected = false;
|
||||||
userTarget = top.document.findAndReplace.target.value;
|
userTarget = top.document.findAndReplace.target.value;
|
||||||
findText = top.findAndReplace.find.value;
|
findText = top.findAndReplace.find.value.toLowerCase();
|
||||||
<?php
|
<?php
|
||||||
$findText = str_replace("ICEcoder:","",str_replace("'","\'",$_GET['find']));
|
$findText = str_replace("ICEcoder:","",str_replace("'","\'",$_GET['find']));
|
||||||
// Find in open docs?
|
// Find in open docs?
|
||||||
@@ -42,7 +42,7 @@ if (!isset($_GET['target'])) {
|
|||||||
$targetName = "document";
|
$targetName = "document";
|
||||||
?>
|
?>
|
||||||
var startTab = top.ICEcoder.selectedTab;
|
var startTab = top.ICEcoder.selectedTab;
|
||||||
var rExp = new RegExp(findText,"g");
|
var rExp = new RegExp(findText,"gi");
|
||||||
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
||||||
top.ICEcoder.switchTab(i);
|
top.ICEcoder.switchTab(i);
|
||||||
var cM = top.ICEcoder.getcMInstance();
|
var cM = top.ICEcoder.getcMInstance();
|
||||||
@@ -68,7 +68,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
||||||
for (var i=0;i<spansArray.length;i++) {
|
for (var i=0;i<spansArray.length;i++) {
|
||||||
targetURL = spansArray[i].id.replace(/\|/g,"/");
|
targetURL = spansArray[i].id.replace(/\|/g,"/");
|
||||||
if (targetURL.indexOf(findText)>-1 && targetURL.indexOf('_perms')>-1) {
|
if (targetURL.toLowerCase().indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) {
|
||||||
if (userTarget.indexOf("selected")>-1) {
|
if (userTarget.indexOf("selected")>-1) {
|
||||||
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
||||||
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) {
|
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) {
|
||||||
@@ -77,8 +77,16 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
|
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
|
||||||
resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">'+ targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b>"+findText+"</b>")+ '</a><br><div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b><?php echo strClean($_GET['replace']);?></b>")+'</div>';
|
resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">';
|
||||||
<?php if (isset($_GET['replace'])) { ?>
|
resultsDisplay += targetURL.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>");
|
||||||
|
resultsDisplay += '</a><br>';
|
||||||
|
<?php if (!isset($_GET['replace'])) { ?>
|
||||||
|
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>';
|
||||||
|
<?php ;} else { ?>
|
||||||
|
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b><?php if(isset($_GET['replace'])) {echo strtolower(strClean($_GET['replace']));};?></b>")+'</div>';
|
||||||
|
<?php
|
||||||
|
;};
|
||||||
|
if (isset($_GET['replace'])) { ?>
|
||||||
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
|
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
|
||||||
<?php ;}; ?>
|
<?php ;}; ?>
|
||||||
resultsDisplay += '<hr>';
|
resultsDisplay += '<hr>';
|
||||||
@@ -92,9 +100,11 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
$r = 0;
|
$r = 0;
|
||||||
function phpGrep($q, $path, $base) {
|
function phpGrep($q, $path, $base) {
|
||||||
$fp = opendir($path);
|
$fp = opendir($path);
|
||||||
$slash = $serverType == "Windows" ? "\\" : "/";
|
|
||||||
global $r;
|
global $r;
|
||||||
global $ICEcoder;
|
global $ICEcoder;
|
||||||
|
global $serverType;
|
||||||
|
if (!isset($ret)) {$ret="";};
|
||||||
|
$slash = $serverType == "Windows" ? "\\" : "/";
|
||||||
while($f = readdir($fp)) {
|
while($f = readdir($fp)) {
|
||||||
if(preg_match("#^\.+$#", $f)) continue;
|
if(preg_match("#^\.+$#", $f)) continue;
|
||||||
$fullPath = $path.$slash.$f;
|
$fullPath = $path.$slash.$f;
|
||||||
@@ -120,7 +130,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = phpGrep($findText, $docRoot.$ICEroot, $docRoot.$ICEroot);
|
$results = phpGrep($findText, $docRoot.$iceRoot, $docRoot.$iceRoot);
|
||||||
echo 'resultsDisplay += "'.$results.'";';
|
echo 'resultsDisplay += "'.$results.'";';
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
@@ -160,7 +170,7 @@ var replaceAll = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var replaceInFileSingle = function(fileRef) {
|
var replaceInFileSingle = function(fileRef) {
|
||||||
top.ICEcoder.replaceInFile(fileRef,findText,'<?php echo strClean($_GET['replace']); ?>');
|
top.ICEcoder.replaceInFile(fileRef,findText,'<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>');
|
||||||
}
|
}
|
||||||
|
|
||||||
var replaceInFilesAll = function() {
|
var replaceInFilesAll = function() {
|
||||||
@@ -172,7 +182,7 @@ var replaceInFilesAll = function() {
|
|||||||
|
|
||||||
var renameSingle = function(arrayRef) {
|
var renameSingle = function(arrayRef) {
|
||||||
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
|
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
|
||||||
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php echo strClean($_GET['replace']); ?>");
|
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>");
|
||||||
top.ICEcoder.renameFile(fileRef,newName);
|
top.ICEcoder.renameFile(fileRef,newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
<html onContextMenu="return false">
|
<html onContextMenu="return false">
|
||||||
<head>
|
<head>
|
||||||
<title>ICE Coder <?php echo $ICEcoder["versionNo"];?> alpha file/folder properties</title>
|
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" type="text/css" href="file-folder-properties.css">
|
<link rel="stylesheet" type="text/css" href="properties.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="properties">
|
<body class="properties">
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> alpha settings screen</title>
|
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" type="text/css" href="settings-screen.css">
|
<link rel="stylesheet" type="text/css" href="settings-screen.css">
|
||||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||||
@@ -36,7 +36,7 @@ for ($i=0;$i<count($themeArray);$i++) {
|
|||||||
|
|
||||||
<div class="infoPane">
|
<div class="infoPane">
|
||||||
<img src="../images/ice-coder.png" class="logo">
|
<img src="../images/ice-coder.png" class="logo">
|
||||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?> alpha</div>
|
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
git:<br>
|
git:<br>
|
||||||
@@ -48,7 +48,9 @@ for ($i=0;$i<count($themeArray);$i++) {
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
codemirror version:<br>
|
codemirror version:<br>
|
||||||
<?php echo $ICEcoder["cMThisVer"]; ?>
|
<script>
|
||||||
|
document.write(CodeMirror.version);
|
||||||
|
</script>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
file manager root:<br>
|
file manager root:<br>
|
||||||
@@ -162,8 +164,8 @@ function findSequence(goal) {
|
|||||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
readOnly: "nocursor",
|
readOnly: "nocursor",
|
||||||
indentUnit: top.tabWidth,
|
indentUnit: top.ICEcoder.tabWidth,
|
||||||
tabSize: top.tabWidth,
|
tabSize: top.ICEcoder.tabWidth,
|
||||||
mode: "javascript",
|
mode: "javascript",
|
||||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Display & log all errors
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('log_errors', 1);
|
||||||
|
ini_set('error_log', dirname(__FILE__).'/../error-log.txt');
|
||||||
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// Set our default timezone and supress warning with @
|
||||||
|
@date_default_timezone_set(date_default_timezone_get());
|
||||||
|
|
||||||
// Start a session if we haven't already
|
// Start a session if we haven't already
|
||||||
if(!isset($_SESSION)) {session_start();}
|
if(!isset($_SESSION)) {session_start();}
|
||||||
|
|
||||||
@@ -29,13 +38,19 @@ include($settingsFile);
|
|||||||
|
|
||||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||||
$ICEcoder = array(
|
$ICEcoder = array(
|
||||||
"versionNo" => "0.9.0",
|
"versionNo" => "1.2",
|
||||||
"codeMirrorDir" => "CodeMirror-2.34",
|
"codeMirrorDir" => "CodeMirror-2.36",
|
||||||
"cMThisVer" => 2.34
|
"demoMode" => false
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
|
|
||||||
|
$onLoadExtras = "";
|
||||||
|
$pluginsDisplay = "";
|
||||||
|
|
||||||
|
if ($ICEcoder['demoMode'] && $ICEcoder['accountPassword']!="") {$_SESSION['loggedIn']=true;};
|
||||||
|
$demoMode = $ICEcoder['demoMode'];
|
||||||
|
|
||||||
// Update this config file?
|
// Update this config file?
|
||||||
if ($_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||||
$settingsContents = file_get_contents($settingsFile);
|
$settingsContents = file_get_contents($settingsFile);
|
||||||
// Replace our settings vars
|
// Replace our settings vars
|
||||||
$repPosStart = strpos($settingsContents,'"root"');
|
$repPosStart = strpos($settingsContents,'"root"');
|
||||||
@@ -43,13 +58,13 @@ if ($_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
|||||||
|
|
||||||
// Prepare all our vars
|
// Prepare all our vars
|
||||||
$ICEcoder["root"] = strClean($_POST['root']);
|
$ICEcoder["root"] = strClean($_POST['root']);
|
||||||
$ICEcoder["tabsIndent"] = $_POST['tabsIndent'] ? "true" : "false";
|
$ICEcoder["tabsIndent"] = isset($_POST['tabsIndent']) && $_POST['tabsIndent'] ? "true" : "false";
|
||||||
$ICEcoder["checkUpdates"] = $_POST['checkUpdates'] ? "true" : "false";
|
$ICEcoder["checkUpdates"] = isset($_POST['checkUpdates']) && $_POST['checkUpdates'] ? "true" : "false";
|
||||||
$ICEcoder["openLastFiles"] = $_POST['openLastFiles'] ? "true" : "false";
|
$ICEcoder["openLastFiles"] = isset($_POST['openLastFiles']) && $_POST['openLastFiles'] ? "true" : "false";
|
||||||
$ICEcoder["findFilesExclude"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['findFilesExclude']))).'")';
|
$ICEcoder["findFilesExclude"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['findFilesExclude']))).'")';
|
||||||
$ICEcoder["codeAssist"] = $_POST['codeAssist'] ? "true" : "false";
|
$ICEcoder["codeAssist"] = isset($_POST['codeAssist']) && $_POST['codeAssist'] ? "true" : "false";
|
||||||
$ICEcoder["visibleTabs"] = $_POST['visibleTabs'] ? "true" : "false";
|
$ICEcoder["visibleTabs"] = isset($_POST['visibleTabs']) && $_POST['visibleTabs'] ? "true" : "false";
|
||||||
$ICEcoder["lockedNav"] = $_POST['lockedNav'] ? "true" : "false";
|
$ICEcoder["lockedNav"] = isset($_POST['lockedNav']) && $_POST['lockedNav'] ? "true" : "false";
|
||||||
if ($_POST['accountPassword']!="") {$ICEcoder["accountPassword"] = generateHash(strClean($_POST['accountPassword']));};
|
if ($_POST['accountPassword']!="") {$ICEcoder["accountPassword"] = generateHash(strClean($_POST['accountPassword']));};
|
||||||
$ICEcoder["bannedFiles"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedFiles']))).'")';
|
$ICEcoder["bannedFiles"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedFiles']))).'")';
|
||||||
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
|
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
|
||||||
@@ -91,7 +106,7 @@ if(isset($_POST['loginPassword']) && generateHash(strClean($_POST['loginPassword
|
|||||||
$_SESSION['loggedIn'] = $_SESSION['loggedIn'];
|
$_SESSION['loggedIn'] = $_SESSION['loggedIn'];
|
||||||
|
|
||||||
// Define the serverType, docRoot & iceRoot
|
// Define the serverType, docRoot & iceRoot
|
||||||
$serverType = stristr($_SERVER[SERVER_SOFTWARE], "win") ? "Windows" : "Linux";
|
$serverType = stristr($_SERVER['SERVER_SOFTWARE'], "win") ? "Windows" : "Linux";
|
||||||
$docRoot = rtrim(str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']));
|
$docRoot = rtrim(str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']));
|
||||||
$iceRoot = rtrim(str_replace("\\","/",$ICEcoder["root"]));
|
$iceRoot = rtrim(str_replace("\\","/",$ICEcoder["root"]));
|
||||||
if ($_SESSION['loggedIn']) {
|
if ($_SESSION['loggedIn']) {
|
||||||
@@ -123,7 +138,7 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
|||||||
// Replace our previousFiles var with the the current
|
// Replace our previousFiles var with the the current
|
||||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||||
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
||||||
if ($_GET['saveFiles']!="CLEAR") {
|
if (!$demoMode && $_GET['saveFiles']!="CLEAR") {
|
||||||
$saveFiles=strClean($_GET['saveFiles']);
|
$saveFiles=strClean($_GET['saveFiles']);
|
||||||
$saveFilesArray = explode(",",$saveFiles);
|
$saveFilesArray = explode(",",$saveFiles);
|
||||||
$saveFiles="";
|
$saveFiles="";
|
||||||
@@ -227,10 +242,11 @@ if (!$_SESSION['loggedIn']) {
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder <?php
|
<title>ICEcoder <?php
|
||||||
echo $ICEcoder["versionNo"]." alpha : ";
|
echo $ICEcoder["versionNo"]." : ";
|
||||||
echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
||||||
?></title>
|
?></title>
|
||||||
<link rel="stylesheet" type="text/css" href="coder.css">
|
<link rel="stylesheet" type="text/css" href="ice-coder.css">
|
||||||
|
<link rel="icon" type="image/png" href="../favicon.png">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onLoad="document.settingsUpdate.<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password.focus()">
|
<body onLoad="document.settingsUpdate.<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password.focus()">
|
||||||
@@ -239,7 +255,7 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
|||||||
<div class="screenVCenter">
|
<div class="screenVCenter">
|
||||||
<div class="screenCenter">
|
<div class="screenCenter">
|
||||||
<img src="../images/ice-coder.png">
|
<img src="../images/ice-coder.png">
|
||||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?> alpha</div>
|
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||||
<form name="settingsUpdate" action="settings.php" method="POST">
|
<form name="settingsUpdate" action="settings.php" method="POST">
|
||||||
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword">
|
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword">
|
||||||
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "Set Password" : "Login"; ?>" class="button">
|
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "Set Password" : "Login"; ?>" class="button">
|
||||||
|
|||||||
BIN
plugins/terminal/icon.gif
Normal file
BIN
plugins/terminal/icon.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 164 B |
201
plugins/terminal/index.php
Normal file
201
plugins/terminal/index.php
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<?php
|
||||||
|
include("../../lib/settings.php");
|
||||||
|
if ($demoMode || !$_SESSION['loggedIn']) {
|
||||||
|
die("You must be logged in to access Terminal");
|
||||||
|
}
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
@session_start();
|
||||||
|
|
||||||
|
if (isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
|
$_SESSION['user'] = $_SERVER['PHP_AUTH_USER'];
|
||||||
|
$_SESSION['pass'] = generateHash(strClean($_SERVER['PHP_AUTH_PW']),$ICEcoder["accountPassword"]);
|
||||||
|
}
|
||||||
|
$passwd = array($_SESSION['user'] => $ICEcoder["accountPassword"]);
|
||||||
|
$aliases = array('la' => 'ls -la',
|
||||||
|
'll' => 'ls -lvhF',
|
||||||
|
'dir' => 'ls' );
|
||||||
|
|
||||||
|
class phpTerm {
|
||||||
|
function phpTerm() {} // constructor
|
||||||
|
|
||||||
|
function formatPrompt() {
|
||||||
|
$user=shell_exec("whoami");
|
||||||
|
$host=explode(".", shell_exec("uname -n"));
|
||||||
|
$_SESSION['prompt'] = "".rtrim($user).""."@"."".rtrim($host[0])."";
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPassword($passwd) {
|
||||||
|
if( !isset($_SERVER['PHP_AUTH_USER'])||
|
||||||
|
!isset($_SERVER['PHP_AUTH_PW']) ||
|
||||||
|
!isset($passwd[$_SERVER['PHP_AUTH_USER']]) ||
|
||||||
|
$passwd[$_SERVER['PHP_AUTH_USER']] != $_SESSION['pass']) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function logout() {
|
||||||
|
header('WWW-Authenticate: Basic realm="Terminal"');
|
||||||
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function initVars() {
|
||||||
|
if (empty($_SESSION['cwd']) || @!empty($_GET['reset'])) {
|
||||||
|
$_SESSION['cwd'] = getcwd();
|
||||||
|
$_SESSION['history'] = array();
|
||||||
|
$_SESSION['output'] = '';
|
||||||
|
$_REQUEST['command'] ='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildCommandHistory() {
|
||||||
|
if(!empty($_REQUEST['command'])) {
|
||||||
|
if(get_magic_quotes_gpc()) {
|
||||||
|
$_REQUEST['command'] = stripslashes($_REQUEST['command']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// drop old commands from list if exists
|
||||||
|
if (($i = array_search($_REQUEST['command'], $_SESSION['history'])) !== false) {
|
||||||
|
unset($_SESSION['history'][$i]);
|
||||||
|
}
|
||||||
|
array_unshift($_SESSION['history'], $_REQUEST['command']);
|
||||||
|
|
||||||
|
// append commmand */
|
||||||
|
$_SESSION['output'] .= "{$_SESSION['prompt']}".":>"."{$_REQUEST['command']}"."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildJavaHistory() {
|
||||||
|
// build command history for use in the JavaScript
|
||||||
|
if (empty($_SESSION['history'])) {
|
||||||
|
$_SESSION['js_command_hist'] = '""';
|
||||||
|
} else {
|
||||||
|
$escaped = array_map('addslashes', $_SESSION['history']);
|
||||||
|
$_SESSION['js_command_hist'] = '"", "' . implode('", "', $escaped) . '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function outputHandle($aliases) {
|
||||||
|
if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command']))
|
||||||
|
{
|
||||||
|
$_SESSION['cwd'] = getcwd(); //dirname(__FILE__);
|
||||||
|
}
|
||||||
|
elseif(preg_match('/^[[:blank:]]*cd[[:blank:]]+([^;]+)$/', @$_REQUEST['command'], $regs)) {
|
||||||
|
// The current command is 'cd', which we have to handle as an internal shell command.
|
||||||
|
// absolute/relative path ?"
|
||||||
|
($regs[1][0] == '/') ? $new_dir = $regs[1] : $new_dir = $_SESSION['cwd'] . '/' . $regs[1];
|
||||||
|
|
||||||
|
// cosmetics
|
||||||
|
while (strpos($new_dir, '/./') !== false) {
|
||||||
|
$new_dir = str_replace('/./', '/', $new_dir);
|
||||||
|
}
|
||||||
|
while (strpos($new_dir, '//') !== false) {
|
||||||
|
$new_dir = str_replace('//', '/', $new_dir);
|
||||||
|
}
|
||||||
|
while (preg_match('|/\.\.(?!\.)|', $new_dir)) {
|
||||||
|
$new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($new_dir)): $new_dir = "/"; endif;
|
||||||
|
|
||||||
|
(@chdir($new_dir)) ? $_SESSION['cwd'] = $new_dir : $_SESSION['output'] .= "could not change to: $new_dir\n";
|
||||||
|
} else {
|
||||||
|
/* The command is not a 'cd' command, so we execute it after
|
||||||
|
changing the directory and save the output. */
|
||||||
|
chdir($_SESSION['cwd']);
|
||||||
|
|
||||||
|
/* Alias expansion. */
|
||||||
|
$length = strcspn(@$_REQUEST['command'], " \t");
|
||||||
|
$token = substr(@$_REQUEST['command'], 0, $length);
|
||||||
|
if (isset($aliases[$token]))
|
||||||
|
$_REQUEST['command'] = $aliases[$token] . substr($_REQUEST['command'], $length);
|
||||||
|
|
||||||
|
$p = proc_open(@$_REQUEST['command'],
|
||||||
|
array(1 => array('pipe', 'w'),
|
||||||
|
2 => array('pipe', 'w')), $io);
|
||||||
|
|
||||||
|
/* Read output sent to stdout. */
|
||||||
|
while (!feof($io[1])) {
|
||||||
|
$_SESSION['output'] .= htmlspecialchars(fgets($io[1]),ENT_COMPAT, 'UTF-8');
|
||||||
|
}
|
||||||
|
/* Read output sent to stderr. */
|
||||||
|
while (!feof($io[2])) {
|
||||||
|
$_SESSION['output'] .= htmlspecialchars(fgets($io[2]),ENT_COMPAT, 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($io[1]);
|
||||||
|
fclose($io[2]);
|
||||||
|
proc_close($p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$terminal = new phpTerm;
|
||||||
|
|
||||||
|
if ($_REQUEST['command']=="logout") {
|
||||||
|
$terminal->logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$terminal->checkPassword($passwd)) {
|
||||||
|
header('WWW-Authenticate: Basic realm="Terminal"');
|
||||||
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
} else {
|
||||||
|
$terminal->initVars();
|
||||||
|
$terminal->buildCommandHistory();
|
||||||
|
$terminal->buildJavaHistory();
|
||||||
|
if(!isset($_SESSION['prompt'])):$terminal->formatPrompt(); endif;
|
||||||
|
$terminal->outputHandle($aliases);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>PHP Terminal</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="terminal.css" />
|
||||||
|
<script type="text/javascript" language="JavaScript">
|
||||||
|
var current_line = 0;
|
||||||
|
var command_hist = new Array(<?php echo $_SESSION['js_command_hist']; ?>);
|
||||||
|
var last = 0;
|
||||||
|
|
||||||
|
function key(e) {
|
||||||
|
if (!e) var e = window.event;
|
||||||
|
if (e.keyCode == 38 && current_line < command_hist.length-1) {
|
||||||
|
command_hist[current_line] = document.shell.command.value;
|
||||||
|
current_line++;
|
||||||
|
document.shell.command.value = command_hist[current_line];
|
||||||
|
}
|
||||||
|
if (e.keyCode == 40 && current_line > 0) {
|
||||||
|
command_hist[current_line] = document.shell.command.value;
|
||||||
|
current_line--;
|
||||||
|
document.shell.command.value = command_hist[current_line];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
document.shell.setAttribute("autocomplete", "off");
|
||||||
|
document.shell.output.scrollTop = document.shell.output.scrollHeight;
|
||||||
|
document.shell.command.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="init()">
|
||||||
|
|
||||||
|
<div class="head"><?php echo $_SESSION['prompt'].":"."$_SESSION[cwd]"; ?></div>
|
||||||
|
|
||||||
|
<form name="shell" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
|
||||||
|
<textarea name="output" readonly="readonly" rows="24"><?php
|
||||||
|
$lines = substr_count($_SESSION['output'], "\n");
|
||||||
|
$padding = str_repeat("\n", max(0, 25 - $lines));
|
||||||
|
echo "\n\n".trim($padding . $_SESSION['output'])."\n";
|
||||||
|
?>
|
||||||
|
</textarea>
|
||||||
|
<p class="commandLine">$> <input class="command" name="command" type="text" size='50' onkeyup="key(event)" tabindex="1"></p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<?php } ?>
|
||||||
28
plugins/terminal/terminal.css
Normal file
28
plugins/terminal/terminal.css
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/* First, reset everything to a standard */
|
||||||
|
html, body, div, span, applet, object, iframe,
|
||||||
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||||
|
a, abbr, acronym, address, big, cite, code,
|
||||||
|
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||||
|
small, strike, strong, sub, sup, tt, var,
|
||||||
|
b, u, i, center,
|
||||||
|
dl, dt, dd, ol, ul, li,
|
||||||
|
fieldset, form, input, label, legend,
|
||||||
|
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||||
|
font-family: verdana, arial, monospace, sans-serif;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
outline: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {width: 100%; height: 100%; background: #000}
|
||||||
|
|
||||||
|
.head {position: fixed; top: 0; padding: 2px; background: rgba(124,124,124,0.8); color: #fff; font-weight: bold; z-index: 1}
|
||||||
|
textarea {position: absolute; display: block; top: 0; padding: 0; width: 100%; height: 100%; min-height: 100%; border: 0; background: #000; color: #0c0}
|
||||||
|
textarea:focus {outline: none}
|
||||||
|
p {color: #0c0}
|
||||||
|
.commandLine {position: fixed; width: 100%; bottom: 0; padding: 2px; background: rgba(32,32,32,0.9); z-index: 1}
|
||||||
|
.command {width: 95%; font-family: verdana, arial, monospace, sans-serif; border: none; background: transparent; color: #0c0}
|
||||||
|
.command:focus {outline: none}
|
||||||
@@ -62,7 +62,7 @@ Class zipIt {
|
|||||||
foreach($zipFiles as $file) {
|
foreach($zipFiles as $file) {
|
||||||
$canAdd=true;
|
$canAdd=true;
|
||||||
for ($i=0;$i<count($excludeFilesFolders);$i++) {
|
for ($i=0;$i<count($excludeFilesFolders);$i++) {
|
||||||
if(strpos($file,$excludeFilesFolders[$i])!==false) {$canAdd=false;};
|
if($excludeFilesFolders[$i] && strpos($file,$excludeFilesFolders[$i])!==false) {$canAdd=false;};
|
||||||
}
|
}
|
||||||
if ($canAdd==true) {
|
if ($canAdd==true) {
|
||||||
$zip->addFile($file,str_replace($docRoot."/","",$file));
|
$zip->addFile($file,str_replace($docRoot."/","",$file));
|
||||||
|
|||||||
Reference in New Issue
Block a user