mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-17 05:47:03 +01:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1bab2dec5 | ||
|
|
b1ba868eb6 | ||
|
|
d1d6760def | ||
|
|
34b263bb18 | ||
|
|
b9faaafacd | ||
|
|
2a00f7e8ea | ||
|
|
fcd2e51c45 | ||
|
|
94438fa34f | ||
|
|
ae008e523c | ||
|
|
8e57e6833c | ||
|
|
133c155ae4 | ||
|
|
81282e6f73 | ||
|
|
7cb270a0a2 | ||
|
|
eaa574f0a3 | ||
|
|
8d4dc52e2d | ||
|
|
f80ab916a3 | ||
|
|
0729daf3b5 | ||
|
|
623ee10a81 | ||
|
|
a5678eba26 | ||
|
|
e8ba59fe46 | ||
|
|
d92c3b00c3 | ||
|
|
7b97ff92ae | ||
|
|
dfb40255a9 | ||
|
|
fe7c03df06 | ||
|
|
dcf1f50cf0 | ||
|
|
3751ea5499 | ||
|
|
b51445c101 | ||
|
|
42d60ea48f | ||
|
|
80bdd04e59 | ||
|
|
7075ced50f | ||
|
|
4fb0d838b6 | ||
|
|
aa357509c8 | ||
|
|
8615828a76 | ||
|
|
766d23bd78 | ||
|
|
6199c06e8e | ||
|
|
5ad21bfe23 | ||
|
|
d326d6a02d | ||
|
|
487ce2710c | ||
|
|
583dcad1c0 | ||
|
|
ba88f98ac7 | ||
|
|
820691665d | ||
|
|
649a050e66 | ||
|
|
c32050889f | ||
|
|
3bd5030c42 | ||
|
|
21d6ae0f2a | ||
|
|
ab99aff272 | ||
|
|
932f07393b | ||
|
|
54e4aff163 | ||
|
|
ab3d04440c | ||
|
|
58f3866b45 | ||
|
|
fcf6c14a91 | ||
|
|
8be9e76e8d | ||
|
|
78e417add4 | ||
|
|
23f86200e0 | ||
|
|
2d03477c66 | ||
|
|
da88db20fb | ||
|
|
f5c1640dbd | ||
|
|
4328ea2c1f | ||
|
|
0fb0644b71 | ||
|
|
01df964ac7 | ||
|
|
1cad4b074c | ||
|
|
50196789a7 | ||
|
|
2d245f2da8 | ||
|
|
a1d545b76b | ||
|
|
a1df16031d | ||
|
|
8cc3a7e037 | ||
|
|
8e01faad10 | ||
|
|
cea8e0a36e | ||
|
|
4a08853605 | ||
|
|
59c39acb35 | ||
|
|
0850127d2b | ||
|
|
f27905404b | ||
|
|
65bc11cd48 | ||
|
|
f79cc0336a | ||
|
|
edaa95df93 | ||
|
|
868db80583 | ||
|
|
c8d4eeb74e | ||
|
|
4a516e9828 | ||
|
|
12a53d4c29 | ||
|
|
6eee161a74 | ||
|
|
0793c2fd63 | ||
|
|
af7e57b1d9 | ||
|
|
de3e46d5ee | ||
|
|
bc589549f3 | ||
|
|
2e7e5a8bcd | ||
|
|
3f0604fff4 | ||
|
|
5e89f0945d | ||
|
|
8f54ff53bc | ||
|
|
574b6f1b7a | ||
|
|
518dbd5818 | ||
|
|
f78dce0e73 | ||
|
|
bb2580c031 | ||
|
|
116c82736f |
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is. Please paste any JS error (from dev tools Console tab) and PHP errors from ICEcoders data/logs/error/error.log file at the time of the bug.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen and what happened instead.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Browser & Server (please complete the following information):**
|
||||
- Browser [eg Chrome, Firefox]
|
||||
- Server [eg Apache, Nginx, IIS]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Got a great idea for feature?
|
||||
title: ''
|
||||
labels: Feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**It would be great if ICEcoder....**
|
||||
Explain your idea here. The more info the better if it's a complicated feature. Be sure to suggest something many people would like however!
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
17
.github/ISSUE_TEMPLATE/got-a-question-.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/got-a-question-.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Got a question?
|
||||
about: Not sure about something, ask away!
|
||||
title: ''
|
||||
labels: Question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**I'm not sure about...**
|
||||
Explain what you're unsure about here. The more info the better if it's a complicated. Other people might have the same questions and can learn from replies, ask away!
|
||||
|
||||
**Describe where you're unsure**
|
||||
Explain where you're at and what in ICEcoder is causing you issues, we can probably advise!
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the question here.
|
||||
17
.github/ISSUE_TEMPLATE/tweak-suggestion.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/tweak-suggestion.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Tweak suggestion
|
||||
about: Could something be tweaked to make it better?
|
||||
title: ''
|
||||
labels: Tweak
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**It would be so much better if we could tweak...**
|
||||
Explain your thoughts here. The more info the better if it's a complicated tweak. Be sure to suggest something many people would like however!
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the tweak suggestion here.
|
||||
19
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
19
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
**Describe the PR**
|
||||
|
||||
A clear and concise description of what the PR covers. Be sure it's something lots of people would appreciate!
|
||||
|
||||
**Benefits**
|
||||
|
||||
If it's a bug fix or tweak, note what it's resolving. If it's a feature, detail what's great about it. Note that not all PR are merged!
|
||||
|
||||
**Check the files!**
|
||||
|
||||
Before you hit the button, check the files changed in this PR, to ensure only the exact changes needed are included.
|
||||
|
||||
**Screenshots**
|
||||
|
||||
If applicable, add screenshots to help explain what's covered here.
|
||||
|
||||
**Notes**
|
||||
|
||||
Any other notes?
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
ICEcoder is a browser based code editor, which provides a modern approach to building websites. By allowing you to code directly within the web browser, online or offline, it means you only need one program (your browser) to develop sites, plus can test on actual web servers. After development, you can also maintain the website easily, all of which make for speedy and smart development.
|
||||
|
||||
<img src="https://icecoder.net/images/icecoder-v8-0-browser-code-editor.png?cachebust" alt="ICEcoder code editor">
|
||||
<img src="https://icecoder.net/images/icecoder-8-1-browser-code-editor.png" alt="ICEcoder code editor">
|
||||
|
||||
### Requirements
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ body {overflow: hidden;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
.bug-report {background-color: #1c1c19; color: #fff; padding: 20px}
|
||||
pre {font-family: monospace}
|
||||
.bug-report {padding: 20px; background: rgba(0,0,0,0.92); color: #ccc}
|
||||
pre {font-family: monospace, courier, sans-serif;; white-space: pre-wrap; word-break: break-all}
|
||||
|
||||
15
assets/css/editor.css
Normal file
15
assets/css/editor.css
Normal file
@@ -0,0 +1,15 @@
|
||||
.dataMessage {display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333}
|
||||
|
||||
.dataItemsContainer {margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd}
|
||||
.dataItems {float: left; line-height: 14px}
|
||||
.dataItems span {line-height: 21px}
|
||||
|
||||
.heading {color: #888}
|
||||
.diffGreen {background: #0b0 !important; color: #000 !important}
|
||||
.diffRed {background: #800 !important; color: #fff !important}
|
||||
.diffGrey {background: #444 !important; color: #fff !important}
|
||||
.diffGreyLighter {background: #888 !important; color: #1d1d1b !important}
|
||||
.diffNone {background: ''; color: ''}
|
||||
|
||||
.resultsBar {position: absolute; display: none; width: 12px; height: 100%; top: 0; right: 0; overflow: hidden; pointer-events: none; z-index: 2}
|
||||
.resultsBar .rBlock {position: absolute; display: block; width: 12px; background: rgba(128,128,128,0.3)}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Additional file types */
|
||||
.ext-c:before {background-position: -48px 0 !important;}
|
||||
.ext-c:before, .ext-h:before {background-position: -48px 0 !important;}
|
||||
.ext-cpp:before, .ext-ino:before {background-position: -64px 0 !important;}
|
||||
.ext-cs:before {background-position: -80px 0 !important;}
|
||||
.ext-coffee:before {background-position: -96px 0 !important;}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
a {color: #2187e7; text-decoration: none}
|
||||
input {padding: 4px; border: 0; background-color: #444; color: #fff}
|
||||
select {padding: 3px 4px; border: 0; background-color: #444; color: #fff}
|
||||
input:focus {outline: none; background: rgba(0,198,255,0.5); color: #fff}
|
||||
select:focus {outline: none}
|
||||
|
||||
.ftpManager {background-color: #1c1c19; color: #fff; padding: 20px}
|
||||
.ftpManager .info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
|
||||
@@ -106,7 +106,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
appearance: none;
|
||||
}
|
||||
.findReplace .selectWrapper select:focus {outline: 0}
|
||||
.findReplace .findText {display: inline-block; height: 28px; font-size: 10px; margin: 7px 3px 0 27px}
|
||||
.findReplace .findRegexToggle {display: inline-block; height: 10px; width: 16px; font-size: 10px; margin: 3px 0 0 5px; padding: 4px 1px; border-radius: 2px; text-align: center; cursor: pointer}
|
||||
.findReplace .findText {display: inline-block; height: 28px; font-size: 10px; margin: 7px 3px 0 4px}
|
||||
.findReplace .find {position: relative; width: 167px; height: 28px; border: 0; top: -2px; font-size: 12px; padding-left: 5px; margin-right: 3px; background: #444; color: #eee}
|
||||
.findReplace .replaceText {height: 28px; font-size: 10px; margin: 6px 3px 0 2px}
|
||||
.findReplace .replace {position: relative; width: 167px; height: 28px; border: 0; top: -2px; font-size: 12px; padding-left: 5px; background: #444; color: #eee}
|
||||
@@ -167,6 +168,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.screenCenter .text {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888}
|
||||
.screenCenter .text input {margin-top: 1px}
|
||||
.screenCenter .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none}
|
||||
.screenCenter .adminUser {margin-bottom: 15px; color: #bbb}
|
||||
.screenCenter .password {border: 0; background-color: #333; color: #fff; height: 20px}
|
||||
.screenCenter .password:focus {outline: none; background: rgba(0,198,255,0.5); color: #fff}
|
||||
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
|
||||
|
||||
@@ -27,6 +27,7 @@ body {overflow: hidden;
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
|
||||
.icon-tabler {width: 24px; height: 24px; stroke-width: 1.25}
|
||||
.settings {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff}
|
||||
.settings .infoPane {position: relative; width: 230px; height: 570px; font-size: 10px; color: #888; background-color: #fff; padding: 20px; float: left}
|
||||
.settings .infoPane a {color: #06c; text-decoration: none}
|
||||
@@ -40,6 +41,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.settings input, .settings textarea {border: 1px solid #555; background-color: #444; color: #fff}
|
||||
.settings input:focus, .settings textarea:focus {outline: none; background: rgba(0,198,255,0.5); color: #fff}
|
||||
.settings input[type="text"]:disabled {opacity: 0.5}
|
||||
.settings .iconCapsLock {position: absolute; margin-left: 2px; color: #888}
|
||||
.settings .info {font-size: 10px; color: rgba(0,198,255,1); cursor: help}
|
||||
.settings .info .icon-tabler {width: 18px; height: 18px; margin-top: -2px; stroke-width: 1.25; pointer-events: none}
|
||||
.settings .info .icon-tabler {width: 18px; height: 18px; margin-top: -2px; pointer-events: none}
|
||||
.settings .update {position: absolute; bottom: 0; right: 20px; padding: 5px 10px; font-size: 18px; background-color: rgba(0,198,255,0.7); opacity: 0.1; cursor: pointer}
|
||||
|
||||
@@ -27,12 +27,12 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
|
||||
html, body {width: 100%; height: 100%}
|
||||
|
||||
.output {position: absolute; display: block; top: 0; padding: 15px 18px 8px 13px; width: 100%; min-height: 100%; border: 0; background: rgba(0,0,0,0.92); color: #ccc}
|
||||
.output {position: absolute; display: block; top: 0; padding: 15px 18px 8px 13px; width: 100%; min-height: 100%; border: 0; background: rgba(0,0,0,0.92); color: #ccc; white-space: pre-wrap; word-break: break-all}
|
||||
.commandLine {width: 100%; padding: 8px 2px 8px 0; color: #fff}
|
||||
.commandLine .user {display: inline-block; height: 24px; margin-top: -4px; margin-left: -13px; padding: 5px 5px 5px 0; margin-bottom: 5px; background: #b58901; color: #000}
|
||||
.commandLine .cwd {display: inline-block; height: 24px; margin-top: -4px; padding: 5px 5px 5px 0; margin-bottom: 5px; background: #278bd2; color: #fff}
|
||||
.commandLine .promptVLine {display: inline-block; width: 1px; height: 12px; margin-top: -5px; margin-left: 3px; background: #b58901}
|
||||
.commandLine .promptHLine {display: inline-block; color: #b58901}
|
||||
.commandLine .promptArrow {display: inline-block; margin-left:-1px}
|
||||
.commandLine .command {border: none; width: 98%; background: transparent; color: #fff}
|
||||
.commandLine .command {border: none; width: 10000px; max-width: 95%; background: transparent; color: #fff}
|
||||
.commandLine .command:focus {outline: none}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Author: Torres Digital® | Sites → Lojas Virtuais e e-Commerce
|
||||
Author URI: https://www.facebook.com/torresdigital/
|
||||
|
||||
Description: omos uma Agência Gaúcha que trabalha com Desenvolvimento Web voltado para todos os Nichos do Mercado tais como os de insumos, commodities, pequenos, médios e grandes Lojistas que desejam alcançar mais Clientes através do e-Commerce: Sites, Aplicativos, Lojas Virtuais, Marketplaces, WordPress e Woocommerce, integrados com os Principais Cartões e Soluções de Pagamentos do Brasil e do Mundo; tais como Cielo, CyberSource, PagSeguro, Stripe, Vindi, MasterCard, Visa, American Express, outros.
|
||||
Description: Somos uma Agência Gaúcha que trabalha com Desenvolvimento Web voltado para todos os Nichos do Mercado tais como os de insumos, commodities, pequenos, médios e grandes Lojistas que desejam alcançar mais Clientes através do e-Commerce: Sites, Aplicativos, Lojas Virtuais, Marketplaces, WordPress e Woocommerce, integrados com os Principais Cartões e Soluções de Pagamentos do Brasil e do Mundo; tais como Cielo, CyberSource, PagSeguro, Stripe, Vindi, MasterCard, Visa, American Express, outros.
|
||||
|
||||
www.torresdigital.tk * Menos é mais.
|
||||
|
||||
@@ -34,7 +34,7 @@ This theme is licensed under the GPL. Use it to make something cool, have fun, a
|
||||
.cm-s-2019-torres-digital-theme span.cm-variable-3 { color: #96F; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-property { color: #F8019E; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-operator { color: #999; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-comment { color: #616163; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-comment { color: #d5d5d5; font-weight: 600; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-string { color: #F8019E; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-meta { color: #F1FD31; font-weight: bold; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-qualifier { color: #FFF700; font-weight: 600; }
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.cm-s-emacs-strict {
|
||||
font-family: monospace;
|
||||
background: #000000EB;
|
||||
background: #000000;
|
||||
color: #D3D3D3;
|
||||
}
|
||||
.cm-s-emacs-strict .CodeMirror-gutters {
|
||||
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||
background-color: #000000EB;
|
||||
background-color: #000000;
|
||||
z-index: 3;
|
||||
border: none;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.cm-s-iplastic {
|
||||
font-family: monospace;
|
||||
background: #EEEEEEEB;
|
||||
background: #EEEEEE;
|
||||
color: #000000;
|
||||
}
|
||||
.cm-s-iplastic .CodeMirror-gutters {
|
||||
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||
background-color: #EEEEEEEB;
|
||||
background-color: #EEEEEE;
|
||||
z-index: 3;
|
||||
border: none;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.cm-s-made-of-code {
|
||||
font-family: monospace;
|
||||
background: #090916F2;
|
||||
background: #090916;
|
||||
color: #F8F8F8;
|
||||
}
|
||||
.cm-s-made-of-code .CodeMirror-gutters {
|
||||
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.5);
|
||||
background-color: #090916F2;
|
||||
background-color: #090916;
|
||||
z-index: 3;
|
||||
border: none;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ var ICEcoder = {
|
||||
results: [], // Array of find coords (line & char)
|
||||
resultsLines: [], // Array of lines containing results (simpler version of results)
|
||||
findResult: 0, // Array position of current find in results
|
||||
findRegex: false, // If find attempts are done using regex
|
||||
findUpdateMultiInfoID: [], // ID of multiple results modal elem to update & text, when rename/replace is successful
|
||||
scrollbarVisible: false, // Indicates if the main pane has a scrollbar
|
||||
mouseDown: false, // If the mouse is down
|
||||
mouseDownInCM: false, // If the mouse is down within CodeMirror instance (can be false, 'editor' or 'gutter')
|
||||
@@ -55,7 +57,7 @@ var ICEcoder = {
|
||||
previewWindowLoading: false, // Loading state of preview window
|
||||
pluginIntervalRefs: [], // Array of plugin interval refs
|
||||
overPopup: false, // Indicates if we're over a popup or not
|
||||
cmdKey: false, // Tracking apple Command key up/down state
|
||||
cmdKey: false, // Tracking Apple Command key up/down state
|
||||
codeZoomedOut: false, // If true, code on non declaration lines is zoomed out
|
||||
showingTool: false, // Which tool is showing right now (terminal, output, database, git etc)
|
||||
oppTagReplaceData: [], // Will contain data for automatic opposite tag replacement to sync them
|
||||
@@ -93,8 +95,11 @@ var ICEcoder = {
|
||||
// Set layout
|
||||
this.setLayout();
|
||||
|
||||
// State we've over the root dir, enact a selection of it, then state
|
||||
// we're not over it it anymore
|
||||
this.overFileFolder('folder', '|');
|
||||
this.selectFileFolder('init');
|
||||
this.overFileFolder('folder', '');
|
||||
this.filesFrame.contentWindow.focus();
|
||||
|
||||
// Hide the loading screen & auto open last files?
|
||||
@@ -428,16 +433,17 @@ var ICEcoder = {
|
||||
},
|
||||
|
||||
// On key up
|
||||
cMonKeyUp: function(thisCM, cMinstance) {
|
||||
if (undefined !== typeof this.doFindTimeout) {
|
||||
clearInterval(this.doFindTimeout);
|
||||
}
|
||||
// If we have something to find in this document, find in 50 ms (unless cancelled by another keypress)
|
||||
if ("" !== get('find').value && t['this document'] === document.findAndReplace.target.value) {
|
||||
this.doFindTimeout = setTimeout(function (ic) {
|
||||
ic.findReplace(get('find').value, false, false, false);
|
||||
}, 50, this);
|
||||
cMonKeyUp: function(thisCM, cMinstance, evt) {
|
||||
let key;
|
||||
|
||||
key = evt.keyCode ?? evt.which ?? evt.charCode;
|
||||
|
||||
// Return true (to continue) if we're not CTRL+dragging and
|
||||
// we have CTRL/Cmd key down, or if it's the CTRL key, or Cmd key now up
|
||||
if ("CTRL" !== this.draggingWithKey && (this.ctrlCmdKeyDown(evt) || 17 === key || this.isCmdKey(key))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.setEditorStats();
|
||||
},
|
||||
|
||||
@@ -463,7 +469,7 @@ var ICEcoder = {
|
||||
thisCM.replaceRange("", {line: thisCMPrevLine, ch: 0}, {line: thisCMPrevLine, ch: 1000000}, "+input");
|
||||
}
|
||||
|
||||
// Set the cursor to text height, not line height
|
||||
// Set the cursor to text height, not line height and update any old highlighted results message
|
||||
setTimeout(function(ic) {
|
||||
let paneMatch;
|
||||
|
||||
@@ -488,6 +494,11 @@ var ICEcoder = {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If we have no selection but still have highlighted result message, run updateResultsDisplay
|
||||
if ("" === thisCM.getSelection() && 0 === get('results').innerHTML.indexOf("Highlighted result")) {
|
||||
ic.updateResultsDisplay('show');
|
||||
}
|
||||
}, 0, this);
|
||||
},
|
||||
|
||||
@@ -609,6 +620,17 @@ var ICEcoder = {
|
||||
this.highlightGitDiffs();
|
||||
}
|
||||
|
||||
// Clear any previous doFindTimeout var
|
||||
if (undefined !== typeof this.doFindTimeout) {
|
||||
clearInterval(this.doFindTimeout);
|
||||
}
|
||||
// If we have something to find in this document, find in 50 ms (unless cancelled by another keypress)
|
||||
if ("" !== get('find').value && t['this document'] === document.findAndReplace.target.value) {
|
||||
this.doFindTimeout = setTimeout(function (ic) {
|
||||
ic.findReplace(get('find').value, false, false, false);
|
||||
}, 50, this);
|
||||
}
|
||||
|
||||
// Update HTML edited files live
|
||||
if (filepath && this.previewWindow.location && filepath !== "/[NEW]") {
|
||||
this.updatePreviewWindow(thisCM, filepath, filename, fileExt);
|
||||
@@ -726,7 +748,7 @@ var ICEcoder = {
|
||||
functionArgsTooltip: function(e, area) {
|
||||
let numLintErrors;
|
||||
|
||||
if (this.indexData) {
|
||||
if (this.indexData && this.indexData.functions) {
|
||||
// If we have no files open, return early
|
||||
if (0 === this.openFiles.length) {
|
||||
get('tooltip').style.display = "none";
|
||||
@@ -760,7 +782,7 @@ var ICEcoder = {
|
||||
// If we have a single result and the mouse pointer is not over the definition of it (that would be pointless), show tooltip
|
||||
if (1 === numResults && -1 === [null, "def"].indexOf(cM.getTokenTypeAt(coordsChar))) {
|
||||
get('tooltip').style.display = "block";
|
||||
get('tooltip').style.left = (this.mouseX - this.maxFilesW + 10) + "px";
|
||||
get('tooltip').style.left = (this.mouseX + 10) + "px";
|
||||
numLintErrors = this.content.contentWindow.document.getElementsByClassName("CodeMirror-lint-tooltip")[0];
|
||||
numLintErrors = numLintErrors && numLintErrors.childNodes
|
||||
? numLintErrors.childNodes.length
|
||||
@@ -770,7 +792,11 @@ var ICEcoder = {
|
||||
? 18 * numLintErrors
|
||||
: 0)
|
||||
) + "px";
|
||||
get('tooltip').style.zIndex = "1";
|
||||
get('tooltip').style.zIndex = 1000;
|
||||
// Limit function args list to 200 char max
|
||||
if (result.params.length > 200) {
|
||||
result.params = result.params.substr(0, 200) + "...)";
|
||||
}
|
||||
get('tooltip').innerHTML = result.params;
|
||||
// Else hide it
|
||||
} else {
|
||||
@@ -1155,7 +1181,12 @@ var ICEcoder = {
|
||||
|
||||
// Go to a specific line number
|
||||
goToLine: function(lineNo, charNo, noFocus) {
|
||||
let thisCM;
|
||||
let thisCM, hiddenLines, tgtLineNo;
|
||||
|
||||
// Return early if trying to find line and no files open
|
||||
if (0 === this.openFiles.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
lineNo = lineNo ? lineNo - 1 : get('goToLineNo').value - 1;
|
||||
charNo = charNo ? charNo : 0;
|
||||
@@ -1164,15 +1195,51 @@ var ICEcoder = {
|
||||
|
||||
this.scrollingOnLine = thisCM.getCursor().line;
|
||||
|
||||
// Scroll cursor into middle of view
|
||||
// Clear any existing interval handling the scrolling
|
||||
if ("undefined" !== typeof this.scrollInt) {
|
||||
clearInterval(this.scrollInt);
|
||||
}
|
||||
|
||||
// Start array of hidden (folded away) lines we should ignore
|
||||
hiddenLines = [];
|
||||
|
||||
// Get all marks
|
||||
const allMarks = thisCM.getAllMarks();
|
||||
if ("undefined" !== typeof allMarks[0]) {
|
||||
// For each of the marks, if it's a fold type marker
|
||||
for (let i = 0; i < allMarks.length; i++) {
|
||||
if (true === allMarks[i].__isFold) {
|
||||
// Get the line number of first child in marker range
|
||||
const firstLine = thisCM.getLineNumber(allMarks[i].lines[0]);
|
||||
// For each of the children in marker range, after first (as that's still visible, subsequent lines not)
|
||||
for (let j = 1; j < allMarks[i].lines.length; j++) {
|
||||
// If not already in hidden lines array we need to also ignore (this check covers nested folds)
|
||||
if (-1 === hiddenLines.indexOf(firstLine + j + 1)) {
|
||||
hiddenLines.push(firstLine + j + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The target line is same as requested line, for now
|
||||
tgtLineNo = lineNo;
|
||||
// Go through each of the lines that are folded away (hidden), if the number is less
|
||||
// than the requested line number, deduct 1 as it's hidden
|
||||
for (let i = 0; i < hiddenLines.length; i++) {
|
||||
if (hiddenLines[i] < lineNo) {
|
||||
tgtLineNo--;
|
||||
}
|
||||
}
|
||||
|
||||
this.scrollInt = setInterval(function(ic) {
|
||||
ic.scrollingOnLine = ic.scrollingOnLine + ((lineNo - ic.scrollingOnLine) / 5);
|
||||
thisCM.scrollTo(0, (thisCM.defaultTextHeight() * ic.scrollingOnLine) - (thisCM.getScrollInfo().clientHeight / 10));
|
||||
if (lineNo === Math.round(ic.scrollingOnLine)) {
|
||||
// Aim for this step to go 1/5th towards the target line we want as next scroll "step"
|
||||
// 1 = instant, 20 = very slow
|
||||
ic.scrollingOnLine = ic.scrollingOnLine + ((tgtLineNo - ic.scrollingOnLine) / ICEcoder.goToLineScrollSpeed);
|
||||
// Scroll on the Y axis to the pixels in this step + 8 to handle margin - 1/10th of editor visible height
|
||||
thisCM.scrollTo(0, (thisCM.defaultTextHeight() * ic.scrollingOnLine) + 8 - (thisCM.getScrollInfo().clientHeight / 10));
|
||||
// Clear interval if we're at the target line now
|
||||
if (tgtLineNo === Math.round(ic.scrollingOnLine)) {
|
||||
clearInterval(ic.scrollInt);
|
||||
}
|
||||
}, 10, this);
|
||||
@@ -1526,6 +1593,7 @@ var ICEcoder = {
|
||||
: fileExt === "erl" ? "Erlang"
|
||||
: fileExt === "jl" ? "Julia"
|
||||
: fileExt === "c" ? "C"
|
||||
: fileExt === "h" ? "C"
|
||||
: fileExt === "cpp" ? "C++"
|
||||
: fileExt === "ino" ? "C++"
|
||||
: fileExt === "cs" ? "C#"
|
||||
@@ -1928,19 +1996,31 @@ var ICEcoder = {
|
||||
const re = /^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/;
|
||||
const reMatch = re.exec(fileLink);
|
||||
|
||||
// "on" or "line" word used followed by line number
|
||||
if (null !== reMatch) {
|
||||
line = reMatch[4];
|
||||
fileLink = reMatch[1];
|
||||
} else if (fileLink.indexOf('://') > 0){
|
||||
// :// protocol host separator used
|
||||
} else if (fileLink.indexOf('://') > 0) {
|
||||
// We have a : then number (and : not same index as ://)
|
||||
if (fileLink.lastIndexOf(':') !== fileLink.indexOf('://')) {
|
||||
line = fileLink.split(':')[2];
|
||||
fileLink = fileLink.substr(0,fileLink.lastIndexOf(":"));
|
||||
fileLink = fileLink.substr(0, fileLink.lastIndexOf(":"));
|
||||
}
|
||||
} else if (fileLink.indexOf(':') > 0){
|
||||
// :/ drive path separator used, likely Windows
|
||||
} else if (fileLink.indexOf(':/') > 0) {
|
||||
// We have a : then number (and : not same index as :/)
|
||||
if (fileLink.lastIndexOf(':') !== fileLink.indexOf(':/')) {
|
||||
line = fileLink.split(':')[2];
|
||||
fileLink = fileLink.substr(0, fileLink.lastIndexOf(":"));
|
||||
}
|
||||
// We have a :
|
||||
} else if (fileLink.indexOf(':') > 0) {
|
||||
line = fileLink.split(':')[1];
|
||||
fileLink = fileLink.split(':')[0];
|
||||
}
|
||||
if ((fileLink.indexOf('(') > 0) && (fileLink.indexOf(')') > 0)){
|
||||
// () Brackets used
|
||||
if ((fileLink.indexOf('(') > 0) && (fileLink.indexOf(')') > 0)) {
|
||||
line = fileLink.split('(')[1].split(')')[0];
|
||||
fileLink = fileLink.split('(')[0];
|
||||
}
|
||||
@@ -2683,19 +2763,9 @@ var ICEcoder = {
|
||||
}
|
||||
},
|
||||
|
||||
// Detect CTRL/Cmd key whilst dragging files
|
||||
// Detect CTRL/Cmd key down whilst dragging files
|
||||
draggingWithKeyTest: function(evt) {
|
||||
let key;
|
||||
|
||||
key = evt.keyCode ?? evt.which ?? evt.charCode;
|
||||
key = parseInt(key, 10);
|
||||
|
||||
// Mac command key handling (224 = Moz, 91/93 = Webkit Left/Right Apple)
|
||||
if (-1 < [224, 91, 93].indexOf(key)) {
|
||||
this.cmdKey = true;
|
||||
}
|
||||
|
||||
this.draggingWithKey = evt.ctrlKey || this.cmdKey ? "CTRL" : false;
|
||||
this.draggingWithKey = this.ctrlCmdKeyDown(evt) ? "CTRL" : false;
|
||||
},
|
||||
|
||||
// Add default drag data (dragging in Firefox on DOM elems not possible otherwise)
|
||||
@@ -2737,6 +2807,7 @@ var ICEcoder = {
|
||||
if ('files' === this.area) {
|
||||
setTimeout(function(ic) {
|
||||
tgtPath = "folder" === ic.thisFileFolderType ? ic.thisFileFolderLink : ic.thisFileFolderLink.substr(0, ic.thisFileFolderLink.lastIndexOf("|"));
|
||||
if ("" === tgtPath) {tgtPath = "|";}
|
||||
if("CTRL" === ic.draggingWithKey) {
|
||||
ic.copyFiles(ic.selectedFiles);
|
||||
ic.pasteFiles(tgtPath);
|
||||
@@ -2745,7 +2816,7 @@ var ICEcoder = {
|
||||
this.filesFrame.contentWindow.document.getElementById(tgtPath.replace(/\//g, "|")).style.background = '';
|
||||
// If the tgtPath is not the root, postfix the path with a pipe
|
||||
if ("|" !== tgtPath) {tgtPath += "|"};
|
||||
ic.moveFile(filePath,tgtPath.replace(/\|/g, "/") + fileName);
|
||||
ic.moveFile(filePath, tgtPath.replace(/\|/g, "/") + fileName);
|
||||
}
|
||||
}, 4, this);
|
||||
}
|
||||
@@ -2757,6 +2828,67 @@ var ICEcoder = {
|
||||
// FIND & REPLACE
|
||||
// ==============
|
||||
|
||||
// Backslash escape regex special chars in string
|
||||
escapeRegex: function(string) {
|
||||
// $& means the whole matched string
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
},
|
||||
|
||||
// Test an input for balanced regex brackets
|
||||
regexIsBalanced: function(input) {
|
||||
const brackets = "[]{}()";
|
||||
const bracketsSlash = brackets + "\\";
|
||||
let stack = [];
|
||||
let remainder = "";
|
||||
|
||||
// Remove backslash escaped brackets & slashes before testing
|
||||
for (let i = 0; i < bracketsSlash.length; i++) {
|
||||
input = input.replace(new RegExp('\\\\\\' + bracketsSlash[i], 'g'), 'ICECODERC' + i)
|
||||
}
|
||||
|
||||
// Go thru each char in input
|
||||
for (let char of input) {
|
||||
// Find index of this char in brackets string
|
||||
let bracketsIndex = brackets.indexOf(char)
|
||||
|
||||
// Not one of the bracket chars, continue to next char
|
||||
if (bracketsIndex === -1) {
|
||||
remainder += char;
|
||||
continue;
|
||||
}
|
||||
|
||||
// If a bracket start: [ { ( push closing bracket onto stack
|
||||
if (bracketsIndex % 2 === 0) {
|
||||
stack.push(bracketsIndex + 1)
|
||||
} else {
|
||||
// When popping brackets off the stack, compare and return false if not matching
|
||||
if (stack.pop() !== bracketsIndex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replace backslash escaped brackets & slashes
|
||||
for (let i = 0; i < bracketsSlash.length; i++) {
|
||||
remainder = remainder.replace(new RegExp('ICECODERC' + i, 'g'), '\\' + bracketsSlash[i])
|
||||
}
|
||||
|
||||
// If we have items left on our stack, we have an unbalanced input
|
||||
return {
|
||||
"balanced" : stack.length === 0,
|
||||
"remainder" : remainder
|
||||
};
|
||||
},
|
||||
|
||||
// Toggle on/off regex matching during find
|
||||
findRegexToggle: function() {
|
||||
// Toggle to opposite bool value and set background according to value
|
||||
this.findRegex = !this.findRegex;
|
||||
get('findRegexToggle').style.background = true === this.findRegex ? "#49d" : "";
|
||||
// Find again now we've changed regex option state
|
||||
ICEcoder.findReplace(get('find').value, true, false, false);
|
||||
},
|
||||
|
||||
// Update find & replace options based on user selection
|
||||
findReplaceOptions: function() {
|
||||
get('rText').style.display =
|
||||
@@ -2766,92 +2898,90 @@ var ICEcoder = {
|
||||
? "inline-block" : "none";
|
||||
},
|
||||
|
||||
findReplaceOnInput: function() {
|
||||
// Realtime finding - only action for finding/replacing in current doc
|
||||
findOnInput: function() {
|
||||
// Realtime finding - only action for finding in current doc
|
||||
if ("" !== get('find').value && t['this document'] === document.findAndReplace.target.value) {
|
||||
ICEcoder.findReplace(get('find').value, true, false, false);
|
||||
// Considers selecting next on value input, according to user setting
|
||||
ICEcoder.findReplace(get('find').value, true === ICEcoder.selectNextOnFindInput, false, false);
|
||||
get("find").focus();
|
||||
return false;
|
||||
// Reset results display
|
||||
} else {
|
||||
ICEcoder.findReplace(get('find').value, false, false, false);
|
||||
}
|
||||
},
|
||||
|
||||
// Find & replace text according to user selections
|
||||
findReplace: function(find, selectNext, canActionChanges, findPrevious) {
|
||||
let replace, results, thisCM, avgBlockH, addPadding, rBlocks, haveMatch, blockColor, replaceQS, targetQS, filesQS;
|
||||
let replace, results, rExp, thisCM, thisSelection, rBlocks, rExpMatch0String, replaceQS, targetQS, filesQS, currRBlock;
|
||||
|
||||
// Determine our find rExp, replace value and results display
|
||||
const rExp = new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), "gi");
|
||||
// Get our replace value and results display
|
||||
replace = get('replace').value;
|
||||
results = get('results');
|
||||
|
||||
// If we're finding with regex and have a problem with it, highlight find box red and return, avoids CPU crash
|
||||
if (true === parent.ICEcoder.findRegex) {
|
||||
const balancedInfo = this.regexIsBalanced(find);
|
||||
|
||||
// Turn input box red if empty, or no balancedInfo data, or we have unbalanced bracket pairs, or the remainder
|
||||
// is empty aside from brackets, or find or only has ^ or $ or .*
|
||||
if ("" !== find && (
|
||||
false === balancedInfo ||
|
||||
false === balancedInfo['balanced'] ||
|
||||
("" === balancedInfo['remainder'].replace(/\[\]\{\}\(\)/g, "")) ||
|
||||
"" === find.replace(/\^|\$|\.\*/g, "")
|
||||
)) {
|
||||
this.clearResultsDisplays();
|
||||
get('find').style.background = "#800";
|
||||
return false;
|
||||
} else {
|
||||
get('find').style.background = "";
|
||||
}
|
||||
}
|
||||
|
||||
// Determine our find rExp, inside a try/catch incase there's an uncaught issue with format
|
||||
try {
|
||||
rExp = new RegExp(true === parent.ICEcoder.findRegex ? find : ICEcoder.escapeRegex(find), "gi");
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get CM pane
|
||||
thisCM = this.getThisCM();
|
||||
|
||||
// Finding in this document only
|
||||
if (thisCM && 0 < find.length && t['this document'] === document.findAndReplace.target.value) {
|
||||
// Get this selection, either as regex escaped version or regular, for comparisons
|
||||
thisSelection = true === parent.ICEcoder.findRegex ? ICEcoder.escapeRegex(thisCM.getSelection()) : thisCM.getSelection();
|
||||
|
||||
// Replacing?
|
||||
if (t['and'] === document.findAndReplace.connector.value && true === canActionChanges) {
|
||||
// Find & replace the next instance, or all?
|
||||
if (t['replace'] === document.findAndReplace.replaceAction.value && thisCM.getSelection().toLowerCase() === find.toLowerCase()) {
|
||||
if (t['replace'] === document.findAndReplace.replaceAction.value && thisSelection.toLowerCase() === find.toLowerCase()) {
|
||||
thisCM.replaceSelection(replace, "around");
|
||||
} else if (t['replace all'] === document.findAndReplace.replaceAction.value) {
|
||||
thisCM.setValue(thisCM.getValue().replace(rExp, replace));
|
||||
}
|
||||
}
|
||||
|
||||
// Set results, resultsLines and findResult back to defaults
|
||||
this.results = [];
|
||||
this.resultsLines = [];
|
||||
this.findResult = 0;
|
||||
|
||||
// Start new iterators for line & last line
|
||||
let i = 0;
|
||||
let lastLine = -1;
|
||||
|
||||
// Get lineNum and chNum from cursor
|
||||
const lineNum = thisCM.getCursor(true === selectNext ? "anchor" : "head").line + 1;
|
||||
const chNum = thisCM.getCursor(true === selectNext ? "anchor" : "head").ch;
|
||||
|
||||
// Work out the avg block is either line height or fraction of space available
|
||||
avgBlockH = !this.scrollBarVisible ? thisCM.defaultTextHeight() : parseInt(this.content.style.height, 10) / thisCM.lineCount();
|
||||
|
||||
// Need to add padding if there's no scrollbar, so current line highlighting lines up with it
|
||||
addPadding = !this.scrollBarVisible ? thisCM.heightAtLine(0) : 0;
|
||||
|
||||
// Result blocks string empty to start, ready to hold DOM elems to show in results bar
|
||||
rBlocks = "";
|
||||
|
||||
// Start looking for results
|
||||
thisCM.eachLine(function(line) {
|
||||
i++;
|
||||
haveMatch = false;
|
||||
// If we have matches for our regex for this line
|
||||
while ((match = rExp.exec(line.text)) !== null) {
|
||||
haveMatch = true;
|
||||
// Not the same as last line, add to resultsLines
|
||||
if (lastLine !== i) {
|
||||
ICEcoder.resultsLines.push(match.index);
|
||||
lastLine = i;
|
||||
}
|
||||
// If the line containing a result is less than than the cursors line or
|
||||
// if the character position of the match is less than the cursor position, increment findResult
|
||||
if (i < lineNum || (i === lineNum && match.index < chNum)) {
|
||||
ICEcoder.findResult++;
|
||||
}
|
||||
// Push the line & char position coords into results
|
||||
ICEcoder.results.push([i, match.index]);
|
||||
}
|
||||
// If the avg block height for results in results bar is above 0.5 pixels high, we can add a DOM elem
|
||||
if (0.5 <= avgBlockH) {
|
||||
// Red for current line, grey for another line, transparent if no match
|
||||
blockColor = haveMatch ? thisCM.getCursor().line + 1 == i ? "rgba(192,0,0,0.3)" : "rgba(128,128,128,0.3)" : "transparent";
|
||||
// Add the DOM elem into our rBlocks string
|
||||
rBlocks += '<div style="position: absolute; display: block; width: 12px; height:' + avgBlockH + 'px; background: ' + blockColor + '; top: ' + parseInt((avgBlockH * (i - 1)) + addPadding, 10) + 'px"></div>';
|
||||
}
|
||||
});
|
||||
rData = ICEcoder.findInCMContent(thisCM, rExp, selectNext);
|
||||
|
||||
// Set results, resultsLines and findResult plus rBlocks which shows DOM elems in results bar
|
||||
// and rExpMatch0String which is the matching string used to set correct selection length
|
||||
this.results = rData.results;
|
||||
this.resultsLines = rData.resultsLines;
|
||||
this.findResult = rData.findResult;
|
||||
rBlocks = rData.rBlocks;
|
||||
rExpMatch0String = rData.rExpMatch0String;
|
||||
|
||||
// Increment findResult one more if our selection is what we want to find and we want to find next
|
||||
if (find.toLowerCase() === thisCM.getSelection().toLowerCase() && false === findPrevious) {
|
||||
ICEcoder.findResult++;
|
||||
// but we're not replacing (replacing removes from array so should not increment thru array index also)
|
||||
if (
|
||||
find.toLowerCase() === thisSelection.toLowerCase() &&
|
||||
false === findPrevious &&
|
||||
(t['and'] !== document.findAndReplace.connector.value || false === canActionChanges)
|
||||
) {
|
||||
this.findResult++;
|
||||
}
|
||||
|
||||
if (findPrevious) {
|
||||
@@ -2860,8 +2990,7 @@ var ICEcoder = {
|
||||
}
|
||||
|
||||
// If we have results
|
||||
if (this.results.length>0) {
|
||||
|
||||
if (this.results.length > 0) {
|
||||
// Show results only
|
||||
if (false === selectNext) {
|
||||
results.innerHTML = this.results.length + " results";
|
||||
@@ -2890,7 +3019,7 @@ var ICEcoder = {
|
||||
// Finally, highlight our selection and focus on CM pane
|
||||
thisCM.setSelection(
|
||||
{"line": this.results[this.findResult][0]-1, "ch": this.results[this.findResult][1]},
|
||||
{"line": this.results[this.findResult][0]-1, "ch": this.results[this.findResult][1] + find.length}
|
||||
{"line": this.results[this.findResult][0]-1, "ch": this.results[this.findResult][1] + rExpMatch0String.length}
|
||||
);
|
||||
this.focus();
|
||||
}
|
||||
@@ -2899,15 +3028,16 @@ var ICEcoder = {
|
||||
this.content.contentWindow.document.getElementById('resultsBar').innerHTML = rBlocks;
|
||||
this.content.contentWindow.document.getElementById('resultsBar').style.display = "inline-block";
|
||||
|
||||
// Mark the currRBlock (result for current line) in red
|
||||
currRBlock = this.content.contentWindow.document.getElementById('rBlock' + (thisCM.getCursor().line + 1));
|
||||
if (currRBlock) {
|
||||
currRBlock.style.background = "#06c";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
results.innerHTML = "No results";
|
||||
this.content.contentWindow.document.getElementById('resultsBar').innerHTML = "";
|
||||
this.content.contentWindow.document.getElementById('resultsBar').style.display = "none";
|
||||
|
||||
// Clear our selection and so also the match highlights
|
||||
thisCM.setCursor(thisCM.getCursor("anchor"));
|
||||
this.clearResultsDisplays();
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2947,16 +3077,91 @@ var ICEcoder = {
|
||||
'" id="multipleResultsIFrame" style="width: 700px; height: 500px"></iframe>';
|
||||
// We have nothing to search for, blank it all out
|
||||
} else {
|
||||
results.innerHTML = "No results";
|
||||
this.content.contentWindow.document.getElementById('resultsBar').innerHTML = "";
|
||||
this.content.contentWindow.document.getElementById('resultsBar').style.display = "none";
|
||||
|
||||
// Clear our selection and so also the match highlights
|
||||
thisCM.setCursor(thisCM.getCursor("anchor"));
|
||||
this.clearResultsDisplays();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clearResultsDisplays: function() {
|
||||
results.innerHTML = this.openFiles.length > 0 ? "No results" : "";
|
||||
this.content.contentWindow.document.getElementById('resultsBar').innerHTML = "";
|
||||
this.content.contentWindow.document.getElementById('resultsBar').style.display = "none";
|
||||
},
|
||||
|
||||
findInCMContent: function(thisCM, rExp, selectNext) {
|
||||
let avgBlockH, addPadding, rBlocks, haveMatch, rExpMatch0String, rBlockTop, lastRBlockTop;
|
||||
|
||||
// Start new iterators for line & last line
|
||||
let i = 0;
|
||||
let lastLine = -1;
|
||||
|
||||
// Set results, resultsLines and findResult to defaults
|
||||
let results = [];
|
||||
let resultsLines = [];
|
||||
let findResult = 0;
|
||||
|
||||
// Get lineNum and chNum from cursor
|
||||
const lineNum = thisCM.getCursor(true === selectNext ? "anchor" : "head").line + 1;
|
||||
const chNum = thisCM.getCursor(true === selectNext ? "anchor" : "head").ch;
|
||||
|
||||
// Work out the avg block - is either line height or fraction of space available, but a min of 1px
|
||||
avgBlockH = Math.max(1, !this.scrollBarVisible ? thisCM.defaultTextHeight() : parseInt(this.content.style.height, 10) / thisCM.lineCount());
|
||||
|
||||
// Need to add padding if there's no scrollbar, so current line highlighting lines up with it
|
||||
addPadding = !this.scrollBarVisible ? thisCM.heightAtLine(0) : 0;
|
||||
|
||||
// Result blocks string empty to start, ready to hold DOM elems to show in results bar
|
||||
rBlocks = "";
|
||||
|
||||
rExpMatch0String = "";
|
||||
lastRBlockTop = 0;
|
||||
|
||||
thisCM.eachLine(function(line) {
|
||||
i++;
|
||||
haveMatch = false;
|
||||
// If we have matches for our regex for this line
|
||||
while ((match = rExp.exec(line.text)) !== null) {
|
||||
// rBlockTop is either:
|
||||
// - the default text height (if no scrollbar), or
|
||||
// - screen height divided by num lines (if scrollbar)
|
||||
// multiply whichever by the line number, plus add padding
|
||||
rBlockTop = parseInt(((
|
||||
!ICEcoder.scrollBarVisible
|
||||
? thisCM.defaultTextHeight()
|
||||
: parseInt(this.content.style.height, 10) / thisCM.lineCount())
|
||||
* (i - 1)) + addPadding, 10);
|
||||
|
||||
rExpMatch0String = match[0];
|
||||
haveMatch = true;
|
||||
// Not the same as last line, add to resultsLines
|
||||
if (lastLine !== i) {
|
||||
resultsLines.push(match.index);
|
||||
lastLine = i;
|
||||
}
|
||||
// If the line containing a result is less than than the cursors line or
|
||||
// if the character position of the match is less than the cursor position, increment findResult
|
||||
if (i < lineNum || (i === lineNum && match.index < chNum)) {
|
||||
findResult++;
|
||||
}
|
||||
// Push the line & char position coords into results
|
||||
results.push([i, match.index]);
|
||||
}
|
||||
// If we have a match, add the DOM elem into our rBlocks string
|
||||
if (true === haveMatch && rBlockTop !== lastRBlockTop) {
|
||||
rBlocks += '<div class="rBlock" style="height:' + avgBlockH + 'px; top: ' + rBlockTop + 'px" id="rBlock' + i +'"></div>';
|
||||
lastRBlockTop = rBlockTop;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
"results": results,
|
||||
"resultsLines": resultsLines,
|
||||
"findResult": findResult,
|
||||
"rBlocks": rBlocks,
|
||||
"rExpMatch0String": rExpMatch0String
|
||||
}
|
||||
},
|
||||
|
||||
// Replace text in a file
|
||||
replaceInFile: function(fileRef, find, replace) {
|
||||
this.serverQueue(
|
||||
@@ -3163,9 +3368,9 @@ var ICEcoder = {
|
||||
farbtastic('picker','color');
|
||||
// If we have a color value, set it in picker
|
||||
if (color) {
|
||||
// If an RGB value, convert to hex
|
||||
if (-1 < color.indexOf("rgb")) {
|
||||
color = color.replace(/rgb|\(|\)|\s+/g, "").split(",");
|
||||
// If a RGB(A) value, convert to Hex
|
||||
if (-1 < color.toLowerCase().indexOf("rgb")) {
|
||||
color = color.replace(/rgba?|\(|\)|\s+/gi, "").split(",");
|
||||
color = "#" + this.rgbToHex(...color);
|
||||
}
|
||||
get('picker').farbtastic.setColor(color);
|
||||
@@ -3263,8 +3468,9 @@ var ICEcoder = {
|
||||
}
|
||||
},
|
||||
|
||||
// Convert RGB values to Hex
|
||||
rgbToHex: function(r, g, b) {
|
||||
// Convert RGB(A) values to Hex
|
||||
rgbToHex: function(r, g, b, a) {
|
||||
// Ignore alpha, use r, g, b
|
||||
return this.toHex(r) + this.toHex(g) + this.toHex(b);
|
||||
},
|
||||
|
||||
@@ -3453,8 +3659,15 @@ var ICEcoder = {
|
||||
console.log(statusObj);
|
||||
ICEcoder.serverMessage();
|
||||
ICEcoder.serverQueue('del');
|
||||
// Successful, process the requested action to take now
|
||||
} else {
|
||||
eval(statusObj.action.doNext);
|
||||
// If we need to update the multiple results pane with new info now a task is done successfully
|
||||
if (ICEcoder.findUpdateMultiInfoID[0]) {
|
||||
get('multipleResultsIFrame').contentWindow.document.getElementById(ICEcoder.findUpdateMultiInfoID[0])
|
||||
.innerHTML = ICEcoder.findUpdateMultiInfoID[1];
|
||||
ICEcoder.findUpdateMultiInfoID = [];
|
||||
}
|
||||
}
|
||||
// Some other response? Display a message about that
|
||||
} else {
|
||||
@@ -3606,7 +3819,7 @@ var ICEcoder = {
|
||||
get('mediaContainer').innerHTML =
|
||||
'<iframe src="' +
|
||||
this.iceLoc +
|
||||
'/lib/help.php" id="helpIFrame" style="width: 840px; height: 485px"></iframe>';
|
||||
'/lib/help.php" id="helpIFrame" style="width: 840px; height: 495px"></iframe>';
|
||||
this.showHide('show', get('blackMask'));
|
||||
},
|
||||
|
||||
@@ -3672,24 +3885,15 @@ var ICEcoder = {
|
||||
this.showHide('show', get('blackMask'));
|
||||
},
|
||||
|
||||
// Go to localhost root
|
||||
goLocalhostRoot: function() {
|
||||
this.filesFrame.contentWindow.frames['fileControl'].location.href =
|
||||
this.iceLoc +
|
||||
"/lib/go-localhost-root.php";
|
||||
},
|
||||
|
||||
// Show the FTP manager
|
||||
ftpManager: function() {
|
||||
get('mediaContainer').innerHTML = '<iframe src="' +
|
||||
this.iceLoc +
|
||||
'/lib/ftp-manager.php" id="ftpManagerIFrame" style="width: 620px; height: 550px"></iframe>';
|
||||
this.showHide('show', get('blackMask'));
|
||||
},
|
||||
|
||||
// Update the settings used when we make a change to them
|
||||
useNewSettings: function(settings) {
|
||||
let styleNode, thisCSS, strCSS, activeLineBG;
|
||||
let styleNode, thisCSS, strCSS, activeLineBG, activeLineNum;
|
||||
const lightThemes = ["base16-light", "chrome-devtools", "duotone-light", "eclipse", "eiffel", "elegant", "mdn-like", "idle", "iplastic", "ir_white", "johnny", "juicy", "neat", "neo", "solarized", "ttcn", "xq-light"];
|
||||
const darkThemes = ["3024-night", "all-hallow-eve", "black-pearl-ii", "blackboard", "colorforth", "django", "emacs-strict", "fade-to-grey", "fake", "glitterbomb", "isotope", "ir_black", "liquibyte", "monokai-fannonedition", "oceanic", "night", "spectacular", "sunburst", "the-matrix", "tomorrow-night-blue", "tomorrow-night-bright", "tomorrow-night-eighties", "vibrant-ink", "xq-dark", "zenburn"];
|
||||
|
||||
// Set iceRoot and update in settings display
|
||||
iceRoot = settings.iceRoot;
|
||||
this.content.contentWindow.document.getElementById('iceRootDisplay').innerText = "" !== iceRoot ? iceRoot : "[Default]";
|
||||
|
||||
// Cut out path prefix, .css file extension and ?microtime= querystring
|
||||
const newTheme = settings.themeURL.replace(/.+\/|.css.+/g, "");
|
||||
@@ -3708,14 +3912,25 @@ var ICEcoder = {
|
||||
// Set the active line color
|
||||
activeLineBG =
|
||||
// Light themes
|
||||
-1 < ["base16-light", "chrome-devtools", "duotone-light", "eclipse", "eiffel", "elegant", "mdn-like", "idle", "iplastic", "ir_white", "johnny", "juicy", "neat", "neo", "solarized", "ttcn", "xq-light"].indexOf(this.theme)
|
||||
-1 < lightThemes.indexOf(this.theme)
|
||||
? "#ccc"
|
||||
// Dark themes
|
||||
: -1 < ["3024-night", "all-hallow-eve", "black-pearl-ii", "blackboard", "colorforth", "django", "emacs-strict", "fade-to-grey", "fake", "glitterbomb", "isotope", "ir_black", "liquibyte", "monokai-fannonedition", "oceanic", "night", "spectacular", "sunburst", "the-matrix", "tomorrow-night-blue", "tomorrow-night-bright", "tomorrow-night-eighties", "vibrant-ink", "xq-dark", "zenburn"].indexOf(this.theme)
|
||||
: -1 < darkThemes.indexOf(this.theme)
|
||||
? "#222"
|
||||
// Other themes
|
||||
: "#000";
|
||||
|
||||
// Set the active line color
|
||||
activeLineNum =
|
||||
// Light themes
|
||||
-1 < lightThemes.indexOf(this.theme)
|
||||
? "#222"
|
||||
// Dark themes
|
||||
: -1 < darkThemes.indexOf(this.theme)
|
||||
? "#ccc"
|
||||
// Other themes
|
||||
: "#ccc";
|
||||
|
||||
// Check/uncheck Code Assist setting
|
||||
if (settings.codeAssist !== this.codeAssist) {
|
||||
this.codeAssistToggle();
|
||||
@@ -3745,6 +3960,7 @@ var ICEcoder = {
|
||||
thisCSS[strCSS][4].style['border-left-width'] = settings.visibleTabs ? '1px' : '0';
|
||||
thisCSS[strCSS][4].style['margin-left'] = settings.visibleTabs ? '-1px' : '0';
|
||||
thisCSS[strCSS][2].style.cssText = "background-color: " + activeLineBG + " !important";
|
||||
thisCSS[strCSS][5].style.cssText = "color: " + activeLineNum + " !important";
|
||||
|
||||
// Set many of the ICEcoder settings
|
||||
this.lineWrapping = settings.lineWrapping;
|
||||
@@ -3796,6 +4012,10 @@ var ICEcoder = {
|
||||
get('plugins').style.left = "left" === settings.pluginPanelAligned ? "0" : "auto";
|
||||
get('plugins').style.right = "right" === settings.pluginPanelAligned ? "0" : "auto";
|
||||
|
||||
// Enable/disable select next on find input and set goToLine scroll speed
|
||||
this.selectNextOnFindInput = settings.selectNextOnFindInput;
|
||||
this.goToLineScrollSpeed = settings.goToLineScrollSpeed;
|
||||
|
||||
// Restart bug checking
|
||||
this.bugFilePaths = settings.bugFilePaths;
|
||||
this.bugFileCheckTimer = settings.bugFileCheckTimer;
|
||||
@@ -3805,6 +4025,8 @@ var ICEcoder = {
|
||||
this.startBugChecking();
|
||||
} else {
|
||||
if ("undefined" != typeof this.bugFileCheckInt) {
|
||||
get('bugIcon').style.color = "";
|
||||
get('bugIcon').title = "Bug reporting not active";
|
||||
clearInterval(this.bugFileCheckInt);
|
||||
}
|
||||
}
|
||||
@@ -4016,9 +4238,7 @@ var ICEcoder = {
|
||||
|
||||
xhr.onreadystatechange=function() {
|
||||
if (4 === xhr.readyState && 200 === xhr.status) {
|
||||
// console.log(xhr.responseText);
|
||||
var statusArray = JSON.parse(xhr.responseText);
|
||||
// console.log(statusArray);
|
||||
|
||||
get('bugIcon').style.color =
|
||||
statusArray['result'] == "off" ? "" :
|
||||
@@ -4039,7 +4259,6 @@ var ICEcoder = {
|
||||
|
||||
}
|
||||
};
|
||||
// console.log('Calling '+bugCheckURL+' via XHR');
|
||||
xhr.open("GET", bugCheckURL, true);
|
||||
xhr.send();
|
||||
|
||||
@@ -4048,6 +4267,8 @@ var ICEcoder = {
|
||||
this.bugReportStatus = "ok";
|
||||
} else {
|
||||
if ("undefined" != typeof this.bugFileCheckInt) {
|
||||
get('bugIcon').style.color = "";
|
||||
get('bugIcon').title = "Bug reporting not active";
|
||||
clearInterval(this.bugFileCheckInt);
|
||||
}
|
||||
}
|
||||
@@ -4088,7 +4309,7 @@ var ICEcoder = {
|
||||
let winTitle;
|
||||
|
||||
if (false === this.loadingFile) {
|
||||
winTitle = "ICEcoder v" + this.versionNo;
|
||||
winTitle = "ICEcoder " + this.versionNo;
|
||||
for(let i = 1; i <= this.savedPoints.length; i++) {
|
||||
if (this.savedPoints[i-1] !== this.getcMInstance(i).changeGeneration()) {
|
||||
// We have an unsaved tab, indicate that in the title
|
||||
@@ -4338,7 +4559,7 @@ var ICEcoder = {
|
||||
: this.savedPoints[closeTabNum - 1] !== this.getcMInstance(closeTabNum).changeGeneration()
|
||||
)
|
||||
)) {
|
||||
okToRemove = this.ask(t['You have made...']);
|
||||
okToRemove = this.ask(t['You have made...'] + "\n\n" + this.openFiles[closeTabNum - 1]);
|
||||
}
|
||||
|
||||
if (true === okToRemove) {
|
||||
@@ -4382,6 +4603,8 @@ var ICEcoder = {
|
||||
// Grey out the view icon
|
||||
if (0 === this.openFiles.length) {
|
||||
this.fMIconVis('fMView', 0.3);
|
||||
// Also clear any find results
|
||||
this.clearResultsDisplays();
|
||||
} else {
|
||||
// Switch the mode & the tab
|
||||
this.switchMode();
|
||||
@@ -4409,6 +4632,9 @@ var ICEcoder = {
|
||||
|
||||
// Update the title tag to indicate any changes
|
||||
this.indicateChanges();
|
||||
|
||||
// Set bool value to false to avoid being stuck on true
|
||||
this.overCloseLink = false;
|
||||
}
|
||||
// Lastly, set the widths
|
||||
this.setTabWidths(true);
|
||||
@@ -4639,26 +4865,47 @@ var ICEcoder = {
|
||||
}
|
||||
},
|
||||
|
||||
// Focus/unfocus tab by contracting/expanding file manager
|
||||
focusUnfocusTab: function() {
|
||||
// Switch current lock state and change display of file manager
|
||||
ICEcoder.lockUnlockNav();
|
||||
this.changeFilesW(true === this.lockedNav ? 'expand' : 'contract');
|
||||
},
|
||||
|
||||
// ==
|
||||
// UI
|
||||
// ==
|
||||
|
||||
// Return bool of true if an Apple Mac Cmd key
|
||||
isCmdKey: function(key) {
|
||||
// Mac command key handling (224 = Moz, 91/93 = Webkit Left/Right Apple)
|
||||
return -1 < [224, 91, 93].indexOf(key);
|
||||
},
|
||||
|
||||
// Return bool of true if either CTRL or Cmd key is down
|
||||
ctrlCmdKeyDown: function(evt) {
|
||||
let key;
|
||||
|
||||
key = evt.keyCode ?? evt.which ?? evt.charCode;
|
||||
|
||||
// Return bool of true if either is true, false otherwise
|
||||
return evt.ctrlKey || this.isCmdKey(key);
|
||||
},
|
||||
|
||||
// Detect keys/combos plus identify our area and set the vars, perform actions
|
||||
interceptKeys: function(area, evt) {
|
||||
let key, ctrlOrCmd, cM, thisCM;
|
||||
|
||||
key = evt.keyCode ?? evt.which ?? evt.charCode;
|
||||
|
||||
// Mac command key handling
|
||||
this.cmdKey = this.isCmdKey(key);
|
||||
|
||||
// Reset the auto-logout timer
|
||||
this.resetAutoLogoutTimer();
|
||||
|
||||
// Mac command key handling (224 = Moz, 91/93 = Webkit Left/Right Apple)
|
||||
if (-1 < [224, 91, 93].indexOf(key)) {
|
||||
this.cmdKey = true;
|
||||
}
|
||||
|
||||
// Set bool based on CTRL or Cmd key being pressed
|
||||
ctrlOrCmd = -1 < [evt.ctrlKey, this.cmdKey].indexOf(true);
|
||||
ctrlOrCmd = this.ctrlCmdKeyDown(evt);
|
||||
|
||||
// F1 (zoom code out non declaration lines)
|
||||
if (112 === key) {
|
||||
@@ -4955,6 +5202,7 @@ var ICEcoder = {
|
||||
this.codeZoomedOut = false;
|
||||
}
|
||||
this.cmdKey = false;
|
||||
this.draggingWithKey = false;
|
||||
},
|
||||
|
||||
// Handle Enter and Escape keys in modals
|
||||
|
||||
@@ -21,6 +21,7 @@ var mode =
|
||||
: fileExt == "java" ? "text/x-java"
|
||||
: fileExt == "jl" ? "text/x-julia"
|
||||
: fileExt == "c" ? "text/x-csrc"
|
||||
: fileExt == "h" ? "text/x-csrc"
|
||||
: fileExt == "cpp" ? "text/x-c++src"
|
||||
: fileExt == "ino" ? "text/x-c++src"
|
||||
: fileExt == "cs" ? "text/x-csharp"
|
||||
|
||||
@@ -14,13 +14,13 @@ class Backup
|
||||
}
|
||||
|
||||
public function makeBackup($fileLoc, $fileName, $contents) {
|
||||
global $ftpSite, $t, $ICEcoder;
|
||||
global $t, $ICEcoder;
|
||||
|
||||
$backupDirFormat = "Y-m-d";
|
||||
|
||||
// Establish the base, host and date dir parts...
|
||||
$backupDirBase = str_replace("\\", "/", dirname(__FILE__)) . "/../data/backups/";
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite, PHP_URL_HOST) : "localhost";
|
||||
$backupDirHost = "localhost";
|
||||
$backupDirDate = date($backupDirFormat);
|
||||
|
||||
// Establish an array of dirs from base to our file location
|
||||
|
||||
188
classes/FTP.php
188
classes/FTP.php
@@ -1,188 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace ICEcoder;
|
||||
|
||||
use ICEcoder\System;
|
||||
|
||||
class FTP
|
||||
{
|
||||
private $systemClass;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->systemClass = new System();
|
||||
}
|
||||
|
||||
public function writeFile() {
|
||||
global $fileLoc, $fileName, $ftpConn, $ftpRoot, $ftpHost, $ftpMode, $ICEcoder, $doNext, $filemtime, $tabNum;
|
||||
|
||||
$ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
|
||||
if (isset($_POST['changes'])) {
|
||||
// Get existing file contents as lines
|
||||
$loadedFile = toUTF8noBOM($this->ftpGetContents($ftpConn, $ftpRoot . $fileLoc . "/" . $fileName, $ftpMode), false);
|
||||
$fileLines = explode("\n", str_replace("\r", "", $loadedFile));
|
||||
// Need to add a new line at the end of each because explode will lose them,
|
||||
// want want to end up with same array that 'file($file)' produces for a local file
|
||||
// - it keeps the line endings at the end of each array item
|
||||
for ($i = 0; $i < count($fileLines); $i++) {
|
||||
if ($i < count($fileLines) - 1) {
|
||||
$fileLines[$i] .= $ICEcoder["lineEnding"];
|
||||
}
|
||||
}
|
||||
// Stitch changes onto it
|
||||
$contents = $this->systemClass->stitchChanges($fileLines, $_POST['changes']);
|
||||
|
||||
// get old file contents and count stats on usage \n and \r there
|
||||
// in this case we can keep line endings, which file had before, without
|
||||
// making code version control systems going crazy about line endings change in whole file.
|
||||
$unixNewLines = preg_match_all('/[^\r][\n]/u', $loadedFile);
|
||||
$windowsNewLines = preg_match_all('/[\r][\n]/u', $loadedFile);
|
||||
} else {
|
||||
$contents = $_POST['contents'];
|
||||
}
|
||||
|
||||
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
|
||||
$contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents);
|
||||
$contents = str_replace("\r", $ICEcoder["lineEnding"], $contents);
|
||||
$contents = str_replace("\n", $ICEcoder["lineEnding"], $contents);
|
||||
if (isset($_POST['changes']) && ($unixNewLines > 0) || ($windowsNewLines > 0)) {
|
||||
if ($unixNewLines > $windowsNewLines){
|
||||
$contents = str_replace($ICEcoder["lineEnding"], "\n", $contents);
|
||||
} elseif ($windowsNewLines > $unixNewLines){
|
||||
$contents = str_replace($ICEcoder["lineEnding"], "\r\n", $contents);
|
||||
}
|
||||
}
|
||||
// Write our file contents
|
||||
if (!$this->ftpWriteFile($ftpConn, $ftpFilepath, $contents, $ftpMode)) {
|
||||
$doNext .= 'ICEcoder.message("Sorry, could not write ' . $ftpFilepath . ' at ' . $ftpHost . '");';
|
||||
} else {
|
||||
$doNext .= 'ICEcoder.openFileMDTs[' . ($tabNum - 1) .']="' . $filemtime . '";';
|
||||
$doNext .= '(function() {var x = ICEcoder.openFileVersions; var y = ' . ($tabNum - 1) .'; x[y] = "undefined" != typeof x[y] ? x[y] + 1 : 1})(); ICEcoder.updateVersionsDisplay();';
|
||||
}
|
||||
}
|
||||
|
||||
// Start a FTP connection
|
||||
function ftpStart()
|
||||
{
|
||||
global $ftpConn, $ftpLogin, $ftpHost, $ftpUser, $ftpPass, $ftpPasv;
|
||||
|
||||
// Establish connection, login and maybe use pasv
|
||||
$ftpConn = ftp_connect($ftpHost);
|
||||
$ftpLogin = ftp_login($ftpConn, $ftpUser, $ftpPass);
|
||||
if ($ftpPasv) {
|
||||
ftp_pasv($ftpConn, true);
|
||||
}
|
||||
}
|
||||
|
||||
// End a FTP connection
|
||||
function ftpEnd()
|
||||
{
|
||||
global $ftpConn;
|
||||
|
||||
ftp_close($ftpConn);
|
||||
}
|
||||
|
||||
// Get dir/file lists (simple and detailed) from FTP detailed rawlist response
|
||||
function ftpGetList($ftpConn, $directory = '.')
|
||||
{
|
||||
$simpleList = $detailedList = array();
|
||||
// If we have a FTP rawlist to work with
|
||||
if (is_array($rows = @ftp_rawlist($ftpConn, $directory))) {
|
||||
foreach ($rows as $row) {
|
||||
// Split row up by spaces and set keys on $item array
|
||||
$chunks = preg_split("/\s+/", $row);
|
||||
list($item['rights'], $item['number'], $item['user'], $item['group'], $item['size'], $item['month'], $item['day'], $item['time']) = $chunks;
|
||||
// Also set if this is a dir or file
|
||||
$item['type'] = $chunks[0][0] === 'd' ? 'directory' : 'file';
|
||||
// Splice the array and finally work out $simpleList and $detailedList
|
||||
array_splice($chunks, 0, 8);
|
||||
$detailedList[implode(" ", $chunks)] = $item;
|
||||
$simpleList[] = implode(" ", $chunks);
|
||||
}
|
||||
// Return simple array list and detailed items list also
|
||||
return array('simpleList' => $simpleList, 'detailedList' => $detailedList);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get detailed info on a file from returned info from ftpGetList
|
||||
function ftpGetFileInfo($ftpConn, $directory = '.', $fileName)
|
||||
{
|
||||
// Get both sets of arrays back and get our detailed list
|
||||
$ftpListArrays = $this->ftpGetList($ftpConn, $directory);
|
||||
$detailedList = $ftpListArrays['detailedList'];
|
||||
|
||||
// Now get the file info for our file
|
||||
$fileInfo = $detailedList[$fileName];
|
||||
|
||||
// Return the info
|
||||
return $fileInfo;
|
||||
}
|
||||
|
||||
// Get contents over FTP
|
||||
function ftpGetContents($ftpConn, $filepath, $ftpMode)
|
||||
{
|
||||
// Create temp handler, this type needed for extended char set
|
||||
$tempHandle = fopen('php://temp', 'r+');
|
||||
|
||||
// Get file from FTP assuming that it exists
|
||||
ftp_fget($ftpConn, $tempHandle, $filepath, $ftpMode, 0);
|
||||
|
||||
// Return our content
|
||||
return stream_get_contents($tempHandle, -1, 0);
|
||||
}
|
||||
|
||||
// Write file contents over FTP
|
||||
function ftpWriteFile($ftpConn, $filepath, $contents, $ftpMode)
|
||||
{
|
||||
// Create temp handler, this type needed for extended char set
|
||||
$tempHandle = fopen('php://temp', 'r+');
|
||||
|
||||
// Write contents to handle and rewind head
|
||||
fwrite($tempHandle, $contents);
|
||||
rewind($tempHandle);
|
||||
|
||||
// Write our content and return true/false
|
||||
return ftp_fput($ftpConn, $filepath, $tempHandle, $ftpMode, 0);
|
||||
}
|
||||
|
||||
// Make a new dir over FTP
|
||||
function ftpMkDir($ftpConn, $perms, $dir)
|
||||
{
|
||||
// Create the new dir
|
||||
if (!ftp_mkdir($ftpConn, $dir)) {
|
||||
return false;
|
||||
} else {
|
||||
// Also then set perms (we must be able to do that if we created dir, so can always return true)
|
||||
$this->ftpPerms($ftpConn, $perms, $dir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Rename a dir/dile over FTP
|
||||
function ftpRename($ftpConn, $oldPath, $newPath)
|
||||
{
|
||||
// Return success status of rename
|
||||
return ftp_rename($ftpConn, $oldPath, $newPath);
|
||||
}
|
||||
|
||||
// Change dir/file perms over FTP
|
||||
function ftpPerms($ftpConn, $perms, $filePath)
|
||||
{
|
||||
// Return success status of perms change
|
||||
return ftp_chmod($ftpConn, $perms, $filePath);
|
||||
}
|
||||
|
||||
// Delete dir/file over FTP
|
||||
function ftpDelete($ftpConn, $type, $path)
|
||||
{
|
||||
if ($type == "file") {
|
||||
// Delete our file and return true/false
|
||||
return ftp_delete($ftpConn, $path);
|
||||
} else {
|
||||
// Delete our dir and return true/false
|
||||
return ftp_rmdir($ftpConn, $path);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,26 +4,24 @@ namespace ICEcoder;
|
||||
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use ICEcoder\FTP;
|
||||
use ICEcoder\System;
|
||||
use scssc;
|
||||
use lessc;
|
||||
|
||||
class File
|
||||
{
|
||||
private $ftpClass;
|
||||
private $systemClass;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ftpClass = new FTP();
|
||||
$this->systemClass = new System();
|
||||
}
|
||||
|
||||
public function check() {
|
||||
global $file, $fileOrig, $docRoot, $iceRoot, $fileLoc, $fileName, $error, $errorStr, $errorMsg;
|
||||
// Replace pipes with slashes, then establish the actual name as we may have HTML entities in filename
|
||||
$file = html_entity_decode(str_replace("|", "/", $file));
|
||||
// Infact we may have &lt; which when decoded is < and decoded again is original < so decoding twice is needed
|
||||
$file = html_entity_decode(html_entity_decode(str_replace("|", "/", $file)));
|
||||
|
||||
// Put the original $file var aside for use
|
||||
$fileOrig = $file;
|
||||
@@ -67,7 +65,7 @@ class File
|
||||
// On the banned file/dir list
|
||||
($bannedFileFound) ||
|
||||
// A local folder that isn't the doc root or starts with the doc root
|
||||
("getRemoteFile" !== $_GET['action'] && !isset($ftpSite) &&
|
||||
("getRemoteFile" !== $_GET['action'] &&
|
||||
rtrim($allFiles[$i], "/") !== rtrim($docRoot, "/") &&
|
||||
true === realpath(rtrim(dirname($allFiles[$i]), "/")) &&
|
||||
0 !== strpos(realpath(rtrim(dirname($allFiles[$i]), "/")), realpath(rtrim($docRoot, "/")))
|
||||
@@ -111,7 +109,7 @@ class File
|
||||
}
|
||||
|
||||
public function load() {
|
||||
global $file, $fileLoc, $fileName, $t, $ftpConn, $ftpHost, $ftpLogin, $ftpRoot, $ftpUser, $ftpMode;
|
||||
global $file, $fileLoc, $fileName, $t, $lineNumber;
|
||||
echo 'action="load";';
|
||||
$lineNumber = max(isset($_REQUEST['lineNumber']) ? intval($_REQUEST['lineNumber']) : 1, 1);
|
||||
// Check this file isn't on the banned list at all
|
||||
@@ -124,10 +122,10 @@ class File
|
||||
|
||||
if (false === $canOpen) {
|
||||
echo 'fileType="nothing"; parent.parent.ICEcoder.message(\'' . $t['Sorry, could not...'] . ' ' . $fileLoc . "/" . $fileName . '\');';
|
||||
} elseif (isset($ftpSite) || file_exists($file)) {
|
||||
} elseif (file_exists($file)) {
|
||||
$finfo = "text";
|
||||
// Determine what to do based on mime type
|
||||
if (!isset($ftpSite) && function_exists('finfo_open')) {
|
||||
if (function_exists('finfo_open')) {
|
||||
$finfoMIME = finfo_open(FILEINFO_MIME);
|
||||
$finfo = finfo_file($finfoMIME, $file);
|
||||
finfo_close($finfoMIME);
|
||||
@@ -144,20 +142,9 @@ class File
|
||||
if (0 === strpos($finfo, "text") || 0 === strpos($finfo, "application/json") || 0 === strpos($finfo, "application/xml") || false !== strpos($finfo, "empty")) {
|
||||
echo 'fileType="text";';
|
||||
|
||||
// Get file over FTP?
|
||||
if (isset($ftpSite)) {
|
||||
$this->ftpClass->ftpStart();
|
||||
// Show user warning if no good connection
|
||||
if (!$ftpConn || !$ftpLogin) {
|
||||
die('parent.parent.ICEcoder.message("Sorry, no FTP connection to ' . $ftpHost . ' for user ' . $ftpUser . '");parent.parent.ICEcoder.serverMessage();parent.parent.ICEcoder.serverQueue("del");</script>');
|
||||
}
|
||||
// Get our file contents and close the FTP connection
|
||||
$loadedFile = toUTF8noBOM($this->ftpClass->ftpGetContents($ftpConn, $ftpRoot . $fileLoc . "/" . $fileName, $ftpMode), false);
|
||||
$this->ftpClass->ftpEnd();
|
||||
// Get local file
|
||||
} else {
|
||||
$loadedFile = toUTF8noBOM(getData($file), true);
|
||||
}
|
||||
// Get data from file
|
||||
$loadedFile = toUTF8noBOM(getData($file), true);
|
||||
|
||||
$encoding = ini_get("default_charset");
|
||||
if ("" == $encoding) {
|
||||
$encoding = "UTF-8";
|
||||
@@ -186,7 +173,7 @@ class File
|
||||
|
||||
$script = 'if ("text" === fileType) {';
|
||||
|
||||
if (isset($ftpSite) || file_exists($file)) {
|
||||
if (file_exists($file)) {
|
||||
$script .= '
|
||||
setTimeout(function() {
|
||||
if (!parent.parent.ICEcoder.content.contentWindow.createNewCMInstance) {
|
||||
@@ -247,7 +234,7 @@ class File
|
||||
parent.parent.document.getElementById(\'blackMask\').style.visibility = "visible";
|
||||
parent.parent.document.getElementById(\'mediaContainer\').innerHTML =
|
||||
"<canvas id=\"canvasPicker\" width=\"1\" height=\"1\" style=\"position: absolute; margin: 10px 0 0 10px; cursor: crosshair\"></canvas>" +
|
||||
"<img src=\"' . ((isset($ftpSite) ? $ftpSite : "") . $fileLoc . "/" . $fileName . "?unique=" . microtime(true)) .'\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url(\'assets/images/checkerboard.png\')\" onLoad=\"reducedImgMsg = (this.naturalWidth > 700 || this.naturalHeight > 500) ? \', ' .$t['displayed at'] . '\' + this.width + \' x \' + this.height : \'\'; document.getElementById(\'imgInfo\').innerHTML += \' (\' + this.naturalWidth + \' x \' + this.naturalHeight + reducedImgMsg + \')\'; ICEcoder.initCanvasImage(this); ICEcoder.interactCanvasImage(this)\"><br>" +
|
||||
"<img src=\"' . $fileLoc . "/" . $fileName . "?unique=" . microtime(true) .'\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url(\'assets/images/checkerboard.png\')\" onLoad=\"reducedImgMsg = (this.naturalWidth > 700 || this.naturalHeight > 500) ? \', ' .$t['displayed at'] . '\' + this.width + \' x \' + this.height : \'\'; document.getElementById(\'imgInfo\').innerHTML += \' (\' + this.naturalWidth + \' x \' + this.naturalHeight + reducedImgMsg + \')\'; ICEcoder.initCanvasImage(this); ICEcoder.interactCanvasImage(this)\"><br>" +
|
||||
"<div style=\"display: inline-block; margin-top: -10px; border: solid 10px #fff; color: #000; background-color: #fff\" id=\"imgInfo\" onmouseover=\"parent.parent.ICEcoder.overPopup=true\" onmouseout=\"parent.parent.ICEcoder.overPopup=false\">" +
|
||||
"<b>' . $fileLoc . "/" . $fileName . '</b>" +
|
||||
"</div><br>" +
|
||||
@@ -273,7 +260,6 @@ class File
|
||||
$fileName = $fileDetails['fileName'];
|
||||
$fileMDTURLPart = $fileDetails['fileMDTURLPart'];
|
||||
$fileVersionURLPart = $fileDetails['fileVersionURLPart'];
|
||||
$ftpSite = $fileDetails['ftpSite'];
|
||||
|
||||
$doNext = '
|
||||
ICEcoder.serverMessage();
|
||||
@@ -300,7 +286,7 @@ class File
|
||||
|
||||
/* Saving under conditions: Confirmation of overwrite or there is no filename conflict, it is a new file, in either case we can save */
|
||||
if (overwriteOK || noConflictSave) {
|
||||
newFileName = "' . (true === $ftpSite ? "" : $docRoot) . '" + newFileName;
|
||||
newFileName = "' . $docRoot . '" + newFileName;
|
||||
saveURL = "lib/file-control.php?action=save' . $fileMDTURLPart . $fileVersionURLPart . '&csrf=' . $_GET["csrf"] . '";
|
||||
|
||||
var xhr = ICEcoder.xhrObj();
|
||||
@@ -386,7 +372,7 @@ class File
|
||||
fclose($fh);
|
||||
|
||||
if ($setPerms) {
|
||||
chmod($file, octdec($ICEcoder['newFilePerms']));
|
||||
chmod($file, octdec((string) $ICEcoder['newFilePerms']));
|
||||
}
|
||||
clearstatcache();
|
||||
$filemtime = "Windows" !== $serverType ? filemtime($file) : "1000000";
|
||||
@@ -493,12 +479,12 @@ class File
|
||||
if (is_dir($source)) {
|
||||
$fileOrFolder = "folder";
|
||||
if (!is_dir($dest)) {
|
||||
mkdir($dest, octdec($ICEcoder['newDirPerms']));
|
||||
mkdir($dest, octdec((string) $ICEcoder['newDirPerms']));
|
||||
} else {
|
||||
for ($i = 2; $i < 1000000000; $i++) {
|
||||
if (!is_dir($dest . " (" . $i . ")")) {
|
||||
$dest = $dest." (" . $i . ")";
|
||||
mkdir($dest, octdec($ICEcoder['newDirPerms']));
|
||||
mkdir($dest, octdec((string) $ICEcoder['newDirPerms']));
|
||||
$i = 1000000000;
|
||||
}
|
||||
}
|
||||
@@ -508,7 +494,7 @@ class File
|
||||
RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||
) {
|
||||
if ($item->isDir()) {
|
||||
mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), octdec($ICEcoder['newDirPerms']));
|
||||
mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), octdec((string) $ICEcoder['newDirPerms']));
|
||||
} else {
|
||||
copy($item->getPathName(), $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
|
||||
}
|
||||
@@ -564,8 +550,8 @@ class File
|
||||
|
||||
$uploadDir = $docRoot . $iceRoot . str_replace("..", "", str_replace("|", "/", $_POST['folder'] . "/"));
|
||||
foreach($uploads as $current) {
|
||||
$uploadedFile = $uploadDir . $current->name;
|
||||
$fileName = $current->name;
|
||||
$uploadedFile = $uploadDir . $current['name'];
|
||||
$fileName = $current['name'];
|
||||
// Get & set existing perms for existing files, or set to newFilePerms setting for new files
|
||||
if (file_exists($uploadedFile)) {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($uploadedFile)), -4);
|
||||
@@ -586,8 +572,8 @@ class File
|
||||
}
|
||||
|
||||
private function uploadThisFile($current, $uploadFile, $setPerms){
|
||||
if (move_uploaded_file($current->tmp_name, $uploadFile)){
|
||||
chmod($uploadFile, octdec($setPerms));
|
||||
if (move_uploaded_file($current['tmp_name'], $uploadFile)){
|
||||
chmod($uploadFile, octdec((string) $setPerms));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -596,10 +582,11 @@ class File
|
||||
public function getUploadedDetails($fileArr) {
|
||||
$uploads = [];
|
||||
foreach($fileArr['name'] as $keyee => $info) {
|
||||
$uploads[$keyee]->name = xssClean($fileArr['name'][$keyee], "html");
|
||||
$uploads[$keyee]->type = $fileArr['type'][$keyee];
|
||||
$uploads[$keyee]->tmp_name = $fileArr['tmp_name'][$keyee];
|
||||
$uploads[$keyee]->error = $fileArr['error'][$keyee];
|
||||
$uploads[$keyee] = [];
|
||||
$uploads[$keyee]['name'] = xssClean($fileArr['name'][$keyee], "html");
|
||||
$uploads[$keyee]['type'] = $fileArr['type'][$keyee];
|
||||
$uploads[$keyee]['tmp_name'] = $fileArr['tmp_name'][$keyee];
|
||||
$uploads[$keyee]['error'] = $fileArr['error'][$keyee];
|
||||
}
|
||||
return $uploads;
|
||||
}
|
||||
@@ -721,26 +708,13 @@ class File
|
||||
}
|
||||
|
||||
public function returnJSON() {
|
||||
global $ftpSite, $ftpConn, $fileLoc, $fileName, $ftpRoot, $file, $filemtime, $finalAction, $timeStart, $error, $errorStr, $errorMsg, $doNext;
|
||||
global $fileLoc, $fileName, $file, $filemtime, $finalAction, $timeStart, $error, $errorStr, $errorMsg, $doNext;
|
||||
|
||||
if (isset($ftpSite)) {
|
||||
// Get info on dir/file now
|
||||
$ftpFileDirInfo = $this->ftpClass->ftpGetFileInfo($ftpConn, ltrim($fileLoc, "/"), $fileName);
|
||||
// End the connection
|
||||
$this->ftpClass->ftpEnd();
|
||||
// Then set info
|
||||
$itemAbsPath = $ftpRoot . $fileLoc . '/' . $fileName;
|
||||
$itemPath = dirname($ftpRoot.$fileLoc . '/' . $fileName);
|
||||
$itemBytes = $ftpFileDirInfo['size'];
|
||||
$itemType = (isset($ftpFileDirInfo['type']) ? ("directory" === $ftpFileDirInfo['type'] ? "dir" : "file") : "unknown");
|
||||
$itemExists = (isset($ftpFileDirInfo['type']) ? "true" : "false");
|
||||
} else {
|
||||
$itemAbsPath = $file;
|
||||
$itemPath = dirname($file);
|
||||
$itemBytes = is_dir($file) || !file_exists($file) ? null : filesize($file);
|
||||
$itemType = (file_exists($file) ? (is_dir($file) ? "dir" : "file") : "unknown");
|
||||
$itemExists = (file_exists($file) ? "true" : "false");
|
||||
}
|
||||
$itemAbsPath = $file;
|
||||
$itemPath = dirname($file);
|
||||
$itemBytes = is_dir($file) || !file_exists($file) ? null : filesize($file);
|
||||
$itemType = (file_exists($file) ? (is_dir($file) ? "dir" : "file") : "unknown");
|
||||
$itemExists = (file_exists($file) ? "true" : "false");
|
||||
|
||||
return '{
|
||||
"file": {
|
||||
|
||||
@@ -7,10 +7,17 @@ class Settings
|
||||
public function __construct()
|
||||
{
|
||||
// Set version number and document root as core settings
|
||||
$this->versionNo = "8.0";
|
||||
$this->versionNo = "8.1";
|
||||
$this->docRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||
}
|
||||
|
||||
public function getCoreDetails()
|
||||
{
|
||||
return [
|
||||
"versionNo" => $this->versionNo,
|
||||
"docRoot" => $this->docRoot,
|
||||
];
|
||||
}
|
||||
|
||||
// ========
|
||||
// DATA DIR
|
||||
@@ -37,7 +44,7 @@ class Settings
|
||||
// GLOBAL CONFIG
|
||||
// =============
|
||||
|
||||
public function getConfigGlobalTemplate()
|
||||
public function getConfigGlobalTemplate($asArray)
|
||||
{
|
||||
// Return the serialized global config template
|
||||
$fileName = 'template-config-global.php';
|
||||
@@ -46,6 +53,9 @@ class Settings
|
||||
opcache_invalidate($fullPath, true);
|
||||
}
|
||||
$settings = file_get_contents($fullPath);
|
||||
if ($asArray) {
|
||||
$settings = $this->serializedFileData("get", $fullPath);
|
||||
}
|
||||
return $settings;
|
||||
}
|
||||
|
||||
@@ -73,9 +83,7 @@ class Settings
|
||||
public function getConfigGlobalSettings()
|
||||
{
|
||||
// Start an array with version number and document root
|
||||
$settings = [];
|
||||
$settings['versionNo'] = $this->versionNo;
|
||||
$settings['docRoot'] = $this->docRoot;
|
||||
$settings = $this->getCoreDetails();
|
||||
// Get global config file details
|
||||
$fullPath = $this->getConfigGlobalFileDetails()['fullPath'];
|
||||
$settingsFromFile = $this->serializedFileData("get", $fullPath);
|
||||
@@ -113,7 +121,7 @@ class Settings
|
||||
// USERS CONFIG
|
||||
// ============
|
||||
|
||||
public function getConfigUsersTemplate()
|
||||
public function getConfigUsersTemplate($asArray)
|
||||
{
|
||||
// Return the serialized users config template
|
||||
$fileName = 'template-config-users.php';
|
||||
@@ -122,6 +130,9 @@ class Settings
|
||||
opcache_invalidate($fullPath, true);
|
||||
}
|
||||
$settings = file_get_contents($fullPath);
|
||||
if ($asArray) {
|
||||
$settings = $this->serializedFileData("get", $fullPath);
|
||||
}
|
||||
return $settings;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ namespace ICEcoder;
|
||||
|
||||
class System
|
||||
{
|
||||
/**
|
||||
* @param $name
|
||||
*/
|
||||
public function functionEnabled($name) {
|
||||
return is_callable($name) && false === stripos(ini_get('disable_functions'), $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
*/
|
||||
@@ -14,6 +21,16 @@ class System
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
*/
|
||||
private function createFileIfNotExists($path)
|
||||
{
|
||||
if (false === file_exists($path)) {
|
||||
touch($path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -33,6 +50,7 @@ class System
|
||||
ini_set('log_errors', '1');
|
||||
$this->createDirIfNotExists(dirname(__FILE__) . '/../data/logs');
|
||||
$this->createDirIfNotExists(dirname(__FILE__) . '/../data/logs/error');
|
||||
$this->createFileIfNotExists(dirname(__FILE__) . '/../data/logs/error/error.log');
|
||||
ini_set('error_log', dirname(__FILE__) . '/../data/logs/error/error.log');
|
||||
error_reporting(-1);
|
||||
}
|
||||
|
||||
35
editor.php
35
editor.php
@@ -7,7 +7,7 @@ $t = $text['editor'];
|
||||
|
||||
<html style="margin: 0" onmousedown="parent.ICEcoder.mouseDown = true; parent.ICEcoder.resetAutoLogoutTimer()" onmouseup="parent.ICEcoder.mouseDown = false; parent.ICEcoder.mouseDownInCM = false; parent.ICEcoder.resetAutoLogoutTimer(); if (!parent.ICEcoder.overCloseLink) {parent.ICEcoder.tabDragEnd()}" onmousemove="if (parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'editor'); parent.ICEcoder.functionArgsTooltip(event, 'editor'); parent.ICEcoder.resetAutoLogoutTimer(); parent.ICEcoder.canResizeFilesW()}" ondrop="if (parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'editor')}">
|
||||
<head>
|
||||
<title>ICEcoder v<?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" href="assets/css/codemirror.css?microtime=<?php echo microtime(true);?>">
|
||||
@@ -42,12 +42,15 @@ echo "?microtime=" . microtime(true);
|
||||
// Light themes
|
||||
if (false !== array_search($ICEcoder["theme"], ["base16-light", "chrome-devtools", "duotone-light", "eclipse", "eiffel", "elegant", "mdn-like", "idle", "iplastic", "ir_white", "johnny", "juicy", "neat", "neo", "solarized", "ttcn", "xq-light"])) {
|
||||
$activeLineBG = "#ccc";
|
||||
$activeLineNum = "#222";
|
||||
// Dark themes
|
||||
} elseif (false !== array_search($ICEcoder["theme"], ["3024-night", "all-hallow-eve", "black-pearl-ii", "blackboard", "colorforth", "django", "emacs-strict", "fade-to-grey", "fake", "glitterbomb", "isotope", "ir_black", "liquibyte", "monokai-fannonedition", "oceanic", "night", "spectacular", "sunburst", "the-matrix", "tomorrow-night-blue", "tomorrow-night-bright", "tomorrow-night-eighties", "vibrant-ink", "xq-dark", "zenburn"])) {
|
||||
$activeLineBG = "#222";
|
||||
$activeLineNum = "#ccc";
|
||||
// Other themes
|
||||
} else {
|
||||
$activeLineBG = "#000";
|
||||
$activeLineNum = "#ccc";
|
||||
}
|
||||
?>">
|
||||
<script src="assets/js/mmd.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
@@ -63,6 +66,8 @@ if (false !== array_search($ICEcoder["theme"], ["base16-light", "chrome-devtools
|
||||
.cm-matchhighlight, .CodeMirror-focused .cm-matchhighlight {color: #fff !important; background: #06c !important}
|
||||
/* Make sure this next one remains the 5th item, updated with JS */
|
||||
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.15)}
|
||||
/* Make sure this next one remains the 6th item, updated with JS */
|
||||
.cm-s-activeLine + .CodeMirror-gutter-wrapper > .CodeMirror-linenumber {color: <?php echo $activeLineNum;?> !important}
|
||||
.cm-trailingspace {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
@@ -79,26 +84,18 @@ if (false !== array_search($ICEcoder["theme"], ["base16-light", "chrome-devtools
|
||||
.CodeMirror-foldgutter-folded {background: #800; color: #ddd}
|
||||
.CodeMirror-foldgutter-folded:after {position: relative; top: -4px}
|
||||
h2 {color: rgba(0,198,255,0.7)}
|
||||
.heading {color: #888}
|
||||
.cm-s-diff {left: 50%}
|
||||
.diffGreen {background: #0b0 !important; color: #000 !important}
|
||||
.diffRed {background: #800 !important; color: #fff !important}
|
||||
.diffGrey {background: #444 !important; color: #fff !important}
|
||||
.diffGreyLighter {background: #888 !important; color: #1d1d1b !important}
|
||||
.diffNone {}
|
||||
.info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
|
||||
.dataItems {float: left; line-height: 14px}
|
||||
.dataItems span {line-height: 21px}
|
||||
</style>
|
||||
<link rel="stylesheet" href="assets/css/editor.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="assets/css/file-types.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="assets/css/file-type-icons.css?microtime=<?php echo microtime(true);?>">
|
||||
</head>
|
||||
|
||||
<body style="color: #fff; margin: 0" onkeydown="return parent.ICEcoder.interceptKeys('content', event);" onkeyup="parent.ICEcoder.resetKeys(event);" onblur="parent.ICEcoder.resetKeys(event);" oncontextmenu="return false">
|
||||
|
||||
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
|
||||
<div class="dataMessage" id="dataMessage"></div>
|
||||
|
||||
<div style="margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
|
||||
<div class="dataItemsContainer">
|
||||
<div class="dataItems" style="width: 300px; margin-right: 50px">
|
||||
<h2><?php echo $t['server'];?></h2>
|
||||
<span class="heading"><?php echo $t['Server name, OS...'];?></span><br>
|
||||
@@ -115,7 +112,7 @@ h2 {color: rgba(0,198,255,0.7)}
|
||||
<span class="heading"><?php echo $t['Root'];?></span><br>
|
||||
<?php echo $docRoot;?><br><br>
|
||||
<span class="heading"><?php echo $t['ICEcoder root'];?></span><br>
|
||||
<?php echo "" !== $iceRoot ? $iceRoot : "[Default]";?><br><br>
|
||||
<div id="iceRootDisplay"><?php echo "" !== $iceRoot ? $iceRoot : "[Default]";?></div><br><br>
|
||||
<span class="heading"><?php echo $t['PHP version'];?></span><br>
|
||||
<?php echo phpversion();?><br><br>
|
||||
<span class="heading"><?php echo $t['Date & time'];?></span><br>
|
||||
@@ -162,11 +159,11 @@ h2 {color: rgba(0,198,255,0.7)}
|
||||
<?php
|
||||
// If we have a .git dir, get the Git short commit hash to display as a link
|
||||
$gitCommitTextLink = "";
|
||||
if (is_dir(dirname(__FILE__) . "/.git")) {
|
||||
$gitCommit = trim(exec('git log --pretty="%h" -n1 HEAD'));
|
||||
if (true === $systemClass->functionEnabled("shell_exec") && is_dir(dirname(__FILE__) . "/.git")) {
|
||||
$gitCommit = trim(shell_exec('git log --pretty="%h" -n1 HEAD'));
|
||||
$gitCommitTextLink = ' (Git commit: <a href="https://github.com/icecoder/ICEcoder/commit/' . $gitCommit . '" style="color: #eee; text-decoration: none" target="_blank">' . $gitCommit . '</a>)';
|
||||
}
|
||||
echo "v" . $ICEcoder["versionNo"] . $gitCommitTextLink;
|
||||
echo $ICEcoder["versionNo"] . $gitCommitTextLink;
|
||||
?><br><br>
|
||||
<span class="heading"><?php echo $t['codemirror version'];?></span><br>
|
||||
<script>
|
||||
@@ -272,7 +269,7 @@ function createNewCMInstance(num) {
|
||||
function createNewCMInstanceEvents(num, pane) {
|
||||
window['cM' + num + pane].on("focus", function(thisCM) {parent.ICEcoder.cMonFocus(thisCM, 'cM' + num + pane)});
|
||||
window['cM' + num + pane].on("blur", function(thisCM) {parent.ICEcoder.cMonBlur(thisCM, 'cM' + num + pane)});
|
||||
window['cM' + num + pane].on("keyup", function(thisCM) {parent.ICEcoder.cMonKeyUp(thisCM, 'cM' + num + pane)});
|
||||
window['cM' + num + pane].on("keyup", function(thisCM, evt) {parent.ICEcoder.cMonKeyUp(thisCM, 'cM' + num + pane, evt)});
|
||||
window['cM' + num + pane].on("cursorActivity", function(thisCM) {parent.ICEcoder.cMonCursorActivity(thisCM, 'cM' + num + pane)});
|
||||
window['cM' + num + pane].on("beforeSelectionChange", function(thisCM, changeObj) {parent.ICEcoder . prevLine = thisCM.getCursor().line;});
|
||||
window['cM' + num + pane].on("change", function(thisCM, changeObj) {parent.ICEcoder.cMonChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
|
||||
@@ -289,7 +286,7 @@ function createNewCMInstanceEvents(num, pane) {
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="position: absolute; display: none; width: 12px; height: 100%; top: 0; right: 0; overflow: hidden; pointer-events: none; z-index: 2" id="resultsBar"></div>
|
||||
<div class="resultsBar" id="resultsBar"></div>
|
||||
|
||||
<script>
|
||||
CodeMirror.commands.autocomplete = function(cM) {
|
||||
@@ -316,7 +313,7 @@ parent.ICEcoder.switchMode = function(mode) {
|
||||
cMdiff.setOption("mode", mode);
|
||||
}
|
||||
} else if (cM && fileName) {
|
||||
<?php include(dirname(__FILE__) . "/assets/js/language-modes-partial.js");?>
|
||||
<?php include(dirname(__FILE__) . "/assets/js/language-modes-partial.js");?>
|
||||
if (mode != cM.getOption("mode")) {
|
||||
cM.setOption("mode", mode);
|
||||
cM.setOption("lint", ("js" === fileExt || "json" === fileExt) && parent.ICEcoder.codeAssist ? true : false);
|
||||
|
||||
18
files.php
18
files.php
@@ -7,7 +7,7 @@ $t = $text['files'];
|
||||
|
||||
<html onmousedown="parent.ICEcoder.mouseDown = true; parent.ICEcoder.resetAutoLogoutTimer(); parent.ICEcoder.boxSelect(event, 'down')" onmouseup="parent.ICEcoder.mouseDown = false; parent.ICEcoder.resetAutoLogoutTimer(); parent.ICEcoder.mouseDownInCM = false; parent.ICEcoder.boxSelect(event, 'up'); if (!parent.ICEcoder.overCloseLink) {parent.ICEcoder.tabDragEnd()}" onmousemove="if (parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'files'); parent.ICEcoder.resetAutoLogoutTimer(); parent.ICEcoder.canResizeFilesW(); parent.ICEcoder.boxSelect(event, 'drag')}" ondrop="if (parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'files')}" oncontextmenu="parent.ICEcoder.selectFileFolder(event); return parent.ICEcoder.showMenu(event)" onclick="if (!parent.ICEcoder.fmDraggedBox) {parent.ICEcoder.selectFileFolder(event)} else {parent.ICEcoder.fmDraggedBox = false}" ondragstart="parent.ICEcoder.selectFileFolder(event);" ondragover="event.preventDefault(); event.stopPropagation()">
|
||||
<head>
|
||||
<title>ICEcoder v<?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/resets.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/files.css?microtime=<?php echo microtime(true);?>">
|
||||
@@ -25,9 +25,17 @@ $t = $text['files'];
|
||||
<div title="<?php echo $t['Refresh'];?>" onclick="parent.ICEcoder.refreshFileManager()" class="refresh"><?php echo file_get_contents(dirname(__FILE__) . "/assets/images/icons/rotate-clockwise.svg");?></div>
|
||||
<div title="<?php echo $t['Plugins'];?>" onclick="parent.ICEcoder.showHidePlugins('55px' !== parent.document.getElementById('plugins').style.width ? 'show' : 'hide')" class="plugins"><?php echo file_get_contents(dirname(__FILE__) . "/assets/images/icons/plug.svg");?></div>
|
||||
|
||||
|
||||
<ul class="fileManager">
|
||||
<li class="pft-directory dirOpen"><a nohref title="/" ondragover="parent.ICEcoder.overFileFolder('folder', '|'); parent.ICEcoder.highlightFileFolder('|', true);" ondragleave="parent.ICEcoder.overFileFolder('folder', ''); parent.ICEcoder.highlightFileFolder('|', false);" onmouseover="parent.ICEcoder.overFileFolder('folder', '|')" onmouseout="parent.ICEcoder.overFileFolder('folder', '')" onclick="parent.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px"> <span id="|">/ <?php
|
||||
echo $iceRoot == "" ? $t['ROOT'] : trim($iceRoot, "/");
|
||||
<?php
|
||||
$displayRoot = $iceRoot == "" ? $t['ROOT'] : trim($iceRoot, "/");
|
||||
if (false === is_dir($docRoot . $iceRoot)) {
|
||||
echo '<li class="pft-directory dir"><a nohref title="' . $displayRoot . ' : can\'t access dir" onclick="parent.ICEcoder.settingsScreen(false, \'general\')" style="position: relative; left:-22px"> <span style="background: #b00">/ ';
|
||||
echo $displayRoot;
|
||||
echo '</span></a></li></ul>';
|
||||
} else {
|
||||
?><li class="pft-directory dirOpen"><a nohref title="/" ondragover="parent.ICEcoder.overFileFolder('folder', '|'); parent.ICEcoder.highlightFileFolder('|', true);" ondragleave="parent.ICEcoder.overFileFolder('folder', ''); parent.ICEcoder.highlightFileFolder('|', false);" onmouseover="parent.ICEcoder.overFileFolder('folder', '|')" onmouseout="parent.ICEcoder.overFileFolder('folder', '')" onclick="parent.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px"> <span id="|">/ <?php
|
||||
echo $displayRoot;
|
||||
$thisPermVal = "Windows" !== $serverType ? substr(sprintf('%o', fileperms($docRoot . $iceRoot)), -3) : "";
|
||||
$permColors = 777 == $thisPermVal ? 'background: #800; color: #eee' : 'color: #888';
|
||||
?></span> <span style="<?php echo $permColors;?>; font-size: 8px" id="|_perms"><?php echo $thisPermVal;?></span></a></li><?php
|
||||
@@ -36,7 +44,9 @@ $t = $text['files'];
|
||||
</ul>
|
||||
|
||||
<iframe name="fileControl" src="lib/get-branch.php?location=|&csrf=<?php echo $_SESSION['csrf'];?>" style="display: none"></iframe>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<iframe name="pingActive" style="display: none"></iframe>
|
||||
|
||||
<div class="fmDragBox" id="fmDragBox"></div>
|
||||
|
||||
27
index.php
27
index.php
@@ -15,7 +15,7 @@ if (true === $ICEcoder["checkUpdates"]) {
|
||||
}
|
||||
$icvInfo = str_replace("\n", "", $icvData);
|
||||
$icv = preg_match("/^[0-9.]+/", $icvInfo, $matches);
|
||||
$icv = floatval($matches[0]);
|
||||
$icv = $matches[0];
|
||||
$icvInfo = [
|
||||
0 => $icv,
|
||||
1 => substr($icvInfo, strlen($matches[0]))
|
||||
@@ -28,7 +28,7 @@ if (true === $ICEcoder["checkUpdates"]) {
|
||||
if ($thisV < $icv) {
|
||||
$updateMsg =
|
||||
";ICEcoder.dataMessage('<b>" . $t['UPDATE INFO'] .
|
||||
":</b> ICEcoder v" . explode("\n", $icvData)[0] ." " . $t['now available'] . ". (" . $t['Your version is'] . " v" . $ICEcoder["versionNo"] .
|
||||
":</b> ICEcoder " . explode("\n", $icvData)[0] ." " . $t['now available'] . ". (" . $t['Your version is'] . " " . $ICEcoder["versionNo"] .
|
||||
").<br><br><a href=\\'https://icecoder.net\\' target=\\'_blank\\' style=\\'color:#fff; background: #b00; padding: 5px; text-decoration: none; cursor: pointer\\'>" .
|
||||
$t['Update now'] . "</a><br><br>" . $icvI ."');";
|
||||
}
|
||||
@@ -39,7 +39,7 @@ $isMac = false !== strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh") ? true : fal
|
||||
<!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 ('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>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?></title>
|
||||
<!--Updated via settings so must remain 1st stylesheet//-->
|
||||
<style>
|
||||
#tabsBar.tabsBar .tab { font-size: <?php echo $ICEcoder["fontSize"];?>; }
|
||||
@@ -140,6 +140,8 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
|
||||
"ICEcoder.demoMode = " . ($ICEcoder["demoMode"] ? 'true' : 'false') . ";" .
|
||||
"ICEcoder.tagWrapperCommand = '" . $ICEcoder["tagWrapperCommand"] . "';" .
|
||||
"ICEcoder.autoComplete = '" . $ICEcoder["autoComplete"] . "';" .
|
||||
"ICEcoder.selectNextOnFindInput = " . ($ICEcoder["selectNextOnFindInput"] ? 'true' : 'false') . ";" .
|
||||
"ICEcoder.goToLineScrollSpeed = '" . $ICEcoder["goToLineScrollSpeed"] . "';" .
|
||||
"ICEcoder.bugFilePaths = ['" . implode("','",$ICEcoder["bugFilePaths"]) . "'];" .
|
||||
"ICEcoder.bugFileCheckTimer = ".$ICEcoder["bugFileCheckTimer"] . ";" .
|
||||
"ICEcoder.bugFileMaxLines = " . $ICEcoder["bugFileMaxLines"] . ";" .
|
||||
@@ -252,7 +254,9 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
|
||||
<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>
|
||||
<?php if (true === $ICEcoder['loginRequired']) {?>
|
||||
<li><a nohref onClick="ICEcoder.logout()"><?php echo $t['Logout'];?></a></li>
|
||||
<?php ;}; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="optionsEdit" class="optionsList" onmouseover="ICEcoder.showHideFileNav('show', this.id)" onmouseout="ICEcoder.showHideFileNav('hide', this.id); ICEcoder.canShowFMNav = false">
|
||||
@@ -275,17 +279,6 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
|
||||
<li><a nohref onclick="ICEcoder.pluginsManager()">Plugins</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--
|
||||
FTP is a far less used method of data transfer and so this menu hidden for now
|
||||
Uncomment if you really want to use it but please note, in future versions of ICEcoder
|
||||
that FTP is likely to be removed altogether
|
||||
<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">
|
||||
<ul>
|
||||
<li><a nohref onclick="ICEcoder.viewTutorial(false, 500)">Tutorial</a></li>
|
||||
@@ -314,15 +307,15 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
|
||||
<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="if (false === ICEcoder.overCloseLink) {ICEcoder.switchTab(parseInt(this.id.slice(3), 10)); ICEcoder.tabDragStart(parseInt(this.id.slice(3), 10))}; if (1 === event.button) {ICEcoder.closeTab(parseInt(this.id.slice(3), 10)); return false}; thisColor = ICEcoder.colorSelectedText;" onmouseover="thisColor = this.style.color; this.style.color = ICEcoder.colorSelectedText" onmouseout="this.style.color = thisColor"></div>';
|
||||
echo '<div id="tab' . $i . '" class="tab" onmousedown="if (false === ICEcoder.overCloseLink) {ICEcoder.switchTab(parseInt(this.id.slice(3), 10)); ICEcoder.tabDragStart(parseInt(this.id.slice(3), 10))}; if (1 === event.button) {ICEcoder.closeTab(parseInt(this.id.slice(3), 10)); return false}; thisColor = ICEcoder.colorSelectedText;" onmouseover="thisColor = this.style.color; this.style.color = ICEcoder.colorSelectedText" onmouseout="this.style.color = thisColor" ondblclick="ICEcoder.focusUnfocusTab()"></div>';
|
||||
}
|
||||
?><div class="newTab" onClick="ICEcoder.newTab(false)" id="newTab">+</div>
|
||||
</div>
|
||||
<div id="findBar" class="findBar" oncontextmenu="return false">
|
||||
<form name="findAndReplace" onsubmit="ICEcoder.findReplace(get('find').value, false, false, false); ICEcoder.getcMInstance().focus(); return false">
|
||||
<div class="findReplace">
|
||||
<div class="findText"><?php echo $t['Find'];?></div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" oninput="ICEcoder.findReplaceOnInput()">
|
||||
<div class="findRegexToggle" id="findRegexToggle" onclick="ICEcoder.findRegexToggle()" title="RegEx">^$</div><div class="findText"><?php echo $t['Find'];?></div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" oninput="ICEcoder.findOnInput()">
|
||||
|
||||
<div class="selectWrapper" style="width: 41px">
|
||||
<select name="connector" onChange="ICEcoder.findReplaceOptions()" style="width: 40px; margin-top: 4px">
|
||||
|
||||
@@ -147,7 +147,6 @@ $text = [
|
||||
"Sorry, cannot save" => "抱歉, 不能保存",
|
||||
"Sorry, cannot replace..." => "抱歉, 目标不能替换文本",
|
||||
"Sorry, cannot change..." => "抱歉, 目标不能更改权限",
|
||||
"Sorry, cannot delete more..." => "抱歉,在FTP模式下一次不能删除多个项目",
|
||||
"Sorry, cannot delete..." => "抱歉, 不能删除根目录",
|
||||
"Sorry, cannot delete" => "抱歉, 不能删除",
|
||||
"Sorry, this file..." => "抱歉, 此文件已更改, 不能保存",
|
||||
@@ -159,37 +158,6 @@ $text = [
|
||||
"Saving" => "正在保存",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "保存FTP站点",
|
||||
"Cannot update config..." => "无法更新配置文件,请设置公用写入权限。",
|
||||
"and try again" => "重试",
|
||||
"ftp manager" => "FTP管理器",
|
||||
"Choose existing site" => "选择现有网站",
|
||||
"Are you sure..." => "确实要删除此网站吗?",
|
||||
"Add new site" => "添加新站点",
|
||||
"Edit site" => "配置站点",
|
||||
"Site base" => "站点信息",
|
||||
"Host" => "域名",
|
||||
"Username" => "用户名",
|
||||
"Password" => "密码",
|
||||
"PASV and mode" => "被动模式",
|
||||
"Root" => "根目录",
|
||||
"eg http://yourdomain.com" => "例 http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "例 ftp.yourdomain.com",
|
||||
"eg user123" => "例 user123",
|
||||
"eg pass123" => "例 pass123",
|
||||
"Use PASV mode..." => "如果FTP站点需要,请使用被动模式,并选择数据传输类型 ASCII(字符) 或 Binary(二进制)",
|
||||
"eg /htdocs" => "例 /htdocs",
|
||||
"PASV connection off" => "关闭 PASV 模式连接",
|
||||
"PASV connection on" => "开启 PASV 模式连接",
|
||||
"ASCII transfer" => "ASCII 字符传输",
|
||||
"Binary transfer" => "Binary 二进制传输",
|
||||
"Add" => "添加",
|
||||
"Choose" => "选择",
|
||||
"Update" => "更新",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -209,6 +177,7 @@ $text = [
|
||||
"or" => "或",
|
||||
"Left click" => "左键单击",
|
||||
"Middle click" => "中键单击",
|
||||
"Double click" => "双击",
|
||||
"Double click tap..." => "双击 / 点击 (移动端)",
|
||||
"Right click" => "右键单击",
|
||||
"Middle scrollwheel" => "中间滚轮滚动",
|
||||
@@ -270,7 +239,7 @@ $text = [
|
||||
"results" => "结果",
|
||||
"No text selected..." => "搜索中没有选中的文本",
|
||||
"all files" => "所有文件",
|
||||
"all filenames" => "所有的文件名",
|
||||
"all filenames" => "所有文件名",
|
||||
"selected files" => "已选择的文件",
|
||||
"selected filenames" => "已选择的文件名",
|
||||
"Creating Folder" => "正在创建文件夹",
|
||||
@@ -287,7 +256,7 @@ $text = [
|
||||
"Sorry cannot paste..." => "抱歉, 无法粘贴到根路径",
|
||||
"Nothing to paste..." => "粘贴失败, 请先复制一个文件 / 文件夹!",
|
||||
"and" => "和",
|
||||
"this document" => "本文件",
|
||||
"this document" => "当前文件",
|
||||
"replace" => "替换",
|
||||
"replace all" => "替换所有",
|
||||
"file" => "文件",
|
||||
@@ -295,11 +264,11 @@ $text = [
|
||||
"Sorry there was..." => "抱歉,您的请求有错误。\\n\\n请检查您的开发工具控制台以获取更多信息。",
|
||||
"Cancelled tasks" => "取消任务",
|
||||
"Please note for..." => "请注意: 需要更新才能正常工作, 你需要为所有 ICEcoder 文件和文件夹设置写入和删除权限. 如果您需要恢复 ICEcoder 到这个版本, 你可以在 /tmp 目录找到它们. 点击 OK 继续使用自动升级或点击 cancel 访问 ICEcoder 网站, 您也可以到 grab 的项目首页下载 zip 来进行手动更新.",
|
||||
"You can start..." => "你可以在 帮助 > 设置中启动错误报告",
|
||||
"You can start..." => "您可以在“设置 > 帐户”中启动错误报告",
|
||||
"Error cannot find..." => "错误: 无法找到/进入错误文件路径",
|
||||
"No new errors..." => "没有新的错误被找到",
|
||||
"You have made..." => "您已做的更改未保存。您确定要关闭它而不保存吗?",
|
||||
"Close all tabs" => "是否关闭所有选项卡?",
|
||||
"Close all tabs" => "关闭所有选项卡?",
|
||||
],
|
||||
|
||||
"login" =>
|
||||
@@ -328,6 +297,7 @@ $text = [
|
||||
"No matches found" => "没有找到匹配",
|
||||
"selected" => "选择",
|
||||
"found in" => "查询结果在",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "已替换"
|
||||
],
|
||||
|
||||
@@ -413,7 +383,6 @@ $text = [
|
||||
"auto-complete on" => "打开自动完成",
|
||||
"security" => "安全",
|
||||
"new password" => "新密码",
|
||||
"8 chars min" => "最少8个字符",
|
||||
"confirm password" => "确认密码",
|
||||
"banned files/folders" => "禁止文件 / 文件夹",
|
||||
"banned paths" => "禁止路径",
|
||||
|
||||
@@ -147,7 +147,6 @@ $text = [
|
||||
"Sorry, cannot replace..." => "抱歉, 目標不能替換文本",
|
||||
"Sorry, cannot change..." => "抱歉, 目標不能更改權限",
|
||||
"Sorry, cannot delete..." => "抱歉, 不能刪除根級別ROOT",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete" => "抱歉, 不能刪除",
|
||||
"Sorry, this file..." => "抱歉, 此文件已更改, 不能保存",
|
||||
"Reload this file..." => "重新加載該文件, 你的版本複製到一個新文件?",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "正在保存",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "或",
|
||||
"Left click" => "左鍵單擊",
|
||||
"Middle click" => "中鍵單擊",
|
||||
"Double click" => "雙擊",
|
||||
"Double click tap..." => "雙擊 / 手指點擊 (移動端)",
|
||||
"Right click" => "右鍵單擊",
|
||||
"Middle scrollwheel" => "中間滾輪滾動",
|
||||
@@ -268,8 +237,8 @@ $text = [
|
||||
[
|
||||
"results" => "results",
|
||||
"No text selected..." => "搜索中沒有選中的文件",
|
||||
"all files" => "all files",
|
||||
"all filenames" => "all filenames",
|
||||
"all files" => "所有文件",
|
||||
"all filenames" => "所有文件名",
|
||||
"selected files" => "selected files",
|
||||
"selected filenames" => "selected filenames",
|
||||
"Creating Folder" => "正在創建文件夾",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "正在打開文件",
|
||||
"Enter relative file..." => "輸入本地相對路徑 (前綴 /) 或遠程 URL",
|
||||
"Getting" => "正在獲取",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => "正在保存:",
|
||||
"Please enter the..." => "請輸入新的名稱爲",
|
||||
"Renaming to" => "正在重命名",
|
||||
"Moving to" => "正在移動到",
|
||||
@@ -286,19 +255,19 @@ $text = [
|
||||
"Sorry cannot paste..." => "抱歉, 無法粘貼到根路徑",
|
||||
"Nothing to paste..." => "粘貼失敗, 請先複製一個文件 / 文件夾!",
|
||||
"and" => "and",
|
||||
"this document" => "this document",
|
||||
"replace" => "replace",
|
||||
"replace all" => "replace all",
|
||||
"file" => "file",
|
||||
"this document" => "當前文件",
|
||||
"replace" => "替換",
|
||||
"replace all" => "替換所有",
|
||||
"file" => "文件",
|
||||
"Replacing text in" => "正在替換文本",
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "取消任務",
|
||||
"Please note for..." => "請注意: 需要更新才能工作, 您需要爲所有 ICEcoder 文件和文件夾設置寫如何刪除權限. 如果您需要恢復 ICEcoder 到這個版本, 您可以在 /tmp 目錄找到它們. 點擊 OK 繼續使用自動升級或點擊 cancel 訪問 ICEcoder 官方網站, 您也可以到 GitHub 的項目首頁下載 zip 來手動進行更新.",
|
||||
"You can start..." => "您可以在 幫助 > 設置中啓動錯誤報告",
|
||||
"You can start..." => "您可以在“設置 > 帳戶”中啟動錯誤報告",
|
||||
"Error cannot find..." => "錯誤: 無法找到和進入錯誤日志文件路徑",
|
||||
"No new errors..." => "沒有新的錯誤被找到",
|
||||
"You have made..." => "您已做的更改未保存。您確定要關閉它而不保存嗎?",
|
||||
"Close all tabs" => "是否關閉所有選項卡?",
|
||||
"Close all tabs" => "關閉所有選項卡?",
|
||||
],
|
||||
|
||||
"login" =>
|
||||
@@ -327,6 +296,7 @@ $text = [
|
||||
"No matches found" => "沒有找到匹配",
|
||||
"selected" => "選擇",
|
||||
"found in" => "查詢結果在",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "已替換"
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "打開自動完成",
|
||||
"security" => "安全",
|
||||
"new password" => "新密碼",
|
||||
"8 chars min" => "至少8個字符",
|
||||
"confirm password" => "確認密碼",
|
||||
"banned files/folders" => "禁止文件 / 文件夾",
|
||||
"banned paths" => "禁止路徑",
|
||||
|
||||
@@ -89,8 +89,8 @@ $text = [
|
||||
"Find" => "Zoek",
|
||||
"in" => "in",
|
||||
"and" => "en",
|
||||
"replace" => "vervangen",
|
||||
"replace all" => "alles vervangen",
|
||||
"replace" => "vervang",
|
||||
"replace all" => "vervang alle",
|
||||
"this document" => "dit document",
|
||||
"open documents" => "open documenten",
|
||||
"all files" => "alle bestanden",
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Kan niet opslaan",
|
||||
"Sorry, cannot replace..." => "Kan geen tekst vervangen in",
|
||||
"Sorry, cannot change..." => "Kan de rechten niet wijzigen voor",
|
||||
"Sorry, cannot delete more..." => "U kunt niet meer dan een bestand tegelijkertijd verwijderen in FTP modus",
|
||||
"Sorry, cannot delete..." => "Kan de root level niet verwijderen",
|
||||
"Sorry, cannot delete" => "Kan niet verwijderd worden",
|
||||
"Sorry, this file..." => "Het bestand is gewijzigd, maar kan niet worden opgeslagen",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Opslaan"
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "of",
|
||||
"Left click" => "Linker muisklik",
|
||||
"Middle click" => "Middelste muisklik",
|
||||
"Double click" => "Dubbel klikken",
|
||||
"Double click tap..." => "Dubbel klikken / tap (mobiele apparatuur)",
|
||||
"Right click" => "Rechter muisklik",
|
||||
"Middle scrollwheel" => "Midden scrollwiel",
|
||||
@@ -286,7 +255,7 @@ $text = [
|
||||
"Sorry cannot paste..." => "Sorry, kan niet de gehele root plakken",
|
||||
"Nothing to paste..." => "Er is niets om te plakken, kopieer eerst een bestand of map!",
|
||||
"and" => "en",
|
||||
"this document" => "dit bestand",
|
||||
"this document" => "dit document",
|
||||
"replace" => "vervang",
|
||||
"replace all" => "vervang alle",
|
||||
"file" => "bestand",
|
||||
@@ -294,7 +263,7 @@ $text = [
|
||||
"Sorry there was..." => "Helaas er is een fout opgetreden met uw aanvraag.\\n\\nKijk in de dev tools console voor meer informatie.",
|
||||
"Cancelled tasks" => "Geannuleerde taken",
|
||||
"Please note for..." => "Let op: om de update goed te laten doorvoeren, moet je schrijfrechten hebben op alle bestanden en mappen van ICEcoder. Moet je deze versie van ICEcoder herstellen, dan vind je die in de map /tmp. Klik op ok om door te gaan met automatisch updaten, of druk op annuleren om af te breken. Voor een handmatige update kun je het zip bestand van de ICEcoder website downloaden.",
|
||||
"You can start..." => "U kunt bug rapporteren aanzetten in: Bewerken > Opties",
|
||||
"You can start..." => "U kunt bug rapporteren aanzetten in: Instellingen > Accounts",
|
||||
"Error cannot find..." => "Fout: kan geen toegang krijgen of de bestands paden vinden",
|
||||
"No new errors..." => "Geen nieuwe fouten gevonden",
|
||||
"You have made..." => "Er zijn wijzigingen aangetroffen. Wilt u verder gaan zonder op te slaan?",
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "keer",
|
||||
"replace" => "vervang",
|
||||
"file folder" => "bestand/map",
|
||||
"rename to" => "hernoemen naar",
|
||||
"rename to" => "Hernoemen naar",
|
||||
"rename" => "hernoemen",
|
||||
"file" => "bestand",
|
||||
"No matches found" => "Geen overeenkomsten gevonden",
|
||||
"selected" => "geselecteerd",
|
||||
"found in" => "gevonden in",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Vervangen",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "automatisch aanvullen",
|
||||
"security" => "beveiliging",
|
||||
"new password" => "nieuw wachtwoord",
|
||||
"8 chars min" => "minimaal 8 tekens",
|
||||
"confirm password" => "herhaal wachtwoord",
|
||||
"banned files/folders" => "uitgesloten bestanden/mappen",
|
||||
"banned paths" => "uitgesloten paden",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Sorry, cannot save",
|
||||
"Sorry, cannot replace..." => "Sorry, cannot replace text in",
|
||||
"Sorry, cannot change..." => "Sorry, cannot change permissions on",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Sorry, cannot delete the root level",
|
||||
"Sorry, cannot delete" => "Sorry, cannot delete",
|
||||
"Sorry, this file..." => "Sorry, this file has changed outside of ICEcoder, cannot save",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Saving",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "or",
|
||||
"Left click" => "Left click",
|
||||
"Middle click" => "Middle click",
|
||||
"Double click" => "Double click",
|
||||
"Double click tap..." => "Double click / tap (mobile)",
|
||||
"Right click" => "Right click",
|
||||
"Middle scrollwheel" => "Middle scrollwheel",
|
||||
@@ -294,7 +263,7 @@ $text = [
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "Cancelled tasks",
|
||||
"Please note for..." => "Please note: for updating to work properly, you need to have write access on all ICEcoder dirs & files. It will first check if this is the case and list any unwriteable (and therefore unmoveable) files.\\n\\nIf you need to recover this version of ICEcoder for any reason, you'll find it in the /tmp dir.\\n\\nClick OK to proceed with the check and auto-update, or cancel to visit the ICEcoder site so you can grab the zip and update manually.",
|
||||
"You can start..." => "You can start bug reporting in Help > Settings",
|
||||
"You can start..." => "You can start bug reporting in Settings > Accounts",
|
||||
"Error cannot find..." => "Error: cannot find/access the error file paths",
|
||||
"No new errors..." => "No new errors found",
|
||||
"You have made..." => "You have made changes. Are you sure you want to close without saving?",
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "times",
|
||||
"replace" => "replace",
|
||||
"file folder" => "file/folder",
|
||||
"rename to" => "rename to",
|
||||
"rename to" => "Rename to",
|
||||
"rename" => "rename",
|
||||
"file" => "file",
|
||||
"No matches found" => "No matches found",
|
||||
"selected" => "selected",
|
||||
"found in" => "found in",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Replaced",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "auto-complete on",
|
||||
"security" => "security",
|
||||
"new password" => "new password",
|
||||
"8 chars min" => "8 chars min",
|
||||
"confirm password" => "confirm password",
|
||||
"banned files/folders" => "banned files/folders",
|
||||
"banned paths" => "banned paths",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Désolé, impossibilité de sauvegarder",
|
||||
"Sorry, cannot replace..." => "Désolé, impossibilité de remplacer le texte dans ",
|
||||
"Sorry, cannot change..." => "Désolé, impossibilité de changer les permissions sur",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Désolé, imossibilité de supprimer le dossier racine",
|
||||
"Sorry, cannot delete" => "Désolé, impossibilité d'effacer",
|
||||
"Sorry, this file..." => "Désolé, le fichier a été modifié, impossibilité de sauvegarder",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Sauvegardé",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "ou",
|
||||
"Left click" => "Clic gauche",
|
||||
"Middle click" => "Clic du milieu",
|
||||
"Double click" => "Double clic",
|
||||
"Double click tap..." => "Double clic / touche (mobile)",
|
||||
"Right click" => "Clic droit",
|
||||
"Middle scrollwheel" => "Roulette du milieu",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "Ouverture de fichier",
|
||||
"Enter relative file..." => "Entrez le chemin relatif du fichier (préfixé avec un /) ou l'URL distante",
|
||||
"Getting" => "Obtention",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => "Sauvegardé:",
|
||||
"Please enter the..." => "S'il vous plait, saisissez le nouveau nom pour",
|
||||
"Renaming to" => "Renommé en",
|
||||
"Moving to" => "Déplacé vers",
|
||||
@@ -288,17 +257,17 @@ $text = [
|
||||
"and" => "et",
|
||||
"this document" => "ce document",
|
||||
"replace" => "remplacer",
|
||||
"replace all" => "tout remplacer",
|
||||
"replace all" => "remplacer tout",
|
||||
"file" => "fichier",
|
||||
"Replacing text in" => "Remplacement de texte dans",
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "Tâches annulés",
|
||||
"Please note for..." => "S'il vous plaît, noter : la mise à jour fonctionne correctement, vous devez avoir les permissions d'écriture / suppression à tous les répertoires et fichiers d'ICEcoder. Si vous avez besoin de récupérer cette version d'ICEcoder pour une raison quelconque, vous la trouverez dans le répertoire / tmp. Cliquez sur OK pour procéder à une mise à jour automatique, ou annuler et visiter le site d'ICEcoder de sorte que vous pouvez récupérer le fichier zip et mettre à jour manuellement.",
|
||||
"You can start..." => "Vous pouvez reporter un dysfonctionnement dans Aide > Préférences",
|
||||
"You can start..." => "Vous pouvez démarrer le rapport de bogue dans Paramètres> Comptes",
|
||||
"Error cannot find..." => "Erreur : ne peut pas trouver / accéder aux chemins des fichiers d'erreur",
|
||||
"No new errors..." => "Aucune nouvelle erreur trouvée",
|
||||
"You have made..." => "Vous avez réalisé des modifications. Etes vous sûr(e) de désirer quitter sans sauvegarder ?",
|
||||
"Close all tabs" => "Fermer tous les onglets?",
|
||||
"Close all tabs" => "Fermer les onglets?",
|
||||
],
|
||||
|
||||
"login" =>
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "date",
|
||||
"replace" => "remplacer",
|
||||
"file folder" => "fichier/dossier",
|
||||
"rename to" => "renommer en",
|
||||
"rename to" => "Renommer en",
|
||||
"rename" => "renommer",
|
||||
"file" => "fichier",
|
||||
"No matches found" => "Aucun résultat de trouver",
|
||||
"selected" => "sélectionné",
|
||||
"found in" => "trouvé dans",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Remplacé",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "auto-complétion sur",
|
||||
"security" => "sécurité",
|
||||
"new password" => "nouveau mot de passe",
|
||||
"8 chars min" => "8 caractères minimum",
|
||||
"confirm password" => "confirmation du mot de passe",
|
||||
"banned files/folders" => "fichiers/dossiers bannis",
|
||||
"banned paths" => "chemins bannis",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Entschuldigung, kann nicht speichern",
|
||||
"Sorry, cannot replace..." => "Entschuldigung, kann den Text nicht ersetzen",
|
||||
"Sorry, cannot change..." => "Entschuldigung, kann die Berechtigung nicht ändern für",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Entschuldigung, kann das Hauptverzeichnis nicht löschen",
|
||||
"Sorry, cannot delete" => "Entschuldigung, kann nicht löschen",
|
||||
"Sorry, this file..." => "Entschuldigung, die Datei wurde geändert, kann nicht speichern",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Speichere",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "oder",
|
||||
"Left click" => "Linksklick",
|
||||
"Middle click" => "mittlerer Klick",
|
||||
"Double click" => "Doppelklick",
|
||||
"Double click tap..." => "Doppelklick / Tap (Mobile)",
|
||||
"Right click" => "Rechtsklick",
|
||||
"Middle scrollwheel" => "mittleres Mausrad",
|
||||
@@ -268,8 +237,8 @@ $text = [
|
||||
[
|
||||
"results" => "results",
|
||||
"No text selected..." => "No text selected to search on",
|
||||
"all files" => "all files",
|
||||
"all filenames" => "all filenames",
|
||||
"all files" => "Alle Dateien",
|
||||
"all filenames" => "Alle Dateinamen",
|
||||
"selected files" => "selected files",
|
||||
"selected filenames" => "selected filenames",
|
||||
"Creating Folder" => "Creating Folder",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "Opening File",
|
||||
"Enter relative file..." => "Enter relative file path (prefixed with /) or remote URL\\nYou can enter \\n'/path/file:123' or \\n'/path/file(123)' or \\n'/path/file.ext line 123' \\nto go directly to particular line",
|
||||
"Getting" => "Getting",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => "Speichere:",
|
||||
"Please enter the..." => "Please enter the new name for",
|
||||
"Renaming to" => "Renaming to",
|
||||
"Moving to" => "Moving to",
|
||||
@@ -285,20 +254,20 @@ $text = [
|
||||
"Pasting File" => "Pasting File",
|
||||
"Sorry cannot paste..." => "Sorry, cannot paste a whole root",
|
||||
"Nothing to paste..." => "Nothing to paste, copy a file/folder first!",
|
||||
"and" => "and",
|
||||
"this document" => "this document",
|
||||
"replace" => "replace",
|
||||
"replace all" => "replace all",
|
||||
"file" => "file",
|
||||
"and" => "und",
|
||||
"this document" => "dieses Dokument",
|
||||
"replace" => "ersetzen",
|
||||
"replace all" => "alle ersetzen",
|
||||
"file" => "Datei",
|
||||
"Replacing text in" => "Replacing text in",
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "Cancelled tasks",
|
||||
"Please note for..." => "Please note: for updating to work properly, you need to have write access on all ICEcoder dirs & files. It will first check if this is the case and list any unwriteable (and therefore unmoveable) files.\\n\\nIf you need to recover this version of ICEcoder for any reason, you'll find it in the /tmp dir.\\n\\nClick OK to proceed with the check and auto-update, or cancel to visit the ICEcoder site so you can grab the zip and update manually.",
|
||||
"You can start..." => "You can start bug reporting in Help > Settings",
|
||||
"You can start..." => "You can start bug reporting in Settings > Accounts",
|
||||
"Error cannot find..." => "Error: cannot find/access the error file paths",
|
||||
"No new errors..." => "No new errors found",
|
||||
"You have made..." => "You have made changes. Are you sure you want to close without saving?",
|
||||
"Close all tabs" => "Close all tabs?",
|
||||
"Close all tabs" => "Alle Tabs schließen?",
|
||||
],
|
||||
|
||||
"login" =>
|
||||
@@ -327,6 +296,7 @@ $text = [
|
||||
"No matches found" => "Nichts gefunden",
|
||||
"selected" => "Ausgewählte",
|
||||
"found in" => "Gefunden in",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Ersetzen",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "Auto-Vervollständigen mit",
|
||||
"security" => "Sicherheit",
|
||||
"new password" => "neues Passwort",
|
||||
"8 chars min" => "8 Zeichen mindestens",
|
||||
"confirm password" => "Passwort bestätigen",
|
||||
"banned files/folders" => "verbannte Dateien/Verzeichnisse",
|
||||
"banned paths" => "verbannte Verzeichnisse",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Siamo spiacenti, non è possibile salvare",
|
||||
"Sorry, cannot replace..." => "Siamo spiacenti, non è possibile sostituire il testo",
|
||||
"Sorry, cannot change..." => "Siamo spiacenti, non è possibile cambiare i permessi",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Siamo spiacenti, non è possibile cancellare la cartella root",
|
||||
"Sorry, cannot delete" => "Siamo spiacenti, non è possibile cancellare",
|
||||
"Sorry, this file..." => "Siamo spiacenti, questo file è stato cambiato, non è possibile salvarlo",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Stiamo salvando",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "o",
|
||||
"Left click" => "Click Sinistro",
|
||||
"Middle click" => "Click centrale",
|
||||
"Double click" => "Doppio click",
|
||||
"Double click tap..." => "Doppio click / tap (mobile)",
|
||||
"Right click" => "Click Destro",
|
||||
"Middle scrollwheel" => "scrollwheel Medio",
|
||||
@@ -269,7 +238,7 @@ $text = [
|
||||
"results" => "risultati",
|
||||
"No text selected..." => "Nessun testo selezionato per la ricerc",
|
||||
"all files" => "tutti i file",
|
||||
"all filenames" => "tutti i nomi dei file",
|
||||
"all filenames" => "tutti i nomi",
|
||||
"selected files" => "seleziona file",
|
||||
"selected filenames" => "seleziona nomi dei file",
|
||||
"Creating Folder" => "Sto creando una cartla",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "Apertura file",
|
||||
"Enter relative file..." => "Digita il percorso relativo (con / di prefisso) o l\'url remoto",
|
||||
"Getting" => "Getting",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => "Stiamo salvando:",
|
||||
"Please enter the..." => "Per favore digita un nuovo nome per",
|
||||
"Renaming to" => "Rinominando a ",
|
||||
"Moving to" => "Muovendo a",
|
||||
@@ -294,11 +263,11 @@ $text = [
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "Compiti cancellati",
|
||||
"Please note for..." => "Si prega di notare: affinche l\'aggiornamento funzioni correttamente, è necessario disporre dei permessi di scrittura e cancellazione su tutti le cartelle e file di ICEcoder e. Se è necessario ripristinare questa versione di ICEcoder per qualsiasi motivo, lo troverete nella directory / tmp dir. Fare clic su OK per procedere con l\'aggiornamento automatico o annullare a visitare il sito ICEcoder in modo da poter utilizzare la zip e aggiornare manualmente.",
|
||||
"You can start..." => "Puoi ripoertare il bug in Help > Settings",
|
||||
"You can start..." => "Puoi avviare la segnalazione dei bug in Impostazioni > Account",
|
||||
"Error cannot find..." => "Error: cannot find/access the error file paths",
|
||||
"No new errors..." => "Nessun nuovo errore trovato",
|
||||
"You have made..." => "Hai fatto alcuni cambiamenti. Sei sicuro che vuoi chiudere senza prima salvare?",
|
||||
"Close all tabs" => "Chiudere tutte le tabs?",
|
||||
"Close all tabs" => "Chiudere tutte le schede?",
|
||||
],
|
||||
|
||||
"login" =>
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "times",
|
||||
"replace" => "replace",
|
||||
"file folder" => "file/folder",
|
||||
"rename to" => "rename to",
|
||||
"rename to" => "Rename to",
|
||||
"rename" => "rename",
|
||||
"file" => "file",
|
||||
"No matches found" => "No matches found",
|
||||
"selected" => "selected",
|
||||
"found in" => "found in",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Replaced",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "auto-completamento attivo",
|
||||
"security" => "sicurezza",
|
||||
"new password" => "nuova password",
|
||||
"8 chars min" => "8 caratteri minimo",
|
||||
"confirm password" => "conferma password",
|
||||
"banned files/folders" => "file e cartelle vietati",
|
||||
"banned paths" => "percorsi vietati",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Beklager, kan ikke lagre",
|
||||
"Sorry, cannot replace..." => "Beklager, kan ikke erstatte tekst i",
|
||||
"Sorry, cannot change..." => "Beklager, kan ikke endre tillatelser på",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Beklager, kan ikke slette rotnivå",
|
||||
"Sorry, cannot delete" => "Beklager, kan ikke slette",
|
||||
"Sorry, this file..." => "Beklager, denne filen er endret, kan ikke lagre",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Lagring",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "eller",
|
||||
"Left click" => "Venstre klikk",
|
||||
"Middle click" => "Middel klikk",
|
||||
"Double click" => "Dobbel klikk",
|
||||
"Double click tap..." => "Dobbel klikk / tap (mobil)",
|
||||
"Right click" => "Høyre klikk",
|
||||
"Middle scrollwheel" => "Middel rullehjul",
|
||||
@@ -268,8 +237,8 @@ $text = [
|
||||
[
|
||||
"results" => "results",
|
||||
"No text selected..." => "Ingen tekst valgt til å søke på",
|
||||
"all files" => "all files",
|
||||
"all filenames" => "all filenames",
|
||||
"all files" => "alle filer",
|
||||
"all filenames" => "alle fileravn",
|
||||
"selected files" => "selected files",
|
||||
"selected filenames" => "selected filenames",
|
||||
"Creating Folder" => "Lage mappe",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "Åpner Fil",
|
||||
"Enter relative file..." => "Oppgi den relative filstien (med prefiks /) eller ekstern URL",
|
||||
"Getting" => "Får",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => "Lagring:",
|
||||
"Please enter the..." => "Skriv inn det nye navnet på",
|
||||
"Renaming to" => "Endre navn til",
|
||||
"Moving to" => "Flytt til",
|
||||
@@ -285,16 +254,16 @@ $text = [
|
||||
"Pasting File" => "Lim inn Fil",
|
||||
"Sorry cannot paste..." => "Beklager, kan ikke lime inn en hel rot mappe",
|
||||
"Nothing to paste..." => "Ingenting å lime inn, kopiere en fil/mappe først!",
|
||||
"and" => "and",
|
||||
"this document" => "this document",
|
||||
"replace" => "replace",
|
||||
"replace all" => "replace all",
|
||||
"file" => "file",
|
||||
"and" => "og",
|
||||
"this document" => "dette dokumentet",
|
||||
"replace" => "erstatt",
|
||||
"replace all" => "erstatt alt",
|
||||
"file" => "fil",
|
||||
"Replacing text in" => "Replacing text in","Replacing text in" => "Erstatte tekst i",
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "Kansellerte oppgaver",
|
||||
"Please note for..." => "Vennligst merk: for at oppdatering skal fungere skikkelig, må du ha skrive/slette tilgang til alle ICEcoder kataloger og filer. Hvis du trenger å gjenopprette denne versjonen av ICEcoder av en eller annen grunn, vil du finne den i /tmp mappen. Klikk OK for å fortsette med en auto-oppdatering eller avbryt for å besøke ICEcoder området slik at du kan ta tak i zip-filen og oppdatere manuelt.",
|
||||
"You can start..." => "Du kan starte feilrapportering i Hjelp > Innstillinger",
|
||||
"You can start..." => "Du kan starte feilrapportering i Innstillinger > Kontoer",
|
||||
"Error cannot find..." => "Feil: kan ikke finne/få tilgang til feil filstier",
|
||||
"No new errors..." => "Ingen feil funnet",
|
||||
"You have made..." => "Du har gjort endringer. Er du sikker på, at du vil lukke uten å lagre?",
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "ganger",
|
||||
"replace" => "erstatte",
|
||||
"file folder" => "fil/mappe",
|
||||
"rename to" => "endre navn til",
|
||||
"rename to" => "Endre navn til",
|
||||
"rename" => "endre navn",
|
||||
"file" => "fil",
|
||||
"No matches found" => "Ingen treff",
|
||||
"selected" => "valgt",
|
||||
"found in" => "funnet i",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Erstattet",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "autokompletering på",
|
||||
"security" => "sikkerhet",
|
||||
"new password" => "nytt passord",
|
||||
"8 chars min" => "min. 8 tegn",
|
||||
"confirm password" => "bekreft passord",
|
||||
"banned files/folders" => "forbudte filer/mapper",
|
||||
"banned paths" => "forbudte stier",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "متاسفانه نمی توانیم ذخیره کنیم",
|
||||
"Sorry, cannot replace..." => "متاسفانه نمی نمی توانیم جایگزین کنیم",
|
||||
"Sorry, cannot change..." => "متاسفانه نمی توانیم دسترسی را تغییر دهیم",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "متاسفانه نمی توانیم دسترسی ریشه را تغییر دهیم",
|
||||
"Sorry, cannot delete" => "متاسفانه نمی توانیم تغییر دهیم",
|
||||
"Sorry, this file..." => "متاسفانه این فایل تغییر دارد و نمی توانیم آن را ذخیره کنیم",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "در حال ذخره",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "یا",
|
||||
"Left click" => "کلیک چپ",
|
||||
"Middle click" => "کلیک وسط",
|
||||
"Double click" => "تب ( موبایل )",
|
||||
"Double click tap..." => "دبل کلیک / تب ( موبایل )",
|
||||
"Right click" => "کلیک راست",
|
||||
"Middle scrollwheel" => "اسکرولر وسط",
|
||||
@@ -268,8 +237,8 @@ $text = [
|
||||
[
|
||||
"results" => "results",
|
||||
"No text selected..." => "هیچ متنی برای جستجو انتخاب نشده است",
|
||||
"all files" => "all files",
|
||||
"all filenames" => "all filenames",
|
||||
"all files" => "همه فایل ها",
|
||||
"all filenames" => "همه نام فایل ها",
|
||||
"selected files" => "selected files",
|
||||
"selected filenames" => "selected filenames",
|
||||
"Creating Folder" => "در حال ساخت پوشه",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "در حال باز کردن فایل",
|
||||
"Enter relative file..." => "قراردادن مسیر فایل مشابه ( ابتدا با / ) یا لینک ریموت",
|
||||
"Getting" => "دریافت",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => ":در حال ذخره",
|
||||
"Please enter the..." => "لطفا یک نام جدید وارد کنید برای",
|
||||
"Renaming to" => "تغییر نام به",
|
||||
"Moving to" => "انتقال به",
|
||||
@@ -285,16 +254,16 @@ $text = [
|
||||
"Pasting File" => "در حال پست کردن فایل",
|
||||
"Sorry cannot paste..." => "متاسفانه نمی توان به ریشه چیزی اضافه کرد",
|
||||
"Nothing to paste..." => "هیچ چیش برای چسباندن نیست ! ابتدا فایل / پوشه را کپی کنید",
|
||||
"and" => "and",
|
||||
"this document" => "this document",
|
||||
"replace" => "replace",
|
||||
"replace all" => "replace all",
|
||||
"and" => "و",
|
||||
"this document" => "این سند",
|
||||
"replace" => "جایگزین کردن",
|
||||
"replace all" => "جایگزین کردن همه",
|
||||
"file" => "file",
|
||||
"Replacing text in" => "جایگزین کردن متن در",
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "تسک های لغو شده ",
|
||||
"Please note for..." => "Please note: for updating to work properly, you need to have write/delete access on all ICEcoder dirs & files. If you need to recover this version of ICEcoder for any reason, you'll find it in the /tmp dir. Click OK to proceed with an auto-update or cancel to visit the ICEcoder site so you can grab the zip and update manually.",
|
||||
"You can start..." => "شما می توانید ارسال خطا را از منوی کمک رسانی > تنظیمات انجام دهید",
|
||||
"You can start..." => "می توانید خطا را از منوی تنظیمات> حساب ها ارسال کنید",
|
||||
"Error cannot find..." => "خطا : نمی توانید به فایل / مسیر فایل های خطا دسترسی پیدا کنید.",
|
||||
"No new errors..." => "هیچ خطای جدیدی پیدا نشد",
|
||||
"You have made..." => "شما تغییراتی اعمال کرده اید. آیا اطمینان دارید که میخواهید بدون ذخیره کردن فایل را ببندید؟",
|
||||
@@ -327,6 +296,7 @@ $text = [
|
||||
"No matches found" => "جستجو نتیجه ای نداشت",
|
||||
"selected" => "انتخاب شده",
|
||||
"found in" => "یافتن در",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "جایگزین شود",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "تکمیل خودکار روشن",
|
||||
"security" => "امنیت",
|
||||
"new password" => "پسورد جدید",
|
||||
"8 chars min" => "حداقل ۸ کارکتر",
|
||||
"confirm password" => "تایید پسورد",
|
||||
"banned files/folders" => "فایل ها / پوشه های مسدود شده",
|
||||
"banned paths" => "مسیر های مسدود شده",
|
||||
|
||||
@@ -94,7 +94,7 @@ $text = [
|
||||
"this document" => "este documento",
|
||||
"open documents" => "documentos abertos",
|
||||
"all files" => "todos os arquivos",
|
||||
"all filenames" => "todos nomes de arquivo",
|
||||
"all filenames" => "todos nomes de arquivos",
|
||||
"Go to Line" => "Ir para linha",
|
||||
"View" => "Exibir",
|
||||
"Bug reporting not active" => "Relatório de Bug desativado",
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Desculpe, não é possível salvar",
|
||||
"Sorry, cannot replace..." => "Desculpe, não é possível substituir texto em",
|
||||
"Sorry, cannot change..." => "Desculpe, não é possível mudar permissões para",
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Desculpe, não é possível excluir nível raiz",
|
||||
"Sorry, cannot delete" => "Desculpe, não é possível remover",
|
||||
"Sorry, this file..." => "Desculpe, este arquivo foi modificado, não é possível salvar",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Salvando",
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "ou",
|
||||
"Left click" => "Clique esquerdo",
|
||||
"Middle click" => "Clique Meio",
|
||||
"Double click" => "Clique duplo",
|
||||
"Double click tap..." => "Clique duplo / toque (mobile)",
|
||||
"Right click" => "Clique direito",
|
||||
"Middle scrollwheel" => "Meio scroll",
|
||||
@@ -277,7 +246,7 @@ $text = [
|
||||
"Opening File" => "Abrindo arquivo",
|
||||
"Enter relative file..." => "Informe caminho relativo (prefixado por /) ou URL remota",
|
||||
"Getting" => "Selecionando",
|
||||
"Saving" => "Saving:",
|
||||
"Saving" => "Salvando:",
|
||||
"Please enter the..." => "Informe novo nome para",
|
||||
"Renaming to" => "Renomeando para",
|
||||
"Moving to" => "Movendo para",
|
||||
@@ -294,7 +263,7 @@ $text = [
|
||||
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
|
||||
"Cancelled tasks" => "Tarefas canceladas",
|
||||
"Please note for..." => "Atenção: para atualizar corretamente, é necessãrio permissão de escrita em todos os diretórios/arquivos do ICEcoder. \\n\\nSe por algum motivo necessite recuperar esta versão do ICEcoder, estarã disponível na pasta /tmp.\\n\\nClique OK para prosseguir com a atualização, ou cancelar para visitar a pãgina do ICEcoder na internet onde poderã baixar a atualização manualmente.",
|
||||
"You can start..." => "Voce pode reportar um bug em Ajuda > Configurações",
|
||||
"You can start..." => "Você pode iniciar o relatório de bug em Configurações> Contas",
|
||||
"Error cannot find..." => "Erro: não é possível acessar caminho/arquivo de erros",
|
||||
"No new errors..." => "Nenhum erro encontrado",
|
||||
"You have made..." => "Voce fez alterações. Deseja realmente fechar sem salvar?",
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "vezes",
|
||||
"replace" => "substituir",
|
||||
"file folder" => "arquivo/pasta",
|
||||
"rename to" => "renomear para",
|
||||
"rename to" => "Renomear para",
|
||||
"rename" => "renomear",
|
||||
"file" => "arquivo",
|
||||
"No matches found" => "Nenhum resultado encontrado",
|
||||
"selected" => "selecionado",
|
||||
"found in" => "encontrado em",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Substituído(s)",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "hab. auto-completar",
|
||||
"security" => "segurança",
|
||||
"new password" => "nova senha",
|
||||
"8 chars min" => "mín. 8 carac.",
|
||||
"confirm password" => "confirmar senha",
|
||||
"banned files/folders" => "arquivos/pastas bloqueados",
|
||||
"banned paths" => "caminhos bloqueados",
|
||||
|
||||
@@ -146,7 +146,6 @@ $text = [
|
||||
"Sorry, cannot save" => "Lo siento, no puedo guardar",
|
||||
"Sorry, cannot replace..." => "Lo siento, no puedo reemplazar texto en",
|
||||
"Sorry, cannot change..." => "Lo siento, no puedo cambiar permisos sobre",
|
||||
"Sorry, cannot delete more..." => "Lo siento, no puedo eliminar mas de un item a la vez bajo modo FTP",
|
||||
"Sorry, cannot delete..." => "Lo siento, no puedo eliminar el nivel raiz",
|
||||
"Sorry, cannot delete" => "Lo siento, no puedo eliminar",
|
||||
"Sorry, this file..." => "Lo siento, este archivo ha cambiado, no puedo almacenar",
|
||||
@@ -158,37 +157,6 @@ $text = [
|
||||
"Saving" => "Guardando"
|
||||
],
|
||||
|
||||
"ftp-manager" =>
|
||||
[
|
||||
"Saving FTP sites" => "Saving FTP sites",
|
||||
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
|
||||
"and try again" => "and try again",
|
||||
"ftp manager" => "ftp manager",
|
||||
"Choose existing site" => "Choose existing site",
|
||||
"Are you sure..." => "Are you sure you wish to remove this site?",
|
||||
"Add new site" => "Add new site",
|
||||
"Edit site" => "Edit site",
|
||||
"Site base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
|
||||
"eg user123" => "eg user123",
|
||||
"eg pass123" => "eg pass123",
|
||||
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
|
||||
"eg /htdocs" => "eg /htdocs",
|
||||
"PASV connection off" => "PASV connection off",
|
||||
"PASV connection on" => "PASV connection on",
|
||||
"ASCII transfer" => "ASCII transfer",
|
||||
"Binary transfer" => "Binary transfer",
|
||||
"Add" => "Add",
|
||||
"Choose" => "Choose",
|
||||
"Update" => "Update",
|
||||
],
|
||||
|
||||
"get-branch" => [],
|
||||
|
||||
"headers" =>
|
||||
@@ -208,6 +176,7 @@ $text = [
|
||||
"or" => "o",
|
||||
"Left click" => "Click izquierdo",
|
||||
"Middle click" => "Click central",
|
||||
"Double click" => "Doble click",
|
||||
"Double click tap..." => "Doble click / tap (móviles)",
|
||||
"Right click" => "Click derecho",
|
||||
"Middle scrollwheel" => "Rueda del ratón",
|
||||
@@ -294,11 +263,11 @@ $text = [
|
||||
"Sorry there was..." => "Lo siento, hubo un error con su solicitud.\\n\\nPor favor verifique su consola de desarrollo para mas informacion.",
|
||||
"Cancelled tasks" => "Tareas canceladas",
|
||||
"Please note for..." => "Importante: para que la actualización trabaje correctamente, usted necesita tener derechos de acceso a todos los directorios y archivos de ICEcoder. Esto sera chequeado previamente y se presentara una lista de archivos sin acceso (por lo tanto no movibles).\\n\\nSi usted necesita restablecer esta version de ICEcoder por alguna razón, usted la encontrara en la carpeta /tmp.\\n\\nClick en OK para proceder con la verificación y auto-instalación, ó cancelar para visitar el sitio de ICEcoder para descargar el ZIP y hacerlo manualmente.",
|
||||
"You can start..." => "Usted puede iniciar el reporte de errores en la pantalla de Ayuda > Configuración",
|
||||
"You can start..." => "Puede comenzar a informar de errores en Configuración > Cuentas",
|
||||
"Error cannot find..." => "Error: no puedo encontrar o accesar las rutas de archivos de error",
|
||||
"No new errors..." => "No fueron encontrados nuevos errores",
|
||||
"You have made..." => "Usted ha realizado cambios. Esta seguro que quiere cerrar sin guardar?",
|
||||
"Close all tabs" => "Cerrar todas las fichas?",
|
||||
"Close all tabs" => "Cerrar todas las pestañas?",
|
||||
],
|
||||
|
||||
"login" =>
|
||||
@@ -321,12 +290,13 @@ $text = [
|
||||
"times" => "veces",
|
||||
"replace" => "reemplazar",
|
||||
"file folder" => "archivo/carpeta",
|
||||
"rename to" => "renombrar a",
|
||||
"rename to" => "Renombrar a",
|
||||
"rename" => "renombrar",
|
||||
"file" => "archivo",
|
||||
"No matches found" => "No se encontraron coincidencias",
|
||||
"selected" => "seleccionado",
|
||||
"found in" => "encontrado en",
|
||||
"Renamed" => "Renamed",
|
||||
"Replaced" => "Reemplezado",
|
||||
],
|
||||
|
||||
@@ -412,7 +382,6 @@ $text = [
|
||||
"auto-complete on" => "auto-completar encendido",
|
||||
"security" => "seguridad",
|
||||
"new password" => "nueva clave",
|
||||
"8 chars min" => "8 caracteres min",
|
||||
"confirm password" => "confirmar clave",
|
||||
"banned files/folders" => "archivos/carpetas prohibidos",
|
||||
"banned paths" => "rutas prohibidas",
|
||||
|
||||
28
lib/adminer-plugins/frames.php
Normal file
28
lib/adminer-plugins/frames.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/** Allow using Adminer inside a frame (disables ClickJacking protection)
|
||||
* @link https://www.adminer.org/plugins/#use
|
||||
* @author Jakub Vrana, https://www.vrana.cz/
|
||||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
class AdminerFrames {
|
||||
/** @access protected */
|
||||
var $sameOrigin;
|
||||
|
||||
/**
|
||||
* @param bool allow running from the same origin only
|
||||
*/
|
||||
function __construct($sameOrigin = false) {
|
||||
$this->sameOrigin = $sameOrigin;
|
||||
}
|
||||
|
||||
function headers() {
|
||||
if ($this->sameOrigin) {
|
||||
header("X-Frame-Options: SameOrigin");
|
||||
} elseif (function_exists('header_remove')) {
|
||||
header_remove("X-Frame-Options");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
406
lib/adminer-plugins/plugin.php
Normal file
406
lib/adminer-plugins/plugin.php
Normal file
@@ -0,0 +1,406 @@
|
||||
<?php
|
||||
|
||||
/** Adminer customization allowing usage of plugins
|
||||
* @link https://www.adminer.org/plugins/#use
|
||||
* @author Jakub Vrana, https://www.vrana.cz/
|
||||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
class AdminerPlugin extends Adminer {
|
||||
/** @access protected */
|
||||
var $plugins;
|
||||
|
||||
function _findRootClass($class) { // is_subclass_of(string, string) is available since PHP 5.0.3
|
||||
do {
|
||||
$return = $class;
|
||||
} while ($class = get_parent_class($class));
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Register plugins
|
||||
* @param array object instances or null to register all classes starting by 'Adminer'
|
||||
*/
|
||||
function __construct($plugins) {
|
||||
if ($plugins === null) {
|
||||
$plugins = array();
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if (preg_match('~^Adminer.~i', $class) && strcasecmp($this->_findRootClass($class), 'Adminer')) { //! can use interface
|
||||
$plugins[$class] = new $class;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->plugins = $plugins;
|
||||
//! it is possible to use ReflectionObject to find out which plugins defines which methods at once
|
||||
}
|
||||
|
||||
function _callParent($function, $args) {
|
||||
return call_user_func_array(array('parent', $function), $args);
|
||||
}
|
||||
|
||||
function _applyPlugin($function, $args) {
|
||||
foreach ($this->plugins as $plugin) {
|
||||
if (method_exists($plugin, $function)) {
|
||||
switch (count($args)) { // call_user_func_array() doesn't work well with references
|
||||
case 0: $return = $plugin->$function(); break;
|
||||
case 1: $return = $plugin->$function($args[0]); break;
|
||||
case 2: $return = $plugin->$function($args[0], $args[1]); break;
|
||||
case 3: $return = $plugin->$function($args[0], $args[1], $args[2]); break;
|
||||
case 4: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]); break;
|
||||
case 5: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3], $args[4]); break;
|
||||
case 6: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]); break;
|
||||
default: trigger_error('Too many parameters.', E_USER_WARNING);
|
||||
}
|
||||
if ($return !== null) {
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->_callParent($function, $args);
|
||||
}
|
||||
|
||||
function _appendPlugin($function, $args) {
|
||||
$return = $this->_callParent($function, $args);
|
||||
foreach ($this->plugins as $plugin) {
|
||||
if (method_exists($plugin, $function)) {
|
||||
$value = call_user_func_array(array($plugin, $function), $args);
|
||||
if ($value) {
|
||||
$return += $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
// appendPlugin
|
||||
|
||||
function dumpFormat() {
|
||||
$args = func_get_args();
|
||||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function dumpOutput() {
|
||||
$args = func_get_args();
|
||||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function editRowPrint($table, $fields, $row, $update) {
|
||||
}
|
||||
|
||||
function editFunctions($field) {
|
||||
$args = func_get_args();
|
||||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
// applyPlugin
|
||||
|
||||
function name() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function credentials() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function connectSsl() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function permanentLogin($create = false) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function bruteForceKey() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function serverName($server) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function database() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function schemas() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function databases($flush = true) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function queryTimeout() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function headers() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function csp() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function head() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function css() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function loginForm() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function loginFormField($name, $heading, $value) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function login($login, $password) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function tableName($tableStatus) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function fieldName($field, $order = 0) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectLinks($tableStatus, $set = "") {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function foreignKeys($table) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function backwardKeys($table, $tableName) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function backwardKeysPrint($backwardKeys, $row) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectQuery($query, $start, $failed = false) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function sqlCommandQuery($query) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function rowDescription($table) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function rowDescriptions($rows, $foreignKeys) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectLink($val, $field) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectVal($val, $link, $field, $original) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function editVal($val, $field) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function tableStructurePrint($fields) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function tableIndexesPrint($indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectColumnsPrint($select, $columns) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectSearchPrint($where, $columns, $indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectOrderPrint($order, $columns, $indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectLimitPrint($limit) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectLengthPrint($text_length) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectActionPrint($indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectCommandPrint() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectImportPrint() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectEmailPrint($emailFields, $columns) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectColumnsProcess($columns, $indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectSearchProcess($fields, $indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectOrderProcess($fields, $indexes) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectLimitProcess() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectLengthProcess() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectEmailProcess($where, $foreignKeys) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectQueryBuild($select, $where, $group, $order, $limit, $page) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function messageQuery($query, $time, $failed = false) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function editHint($table, $field, $value) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function processInput($field, $value, $function = "") {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function dumpDatabase($db) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function dumpTable($table, $style, $is_view = 0) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function dumpData($table, $style, $query) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function dumpFilename($identifier) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function dumpHeaders($identifier, $multi_table = false) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function importServerPath() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function homepage() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function navigation($missing) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function databasesPrint($missing) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function tablesPrint($tables) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ $dateCounts = $fileCountInfo['dateCounts'];
|
||||
$displayVersions = $versions;
|
||||
|
||||
// Establish the base, host and date dir parts...
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite, PHP_URL_HOST) : "localhost";
|
||||
$backupDirHost = "localhost";
|
||||
|
||||
foreach ($dateCounts as $key => $value) {
|
||||
echo "<b>".date("jS M Y", strtotime($key)) . " (" . $value . " " . ($value !== 1 ? $t["backups"] : $t["backup"]) . ")</b>";
|
||||
|
||||
1786
lib/database-adminer-480-en.php
Normal file
1786
lib/database-adminer-480-en.php
Normal file
File diff suppressed because one or more lines are too long
2051
lib/database.php
2051
lib/database.php
File diff suppressed because one or more lines are too long
@@ -4,13 +4,11 @@ require "icecoder.php";
|
||||
use ICEcoder\ExtraProcesses;
|
||||
use ICEcoder\Backup;
|
||||
use ICEcoder\File;
|
||||
use ICEcoder\FTP;
|
||||
use ICEcoder\System;
|
||||
use ICEcoder\URL;
|
||||
|
||||
$backupClass = new Backup;
|
||||
$fileClass = new File;
|
||||
$ftpClass = new FTP;
|
||||
$systemClass = new System;
|
||||
|
||||
$t = $text['file-control'];
|
||||
@@ -68,14 +66,6 @@ if (false === $error) {
|
||||
}
|
||||
|
||||
$doNext = "";
|
||||
// If we're in FTP mode, start a connection and leave open for FTP actions
|
||||
if (isset($ftpSite)) {
|
||||
$ftpClass->ftpStart();
|
||||
// Show user warning if no good connection
|
||||
if (!$ftpConn || !$ftpLogin) {
|
||||
$doNext .= 'ICEcoder.message("Sorry, no FTP connection to ' . $ftpHost . ' for user ' . $ftpUser . '");';
|
||||
}
|
||||
}
|
||||
|
||||
// =============
|
||||
// LOADING FILES
|
||||
@@ -118,8 +108,7 @@ if (!$error && "save" === $_GET['action']) {
|
||||
"fileURL" => $fileURL,
|
||||
"fileName" => $fileName,
|
||||
"fileMDTURLPart" => $fileMDTURLPart,
|
||||
"fileVersionURLPart" => $fileVersionURLPart,
|
||||
"ftpSite" => true === isset($ftpSite)
|
||||
"fileVersionURLPart" => $fileVersionURLPart
|
||||
];
|
||||
$doNext .= $fileClass->handleSaveLooparound($fileDetails, $finalAction, $t);
|
||||
|
||||
@@ -134,22 +123,17 @@ if (!$error && "save" === $_GET['action']) {
|
||||
// FILE IS WRITEABLE
|
||||
// =================
|
||||
|
||||
if (!$demoMode && (isset($ftpSite) || (file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && "" != $_POST['newFileName'])) {
|
||||
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && "" != $_POST['newFileName'])) {
|
||||
|
||||
$filemtime = !isset($ftpSite) && "Windows" !== $serverType && file_exists($file) ? filemtime($file) : "1000000";
|
||||
$filemtime = "Windows" !== $serverType && file_exists($file) ? filemtime($file) : "1000000";
|
||||
|
||||
// ==================================================
|
||||
// MDT'S MATCH (OR WE'RE SAVING NEW FILE), WRITE FILE
|
||||
// ==================================================
|
||||
if (!(isset($_GET['fileMDT'])) || $filemtime == $_GET['fileMDT'] || isset($_POST['newFileName'])) {
|
||||
|
||||
// FTP Saving
|
||||
if (isset($ftpSite)) {
|
||||
$ftpClass->writeFile();
|
||||
// Local saving
|
||||
} else {
|
||||
$fileClass->writeFile();
|
||||
}
|
||||
// Write file
|
||||
$fileClass->writeFile();
|
||||
|
||||
// Save a version controlled backup source of the file
|
||||
if ($ICEcoder["backupsKept"]) {
|
||||
@@ -192,20 +176,9 @@ if (!$error && "save" === $_GET['action']) {
|
||||
// ==========
|
||||
|
||||
if (!$error && "newFolder" === $_GET['action']) {
|
||||
if (!$demoMode && (isset($ftpSite) || is_writable($docRoot.$fileLoc))) {
|
||||
// FTP
|
||||
if (isset($ftpSite)) {
|
||||
$ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
|
||||
if (!$ftpClass->ftpMkDir($ftpConn, octdec($ICEcoder['newDirPerms']), $ftpFilepath)) {
|
||||
$doNext .= 'ICEcoder.message("Sorry, could not create dir '.$ftpFilepath.' at ' . $ftpHost . '");';
|
||||
} else {
|
||||
$fileClass->updateFileManager('add', $fileLoc, $fileName, '', '', '', 'folder');
|
||||
}
|
||||
// Local
|
||||
} else {
|
||||
mkdir($file, octdec($ICEcoder['newDirPerms']));
|
||||
$fileClass->updateFileManager('add', $fileLoc, $fileName, '', '', '', 'folder');
|
||||
}
|
||||
if (!$demoMode && is_writable($docRoot . $fileLoc)) {
|
||||
mkdir($file, octdec((string) $ICEcoder['newDirPerms']));
|
||||
$fileClass->updateFileManager('add', $fileLoc, $fileName, '', '', '', 'folder');
|
||||
$finalAction = "newFolder";
|
||||
// Run any extra processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
@@ -222,39 +195,22 @@ if (!$error && "newFolder" === $_GET['action']) {
|
||||
// ================
|
||||
|
||||
if (!$error && "move" === $_GET['action']) {
|
||||
if (isset($ftpSite)) {
|
||||
$srcDir = ltrim(str_replace("|", "/", $_GET['oldFileName']), "/");
|
||||
$tgtDir = ltrim($fileLoc . "/" . $fileName, "/");
|
||||
} else {
|
||||
$srcDir = $docRoot . $iceRoot . str_replace("|", "/", $_GET['oldFileName']);
|
||||
$tgtDir = $docRoot . $fileLoc . "/" . $fileName;
|
||||
}
|
||||
$srcDir = $docRoot . $iceRoot . str_replace("|", "/", $_GET['oldFileName']);
|
||||
$tgtDir = $docRoot . $fileLoc . "/" . $fileName;
|
||||
if ($srcDir != $tgtDir) {
|
||||
if (!$demoMode && (isset($ftpSite) || is_writable($srcDir))) {
|
||||
// FTP
|
||||
if (isset($ftpSite)) {
|
||||
if (!$ftpClass->ftpRename($ftpConn, $srcDir, $tgtDir)) {
|
||||
$doNext .= 'ICEcoder.message("Sorry, could not rename ' . $srcDir . ' to ' . $tgtDir . '");';
|
||||
} else {
|
||||
$ftpFileDirInfo = $ftpClass->ftpGetFileInfo($ftpConn, ltrim($fileLoc, "/"), $fileName);
|
||||
$fileOrFolder = "directory" === $ftpFileDirInfo['type'] ? "folder" : "file";
|
||||
$fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder);
|
||||
}
|
||||
// Local
|
||||
if (!$demoMode && is_writable($srcDir)) {
|
||||
if(rename($srcDir, $tgtDir)) {
|
||||
// Is a dir or file (needed to create new item in file manager)
|
||||
$fileOrFolder = is_dir($docRoot . $fileLoc . "/" . $fileName) ? "folder" : "file";
|
||||
$fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder);
|
||||
$doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
|
||||
$finalAction = "move";
|
||||
// Run any extra processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
$doNext = $extraProcessesClass->onFileDirMove($doNext);
|
||||
} else {
|
||||
if(rename($srcDir, $tgtDir)) {
|
||||
// Is a dir or file (needed to create new item in file manager)
|
||||
$fileOrFolder = is_dir($docRoot . $fileLoc . "/" . $fileName) ? "folder" : "file";
|
||||
$fileClass->updateFileManager('move', $fileLoc, $fileName, '', str_replace($iceRoot, "", str_replace("|", "/", $_GET['oldFileName'])), '', $fileOrFolder);
|
||||
$doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
|
||||
$finalAction = "move";
|
||||
// Run any extra processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
$doNext = $extraProcessesClass->onFileDirMove($doNext);
|
||||
} else {
|
||||
$doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
|
||||
$finalAction = "nothing";
|
||||
}
|
||||
$doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
|
||||
$finalAction = "nothing";
|
||||
}
|
||||
} else {
|
||||
$doNext .= "ICEcoder.message('" . $t['Sorry, cannot move'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
|
||||
@@ -272,29 +228,18 @@ if (!$error && "move" === $_GET['action']) {
|
||||
// ==================
|
||||
|
||||
if (!$error && "rename" === $_GET['action']) {
|
||||
if (!$demoMode && (isset($ftpSite) || is_writable($docRoot.$iceRoot.str_replace("|", "/", $_GET['oldFileName'])))) {
|
||||
// FTP
|
||||
if (isset($ftpSite)) {
|
||||
$ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
|
||||
if (!$ftpClass->ftpRename($ftpConn, ltrim($_GET['oldFileName'], "/"), $ftpFilepath)) {
|
||||
$doNext .= 'ICEcoder.message("Sorry, could not rename ' . ltrim($_GET['oldFileName'], "/") . ' to ' . $ftpFilepath . '");';
|
||||
} else {
|
||||
$fileClass->updateFileManager('rename', $fileLoc, $fileName, '', str_replace($iceRoot, "", $_GET['oldFileName']), '', '');
|
||||
}
|
||||
// Local
|
||||
if (!$demoMode && is_writable($docRoot . $iceRoot . str_replace("|", "/", $_GET['oldFileName']))) {
|
||||
if (true === file_exists($docRoot . $fileLoc)) {
|
||||
rename($docRoot.$iceRoot.str_replace("|", "/", $_GET['oldFileName']), $docRoot . $fileLoc . "/" . $fileName);
|
||||
$fileClass->updateFileManager('rename', $fileLoc, $fileName, '', str_replace($iceRoot, "", $_GET['oldFileName']), '', '');
|
||||
$doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
|
||||
$finalAction = "rename";
|
||||
// Run any extra processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
$doNext = $extraProcessesClass->onFileDirRename($doNext);
|
||||
} else {
|
||||
if (true === file_exists($docRoot . $fileLoc)) {
|
||||
rename($docRoot.$iceRoot.str_replace("|", "/", $_GET['oldFileName']), $docRoot . $fileLoc . "/" . $fileName);
|
||||
$fileClass->updateFileManager('rename', $fileLoc, $fileName, '', str_replace($iceRoot, "", $_GET['oldFileName']), '', '');
|
||||
$doNext .= 'tabNum = ICEcoder.openFiles.indexOf(\'' . str_replace("|", "/", $_GET['oldFileName']) . '\') + 1; if (0 < tabNum) {ICEcoder.renameTab(tabNum, \'' . $fileLoc . "/" . $fileName . '\');};';
|
||||
$finalAction = "rename";
|
||||
// Run any extra processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
$doNext = $extraProcessesClass->onFileDirRename($doNext);
|
||||
} else {
|
||||
$doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['does not seem...'] . "');";
|
||||
$finalAction = "nothing";
|
||||
}
|
||||
$doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['does not seem...'] . "');";
|
||||
$finalAction = "nothing";
|
||||
}
|
||||
} else {
|
||||
$doNext .= "ICEcoder.message('".$t['Sorry, cannot rename'] . "\\\\n" . str_replace("|", "/", $_GET['oldFileName']) . "\\\\n\\\\n" . $t['Maybe public write...'] . "');";
|
||||
@@ -307,7 +252,7 @@ if (!$error && "rename" === $_GET['action']) {
|
||||
// PASTE FILE/FOLDER
|
||||
// =================
|
||||
|
||||
if (!isset($ftpSite) && !$error && "paste" === $_GET['action']) {
|
||||
if (!$error && "paste" === $_GET['action']) {
|
||||
$source = $file;
|
||||
$dest = str_replace("//", "/", $docRoot . $iceRoot . str_replace("|", "/", $_GET['location']) . "/" . basename($source));
|
||||
if (!$demoMode && is_writable(dirname($dest))) {
|
||||
@@ -331,7 +276,7 @@ if (!isset($ftpSite) && !$error && "paste" === $_GET['action']) {
|
||||
// UPLOAD FILE(S)
|
||||
// ==============
|
||||
|
||||
if (!isset($ftpSite) && !$error && "upload" === $_GET['action']) {
|
||||
if (!$error && "upload" === $_GET['action']) {
|
||||
if (!$demoMode) {
|
||||
|
||||
if ($_FILES['filesInput']){
|
||||
@@ -358,34 +303,7 @@ if (!isset($ftpSite) && !$error && "upload" === $_GET['action']) {
|
||||
|
||||
if (!$error && "delete" === $_GET['action']) {
|
||||
$filesArray = explode(";", $file); // May contain more than one file here
|
||||
// FTP
|
||||
if (isset($ftpSite)) {
|
||||
if (1 === count($filesArray)) {
|
||||
$ftpFileDirInfo = $ftpClass->ftpGetFileInfo($ftpConn, ltrim($fileLoc, "/"), $fileName);
|
||||
$itemType = "directory" === $ftpFileDirInfo['type'] ? "dir" : "file";
|
||||
$itemPath = ltrim($fileLoc . "/" . $fileName, "/");
|
||||
if (!$demoMode && $ftpClass->ftpDelete($ftpConn, $itemType, $itemPath)) {
|
||||
if ($fileLoc=="" || "\\" === $fileLoc) {
|
||||
$fileLoc = "/";
|
||||
};
|
||||
// Reload file manager
|
||||
$doNext .= 'ICEcoder.selectedFiles = []; ICEcoder.updateFileManagerList(\'delete\', \'' . $fileLoc . '\', \'' . $fileName . '\', false, false, false, \'' . ("dir" === $itemType ? 'folder' : 'file') . '\');';
|
||||
$finalAction = "delete";
|
||||
// Run any extra processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
$doNext = $extraProcessesClass->onFileDirDelete($doNext);
|
||||
} else {
|
||||
$doNext .= "ICEcoder.message('" . $t['Sorry, cannot delete'] . "\\\\n" . $fileLoc . "/" . $fileName . "');";
|
||||
$finalAction = "nothing";
|
||||
}
|
||||
} else {
|
||||
$doNext .= "ICEcoder.message('" . $t['Sorry, cannot delete more...'] . "');";
|
||||
$finalAction = "nothing";
|
||||
}
|
||||
// Local
|
||||
} else {
|
||||
$fileClass->delete();
|
||||
}
|
||||
$fileClass->delete();
|
||||
$doNext .= 'ICEcoder.serverMessage(); ICEcoder.serverQueue("del");';
|
||||
};
|
||||
|
||||
@@ -393,7 +311,7 @@ if (!$error && "delete" === $_GET['action']) {
|
||||
// REPLACE TEXT IN A FILE
|
||||
// ======================
|
||||
|
||||
if (!isset($ftpSite) && !$error && "replaceText" === $_GET['action']) {
|
||||
if (!$error && "replaceText" === $_GET['action']) {
|
||||
if (!$demoMode && is_writable($file)) {
|
||||
$loadedFile = toUTF8noBOM(getData($file), true);
|
||||
$find = $_GET['find'];
|
||||
@@ -419,7 +337,7 @@ if (!isset($ftpSite) && !$error && "replaceText" === $_GET['action']) {
|
||||
// GET CONTENTS OF REMOTE URL
|
||||
// ==========================
|
||||
|
||||
if (!isset($ftpSite) && !$error && "getRemoteFile" === $_GET['action']) {
|
||||
if (!$error && "getRemoteFile" === $_GET['action']) {
|
||||
$lineNumber = max(isset($_REQUEST['lineNumber']) ? intval($_REQUEST['lineNumber']) : 1, 1);
|
||||
|
||||
if ($remoteFile = toUTF8noBOM(getData($file, 'curl'), true)) {
|
||||
@@ -445,20 +363,9 @@ if (!isset($ftpSite) && !$error && "getRemoteFile" === $_GET['action']) {
|
||||
// =======================
|
||||
|
||||
if (!$error && "perms" === $_GET['action']) {
|
||||
if (!$demoMode && (isset($ftpSite) || is_writable($file))) {
|
||||
// FTP
|
||||
if (isset($ftpSite)) {
|
||||
$ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
|
||||
if (!$ftpClass->ftpPerms($ftpConn, octdec(numClean($_GET['perms'])), $ftpFilepath)) {
|
||||
$doNext .= 'ICEcoder.message("Sorry, could not set perms on ' . $ftpFilepath . ' at ' . $ftpHost . '");';
|
||||
} else {
|
||||
$fileClass->updateFileManager('chmod', $fileLoc, $fileName, numClean($_GET['perms']), '', '', '');
|
||||
}
|
||||
// Local
|
||||
} else {
|
||||
chmod($file, octdec(numClean($_GET['perms'])));
|
||||
$fileClass->updateFileManager('chmod', $fileLoc, $fileName, numClean($_GET['perms']), '', '', '');
|
||||
}
|
||||
if (!$demoMode && is_writable($file)) {
|
||||
chmod($file, octdec((string) numClean($_GET['perms'])));
|
||||
$fileClass->updateFileManager('chmod', $fileLoc, $fileName, numClean($_GET['perms']), '', '', '');
|
||||
$finalAction = "perms";
|
||||
// Run any custom processes
|
||||
$extraProcessesClass = new ExtraProcesses($fileLoc, $fileName);
|
||||
@@ -474,7 +381,7 @@ if (!$error && "perms" === $_GET['action']) {
|
||||
// CHECK FOR A FILE/DIR
|
||||
// ====================
|
||||
|
||||
if (!isset($ftpSite) && !$error && "checkExists" === $_GET['action']) {
|
||||
if (!$error && "checkExists" === $_GET['action']) {
|
||||
// This action is called under seperate AJAX call and the responseText object stored in ICEcoder.lastFileDirCheckStatusObj
|
||||
// Nothing really done here though, we do something with the responseText
|
||||
$finalAction = "checkExists";
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
<?php
|
||||
die("FTP Manager now offline");
|
||||
|
||||
include "headers.php";
|
||||
include "settings.php";
|
||||
$t = $text['ftp-manager'];
|
||||
|
||||
// If we have an action to perform
|
||||
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_GET['action'])) {
|
||||
|
||||
// Get our old FTP sites & user settings
|
||||
$oldFTPSites = $ICEcoder["ftpSites"];
|
||||
$settingsContents = getData("../data/" . $settingsFile);
|
||||
|
||||
// ========
|
||||
// CHOOSING
|
||||
// ========
|
||||
if ("choose" === $_GET['action']) {
|
||||
|
||||
// Set the site ref in session, hide the popup and reload the file manager
|
||||
$_SESSION['ftpSiteRef'] = numClean($_GET['ftpSiteRef']);
|
||||
// Hide this popup and reload file manager
|
||||
echo "<script>parent.parent.ICEcoder.showHide('hide', parent.document.getElementById('blackMask')); parent.parent.ICEcoder.refreshFileManager();</script>";
|
||||
} else {
|
||||
// Start creating a new chunk for the FTP sites
|
||||
$settingsNew = '"ftpSites" => array(
|
||||
';
|
||||
}
|
||||
|
||||
// ======
|
||||
// ADDING
|
||||
// ======
|
||||
|
||||
if ($_GET['action']=="add") {
|
||||
|
||||
// Add the new FTP site
|
||||
if ($_POST['ftpSiteNEW'] != "") {
|
||||
$settingsNew .= ' array(
|
||||
"site" => "' . injClean($_POST['ftpSiteNEW']) . '",
|
||||
"host" => "' . injClean($_POST['ftpHostNEW']) . '",
|
||||
"user" => "' . injClean($_POST['ftpUserNEW']) . '",
|
||||
"pass" => "' . injClean($_POST['ftpPassNEW']) . '",
|
||||
"pasv" => ' . injClean($_POST['ftpPASVNEW']) . ',
|
||||
"mode" => "' . injClean($_POST['ftpModeNEW']) . '",
|
||||
"root" => "' . injClean($_POST['ftpRootNEW']) . '"
|
||||
),
|
||||
';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ===============================================
|
||||
// UPDATING & REMOVING PLUS UPDATE CONFIG SETTINGS
|
||||
// ===============================================
|
||||
|
||||
if ("choose" !== $_GET['action'] && "edit" !== $_GET['action']) {
|
||||
|
||||
// Look at each of the existing FTP sites
|
||||
for ($i = 0; $i < count($oldFTPSites); $i++) {
|
||||
|
||||
// Updating
|
||||
if ("update" === $_GET['action'] && $i == $_GET['ftpSiteRef']) {
|
||||
$settingsNew .= ' array(
|
||||
"site" => "' . injClean($_POST['ftpSiteNEW']) . '",
|
||||
"host" => "' . injClean($_POST['ftpHostNEW']) . '",
|
||||
"user" => "' . injClean($_POST['ftpUserNEW']) . '",
|
||||
"pass" => "' . injClean($_POST['ftpPassNEW']) . '",
|
||||
"pasv" => ' . injClean($_POST['ftpPASVNEW']) . ',
|
||||
"mode" => "' . injClean($_POST['ftpModeNEW']) . '",
|
||||
"root" => "' . injClean($_POST['ftpRootNEW']) . '"
|
||||
),
|
||||
';
|
||||
// Deleting
|
||||
} elseif ("remove" === $_GET['action'] && $i == $_GET['ftpSiteRef']) {
|
||||
// Do nothing, so we ignore this entry now
|
||||
|
||||
// Entry is as before
|
||||
} else {
|
||||
$settingsNew .= ' array(
|
||||
"site" => "' . $oldFTPSites[$i]['site'] . '",
|
||||
"host" => "' . $oldFTPSites[$i]['host'] . '",
|
||||
"user" => "' . $oldFTPSites[$i]['user'] . '",
|
||||
"pass" => "' . $oldFTPSites[$i]['pass'] . '",
|
||||
"pasv" => ' . ($oldFTPSites[$i]['pasv'] ? 'true' : 'false') . ',
|
||||
"mode" => "' . ('FTP_ASCII' === $oldFTPSites[$i]['mode'] ? 'FTP_ASCII' : 'FTP_BINARY') . '",
|
||||
"root" => "' . $oldFTPSites[$i]['root'] . '"
|
||||
),
|
||||
';
|
||||
}
|
||||
}
|
||||
// Rtrim off the last comma
|
||||
$settingsNew = rtrim($settingsNew,',
|
||||
');
|
||||
$settingsNew .= '
|
||||
),' . PHP_EOL;
|
||||
|
||||
// Now we have a new settingsNew string to use
|
||||
// we can update the FTP sites in the settings file
|
||||
|
||||
// Identify the bit to replace
|
||||
$repPosStart = strpos($settingsContents, '"ftpSites"');
|
||||
$repPosEnd = strpos($settingsContents, '"tutorialOnLogin"');
|
||||
|
||||
// Compile our new settings
|
||||
$settingsContents = substr($settingsContents, 0, $repPosStart) . $settingsNew . substr($settingsContents, $repPosEnd, strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable("../data/" . $settingsFile)) {
|
||||
$fh = fopen("../data/" . $settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
// Finally, reload the iFrame screen for the user
|
||||
header("Location: ftp-manager.php?updatedFTPSites&csrf=" . $_SESSION["csrf"]);
|
||||
echo "<script>window.location = 'ftp-manager.php?updatedFTPSites&csrf=' + parent.parent.ICEcoder.csrf;</script>";
|
||||
die($t['Saving FTP sites']);
|
||||
} else {
|
||||
echo "<script>parent.parent.ICEcoder.message('" . $t['Cannot update config...'] . " data/" . $settingsFile . " " . $t['and try again'] . "');</script>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> FTP manager</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="../assets/css/resets.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" type="text/css" href="../assets/css/ftp-manager.css?microtime=<?php echo microtime(true);?>">
|
||||
</head>
|
||||
|
||||
<body class="ftpManager" onkeyup="parent.ICEcoder.handleModalKeyUp(event, 'ftpManager')" onload="this.focus();">
|
||||
|
||||
<h1><?php echo $t['ftp manager'];?></h1>
|
||||
|
||||
<div style="display: inline-block; width: 620px; height: 440px; overflow-y: auto">
|
||||
<?php
|
||||
$ftpSites = $ICEcoder['ftpSites'];
|
||||
if (count($ftpSites) > 0) {
|
||||
?>
|
||||
<div style="display: inline-block; width: 600px; margin-bottom: 30px">
|
||||
<h2><?php echo $t['Choose existing site'];?></h2><br>
|
||||
|
||||
<form id="ftpUpdateForm" action="ftp-manager.php?action=update" method="POST">
|
||||
<table style="width: 100%">
|
||||
<?php
|
||||
for ($i = 0; $i < count($ftpSites); $i++) {
|
||||
echo '<tr>';
|
||||
echo '<td style="padding: 10px 10px 8px 0">' . $ftpSites[$i]['site'] . '</td>';
|
||||
echo '<td style="padding: 10px 10px 8px 0">' . $ftpSites[$i]['host'] . '</td>';
|
||||
echo '<td style="padding: 10px 10px 8px 0"><a href="ftp-manager.php?action=edit&ftpSiteRef=' . $i . '&csrf=' . $_SESSION["csrf"] . '" class="blue">Edit</a></td>';
|
||||
echo '<td style="padding: 10px 10px 8px 0"><a href="ftp-manager.php?action=remove&ftpSiteRef=' . $i . '&csrf=' . $_SESSION["csrf"] . '" class="blue" onclick="return parent.parent.ICEcoder.ask(\'' . $t['Are you sure...'] . '\')">Delete</a></td>';
|
||||
echo '<td style="padding: 2px 20px 8px 0; text-align: right"><div style="display: inline-block; padding: 5px; margin-top: 4px; background: #2187e7; color: #fff; font-size: 12px; cursor: pointer" onclick="window.location=\'ftp-manager.php?action=choose&ftpSiteRef=' . $i . '&csrf=' . $_SESSION["csrf"] . '\'">' . $t['Choose'] . '</div></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<div style="display: inline-block; width: 600px">
|
||||
<h2><?php echo isset($_GET['action']) && "edit" === $_GET['action'] ? $t['Edit site'] : $t['Add new site'];?></h2><br>
|
||||
|
||||
<form id="ftpAddEditForm" action="ftp-manager.php?action=<?php echo isset($_GET['action']) && "edit" === $_GET['action'] ? "update&ftpSiteRef=" . numClean($_GET['ftpSiteRef']) : "add";?>" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo $t['Site base'];?> <span class="info" title="<?php echo $t['eg http://yourdomain.com'];?>">[?]</span></td>
|
||||
<td><?php echo $t['Host'];?> <span class="info" title="<?php echo $t['eg ftp.yourdomain.com'];?>">[?]</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 0 10px 8px 0"><input type="text" name="ftpSiteNEW" value="<?php if (isset($_GET['action']) && "edit" === $_GET['action']) {echo $ICEcoder['ftpSites'][numClean($_GET['ftpSiteRef'])]['site'];};?>" style="width: 272px"></td>
|
||||
<td style="padding: 0 0 8px 0"><input type="text" name="ftpHostNEW" value="<?php if (isset($_GET['action']) && "edit" === $_GET['action']) {echo $ICEcoder['ftpSites'][numClean($_GET['ftpSiteRef'])]['host'];};?>" style="width: 272px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $t['Username'];?> <span class="info" title="<?php echo $t['eg user123'];?>">[?]</span></td>
|
||||
<td><?php echo $t['Password'];?> <span class="info" title="<?php echo $t['eg pass123'];?>">[?]</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 0 10px 8px 0"><input type="text" name="ftpUserNEW" value="<?php if (isset($_GET['action']) && "edit" === $_GET['action']) {echo $ICEcoder['ftpSites'][numClean($_GET['ftpSiteRef'])]['user'];};?>" style="width: 272px"></td>
|
||||
<td style="padding: 0 0 8px 0"><input type="password" name="ftpPassNEW" value="<?php if (isset($_GET['action']) && "edit" === $_GET['action']) {echo $ICEcoder['ftpSites'][numClean($_GET['ftpSiteRef'])]['pass'];};?>" style="width: 272px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $t['PASV and mode'];?> <span class="info" title="<?php echo $t['Use PASV mode...'];?>">[?]</span></td>
|
||||
<td><?php echo $t['Root'];?> <span class="info" title="<?php echo $t['eg /htdocs'];?>">[?]</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 0 10px 8px 0">
|
||||
<select name="ftpPASVNEW">
|
||||
<option value="false"<?php echo isset($_GET['action']) && "edit" === $_GET['action'] && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['pasv'] == false ? " selected" : "";?>><?php echo $t['PASV connection off'];?></option>
|
||||
<option value="true"<?php echo isset($_GET['action']) && "edit" === $_GET['action'] && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['pasv'] == true ? " selected" : "";?>><?php echo $t['PASV connection on'];?></option>
|
||||
</select>
|
||||
<select name="ftpModeNEW">
|
||||
<option value="FTP_ASCII"<?php echo isset($_GET['action']) && "edit" === $_GET['action'] && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['mode'] == "FTP_ASCII" ? " selected" : "";?>><?php echo $t['ASCII transfer'];?></option>
|
||||
<option value="FTP_BINARY"<?php echo isset($_GET['action']) && "edit" === $_GET['action'] && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['mode'] == "FTP_BINARY" ? " selected" : "";?>><?php echo $t['Binary transfer'];?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="padding: 0 0 8px 0"><input type="text" name="ftpRootNEW" value="<?php if (isset($_GET['action']) && "edit" === $_GET['action']) {echo $ICEcoder['ftpSites'][numClean($_GET['ftpSiteRef'])]['root'];};?>" style="width: 272px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding: 3px 0 8px 0; text-align: right"><div style="display: inline-block; padding: 5px; background: #2187e7; color: #fff; font-size: 12px; cursor: pointer" onclick="document.getElementById('ftpAddEditForm').submit()"><?php echo isset($_GET['action']) && "edit" === $_GET['action'] ? $t['Update'] : $t['Add'];?></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,10 +1,6 @@
|
||||
<?php
|
||||
require "icecoder.php";
|
||||
|
||||
use ICEcoder\FTP;
|
||||
|
||||
$ftpClass = new FTP;
|
||||
|
||||
if (!$_SESSION['loggedIn']) {
|
||||
header("Location: ../");
|
||||
die();
|
||||
@@ -16,7 +12,7 @@ $t = $text['get-branch'];
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder v<?php echo $ICEcoder["versionNo"];?> get branch</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> get branch</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
</head>
|
||||
@@ -25,32 +21,15 @@ $t = $text['get-branch'];
|
||||
<?php
|
||||
// If we're just getting a branch, get that and set as the finalArray
|
||||
$scanDir = $docRoot . $iceRoot;
|
||||
$location = "";
|
||||
|
||||
echo '<div id="branch" style="display: none">';
|
||||
$location = str_replace("|", "/", xssClean($_GET['location'], "html"));
|
||||
if ("/" === $location) {
|
||||
$location = "";
|
||||
};
|
||||
|
||||
$dirArray = $filesArray = $finalArray = [];
|
||||
|
||||
// Get dir/file list over FTP
|
||||
if (isset($ftpSite)) {
|
||||
$ftpClass->ftpStart();
|
||||
// Show user warning if no good connection
|
||||
if (!$ftpConn || !$ftpLogin) {
|
||||
die('<script>parent.parent.ICEcoder.message("Sorry, no FTP connection to ' . $ftpHost . ' for user ' . $ftpUser . '");</script>');
|
||||
exit;
|
||||
}
|
||||
// Get our simple and detailed lists and close the FTP connection
|
||||
$ftpList = $ftpClass->ftpGetList($ftpConn, $ftpRoot . $location);
|
||||
$finalArray = $ftpList['simpleList'];
|
||||
$ftpItems = $ftpList['detailedList'];
|
||||
$ftpClass->ftpEnd();
|
||||
// or get local list
|
||||
} else {
|
||||
$finalArray = scanDir($scanDir . $location);
|
||||
}
|
||||
$dirArray = $filesArray = [];
|
||||
$finalArray = scanDir($scanDir . $location);
|
||||
|
||||
foreach($finalArray as $entry) {
|
||||
$canAdd = true;
|
||||
@@ -59,20 +38,14 @@ foreach($finalArray as $entry) {
|
||||
$canAdd = false;
|
||||
}
|
||||
}
|
||||
// Only applicable for local dir, ignoring ICEcoder's dir
|
||||
if (!isset($ftpSite) && $docRoot . $iceRoot . $location . "/" . $entry === $docRoot . $ICEcoderDir) {
|
||||
// Ignore ICEcoder's dir
|
||||
if ($docRoot . $iceRoot . $location . "/" . $entry === $docRoot . $ICEcoderDir) {
|
||||
$canAdd = false;
|
||||
}
|
||||
if ("." !== $entry && ".." !== $entry && $canAdd) {
|
||||
if (!isset($ftpSite)) {
|
||||
is_dir($docRoot . $iceRoot . $location . "/".$entry)
|
||||
is_dir($docRoot . $iceRoot . $location . "/".$entry)
|
||||
? array_push($dirArray, $location . "/" . $entry)
|
||||
: array_push($filesArray, $location . "/" . $entry);
|
||||
} else {
|
||||
"directory" === $ftpItems[$entry]['type']
|
||||
? array_push($dirArray, $location . "/" . $entry)
|
||||
: array_push($filesArray, $location. "/" . $entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
natcasesort($dirArray);
|
||||
@@ -81,11 +54,7 @@ natcasesort($filesArray);
|
||||
$finalArray = array_merge($dirArray, $filesArray);
|
||||
for ($i = 0; $i < count($finalArray); $i++) {
|
||||
$fileFolderName = str_replace("\\", "/", $finalArray[$i]);
|
||||
if (!isset($ftpSite)) {
|
||||
$type = is_dir($docRoot . $iceRoot . $fileFolderName) ? "folder" : "file";
|
||||
} else {
|
||||
$type = "directory" === $ftpItems[basename($fileFolderName)]['type'] ? "folder" : "file";
|
||||
}
|
||||
$type = is_dir($docRoot . $iceRoot . $fileFolderName) ? "folder" : "file";
|
||||
if ("file" === $type) {
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-" . pathinfo($docRoot . $iceRoot . $fileFolderName, PATHINFO_EXTENSION);
|
||||
@@ -113,25 +82,9 @@ for ($i = 0; $i < count($finalArray); $i++) {
|
||||
(("folder" === $type) ? " parent.ICEcoder.openCloseDir(this,$loadParam);" : "") .
|
||||
|
||||
" if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {parent.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".xssClean(basename($fileFolderName),"html")."</span> ";
|
||||
if (!isset($ftpSite)) {
|
||||
$thisPermVal = "Windows" !== $serverType ? intval(substr(sprintf('%o', fileperms($docRoot . $iceRoot . $fileFolderName)), -3)) : 0;
|
||||
} else {
|
||||
// Work out perms value
|
||||
$thisPermVal = 0;
|
||||
$r = $ftpItems[basename($fileFolderName)]['rights'];
|
||||
// Owner
|
||||
$thisPermVal += "r" === substr($r,1,1) ? 400 : 0;
|
||||
$thisPermVal += "w" === substr($r,2,1) ? 200 : 0;
|
||||
$thisPermVal += "x" === substr($r,3,1) ? 100 : 0;
|
||||
// Group
|
||||
$thisPermVal += "r" === substr($r,4,1) ? 40 : 0;
|
||||
$thisPermVal += "w" === substr($r,5,1) ? 20 : 0;
|
||||
$thisPermVal += "x" === substr($r,6,1) ? 10 : 0;
|
||||
// Public
|
||||
$thisPermVal += "r" === substr($r,7,1) ? 4 : 0;
|
||||
$thisPermVal += "w" === substr($r,8,1) ? 2 : 0;
|
||||
$thisPermVal += "x" === substr($r,9,1) ? 1 : 0;
|
||||
}
|
||||
$thisPermVal = "Windows" !== $serverType
|
||||
? intval(substr(sprintf('%o', fileperms($docRoot . $iceRoot . $fileFolderName)), -3))
|
||||
: 0;
|
||||
$permColors = 777 === $thisPermVal ? 'background: #800; color: #eee' : 'color: #888';
|
||||
echo '<span style="' . $permColors . '; font-size: 8px" id="' . str_replace($docRoot, "", str_replace("/", "|", $fileFolderName)) . '_perms">';
|
||||
echo 0 !== $thisPermVal ? $thisPermVal : '';
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
include_once "settings.php" ;
|
||||
$text = $_SESSION['text'];
|
||||
$t = $text['settings-update'];
|
||||
|
||||
// Update our 'root' value to be blank
|
||||
// which resets the file manager to localhost root again
|
||||
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) {
|
||||
$settingsContents = getData("../data/" . $settingsFile);
|
||||
// Replace our root var
|
||||
$repPosStart = strpos($settingsContents, '"root"');
|
||||
$repPosEnd = strpos($settingsContents, '"checkUpdates"');
|
||||
|
||||
// Compile our new settings
|
||||
$settingsContents =
|
||||
substr($settingsContents, 0, $repPosStart).
|
||||
'"root" => "",'.PHP_EOL.
|
||||
substr($settingsContents, ($repPosEnd), strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable("../data/" . $settingsFile)) {
|
||||
$fh = fopen("../data/" . $settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
|
||||
// Clear any FTP session we may have
|
||||
$_SESSION['ftpSiteRef'] = false;
|
||||
|
||||
// Now we've reset the root path to localhost root, refresh the file manager to show it
|
||||
echo "<script>parent.parent.ICEcoder.refreshFileManager();</script>";
|
||||
} else {
|
||||
echo "<script>parent.parent.ICEcoder.message('" . $t['Cannot update config'] . " data/" . $settingsFile . " " . $t['and try again'] . "');</script>";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
;};
|
||||
@@ -48,6 +48,7 @@ $t = $text['help'];
|
||||
|
||||
<h2><?php echo $t['On Tabs'];?></h2>
|
||||
<span class="key"><?php echo $t['Middle click'];?></span> <span class="shortcut"><?php echo $t['Close tab'];?></span><br>
|
||||
<span class="key"><?php echo $t['Double click'];?></span> <span class="shortcut"><?php echo $t['Contract expand file...'];?></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Backspace</span> <span class="shortcut"><?php echo $t['Jump to previous tab'];?></span><br><br>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
require_once "../classes/_ExtraProcesses.php";
|
||||
require_once "../classes/Backup.php";
|
||||
require_once "../classes/File.php";
|
||||
require_once "../classes/FTP.php";
|
||||
require_once "../classes/Settings.php";
|
||||
require_once "../classes/System.php";
|
||||
require_once "../classes/URL.php";
|
||||
|
||||
@@ -3,7 +3,7 @@ include "headers.php";
|
||||
include "settings.php";
|
||||
|
||||
// File extensions to look for functions & classes in
|
||||
$indexableFileExts = ["php", "js", "coffee", "ts", "rb", "py", "mpy", "sql", "erl", "java", "jl", "c", "cpp", "ino", "cs", "go", "lua", "pl"];
|
||||
$indexableFileExts = ["php", "js", "coffee", "ts", "rb", "py", "mpy", "sql", "erl", "java", "jl", "c", "h", "cpp", "ino", "cs", "go", "lua", "pl"];
|
||||
|
||||
// Fallback for prevIndexData to start off initially
|
||||
$prevIndexData = [];
|
||||
@@ -19,7 +19,7 @@ if (file_exists($docRoot . $ICEcoderDir . "/data/index.php")) {
|
||||
}
|
||||
|
||||
// Roughly 1 in 100 index runs, we'll do a full index
|
||||
if (mt_rand(1,100) === 50) {
|
||||
if (mt_rand(1, 100) === 50) {
|
||||
$prevIndexData = [];
|
||||
}
|
||||
|
||||
@@ -47,10 +47,20 @@ function phpGrep($path, $base) {
|
||||
if (is_dir($filePath)) {
|
||||
$ret .= phpGrep($filePath, $base);
|
||||
} else {
|
||||
// Check if we should scan within this file, by only considering files that may contain functions & classes
|
||||
// Check if we should scan within this file, by only considering files that may contain functions & classes...
|
||||
// Must be in the indexableFileExts list
|
||||
if (false === in_array($filePathExt, $indexableFileExts)) {
|
||||
continue;
|
||||
}
|
||||
$finfo = "text";
|
||||
// Must have a MIME type string starting with "text" (also avoids "empty" files)
|
||||
if (function_exists('finfo_open')) {
|
||||
$finfoMIME = finfo_open(FILEINFO_MIME);
|
||||
$finfo = finfo_file($finfoMIME, $filePath);
|
||||
}
|
||||
if (0 !== strpos($finfo, "text")) {
|
||||
continue;
|
||||
}
|
||||
// Check if file appears to be the same (same size and mtime), if so, continue as we'll assume it's not changed
|
||||
if (isset($prevIndexData['files'][$filePath]) &&
|
||||
$prevIndexData['files'][$filePath]['size'] === stat($filePath)['size'] &&
|
||||
@@ -91,7 +101,7 @@ function phpGrep($path, $base) {
|
||||
(($filePathExt === "py" || $filePathExt === "mpy" || $filePathExt === "rb") && strpos($line, "def") !== false && strpos($line, "def") < strpos($line, "(")) ||
|
||||
(($filePathExt === "js" || $filePathExt === "ts") && strpos($line, "=>") !== false) ||
|
||||
(($filePathExt === "erl" || $filePathExt === "coffee") && strpos($line, "->") !== false) ||
|
||||
(($filePathExt === "c" || $filePathExt === "cpp") && strpos($line, "{") !== false && strpos($line, "{") > strpos($line, "(")) ||
|
||||
(($filePathExt === "c" || $filePathExt === "h" || $filePathExt === "cpp" || $filePathExt === "ino") && strpos($line, "{") !== false && strpos($line, "{") > strpos($line, "(")) ||
|
||||
($filePathExt === "go" && strpos($line, "func") !== false && strpos($line, "func") < strpos($line, "(")) ||
|
||||
// ...or if the line contains "function" before opening parens...
|
||||
(strpos($line, "function") !== false && strpos($line, "function") < strpos($line, "("))
|
||||
@@ -119,6 +129,11 @@ function phpGrep($path, $base) {
|
||||
$functionArgs = str_replace('=', ' = ', $functionArgs);
|
||||
$functionArgs = preg_replace('/\s+/', ' ', $functionArgs);
|
||||
|
||||
// Limit function args list to 200 char max
|
||||
if (strlen($functionArgs) > 200) {
|
||||
$functionArgs = substr($functionArgs, 0, 200) . "...)";
|
||||
}
|
||||
|
||||
// Finally, we have our function name and args
|
||||
$functionText = [
|
||||
0 => $functionName,
|
||||
@@ -184,6 +199,7 @@ function phpGrep($path, $base) {
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($fp);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,30 @@
|
||||
<?php
|
||||
include "headers.php";
|
||||
include "settings.php";
|
||||
|
||||
// Redirect up 2 dirs to get into ICEcoder (useful if we changed setting and refresh)
|
||||
if (false === $ICEcoder['loginRequired']) {
|
||||
$tgtDir = dirname(dirname($_SERVER['REQUEST_URI']));
|
||||
header('Location: ' . $tgtDir);
|
||||
echo "<script>window.location = '" . $tgtDir . "';</script>";
|
||||
exit;
|
||||
}
|
||||
|
||||
$t = $text['login'];
|
||||
|
||||
$settingPW = $ICEcoder["enableRegistration"] && ($ICEcoder["multiUser"] || "" === $ICEcoder["password"]);
|
||||
$settingPW = true === $ICEcoder["enableRegistration"] && (true === $ICEcoder["multiUser"] || "" === $ICEcoder["password"]);
|
||||
|
||||
// If multiUser, detect which users we have
|
||||
if ($ICEcoder["multiUser"]) {
|
||||
$configUsernames = [];
|
||||
$handle = opendir('../data/');
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file !== "config-global.php" && 0 === strpos($file, "config-")) {
|
||||
$configUsernames[explode("-", $file)[1]] = true;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -11,7 +32,7 @@ $settingPW = $ICEcoder["enableRegistration"] && ($ICEcoder["multiUser"] || "" ==
|
||||
<head>
|
||||
<title>ICEcoder <?php
|
||||
echo $ICEcoder["versionNo"] . " : ";
|
||||
echo $settingPW ? "Setup" : "Login";
|
||||
echo true === $settingPW ? "Setup" : "Login";
|
||||
?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
@@ -21,27 +42,37 @@ echo $settingPW ? "Setup" : "Login";
|
||||
<link rel="icon" type="image/png" href="../assets/images/favicon.png">
|
||||
</head>
|
||||
|
||||
<body style="background-color: #181817" onLoad="<?php if (false === isset($_GET["get"])) {$inputFocus = true === $ICEcoder["multiUser"] ? "username" : "password"; echo "document.settingsUpdate." . $inputFocus . ".focus(); ";}; ?>setTimeout(function(){document.getElementById('screenContainer').style.opacity = '1'}, 50)">
|
||||
<body style="background-color: #181817" onLoad="<?php if (false === isset($_GET["get"])) {$inputFocus = true === $ICEcoder["multiUser"] && (true === $ICEcoder["enableRegistration"] || 1 < count($configUsernames)) ? "username" : "password"; echo "document.settingsUpdate." . $inputFocus . ".focus(); ";}; ?>setTimeout(function(){document.getElementById('screenContainer').style.opacity = '1'}, 50)">
|
||||
|
||||
<div class="screenContainer" id="screenContainer" style="background-color: #181817; opacity: 0; transition: opacity 0.1s ease-out">
|
||||
<div class="screenVCenter">
|
||||
<div class="screenCenter">
|
||||
<img src="../assets/images/icecoder.png" alt="ICEcoder">
|
||||
<div class="version" style="margin-bottom: 22px">v<?php echo $ICEcoder["versionNo"];?></div>
|
||||
<div class="version" style="margin-bottom: 22px"><?php echo $ICEcoder["versionNo"];?></div>
|
||||
|
||||
<form name="settingsUpdate" action="login.php" method="POST"<?php if ($settingPW) {?> onsubmit="return checkCanSubmit();"<?php } ?>>
|
||||
<form name="settingsUpdate" action="login.php" method="POST"<?php if (true === $settingPW) {?> onsubmit="return checkCanSubmit();"<?php } ?>>
|
||||
<?php
|
||||
if (true === $settingPW && false === $ICEcoder["multiUser"]) {
|
||||
echo '<div class="text adminUser">User: admin</div>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($ICEcoder["multiUser"]) {echo '<input type="text" name="username" class="password"><br><br>';};
|
||||
// Display username field if multiUser enabled
|
||||
if (true === $ICEcoder["multiUser"]) {
|
||||
// Also set value to "admin" if only 1 user (has to be admin)
|
||||
$showAdminValue = 1 === count($configUsernames) ? ' value="admin"' : '';
|
||||
echo '<input type="text" name="username"' . $showAdminValue . ' class="password"><br><br>';
|
||||
};
|
||||
?>
|
||||
<input type="password" name="password" class="password" id="password"<?php
|
||||
if ($settingPW) {
|
||||
if (true === $settingPW) {
|
||||
?> onkeyup="checkCase(event); pwStrength(this.value)" onchange="pwStrength(this.value)" onpaste="pwStrength(this.value)"<?php
|
||||
} else {
|
||||
?> onkeyup="checkCase(event)"<?php
|
||||
}
|
||||
?>><div class="iconCapsLock" style="display: none" id="iconCapsLock" title="Caps lock on"><?php echo file_get_contents(dirname(__FILE__) . "/../assets/images/icons/alert-triangle.svg");?></div><br>
|
||||
<?php
|
||||
if ($settingPW) {
|
||||
if (true === $settingPW) {
|
||||
echo '<div id="pwReqs">'.
|
||||
'<div class="text" style="display: inline-block" id="pwChars">10+</div> ' .
|
||||
'<div class="text" style="display: inline-block" id="pwUpper">upper</div> ' .
|
||||
@@ -82,6 +113,10 @@ echo $settingPW ? "Setup" : "Login";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
echo $systemClass->getDemoModeIndicator(true);
|
||||
?>
|
||||
|
||||
<script>
|
||||
// Get any elem by ID
|
||||
const get = function(elem) {
|
||||
@@ -127,12 +162,12 @@ const checkCase = function(evt) {
|
||||
const checkCanSubmit = function() {
|
||||
// Password isn't strong enough, shake requirements
|
||||
if(false === pwStrength(get("password").value)) {
|
||||
var posArray = [6, -6, 3, -3, 0];
|
||||
var posArray = [24, -24, 12, -12, 6, -6, 3, -3, 0];
|
||||
var pos = -1;
|
||||
var anim = setInterval(function() {
|
||||
if (pos < posArray.length) {
|
||||
pos++;
|
||||
get("pwReqs").style.marginLeft = posArray[pos] + "px";
|
||||
get("pwReqs").style.marginLeft = get("password").style.marginLeft = posArray[pos] + "px";
|
||||
} else {
|
||||
clearInterval(anim);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
// TODO: The whole file needs a refactor and comments!
|
||||
include "headers.php";
|
||||
include "settings.php";
|
||||
$t = $text['multiple-results'];
|
||||
?>
|
||||
<?php
|
||||
if (true === isset($_GET['selectedFiles'])) {
|
||||
$selectedFiles = explode(":", $_GET['selectedFiles']);
|
||||
}
|
||||
$selectedFiles = true === isset($_GET['selectedFiles'])
|
||||
? explode(":", $_GET['selectedFiles'])
|
||||
: [];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -48,24 +49,27 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
let foundInSelected = false;
|
||||
const userTarget = parent.document.findAndReplace.target.value;
|
||||
const findText = parent.document.findAndReplace.find.value;
|
||||
const regexFindText = true === parent.ICEcoder.findRegex ? findText : parent.ICEcoder.escapeRegex(findText);
|
||||
const rExp = new RegExp("(" + regexFindText + ")", "gi");
|
||||
<?php
|
||||
$findText = str_replace("ICEcoder:", "", str_replace("'", "\'", $_GET['find']));
|
||||
// Find in open docs?
|
||||
// TODO: This doesn't actually replace if using regex, it doesn't error - tabs show a change, but nothing replaced
|
||||
if (false === isset($_GET['target'])) {
|
||||
$targetName = $t['document'];
|
||||
?>
|
||||
let startTab = parent.ICEcoder.selectedTab;
|
||||
const rExp = new RegExp(findText, "gi");
|
||||
|
||||
for (let i = 1; i <= parent.ICEcoder.openFiles.length; i++) {
|
||||
parent.ICEcoder.switchTab(i);
|
||||
const cM = parent.ICEcoder.getcMInstance();
|
||||
const content = cM.getValue();
|
||||
if (content.match(rExp)) {
|
||||
const selectNext = true;
|
||||
rData = parent.ICEcoder.findInCMContent(cM, rExp, selectNext);
|
||||
if (0 < rData.results.length) {
|
||||
resultsDisplay +=
|
||||
'<a href="javascript:gotoTab(' + i + '); goFind()">' +
|
||||
parent.ICEcoder.openFiles[i - 1] +
|
||||
'</a><br><div id="foundCount' + i + '"><?php echo $t['Found'];?> ' +
|
||||
content.match(rExp).length +
|
||||
rData.results.length +
|
||||
' <?php echo $t['times'];?></div>';
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay +=
|
||||
@@ -79,50 +83,64 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
parent.ICEcoder.switchTab(startTab);
|
||||
}
|
||||
<?php
|
||||
// Find in files or filenames
|
||||
// Find in files or filenames
|
||||
} else {
|
||||
// filenames
|
||||
if (0 < strpos($_GET['target'], "filenames")) {
|
||||
$targetName = $t['file folder'];
|
||||
?>
|
||||
const spansArray = parent.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
||||
for (let i = 0; i < spansArray.length; i++) {
|
||||
let foundInSelected = false;
|
||||
const targetURLElem = spansArray[i];
|
||||
const targetURL = spansArray[i].id.replace(/\|/g, "/").toLowerCase();
|
||||
const targetURLDisplay = spansArray[i].id.replace(/\|/g, "/"); // Original filename incl casing
|
||||
const targetName = targetURL.substring(targetURL.lastIndexOf("/") + 1);
|
||||
let haveMatch = false;
|
||||
while ((match = rExp.exec(targetName)) !== null) {
|
||||
haveMatch = true;
|
||||
}
|
||||
if (
|
||||
targetURL.lastIndexOf(findText.toLowerCase()) > targetURL.lastIndexOf("/")
|
||||
&& -1 < targetURL.indexOf(findText.toLowerCase()) && targetURL.indexOf('_perms')>-1) {
|
||||
if (-1 < userTarget.indexOf("selected")) {
|
||||
for (let j = 0; j < parent.ICEcoder.selectedFiles.length; j++) {
|
||||
true === haveMatch && -1 === targetURL.indexOf('_perms')) {
|
||||
if (-1 < userTarget.indexOf("selected")) {
|
||||
for (let j = 0; j < parent.ICEcoder.selectedFiles.length; j++) {
|
||||
if (
|
||||
0 === targetURL.replace(/\//g, "|").indexOf(parent.ICEcoder.selectedFiles[j].replace(/\//g, "|").replace(/_perms/g, ""))
|
||||
// If the pipe delimited targetURL starts with this pipe delimited selectedFile
|
||||
0 === targetURL.replace(/\//g, "|").indexOf(parent.ICEcoder.selectedFiles[j].replace(/\//g, "|").toLowerCase())
|
||||
&& (
|
||||
targetURL.replace(/\|/g, "/").replace(/_perms/g, "") === parent.ICEcoder.selectedFiles[j].replace(/\|/g, "/").replace(/_perms/g, "")
|
||||
// If the slash delimited elem matches this slash delimited elem
|
||||
targetURL.replace(/\|/g, "/") === parent.ICEcoder.selectedFiles[j].replace(/\|/g, "/").toLowerCase()
|
||||
||
|
||||
// Path length for targetURL is greater than path length for this selectedFile and targetURL char at selectedFiles length ends with a slash
|
||||
(targetURL.replace(/\|/g, "/").split("/").length > parent.ICEcoder.selectedFiles[j].replace(/\|/g, "/").split("/").length && "/" === targetURL.charAt(parent.ICEcoder.selectedFiles[j].length)))) {
|
||||
foundInSelected = true;
|
||||
foundInSelected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-1 < userTarget.indexOf("all") || (-1 < userTarget.indexOf("selected") && foundInSelected)) {
|
||||
// Skip displaying directories
|
||||
if (-1 < targetURLElem.parentNode.parentNode.className.indexOf('pft-directory')) {
|
||||
continue;
|
||||
}
|
||||
const tidiedFileName = targetURLDisplay.replace(/\|/g, "/");
|
||||
resultsDisplay +=
|
||||
'<a href="javascript:parent.ICEcoder.openFile(\'<?php echo $docRoot;?>' +
|
||||
targetURL.replace(/\|/g, "/").replace(/_perms/g,"") +
|
||||
tidiedFileName +
|
||||
'\');parent.ICEcoder.goFindAfterOpenInt = setInterval(function(){goFindAfterOpen(\'<?php echo $docRoot;?>' +
|
||||
targetURL.replace(/\|/g, "/").replace(/_perms/g, "") +
|
||||
tidiedFileName +
|
||||
'\')}, 20);parent.ICEcoder.showHide(\'hide\', parent.document.getElementById(\'blackMask\'))">';
|
||||
|
||||
|
||||
// Highlight our matches in filename via single regex () capturing group to use with $1
|
||||
resultsDisplay += tidiedFileName.replace(rExp, '<b>$1</b>') + '</a><br>';
|
||||
|
||||
// If replacing in filename
|
||||
<?php if (true === isset($_GET['replace'])) { ?>
|
||||
resultsDisplay +=
|
||||
targetURL.replace(/\|/g, "/").replace(/_perms/g, "").replace(/<?php
|
||||
echo str_replace("/", "\/",strtolower($findText)); ?>/g, "<b>" +
|
||||
findText.toLowerCase() + "</b>");
|
||||
resultsDisplay += '</a><br>';
|
||||
<?php if (false === isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div id="foundCount' + i +'">' + spansArray[i].innerHTML + '</div>';
|
||||
<?php ;} else { ?>
|
||||
resultsDisplay +=
|
||||
'<div id="foundCount' + i + '">' + spansArray[i].innerHTML +
|
||||
', <?php echo $t['rename to'];?> ' +
|
||||
targetURL.replace(/\|/g, "/").replace(/_perms/g, "").replace(/<?php echo str_replace("/", "\/",strtolower($findText)); ?>/g,"<b><?php
|
||||
if (isset($_GET['replace'])) {echo $_GET['replace'];};
|
||||
'<div id="foundCount' + i + '">' +
|
||||
'<?php echo $t['rename to'];?> ' +
|
||||
tidiedFileName.replace(rExp, "<b><?php
|
||||
if (isset($_GET['replace'])) {echo str_replace("&", "&", xssClean($_GET['replace'], 'script'));};
|
||||
?></b>")+'</div>';
|
||||
<?php
|
||||
;};
|
||||
@@ -135,6 +153,7 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
}
|
||||
}
|
||||
<?php
|
||||
// files
|
||||
} else {
|
||||
$targetName = $t['file'];
|
||||
$r = 0;
|
||||
@@ -151,15 +170,15 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
} else if(stristr(toUTF8noBOM(getData($fullPath), false), $q)) {
|
||||
$bFile = false;
|
||||
$foundInSelFile = false;
|
||||
// Exclude banned files
|
||||
// Exclude banned dirs/files (string in path name)
|
||||
for ($i = 0; $i < count($ICEcoder['bannedFiles']); $i++) {
|
||||
if (false !== strpos($f, str_replace("*", "", $ICEcoder['bannedFiles'][$i]))) {
|
||||
if (false !== strpos($fullPath, str_replace("*", "", $ICEcoder['bannedFiles'][$i]))) {
|
||||
$bFile = true;
|
||||
};
|
||||
}
|
||||
// Exclude the dirs & files we wish to exclude from find & replace tasks
|
||||
// Exclude the dirs/files we wish to exclude from find & replace tasks (string in path name)
|
||||
for ($i = 0; $i < count($ICEcoder['findFilesExclude']); $i++) {
|
||||
if (false !== strpos($f, str_replace("*", "", $ICEcoder['findFilesExclude'][$i]))) {
|
||||
if (false !== strpos($fullPath, str_replace("*", "", $ICEcoder['findFilesExclude'][$i]))) {
|
||||
$bFile = true;
|
||||
};
|
||||
}
|
||||
@@ -181,7 +200,7 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
$ret .= str_replace($base, "", $fullPath) . "</a><div id=\\\"foundCount" . $r . "\\\">" .
|
||||
$t['Found'] . " " . substr_count(strtolower(toUTF8noBOM(getData($fullPath), false)), strtolower($q)) . " " . $t['times'] . "</div>";
|
||||
if (isset($_GET['replace'])) {
|
||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('" . $fullPath . "'); this.style.display=\'none\'\\\">" . $t['replace'] . "</div>";
|
||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('" . $fullPath . "', " . $r . "); this.style.display=\'none\'\\\">" . $t['replace'] . "</div>";
|
||||
};
|
||||
$ret .= '<hr>';
|
||||
echo 'foundArray.push("' . $fullPath . '");' . PHP_EOL;
|
||||
@@ -189,9 +208,12 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($fp);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// TODO: consider $findText here, is OK?
|
||||
$findText = str_replace("ICEcoder:", "", str_replace("'", "\'", $_GET['find']));
|
||||
$results = phpGrep($findText, $docRoot . $iceRoot, $docRoot . $iceRoot);
|
||||
echo 'resultsDisplay += "' . $results . '";';
|
||||
?>
|
||||
@@ -213,7 +235,7 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
targetName = "<?php echo $targetName;?>";
|
||||
selectedText = foundInSelected ? "<?php echo $t['selected'];?> " : "";
|
||||
document.getElementById('title').innerHTML =
|
||||
findText.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """).replace(/'/g, "'") +
|
||||
parent.ICEcoder.xssClean(findText) +
|
||||
" <?php echo $t['found in'];?> " + foundArray.length + " " + selectedText + targetName + plural;
|
||||
document.getElementById('results').innerHTML = resultsDisplay;
|
||||
|
||||
@@ -236,8 +258,13 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
parent.ICEcoder.showHide('hide', parent.document.getElementById('blackMask'));
|
||||
};
|
||||
|
||||
const replaceInFileSingle = function(fileRef) {
|
||||
parent.ICEcoder.replaceInFile(fileRef, findText, '<?php if (isset($_GET['replace'])) {echo $_GET['replace'];}; ?>');
|
||||
const replaceInFileSingle = function(fileRef, idNum) {
|
||||
// TODO: findText in this line
|
||||
parent.ICEcoder.replaceInFile(fileRef, true === parent.ICEcoder.findRegex ? findText : parent.ICEcoder.escapeRegex(findText), '<?php if (isset($_GET['replace'])) {echo xssClean($_GET['replace'], 'script');}; ?>');
|
||||
if (idNum) {
|
||||
const newText = document.getElementById('foundCount' + idNum).innerHTML = document.getElementById('foundCount' + idNum).innerHTML.replace('<?php echo $t['Found'];?>', '<?php echo $t['Replaced'];?>');
|
||||
parent.ICEcoder.findUpdateMultiInfoID = ['foundCount' + idNum, newText];
|
||||
}
|
||||
};
|
||||
|
||||
const replaceInFilesAll = function() {
|
||||
@@ -249,9 +276,11 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
|
||||
const renameSingle = function(arrayRef) {
|
||||
fileRef = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "");
|
||||
const rExp = new RegExp(findText, "gi");
|
||||
newName = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "").replace(rExp, "<?php if (isset($_GET['replace'])) {echo $_GET['replace'];}; ?>");
|
||||
const rExp = new RegExp(true === parent.ICEcoder.findRegex ? findText : parent.ICEcoder.escapeRegex(findText), "gi");
|
||||
// TODO: get this working with regex
|
||||
newName = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "").replace(rExp, "<?php if (isset($_GET['replace'])) {echo xssClean($_GET['replace'], 'script');}; ?>");
|
||||
parent.ICEcoder.renameFile(fileRef,newName);
|
||||
parent.ICEcoder.findUpdateMultiInfoID = ['foundCount' + arrayRef, '<?php echo $t['Renamed'];?>'];
|
||||
};
|
||||
|
||||
const renameAll = function() {
|
||||
@@ -277,7 +306,7 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
|
||||
parent.document.getElementById('results').style.display = 'inline-block';
|
||||
// Action the find and then focus on find input box
|
||||
setTimeout(function() {
|
||||
parent.ICEcoder.findReplace(findText, true, false, false);
|
||||
parent.ICEcoder.findReplace(true === parent.ICEcoder.findRegex ? findText : parent.ICEcoder.escapeRegex(findText), true, false, false);
|
||||
parent.document.getElementById("find").focus();
|
||||
}, 0);
|
||||
};
|
||||
|
||||
@@ -218,8 +218,14 @@ function deletePlugin($dir) {
|
||||
<h2><?php echo $t['Install'] . ' / ' . $t['Uninstall'];?></h2><br>
|
||||
|
||||
<?php
|
||||
// ZipArchive plugin not available
|
||||
if (false === class_exists('ZipArchive')) {
|
||||
echo "Sorry, you don't have the ZipArchive class in your PHP installation, or it's not enabled in php.ini.";
|
||||
// Cannot get data? Show error info
|
||||
} elseif (0 === count($pluginsData)) {
|
||||
echo "Sorry, unable to get plugin data. Please make sure you have either curl or fopen available on your server.";
|
||||
// Show list of plugins
|
||||
if (0 < count($pluginsData)) {
|
||||
} else {
|
||||
?>
|
||||
<table>
|
||||
<?php
|
||||
@@ -249,9 +255,6 @@ function deletePlugin($dir) {
|
||||
</table>
|
||||
|
||||
<?php
|
||||
// Cannot get data? Show error info
|
||||
} else {
|
||||
die("Sorry, unable to get plugin data. Please make sure you have either curl or fopen available on your server.");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@ if (false === empty($reqsFailures)) {
|
||||
<div class="screenVCenter">
|
||||
<div class="screenCenter">
|
||||
<img src="../assets/images/icecoder.png" alt="ICEcoder">
|
||||
<div class="version" style="margin-bottom: 22px"> echo $settingsClass->versionNo;?></div>
|
||||
<div class="version" style="margin-bottom: 22px"><?php echo $settingsClass->versionNo;?></div>
|
||||
|
||||
<span style="display: inline-block; color: #fff">
|
||||
<b style="padding: 5px; background: #b00; color: #fff">Requirements problem!</b><br><br><br><br>
|
||||
|
||||
@@ -14,23 +14,29 @@ $context = $systemClass->setStreamContext();
|
||||
if(false === isset($_SESSION)) {
|
||||
ini_set('session.use_cookies', '1'); // Use cookies not URL parameters
|
||||
ini_set('session.use_only_cookies', '1'); // Force use of cookies and nothing else
|
||||
ini_set('session.name', 'ICEcoder_Cookie'); // Set a seperate cookie session name
|
||||
ini_set('session.name', 'ICEcoder'); // Set a seperate cookie name
|
||||
ini_set('session.cookie_lifetime', '0'); // Until the browser restarts by default
|
||||
ini_set('session.cookie_domain', ''); // This domain only
|
||||
// ini_set('session.cookie_path', str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname(dirname(__FILE__)))); // ICEcoder path only, fails ON IE
|
||||
ini_set('session.use_trans_sid', '0'); // Ensure this insecure feature is disabled
|
||||
ini_set('session.hash_function', 'sha512'); // Use Sha512 for session
|
||||
ini_set('session.hash_bits_per_character', '6'); // Specify hash scheme of 0-9,a-v,A-Z,-,,
|
||||
// ini_set('session.use_strict_mode', '1'); // Reject any session ID that was user provided and not generated by the session (since PHP 5.5.2)
|
||||
ini_set('session.httponly', '1'); // Only allow http protocol (ie, not JS) access to the cookie (since PHP 5.2.0)
|
||||
ini_set('session.save_path', dirname(__FILE__) . '/../tmp'); // Localise the session files to /tmp
|
||||
ini_set('session.use_strict_mode', true); // Reject any session ID that was user provided and not generated by the session
|
||||
ini_set('session.httponly', true); // Only allow http protocol (ie, not JS) access to the cookie
|
||||
ini_set('session.cookie_httponly', true); // Only allow cookie via http protocol (ie, not JS) access to the cookie
|
||||
// ini_set('session.save_path', dirname(__FILE__) . '/../tmp'); // Localise the session files to /tmp
|
||||
if(false === isset($_COOKIE['ICEcoder'])) {
|
||||
$_COOKIE['ICEcoder'] = session_create_id();
|
||||
}
|
||||
session_id($_COOKIE['ICEcoder']);
|
||||
|
||||
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
|
||||
ini_set('session.cookie_secure', '1'); // Only allows access to session ID when protocol is HTTPS, switched on under 'if https' condition
|
||||
}
|
||||
session_start(); // Finally, start the session!
|
||||
if (false === isset($_SESSION['csrf'])){
|
||||
session_regenerate_id(true); // Create a new ID to help prevent fixation
|
||||
session_regenerate_id(true); // Create a new ID to help prevent fixation & hijacking
|
||||
$_COOKIE['ICEcoder'] = session_id();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,15 +272,11 @@ function getVersionsCount($fileLoc, $fileName) {
|
||||
$backupDateDirs = [];
|
||||
// Establish the base, host and date dirs within...
|
||||
$backupDirBase = str_replace("\\", "/", dirname(__FILE__)) . "/../data/backups/";
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite, PHP_URL_HOST) : "localhost";
|
||||
// check if folder exists if local before enumerating contents
|
||||
if (false === isset($ftpSite)) {
|
||||
if (true === is_dir($backupDirBase . $backupDirHost)) {
|
||||
$backupDateDirs = scandir($backupDirBase . $backupDirHost, 1);
|
||||
}
|
||||
} else {
|
||||
$backupDateDirs = scandir($backupDirBase . $backupDirHost, 1);
|
||||
}
|
||||
$backupDirHost = "localhost";
|
||||
// check if folder exists if local before enumerating contents
|
||||
if (true === is_dir($backupDirBase . $backupDirHost)) {
|
||||
$backupDateDirs = scandir($backupDirBase . $backupDirHost, 1);
|
||||
}
|
||||
// Get rid of . and .. from date dirs array
|
||||
for ($i = 0; $i < count($backupDateDirs); $i++) {
|
||||
if ($backupDateDirs[$i] === "." || $backupDateDirs[$i] === "..") {
|
||||
|
||||
@@ -30,6 +30,7 @@ while (false !== ($file = readdir($handle))) {
|
||||
array_push($themeArray,basename($file,".css"));
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
sort($themeArray);
|
||||
for ($i = 0;$i < count($themeArray); $i++) {
|
||||
echo '<link rel="stylesheet" href="../assets/css/theme/' . $themeArray[$i] . '.css?microtime=' . microtime(true) . '">' . PHP_EOL;
|
||||
@@ -56,12 +57,12 @@ if (true === isset($_GET['tab'])) {
|
||||
<?php
|
||||
// If we have a .git dir, get the Git short commit hash to display as a link
|
||||
$gitCommitTextLink = "";
|
||||
if (is_dir(dirname(__FILE__) . "/../.git")) {
|
||||
$gitCommit = trim(exec('git log --pretty="%h" -n1 HEAD'));
|
||||
if (true === $systemClass->functionEnabled("shell_exec") && is_dir(dirname(__FILE__) . "/../.git")) {
|
||||
$gitCommit = trim(shell_exec('git log --pretty="%h" -n1 HEAD'));
|
||||
$gitCommitTextLink = ' (Git commit: <a href="https://github.com/icecoder/ICEcoder/commit/' . $gitCommit . '" target="_blank">' . $gitCommit . '</a>)';
|
||||
}
|
||||
?>
|
||||
v<?php echo $ICEcoder["versionNo"] . $gitCommitTextLink;?>
|
||||
<?php echo $ICEcoder["versionNo"] . $gitCommitTextLink;?>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['website'];?>:<br>
|
||||
@@ -165,13 +166,18 @@ if (true === isset($_GET['tab'])) {
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<h2>go to line</h2><br>
|
||||
scroll speed<br>
|
||||
<input type="range" name="goToLineScrollSpeed" min="1" max="20" value="<?php echo $ICEcoder["goToLineScrollSpeed"];?>" onchange="showButton()" style="width: 150px"><br>
|
||||
<div style="position: relative; width: 150px; padding: 0 0 5px 5px; color: #888">instant<div style="position: absolute; top: 0; right: 0">slow</div></div>
|
||||
</div>
|
||||
|
||||
<div style="display: inline-block">
|
||||
|
||||
<h2>find & replace</h2><br>
|
||||
<?php echo $t['when finding in...'];?>:<br>
|
||||
<input type="text" onkeydown="showButton()" name="findFilesExclude" style="width: 300px" value="<?php echo implode(", ",$ICEcoder["findFilesExclude"]); ?>">
|
||||
<input type="text" onkeydown="showButton()" name="findFilesExclude" style="width: 300px" value="<?php echo implode(", ",$ICEcoder["findFilesExclude"]); ?>"><br><br>
|
||||
<input type="checkbox" onclick="showButton()" name="selectNextOnFindInput" value="true"<?php if (true === $ICEcoder["selectNextOnFindInput"]) {echo ' checked';};?>> select next result on find input
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['bug reporting'];?></h2><br>
|
||||
@@ -198,7 +204,7 @@ if (true === isset($_GET['tab'])) {
|
||||
<?php
|
||||
// Display number of days backups available
|
||||
$backupDirBase = str_replace("\\", "/", dirname(__FILE__)) . "/../data/backups/";
|
||||
$backupDirHost = true === isset($ftpSite) ? parse_url($ftpSite, PHP_URL_HOST) : "localhost";
|
||||
$backupDirHost = "localhost";
|
||||
$backupDirsList = scandir($backupDirBase . $backupDirHost);
|
||||
// Remove . and .. from array
|
||||
for ($i = 0; $i < count($backupDirsList); $i++) {
|
||||
@@ -261,11 +267,11 @@ function findSequence(goal) {
|
||||
|
||||
function getThemeDisplayName($optionName) {
|
||||
$wordCasings = [
|
||||
Ii => "II",
|
||||
Ir => "IR",
|
||||
Mdn => "MDN",
|
||||
Ttcn => "TTCN",
|
||||
Xq => "XQ"
|
||||
"Ii" => "II",
|
||||
"Ir" => "IR",
|
||||
"Mdn" => "MDN",
|
||||
"Ttcn" => "TTCN",
|
||||
"Xq" => "XQ"
|
||||
];
|
||||
|
||||
$optionName = ucwords(preg_replace("/_|\-/", " ", $optionName));
|
||||
@@ -381,12 +387,19 @@ function findSequence(goal) {
|
||||
<div id="accountsSection" class="section" style="display: none">
|
||||
|
||||
<h2>password</h2><br>
|
||||
<?php echo $t['new password'];?> <span class="info" title="<?php echo $t['8 chars min'];?>"><?php echo file_get_contents(dirname(__FILE__) . "/../assets/images/icons/info-circle.svg");?></span><br>
|
||||
<input type="password" name="password" style="width: 320px" onkeydown="showButton()">
|
||||
<br><br>
|
||||
<span id="newPasswordText"><?php echo $t['new password'];?></span><br>
|
||||
<input type="password" name="password" style="width: 320px" id="password" onkeydown="showButton()" onkeyup="checkCase(event); pwStrength(this.value)" onchange="pwStrength(this.value)" onpaste="pwStrength(this.value)"><div class="iconCapsLock" style="display: none" id="iconCapsLock" title="Caps lock on"><?php echo file_get_contents(dirname(__FILE__) . "/../assets/images/icons/alert-triangle.svg");?></div>
|
||||
<div id="pwReqs">
|
||||
<div style="display: inline-block" id="pwChars">10+</div>
|
||||
<div style="display: inline-block" id="pwUpper">upper</div>
|
||||
<div style="display: inline-block" id="pwLower">lower</div>
|
||||
<div style="display: inline-block" id="pwNum">number</div>
|
||||
<div style="display: inline-block" id="pwSpecial">special</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<?php echo $t['confirm password'];?><br>
|
||||
<input type="password" name="passwordConfirm" style="width: 320px" onkeydown="showButton()">
|
||||
<span id="passwordConfirmText"><?php echo $t['confirm password'];?></span><br>
|
||||
<input type="password" name="passwordConfirm" style="width: 320px" id="passwordConfirm" onkeydown="showButton()">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['multi-user'];?> <span class="info" title="<?php echo $t['Make sure you...'];?>"><?php echo file_get_contents(dirname(__FILE__) . "/../assets/images/icons/info-circle.svg");?></span></h2><br>
|
||||
@@ -427,7 +440,12 @@ function findSequence(goal) {
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
// Get any elem by ID
|
||||
const get = function(elem) {
|
||||
return document.getElementById(elem);
|
||||
};
|
||||
|
||||
var editor = CodeMirror.fromTextArea(get("code"), {
|
||||
lineNumbers: parent.ICEcoder.lineNumbers,
|
||||
readOnly: "nocursor",
|
||||
indentUnit: parent.ICEcoder.indentSize,
|
||||
@@ -438,14 +456,14 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
});
|
||||
|
||||
function selectTheme() {
|
||||
const input = document.getElementById("theme");
|
||||
const input = get("theme");
|
||||
let theme = input.options[input.selectedIndex].value;
|
||||
if ("default" === theme) {theme = "icecoder"}
|
||||
editor.setOption("theme", theme);
|
||||
}
|
||||
|
||||
function changeIndentSize() {
|
||||
const indentSize = document.getElementById("indentSize").value;
|
||||
const indentSize = get("indentSize").value;
|
||||
editor.setOption("indentUnit", indentSize);
|
||||
editor.setOption("tabSize", indentSize);
|
||||
editor.refresh();
|
||||
@@ -453,13 +471,13 @@ function changeIndentSize() {
|
||||
|
||||
|
||||
function changeLineNumbersToggle() {
|
||||
const lineNumbers = document.getElementById("lineNumbers").checked;
|
||||
const lineNumbers = get("lineNumbers").checked;
|
||||
editor.setOption("lineNumbers", lineNumbers);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
function changeScrollbarStyle() {
|
||||
const scrollbarStyle = document.getElementById("scrollbarStyle").value;
|
||||
const scrollbarStyle = get("scrollbarStyle").value;
|
||||
editor.setOption("scrollbarStyle", scrollbarStyle);
|
||||
editor.refresh();
|
||||
}
|
||||
@@ -467,20 +485,20 @@ function changeScrollbarStyle() {
|
||||
function changeFontSize() {
|
||||
let cMCSS = document.styleSheets[2];
|
||||
let strCSS = cMCSS.rules ? 'rules' : 'cssRules';
|
||||
cMCSS[strCSS][0].style['fontSize'] = document.getElementById("fontSize").value;
|
||||
cMCSS[strCSS][0].style['fontSize'] = get("fontSize").value;
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
function changeEnableRegistrationStatus(){
|
||||
document.getElementById('enableRegistration').disabled=!document.getElementById('enableRegistration').disabled;
|
||||
get('enableRegistration').disabled = !get('enableRegistration').disabled;
|
||||
}
|
||||
|
||||
function changeBackupsDaysStatus(){
|
||||
document.getElementById('backupsDays').disabled=!document.getElementById('backupsDays').disabled;
|
||||
get('backupsDays').disabled = !get('backupsDays').disabled;
|
||||
}
|
||||
|
||||
function showButton() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
get('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
function showHideTabs() {
|
||||
@@ -490,24 +508,85 @@ function showHideTabs() {
|
||||
cMCSS[strCSS][2].style['margin-left'] = document.settings.visibleTabs.checked ? '-1px' : '0';
|
||||
}
|
||||
|
||||
// Check password strength and color requirements not met
|
||||
const pwStrength = function(pw) {
|
||||
// Set variables
|
||||
const hlCol = "rgba(0, 198, 255, 0.7)";
|
||||
let chars, upper, lower, num, special;
|
||||
|
||||
// Test password for requirements
|
||||
chars = pw.length >= 10;
|
||||
upper = pw.replace(/[A-Z]/g, "").length < pw.length;
|
||||
lower = pw.replace(/[a-z]/g, "").length < pw.length;
|
||||
num = pw.replace(/[0-9]/g, "").length < pw.length;
|
||||
special = pw.replace(/[A-Za-z0-9]/g, "").length > 0;
|
||||
|
||||
// Set colors based on each requirements
|
||||
get("pwChars").style.color = true === chars ? hlCol : "";
|
||||
get("pwUpper").style.color = true === upper ? hlCol : "";
|
||||
get("pwLower").style.color = true === lower ? hlCol : "";
|
||||
get("pwNum").style.color = true === num ? hlCol : "";
|
||||
get("pwSpecial").style.color = true === special ? hlCol : "";
|
||||
|
||||
// Return a bool based on meeting the requirements
|
||||
return (true === chars && true === upper && true === lower && true === num && true === special);
|
||||
};
|
||||
|
||||
const checkCase = function(evt) {
|
||||
const key = evt.keyCode ?? evt.which ?? evt.charCode;
|
||||
|
||||
// Not caps lock key
|
||||
if (20 !== key) {
|
||||
get("iconCapsLock").style.display = true === evt.getModifierState("CapsLock")
|
||||
? "inline-block"
|
||||
: "none";
|
||||
}
|
||||
};
|
||||
|
||||
// Check if we can submit, else shake requirements
|
||||
const checkCanSubmit = function() {
|
||||
// Password isn't strong enough, shake requirements
|
||||
if("" !== get("password").value && false === pwStrength(get("password").value)) {
|
||||
switchTab('accounts');
|
||||
shake("newPasswordText");
|
||||
shake("password");
|
||||
shake("pwReqs");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function validatePasswords() {
|
||||
if ("" !== document.settings.password.value && 8 > document.settings.password.value.length) {
|
||||
parent.ICEcoder.message('Please use at least 8 chars in the password');
|
||||
} else {
|
||||
if (true === checkCanSubmit()) {
|
||||
if (document.settings.password.value !== document.settings.passwordConfirm.value) {
|
||||
parent.ICEcoder.message('Sorry, your passwords don\'t match')
|
||||
switchTab('accounts');
|
||||
shake("passwordConfirmText");
|
||||
shake("passwordConfirm");
|
||||
} else {
|
||||
document.settings.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function shake(elem) {
|
||||
var posArray = [24, -24, 12, -12, 6, -6, 3, -3, 0];
|
||||
var pos = -1;
|
||||
var anim = setInterval(function() {
|
||||
if (pos < posArray.length) {
|
||||
pos++;
|
||||
get(elem).style.marginLeft = posArray[pos] + "px";
|
||||
} else {
|
||||
clearInterval(anim);
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
tabNames = ['general','style','accounts','security'];
|
||||
|
||||
function switchTab(tab) {
|
||||
for (var i = 0; i < tabNames.length; i++) {
|
||||
document.getElementById(tabNames[i] + 'Tab').className = tabNames[i] === tab ? "tab tabActive" : "tab";
|
||||
document.getElementById(tabNames[i] + 'Section').style.display = tabNames[i] === tab ? "block" : "none";
|
||||
get(tabNames[i] + 'Tab').className = tabNames[i] === tab ? "tab tabActive" : "tab";
|
||||
get(tabNames[i] + 'Section').style.display = tabNames[i] === tab ? "block" : "none";
|
||||
}
|
||||
editor.refresh();
|
||||
}
|
||||
@@ -517,7 +596,7 @@ function submitSettings() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="update" id="updateButton" onClick="submitSettings()">update</div>
|
||||
<div class="update" id="updateButton" onclick="submitSettings()">update</div>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
|
||||
|
||||
@@ -28,49 +28,50 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S
|
||||
|
||||
// Prepare all our vars
|
||||
$updatedSettings = [
|
||||
"versionNo" => $currentSettings['versionNo'],
|
||||
"configCreateDate" => $currentSettings['configCreateDate'],
|
||||
"root" => xssClean($_POST['root'], "html"),
|
||||
"checkUpdates" => isset($_POST['checkUpdates']),
|
||||
"openLastFiles" => isset($_POST['openLastFiles']),
|
||||
"updateDiffOnSave" => isset($_POST['updateDiffOnSave']),
|
||||
"languageUser" => $_POST['languageUser'],
|
||||
"backupsKept" => isset($_POST['backupsKept']),
|
||||
"backupsDays" => intval($_POST['backupsDays']),
|
||||
"deleteToTmp" => isset($_POST['deleteToTmp']),
|
||||
"findFilesExclude" => explode(",", str_replace(" ", "", $_POST['findFilesExclude'])),
|
||||
"codeAssist" => isset($_POST['codeAssist']),
|
||||
"visibleTabs" => isset($_POST['visibleTabs']),
|
||||
"lockedNav" => isset($_POST['lockedNav']),
|
||||
"tagWrapperCommand" => $_POST['tagWrapperCommand'],
|
||||
"autoComplete" => $_POST['autoComplete'],
|
||||
"password" => $currentSettings['password'],
|
||||
"bannedFiles" => explode(",", str_replace(" ", "", $_POST['bannedFiles'])),
|
||||
"bannedPaths" => explode(",", str_replace(" ", "", $_POST['bannedPaths'])),
|
||||
"allowedIPs" => explode(",", str_replace(" ", "", $_POST['allowedIPs'])),
|
||||
"autoLogoutMins" => intval($_POST['autoLogoutMins']),
|
||||
"theme" => $_POST['theme'],
|
||||
"fontSize" => $_POST['fontSize'],
|
||||
"lineWrapping" => isset($_POST['lineWrapping']),
|
||||
"lineNumbers" => isset($_POST['lineNumbers']),
|
||||
"showTrailingSpace" => isset($_POST['showTrailingSpace']),
|
||||
"matchBrackets" => isset($_POST['matchBrackets']),
|
||||
"autoCloseTags" => isset($_POST['autoCloseTags']),
|
||||
"autoCloseBrackets" => isset($_POST['autoCloseBrackets']),
|
||||
"indentType" => $_POST['indentType'],
|
||||
"indentAuto" => isset($_POST['indentAuto']),
|
||||
"indentSize" => intval($_POST['indentSize']),
|
||||
"pluginPanelAligned" => $_POST['pluginPanelAligned'],
|
||||
"scrollbarStyle" => $_POST['scrollbarStyle'],
|
||||
"bugFilePaths" => explode(",", str_replace(" ", "", $_POST['bugFilePaths'])),
|
||||
"bugFileCheckTimer" => intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0,
|
||||
"bugFileMaxLines" => intval($_POST['bugFileMaxLines']),
|
||||
"plugins" => $currentSettings['plugins'],
|
||||
"ftpSites" => $currentSettings['ftpSites'],
|
||||
"tutorialOnLogin" => isset($_POST['tutorialOnLogin']),
|
||||
"previousFiles" => $currentSettings['previousFiles'],
|
||||
"last10Files" => $currentSettings['last10Files'],
|
||||
"favoritePaths" => $currentSettings['favoritePaths'],
|
||||
"versionNo" => $currentSettings['versionNo'],
|
||||
"configCreateDate" => $currentSettings['configCreateDate'],
|
||||
"root" => xssClean($_POST['root'], "html"),
|
||||
"checkUpdates" => isset($_POST['checkUpdates']),
|
||||
"openLastFiles" => isset($_POST['openLastFiles']),
|
||||
"updateDiffOnSave" => isset($_POST['updateDiffOnSave']),
|
||||
"languageUser" => $_POST['languageUser'],
|
||||
"backupsKept" => isset($_POST['backupsKept']),
|
||||
"backupsDays" => intval($_POST['backupsDays']),
|
||||
"deleteToTmp" => isset($_POST['deleteToTmp']),
|
||||
"findFilesExclude" => explode(",", str_replace(" ", "", $_POST['findFilesExclude'])),
|
||||
"codeAssist" => isset($_POST['codeAssist']),
|
||||
"visibleTabs" => isset($_POST['visibleTabs']),
|
||||
"lockedNav" => isset($_POST['lockedNav']),
|
||||
"tagWrapperCommand" => $_POST['tagWrapperCommand'],
|
||||
"autoComplete" => $_POST['autoComplete'],
|
||||
"password" => $currentSettings['password'],
|
||||
"bannedFiles" => explode(",", str_replace(" ", "", $_POST['bannedFiles'])),
|
||||
"bannedPaths" => explode(",", str_replace(" ", "", $_POST['bannedPaths'])),
|
||||
"allowedIPs" => explode(",", str_replace(" ", "", $_POST['allowedIPs'])),
|
||||
"autoLogoutMins" => intval($_POST['autoLogoutMins']),
|
||||
"theme" => $_POST['theme'],
|
||||
"fontSize" => $_POST['fontSize'],
|
||||
"lineWrapping" => isset($_POST['lineWrapping']),
|
||||
"lineNumbers" => isset($_POST['lineNumbers']),
|
||||
"showTrailingSpace" => isset($_POST['showTrailingSpace']),
|
||||
"matchBrackets" => isset($_POST['matchBrackets']),
|
||||
"autoCloseTags" => isset($_POST['autoCloseTags']),
|
||||
"autoCloseBrackets" => isset($_POST['autoCloseBrackets']),
|
||||
"indentType" => $_POST['indentType'],
|
||||
"indentAuto" => isset($_POST['indentAuto']),
|
||||
"indentSize" => intval($_POST['indentSize']),
|
||||
"pluginPanelAligned" => $_POST['pluginPanelAligned'],
|
||||
"scrollbarStyle" => $_POST['scrollbarStyle'],
|
||||
"selectNextOnFindInput" => isset($_POST['selectNextOnFindInput']),
|
||||
"goToLineScrollSpeed" => intval($_POST['goToLineScrollSpeed']),
|
||||
"bugFilePaths" => explode(",", str_replace(" ", "", $_POST['bugFilePaths'])),
|
||||
"bugFileCheckTimer" => intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0,
|
||||
"bugFileMaxLines" => intval($_POST['bugFileMaxLines']),
|
||||
"plugins" => $currentSettings['plugins'],
|
||||
"tutorialOnLogin" => isset($_POST['tutorialOnLogin']),
|
||||
"previousFiles" => $currentSettings['previousFiles'],
|
||||
"last10Files" => $currentSettings['last10Files'],
|
||||
"favoritePaths" => $currentSettings['favoritePaths'],
|
||||
];
|
||||
|
||||
if ("" !== $_POST['password']) {
|
||||
@@ -119,6 +120,7 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S
|
||||
// With all that worked out, we can now hide the settings screen and apply the new settings
|
||||
$jsBugFilePaths = "['" . str_replace(",", "','", str_replace(" ", "", $_POST['bugFilePaths'])) . "']";
|
||||
echo "<script>parent.ICEcoder.settingsScreen(true); parent.ICEcoder.useNewSettings({" .
|
||||
"iceRoot: '" . $ICEcoder["root"] . "', " .
|
||||
"themeURL: '" . $themeURL . "', " .
|
||||
"codeAssist: " . (true === $ICEcoder["codeAssist"] ? "true" : "false") . ", " .
|
||||
"lockedNav: " . (true === $ICEcoder["lockedNav"] ? "true" : "false") . ", " .
|
||||
@@ -137,12 +139,13 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S
|
||||
"indentSize: " . $ICEcoder["indentSize"] . ", " .
|
||||
"pluginPanelAligned: '" . $ICEcoder["pluginPanelAligned"] . "', " .
|
||||
"scrollbarStyle: '" . $ICEcoder["scrollbarStyle"] . "', " .
|
||||
"selectNextOnFindInput: " . (true === $ICEcoder["selectNextOnFindInput"] ? "true" : "false") . ", " .
|
||||
"goToLineScrollSpeed: " . $ICEcoder["goToLineScrollSpeed"] . ", " .
|
||||
"bugFilePaths: " . $jsBugFilePaths . ", " .
|
||||
"bugFileCheckTimer: " . $ICEcoder["bugFileCheckTimer"] . ", " .
|
||||
"bugFileMaxLines: " . $ICEcoder["bugFileMaxLines"] . ", " .
|
||||
"updateDiffOnSave: " . (true === $ICEcoder["updateDiffOnSave"] ? "true" : "false") . ", " .
|
||||
"autoLogoutMins: " . $ICEcoder["autoLogoutMins"] . ", " .
|
||||
"refreshFM: " . $refreshFM .
|
||||
"}); iceRoot = '" . $ICEcoder["root"] .
|
||||
"';</script>";
|
||||
"});</script>";
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ if (false === $settingsClass->getDataDirDetails()['writable']) {
|
||||
// Create a new global config file if it doesn't exist yet.
|
||||
// The reason we create it, is so it has PHP write permissions, meaning we can update it later
|
||||
if (false === $settingsClass->getConfigGlobalFileDetails()['exists']) {
|
||||
if (false === $settingsClass->setConfigGlobalSettings($settingsClass->getConfigGlobalTemplate())) {
|
||||
if (false === $settingsClass->setConfigGlobalSettings($settingsClass->getConfigGlobalTemplate(false))) {
|
||||
$reqsFailures = ["phpGlobalConfigFileCreate"];
|
||||
include dirname(__FILE__) . "/requirements.php";
|
||||
}
|
||||
@@ -58,7 +58,7 @@ $ICEcoderSettings = $settingsClass->getConfigGlobalSettings();
|
||||
include_once dirname(__FILE__) . "/settings-common.php";
|
||||
|
||||
// Establish user settings file
|
||||
$username = "";
|
||||
$username = "admin-";
|
||||
if (true === isset($_POST['username']) && "" !== $_POST['username']) {$username = $_POST['username'] . "-";};
|
||||
if (true === isset($_SESSION['username']) && "" !== $_SESSION['username']) {$username = $_SESSION['username'] . "-";};
|
||||
$settingsFile = 'config-' . $username . str_replace(".", "_", str_replace("www.", "", $_SERVER['SERVER_NAME'])) . '.php';
|
||||
@@ -68,15 +68,28 @@ $setPWorLogin = "login";
|
||||
|
||||
// Create user settings file if it doesn't exist
|
||||
if (true === $ICEcoderSettings['enableRegistration'] && false === $settingsClass->getConfigUsersFileDetails($settingsFile)['exists']) {
|
||||
if (false === $settingsClass->setConfigUsersSettings($settingsFile, $settingsClass->getConfigUsersTemplate())) {
|
||||
if (false === $settingsClass->setConfigUsersSettings($settingsFile, $settingsClass->getConfigUsersTemplate(false))) {
|
||||
$reqsFailures = ["phpUsersConfigCreateConfig"];
|
||||
include dirname(__FILE__) . "/requirements.php";
|
||||
}
|
||||
// Initial setup,triggered from index,php...
|
||||
if ("index.php" === basename($_SERVER['SCRIPT_NAME'])) {
|
||||
// Set bug reporting for ICEcoders error.log file
|
||||
$settingsClass->updateConfigUsersSettings($settingsFile, ["bugFilePaths" => [dirname($_SERVER['SCRIPT_NAME']) . "/data/logs/error/error.log"]]);
|
||||
$settingsClass->updateConfigUsersSettings($settingsFile, ["bugFileCheckTimer" => 10]);
|
||||
$settingsClass->updateConfigUsersSettings($settingsFile, ["bugFileMaxLines" => 10]);
|
||||
}
|
||||
$setPWorLogin = "set password";
|
||||
}
|
||||
|
||||
// Check users config settings file exists
|
||||
if (false === $settingsClass->getConfigUsersFileDetails($settingsFile)['exists']) {
|
||||
// If on the login page and we couldn't find the file, boot back to login page
|
||||
if ("login.php" === basename($_SERVER['SCRIPT_NAME'])) {
|
||||
header('Location: login.php');
|
||||
echo "<script>window.location = 'login.php';</script>";
|
||||
die('Redirecting to login...');
|
||||
}
|
||||
$reqsFailures = ["phpUsersConfigFileExists"];
|
||||
include dirname(__FILE__) . "/requirements.php";
|
||||
}
|
||||
@@ -114,8 +127,13 @@ If ($ICEcoderUserSettings["versionNo"] !== $ICEcoderSettings["versionNo"]) {
|
||||
include dirname(__FILE__) . "/requirements.php";
|
||||
}
|
||||
|
||||
// Join ICEcoder global config settings and user config settings together to make our final ICEcoder array
|
||||
$ICEcoder = $ICEcoderSettings + $ICEcoderUserSettings;
|
||||
// Set ICEcoder settings array to (global + user) template and layer ontop (global + user) from current settings
|
||||
$ICEcoder = array_merge(
|
||||
$settingsClass->getConfigGlobalTemplate(true),
|
||||
$settingsClass->getConfigUsersTemplate(true),
|
||||
$ICEcoderSettings,
|
||||
$ICEcoderUserSettings
|
||||
);
|
||||
|
||||
// Include language file
|
||||
// Load base first as foundation
|
||||
@@ -127,8 +145,8 @@ include dirname(__FILE__) . "/../lang/" . basename($ICEcoder['languageUser']);
|
||||
$text = array_replace_recursive($baseText, $text);
|
||||
$_SESSION['text'] = $text;
|
||||
|
||||
// Login not required or we're in demo mode and have password set in our settings, log us straight in
|
||||
if ((false === $ICEcoder['loginRequired'] || true === $ICEcoder['demoMode']) && "" !== $ICEcoder['password']) {
|
||||
// Login not required, log us straight in
|
||||
if (false === $ICEcoder['loginRequired']) {
|
||||
$_SESSION['loggedIn'] = true;
|
||||
};
|
||||
$demoMode = $ICEcoder['demoMode'];
|
||||
@@ -188,26 +206,14 @@ if (false === in_array(getUserIP(), $_SESSION['allowedIPs']) && false === in_arr
|
||||
include(dirname(__FILE__) . "/requirements.php");
|
||||
};
|
||||
|
||||
// Establish any FTP site to use
|
||||
if (true === isset($_SESSION['ftpSiteRef']) && false !== $_SESSION['ftpSiteRef']) {
|
||||
$ftpSiteArray = $ICEcoder['ftpSites'][$_SESSION['ftpSiteRef']];
|
||||
$ftpSite = $ftpSiteArray['site']; // FTP site domain, eg http://yourdomain.com
|
||||
$ftpHost = $ftpSiteArray['host']; // FTP host, eg ftp.yourdomain.com
|
||||
$ftpUser = $ftpSiteArray['user']; // FTP username
|
||||
$ftpPass = $ftpSiteArray['pass']; // FTP password
|
||||
$ftpPasv = $ftpSiteArray['pasv']; // FTP account requires PASV mode?
|
||||
$ftpMode = $ftpSiteArray['mode'] == "FTP_ASCII" ? FTP_ASCII : FTP_BINARY; // FTP transfer mode, FTP_ASCII or FTP_BINARY
|
||||
$ftpRoot = $ftpSiteArray['root']; // FTP root dir to use as base, eg /htdocs
|
||||
}
|
||||
|
||||
// Save currently opened files in previousFiles and last10Files arrays
|
||||
include(dirname(__FILE__) . "/settings-save-current-files.php");
|
||||
|
||||
// Display the plugins
|
||||
include(dirname(__FILE__) . "/plugins-display.php");
|
||||
|
||||
// If loggedIn is false or we don't have a password set yet and we're not on login screen, boot user to that
|
||||
if (false === isset($_POST['password']) && (!$_SESSION['loggedIn'] || "" === $ICEcoder["password"]) && false === strpos($_SERVER['SCRIPT_NAME'], "lib/login.php")) {
|
||||
// If we require a login, loggedIn is false or we don't have a password set yet and we're not on login screen, boot user to that
|
||||
if (true === $ICEcoder['loginRequired'] && false === isset($_POST['password']) && (!$_SESSION['loggedIn'] || "" === $ICEcoder["password"]) && false === strpos($_SERVER['SCRIPT_NAME'], "lib/login.php")) {
|
||||
if (file_exists('lib/login.php')) {
|
||||
header('Location: ' . rtrim($_SERVER['REQUEST_URI'], "/") . '/lib/login.php');
|
||||
echo "<script>window.location = 'lib/login.php';</script>";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
a:43:{s:9:"versionNo";s:3:"8.0";s:16:"configCreateDate";i:0;s:4:"root";s:0:"";s:12:"checkUpdates";b:1;s:13:"openLastFiles";b:1;s:16:"updateDiffOnSave";b:1;s:12:"languageUser";s:11:"english.php";s:11:"backupsKept";b:1;s:11:"backupsDays";i:14;s:11:"deleteToTmp";b:1;s:16:"findFilesExclude";a:9:{i:0;s:4:".doc";i:1;s:4:".gif";i:2;s:4:".jpg";i:3;s:5:".jpeg";i:4;s:4:".pdf";i:5;s:4:".png";i:6;s:4:".swf";i:7;s:4:".xml";i:8;s:4:".zip";}s:10:"codeAssist";b:1;s:11:"visibleTabs";b:0;s:9:"lockedNav";b:1;s:17:"tagWrapperCommand";s:8:"ctrl+alt";s:12:"autoComplete";s:8:"keypress";s:8:"password";s:0:"";s:11:"bannedFiles";a:0:{}s:11:"bannedPaths";a:3:{i:0;s:13:"/var/www/.git";i:1;s:26:"/var/www/sites/all/modules";i:2;s:28:"/var/www/sites/default/files";}s:10:"allowedIPs";a:1:{i:0;s:1:"*";}s:14:"autoLogoutMins";i:0;s:5:"theme";s:7:"default";s:8:"fontSize";s:4:"13px";s:12:"lineWrapping";b:0;s:11:"lineNumbers";b:1;s:17:"showTrailingSpace";b:1;s:13:"matchBrackets";b:1;s:13:"autoCloseTags";b:1;s:17:"autoCloseBrackets";b:1;s:10:"indentType";s:6:"spaces";s:10:"indentAuto";b:1;s:10:"indentSize";i:4;s:18:"pluginPanelAligned";s:4:"left";s:14:"scrollbarStyle";s:7:"overlay";s:12:"bugFilePaths";a:0:{}s:17:"bugFileCheckTimer";i:0;s:15:"bugFileMaxLines";i:0;s:7:"plugins";a:0:{}s:8:"ftpSites";a:0:{}s:15:"tutorialOnLogin";b:1;s:13:"previousFiles";a:0:{}s:11:"last10Files";a:0:{}s:13:"favoritePaths";a:0:{}}
|
||||
a:44:{s:9:"versionNo";s:3:"8.1";s:16:"configCreateDate";i:0;s:4:"root";s:0:"";s:12:"checkUpdates";b:1;s:13:"openLastFiles";b:1;s:16:"updateDiffOnSave";b:1;s:12:"languageUser";s:11:"english.php";s:11:"backupsKept";b:1;s:11:"backupsDays";i:14;s:11:"deleteToTmp";b:1;s:16:"findFilesExclude";a:9:{i:0;s:4:".doc";i:1;s:4:".gif";i:2;s:4:".jpg";i:3;s:5:".jpeg";i:4;s:4:".pdf";i:5;s:4:".png";i:6;s:4:".swf";i:7;s:4:".xml";i:8;s:4:".zip";}s:10:"codeAssist";b:1;s:11:"visibleTabs";b:0;s:9:"lockedNav";b:1;s:17:"tagWrapperCommand";s:8:"ctrl+alt";s:12:"autoComplete";s:8:"keypress";s:8:"password";s:0:"";s:11:"bannedFiles";a:2:{i:0;s:4:".git";i:1;s:12:"node_modules";}s:11:"bannedPaths";a:2:{i:0;s:26:"/var/www/sites/all/modules";i:1;s:28:"/var/www/sites/default/files";}s:10:"allowedIPs";a:1:{i:0;s:1:"*";}s:14:"autoLogoutMins";i:0;s:5:"theme";s:7:"default";s:8:"fontSize";s:4:"13px";s:12:"lineWrapping";b:0;s:11:"lineNumbers";b:1;s:17:"showTrailingSpace";b:1;s:13:"matchBrackets";b:1;s:13:"autoCloseTags";b:1;s:17:"autoCloseBrackets";b:1;s:10:"indentType";s:6:"spaces";s:10:"indentAuto";b:1;s:10:"indentSize";i:4;s:18:"pluginPanelAligned";s:4:"left";s:14:"scrollbarStyle";s:7:"overlay";s:21:"selectNextOnFindInput";b:1;s:19:"goToLineScrollSpeed";i:5;s:12:"bugFilePaths";a:0:{}s:17:"bugFileCheckTimer";i:0;s:15:"bugFileMaxLines";i:0;s:7:"plugins";a:0:{}s:15:"tutorialOnLogin";b:1;s:13:"previousFiles";a:0:{}s:11:"last10Files";a:0:{}s:13:"favoritePaths";a:0:{}}
|
||||
|
||||
*/
|
||||
?>
|
||||
|
||||
@@ -17,8 +17,13 @@ if (false === isset($_SESSION['cwd'])) {
|
||||
chdir($_SESSION['cwd']);
|
||||
|
||||
// Get current user and cwd
|
||||
$user = str_replace("\n", "", shell_exec("whoami"));
|
||||
$cwd = str_replace("\n", "", shell_exec("pwd"));
|
||||
if (true === $systemClass->functionEnabled("shell_exec")) {
|
||||
$user = str_replace("\n", "", shell_exec("whoami"));
|
||||
$cwd = str_replace("\n", "", shell_exec("pwd"));
|
||||
} else {
|
||||
$user = "";
|
||||
$cwd = "";
|
||||
}
|
||||
|
||||
// Check if we have proc_open_enabled
|
||||
// (Used later to handle commands)
|
||||
@@ -142,8 +147,13 @@ if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', $_REQUEST['command'])) {
|
||||
chdir($_SESSION['cwd']);
|
||||
|
||||
// and again ask for current user and working dir
|
||||
$user = str_replace("\n", "", shell_exec("whoami"));
|
||||
$cwd = str_replace("\n", "", shell_exec("pwd"));
|
||||
if (true === $systemClass->functionEnabled("shell_exec")) {
|
||||
$user = str_replace("\n", "", shell_exec("whoami"));
|
||||
$cwd = str_replace("\n", "", shell_exec("pwd"));
|
||||
} else {
|
||||
$user = "";
|
||||
$cwd = "";
|
||||
}
|
||||
|
||||
// Finally, output our JSON data
|
||||
echo json_encode([
|
||||
|
||||
@@ -82,10 +82,10 @@ function copyOldVersion() {
|
||||
|
||||
function openZipNew($icvInfo) {
|
||||
echo 'Retrieving zip from ICEcoder site...<br>';
|
||||
$source = 'ICEcoder v'.$icvInfo;
|
||||
$source = 'ICEcoder '.$icvInfo;
|
||||
$target = '../';
|
||||
|
||||
$remoteFile = 'https://icecoder.net/ICEcoder-v'.(str_replace(" beta", "-beta",$icvInfo)).'.zip';
|
||||
$remoteFile = 'https://icecoder.net/ICEcoder-'.(str_replace(" beta", "-beta",$icvInfo)).'.zip';
|
||||
$file = "../tmp/new-version.zip";
|
||||
$fileData = getData($remoteFile,'curl','Sorry, couldn\'t get latest version zip file.');
|
||||
echo 'Storing zip file...<br>';
|
||||
|
||||
@@ -32,6 +32,7 @@ function requireReIndexNextTime() {
|
||||
|
||||
// Run continuously
|
||||
while(true) {
|
||||
if (true === is_callable("shell_exec") && false === stripos(ini_get('disable_functions'), "shell_exec")) {
|
||||
// Get git diff output as a string and MD5 it as a checksum
|
||||
$thisMD5 = shell_exec("cd .. && git diff | md5sum");
|
||||
// If we have a previous checksum value and the current is different to it
|
||||
@@ -63,9 +64,11 @@ while(true) {
|
||||
}
|
||||
file_put_contents(dirname(__FILE__)."/../data/git-content.php", "<?php\n/*\n\n".serialize($output)."\n\n*/\n?".">");
|
||||
}
|
||||
// Set prev MD5 to this one, ready for next time, sleep for 2 secs before loop starts again
|
||||
// Set prev MD5 to this one, ready for next time
|
||||
$prevMD5 = $thisMD5;
|
||||
sleep(2);
|
||||
}
|
||||
// sleep for 2 secs before loop starts again
|
||||
sleep(2);
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
16
terminal.php
16
terminal.php
@@ -5,7 +5,7 @@ include "lib/settings.php";
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ICEcoder v<?php echo $ICEcoder["versionNo"];?> Terminal</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> Terminal</title>
|
||||
<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">
|
||||
@@ -101,18 +101,24 @@ if (false === isset($_SESSION['cwd'])) {
|
||||
// Change to cwd
|
||||
chdir($_SESSION['cwd']);
|
||||
|
||||
// Get current user and cwd
|
||||
$user = str_replace("\n", "", shell_exec("whoami"));
|
||||
$cwd = str_replace("\n", "", shell_exec("pwd"));
|
||||
if (true === $systemClass->functionEnabled("shell_exec")) {
|
||||
// Get current user and cwd
|
||||
$user = str_replace("\n", "", shell_exec("whoami"));
|
||||
$cwd = str_replace("\n", "", shell_exec("pwd"));
|
||||
?>
|
||||
|
||||
<form name="shell" onsubmit="sendCmd(document.getElementById('command').value); return false" method="POST">
|
||||
<pre class="output" id="output"><span style="color: #0a0">ICEcoder v<?php echo $ICEcoder["versionNo"];?> terminal</span>
|
||||
<pre class="output" id="output"><span style="color: #0a0">ICEcoder <?php echo $ICEcoder["versionNo"];?> terminal</span>
|
||||
This is a full powered terminal, but will have the permissions of the '<?php echo $user;?>' user.
|
||||
The more access rights you give that user, the more this terminal has.
|
||||
|
||||
<div class="commandLine" id="commandLine"><div class="user" id="user"> <?php echo $user;?> </div><div class="cwd" id="cwd"> <?php echo $cwd;?> </div> : <?php echo date("H:m:s");?><br><div class="promptVLine"></div><div class="promptHLine">─<div class="promptArrow">▶</div></div> <input type="text" class="command" id="command" onkeyup="key(event)" tabindex="1" autocomplete="off"></div></pre>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<pre class="output" id="output">shell_exec not available on the server, unable to use terminal.</pre>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user