Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Lucksi
GitHub Repository: Lucksi/Mr.Holmes
Path: blob/master/GUI/Actions/Theme_Controller.php
1071 views
1
<?php
2
/*ORIGINAL CREATOR: Luca Garofalo (Lucksi)
3
AUTHOR: Luca Garofalo (Lucksi)
4
Copyright (C) 2021-2023 Lucksi <[email protected]>
5
License: GNU General Public License v3.0*/
6
7
function Body_Theme($File_Name){
8
$mode_file = "../Theme/Mode.json";
9
if (file_exists($mode_file)) {
10
$reader = file_get_contents($mode_file);
11
$parser = json_decode($reader,true);
12
$color = $parser["Color"]["Background"];
13
$Style_name = "../Css/$color/$File_Name";
14
if (file_exists($Style_name)) {
15
echo '<link rel = "stylesheet" id = "Theme" href ="'.$Style_name.'">';
16
}
17
else {
18
echo "<script>
19
alert ('VALUE NOT VALID MODE DISPLAYED:LIGHT-MODE');
20
</script>";
21
echo "<link rel = 'stylesheet' href = '../Css/Light/$File_Name'>";
22
}
23
}
24
else {
25
echo "<script>
26
alert ('THEME FILE NOT FOUND MODE DISPLAYED:LIGHT-MODE');
27
</script>";
28
echo "<link rel = 'stylesheet' href = '../Css/Light/$File_Name'>";
29
}
30
echo "\n";
31
}
32
33
function Cards() {
34
$mode_file = "../Theme/Mode.json";
35
if (file_exists($mode_file)) {
36
$reader = file_get_contents($mode_file);
37
$parser = json_decode($reader,true);
38
$color = $parser["Color"]["Background"];
39
if ($color == "Light" or $color == "Dark" or $color == "High-Contrast"){
40
echo "
41
<img class = 'Mod' src = '../Icon/Base/social.png'>
42
<p id = 'Const'>USERNAME</p>
43
<a href = 'Username.php'><button class = But>Search</button></a>
44
</div>
45
<div id = 'Website'>
46
<img class = 'Mod' src = '../Icon/Base/browser.png'>
47
<p id = 'Const'>WEBSITE</p>
48
<a href = 'Websites.php'><button class = But>Search</button></a>
49
</div>
50
<div id = 'Phone'>
51
<img class = 'Mod' src = '../Icon/Base/phone.png'>
52
<p id = 'Const'>Phone</p>
53
<a href = 'Phone.php'><button class = But>Search</button></a>
54
</div>
55
<div id = 'Ports'>
56
<img class = 'Mod' src = '../Icon/Base/Ports.png'>
57
<p id = 'Const'>Ports</p>
58
<a href = 'Ports.php'><button class = But>Search</button></a>
59
</div>
60
<br>
61
<br>
62
<div id = 'Username'>
63
<img class = 'Mod' src = '../Icon/Base/Email.png'>
64
<p id = 'Const'>Email</p>
65
<a href = 'Email.php'><button class = But>Search</button></a>
66
</div>
67
<div id = 'Website'>
68
<img class = 'Mod' src = '../Icon/Base/User.png'>
69
<p id = 'Const'>CREATE-USER</p>
70
<a href = 'New_User.php'><button class = But>Create</button></a>
71
</div>
72
<div id = 'Phone'>
73
<img class = 'Mod' src = '../Icon/Base/Graph.png'>
74
<p id = 'Const'>Graph</p>
75
<a href = 'Schema.php'><button class = But>Create</button></a>
76
</div>
77
<div id = 'Ports'>
78
<img class = 'Mod' src = '../Icon/Base/Marker.png'>
79
<p id = 'Const'>MAP</p>
80
<a href = 'Map.php'><button class = But>Create</button></a>
81
</div>
82
<br>
83
<br>
84
<div id = 'Username'>
85
<img class = 'Mod' src = '../Icon/Base/Author.png'>
86
<p id = 'Const'>PEOPLE</p>
87
<a href = 'People.php'><button class = But>Search</button></a>
88
</div>
89
<div id = 'Website'>
90
<img class = 'Mod' src = '../Icon/Base/Author.png'>
91
<p id = 'Const'>AUTHOR</p>
92
<a href = 'New_User.php'><button class = But>Show</button></a>
93
</div>";
94
}
95
else {
96
echo "
97
<img class = 'Mod' src = '../Icon/$color/Username.png'>
98
<p id = 'Const'>USERNAME</p>
99
<a href = 'Username.php'><button class = But>Search</button></a>
100
</div>
101
<div id = 'Website'>
102
<img class = 'Mod' src = '../Icon/$color/Website.png'>
103
<p id = 'Const'>WEBSITE</p>
104
<a href = 'Websites.php'><button class = But>Search</button></a>
105
</div>
106
<div id = 'Phone'>
107
<img class = 'Mod' src = '../Icon/$color/Phone.png'>
108
<p id = 'Const'>Phone</p>
109
<a href = 'Phone.php'><button class = But>Search</button></a>
110
</div>
111
<div id = 'Ports'>
112
<img class = 'Mod' src = '../Icon/$color/Ports.png'>
113
<p id = 'Const'>Ports</p>
114
<a href = 'Ports.php'><button class = But>Search</button></a>
115
</div>
116
<br>
117
<br>
118
<div id = 'Username'>
119
<img class = 'Mod' src = '../Icon/$color/Email.png'>
120
<p id = 'Const' id = But>Email</p>
121
<a href = 'Email.php'><button class = But>Search</button></a>
122
</div>
123
<div id = 'Website'>
124
<img class = 'Mod' src = '../Icon/$color/User.png'>
125
<p id = 'Const'>CREATE-USER</p>
126
<a href = 'New_User.php'><button class = But>Create</button></a>
127
</div>
128
<div id = 'Phone'>
129
<img class = 'Mod' src = '../Icon/$color/Graph.png'>
130
<p id = 'Const'>Graph</p>
131
<a href = 'Schema.php'><button class = But>Open</button></a>
132
</div>
133
<div id = 'Ports'>
134
<img class = 'Mod' src = '../Icon/$color/Marker.png'>
135
<p id = 'Const'>Map</p>
136
<a href = 'Map.php' ><button class = But>Open</button></a>
137
</div>
138
<br>
139
<br>
140
<div id = 'Username'>
141
<img class = 'Mod' src = '../Icon/$color/Author.png'>
142
<p id = 'Const'></p>
143
<a href = 'People.php'><button class = But>Search</button></a>
144
</div>
145
<div id = 'Website'>
146
<img class = 'Mod' src = '../Icon/$color/Author.png'>
147
<p id = 'Const'>Author</p>
148
<a id = 'change2'><button class = But>Show</button></a>
149
</div>";
150
}
151
}
152
else {
153
echo "
154
<img class = 'Mod' src = '../Icon/Base/social.png'>
155
<p id = 'Const'>USERNAME</p>
156
<a href = 'Username.php'><button class = But>Search</button></a>
157
</div>
158
<div id = 'Website'>
159
<img class = 'Mod' src = '../Icon/Base/browser.png'>
160
<p id = 'Const'>WEBSITE</p>
161
<a href = 'Websites.php'><button class = But>Search</button></a>
162
</div>
163
<div id = 'Phone'>
164
<img class = 'Mod' src = '../Icon/Base/phone.png'>
165
<p id = 'Const'>Phone</p>
166
<a href = 'Phone.php'><button class = But>Search</button></a>
167
</div>
168
<div id = 'Ports'>
169
<img class = 'Mod' src = '../Icon/Base/Ports.png'>
170
<p id = 'Const'>Ports</p>
171
<a href = 'Ports.php'><button class = But>Search</button></a>
172
</div>
173
<div id = 'Username'>
174
<img class = 'Mod' src = '../Icon/Base/Email.png'>
175
<p id = 'Const' id = But>Email</p>
176
<a href = 'Email.php'><button class = But>Search</button></a>
177
</div>
178
<div id = 'Website'>
179
<img class = 'Mod' src = '../Icon/Base/User.png'>
180
<p id = 'Const'>CREATE-USER</p>
181
<a href = 'New_User.php'><button class = But>Create</button></a>
182
</div>
183
<div id = 'Phone'>
184
<img class = 'Mod' src = '../Icon/Base/Ports.png'>
185
<p id = 'Const'>Graph</p>
186
<a href = 'Schema.php'><button class = But>Create</button></a>
187
</div>
188
<div id = 'Ports'>
189
<img class = 'Mod' src = '../Icon/Base/Marker.png'>
190
<p id = 'Const'>Map</p>
191
<a href = 'Map.php'><button class = But>Create</button></a>
192
</div>
193
<br>
194
<br>
195
<div id = 'USERNAME'>
196
<img class = 'Mod' src = '../Icon/Base/Author.png'>
197
<p id = 'Const'>People</p>
198
<a href = 'People.php'><button class = But>Search</button></a>
199
</div>
200
<div id = 'Website'>
201
<img class = 'Mod' src = '../Icon/Base/Author.png'>
202
<p id = 'Const'>Author</p>
203
<a id = 'change2'><button class = But>Show</button></a>
204
</div>";
205
}
206
}
207
208
function Image(){
209
$mode_file = "../Theme/Mode.json";
210
if (file_exists($mode_file)) {
211
$reader = file_get_contents($mode_file);
212
$parser = json_decode($reader,true);
213
$color = $parser["Color"]["Background"];
214
if ($color == "Light" or $color == "Dark" ){
215
echo "<img src = '../Icon/Base/Logo.png'>";
216
}
217
else {
218
echo "<img id = 'Main_img' src = '../Icon/$color/Logo.png'>";
219
}
220
}
221
else {
222
echo "<img id = 'Main_img' src = '../Icon/Base/Logo.png'>";
223
}
224
}
225
226
function Image2(){
227
$mode_file = "../Theme/Mode.json";
228
if (file_exists($mode_file)) {
229
$reader = file_get_contents($mode_file);
230
$parser = json_decode($reader,true);
231
$color = $parser["Color"]["Background"];
232
if ($color == "Light" or $color == "Dark" ){
233
$Folder = "../Icon/Base/Companies/";
234
}
235
else {
236
$Folder = "../Icon/High-Contrast/Companies/";
237
}
238
}
239
else {
240
$Folder = "../Icon/Base/Companies/";
241
}
242
$image = glob($Folder."*.png");
243
echo "<center>
244
<div class = 'part'>
245
<p>PARTNERSHIPS</p>";
246
foreach($image as $Content => $pic){
247
$name = str_replace(".png","",$pic);
248
$name2 = str_replace($Folder,"",$name);
249
echo "<img src = '$pic' abbr title = '$name2'";
250
}
251
echo "</div></center>";
252
}
253
254
?>
255