-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
index.php
executable file
·139 lines (107 loc) · 4.17 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
//////////////////////////////////////////////////////////////////////////////80
// Index
//////////////////////////////////////////////////////////////////////////////80
// Copyright (c) Atheos & Liam Siira (Atheos.io), distributed as-is and without
// warranty under the MIT License. See [root]/docs/LICENSE.md for more.
// This information must remain intact.
//////////////////////////////////////////////////////////////////////////////80
// Authors: Codiad Team, @Fluidbyte, Atheos Team, @hlsiira
//////////////////////////////////////////////////////////////////////////////80
require_once("common.php");
if (defined("HEADERS") && HEADERS) {
foreach (unserialize(HEADERS) as $val) {
header($val);
}
}
require_once("traits/cls.source.php");
$SourceManager = new SourceManager;
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php if (defined("DOMAIN") && DOMAIN) echo(DOMAIN . " | ") ?>Atheos IDE</title>
<meta name="author" content="Liam Siira">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A Web-Based IDE with a small footprint and minimal requirements">
<!-- FAVICONS -->
<?php
require_once("templates/favicons.php");
// Load THEME
echo("<!-- THEME -->\n");
echo("\t<link rel=\"stylesheet\" href=\"theme/main.min.css\">\n");
// LOAD FONTS
$SourceManager->linkResource("css", "fonts", DEVELOPMENT);
// LOAD LIBRARIES
$SourceManager->linkResource("js", "libraries", DEVELOPMENT);
// LOAD MODULES
$SourceManager->linkResource("js", "modules", DEVELOPMENT);
// LOAD PLUGINS
$SourceManager->linkResource("css", "plugins", DEVELOPMENT);
?>
</head>
<body>
<?php
//////////////////////////////////////////////////////////////////
// LOGGED IN
//////////////////////////////////////////////////////////////////
if (SESSION("user")) {
?>
<div id="workspace">
<div id="contextmenu"></div>
<?php require_once("components/sidebars/sb-left.php"); ?>
<div id="ACTIVE">
<ul id="active_file_tabs" class="tabList"></ul>
<a id="tab_dropdown" class="fas fa-chevron-circle-down"></a>
<a id="tab_close" class="fas fa-times-circle"></a>
<ul id="active_file_dropdown" style="display: none;"></ul>
</div>
<div id="EDITOR">
<div id="root-editor-wrapper"></div>
</div>
<div id="BOTTOM">
<a id="split"><i class="fas fa-columns"></i><?php echo i18n("split"); ?></a>
<a id="current_mode"><i class="fas fa-code"></i><span></span></a>
<span id="current_file"></span>
<span id="codegit_file_status"></span>
<div id="changemode_menu" style="display:none;" class="options-menu"></div>
<ul id="split_menu" style="display:none;" class="options-menu">
<li id="split-horizontally"><a><i class="fas fa-arrows-alt-h"></i><?php echo i18n("split_h"); ?> </a></li>
<li id="split-vertically"><a><i class="fas fa-arrows-alt-v"></i><?php echo i18n("split_v"); ?> </a></li>
<li id="merge-all"><a><i class="fas fa-compress-arrows-alt"></i><?php echo i18n("merge_all"); ?> </a></li>
</ul>
<span id="cursor-position"><?php echo i18n("ln"); ?>: 0 · <?php echo i18n("col"); ?>: 0</span>
</div>
<?php require_once("components/sidebars/sb-right.php"); ?>
</div>
<iframe id="download" title="download"></iframe>
<!-- ACE -->
<script src="components/editor/ace-editor/ace.js"></script>
<script src="components/editor/ace-editor/ext-language_tools.js"></script>
<script src="components/editor/ace-editor/ext-beautify.js"></script>
<?php
// LOAD COMPONENTS
echo("\n");
$SourceManager->linkResource("js", "components", DEVELOPMENT);
// LOAD PLUGINS
$SourceManager->linkResource("js", "plugins", DEVELOPMENT);
} else {
// If constant DATA defined in config.php, use it. Otherwise fall back to default folder location
$path = defined("DATA") ? DATA . "/" : __DIR__ . "/data/";
$users = file_exists($path . "users.json");
$projects = file_exists($path . "projects.json");
if (!$users && !$projects) {
// Installer
require_once("components/install/view.php");
} else {
// Login form
require_once("components/user/login.php");
}
}
?>
<overlay class=""></overlay>
<toaster></toaster>
<output></output>
</body>
</html>