forked from mescon/Muximux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
muximux.php
69 lines (61 loc) · 2.28 KB
/
muximux.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
<?php
/*
* DO NOT CHANGE THIS FILE!
* The settings are all in config.ini.php
*/
$config = parse_ini_file('config.ini.php', true);
function menuItems($config) {
if (empty($item)) $item = '';
foreach ($config as $keyname => $section) {
if(!empty($section["enabled"]) && !($section["enabled"]=="false") && ($section["enabled"]=="true")) {
if(!empty($section["default"]) && !($section["default"]=="false") && ($section["default"]=="true")) {
$item .= "<li><a data-content=\"" . $keyname . "\" class=\"selected\"><span class=\"". $section["icon"] ." fa-lg\"></span> ". $section["name"] ."</a></li>\n";
} else {
$item .= "<li><a data-content=\"" . $keyname . "\"><span class=\"". $section["icon"] ." fa-lg\"></span> ". $section["name"] ."</a></li>\n";
}
}
}
return $item;
}
function frameContent($config) {
if (empty($item)) $item = '';
foreach ($config as $keyname => $section) {
if(!empty($section["landingpage"]) && !($section["landingpage"]=="false") && ($section["landingpage"]=="true")) {
$section["url"] = "?landing=" . $keyname;
}
if(!empty($section["enabled"]) && !($section["enabled"]=="false") && ($section["enabled"]=="true")) {
if(!empty($section["default"]) && !($section["default"]=="false") && ($section["default"]=="true")) {
$item .= "<li data-content=\"". $keyname . "\" class=\"selected\"><iframe scrolling=\"auto\" src=\"". $section["url"] . "\"></iframe></li>\n";
} else {
$item .= "<li data-content=\"". $keyname . "\"><iframe scrolling=\"auto\" src=\"". $section["url"] . "\"></iframe></li>\n";
}
}
}
return $item;
}
function landingPage($config, $keyname) {
$item = "
<html lang=\"en\">
<head>
<title>". $config[$keyname]["name"] ."</title>
<link rel=\"stylesheet\" href=\"css/landing.css\">
</head>
<body>
<div class=\"login\">
<div class=\"heading\">
<h2><span class=\"". $config[$keyname]["icon"] ." fa-3x\"></span></h2>
<section>
<a href=\"". $config[$keyname]["url"] ."\" target=\"_self\" title=\"Launch ". $config[$keyname]["name"] ."!\"><button class=\"float\">Launch ". $config[$keyname]["name"] ."</button></a>
</section>
</div>
</div>
</body></html>";
if (empty($item)) $item = '';
return $item;
}
if(isset($_GET['landing'])) {
$keyname = $_GET['landing'];
echo landingPage($config, $keyname);
die();
}
?>