]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | $nav_shown = true; | |
3 | $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr); | |
4 | ?> | |
5 | <!DOCTYPE html> | |
6 | <head> | |
7 | <?php if (is_auth_provided() && !str_ends_with($_SERVER['SCRIPT_FILENAME'], "setup.php")) | |
8 | {?> | |
9 | <?php } ?> | |
10 | <div class="media"> | |
11 | <div class="media-body"> | |
12 | ||
13 | <meta name="viewport" content="width=device-width, initial-scale=1"> | |
14 | <meta name="HandheldFriendly" content="true"> | |
15 | ||
16 | <link href="<?php echo get_config("base_url"); ?>css/unrealircd-admin.css" rel="stylesheet"> | |
17 | ||
18 | ||
19 | <!-- Latest compiled and minified CSS --> | |
20 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"> | |
21 | ||
22 | <!-- Font Awesome JS --> | |
23 | <script defer src="https://use.fontawesome.com/releases/v6.2.1/js/solid.js" integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous"></script> | |
24 | <script defer src="https://use.fontawesome.com/releases/v6.2.1/js/fontawesome.js" integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous"></script> | |
25 | ||
26 | <!-- Font Awesome icons --> | |
27 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"> | |
28 | <title>UnrealIRCd Panel</title> | |
29 | <link rel="icon" type="image/x-icon" href="<?php echo get_config("base_url"); ?>img/favicon.ico"> | |
30 | </head> | |
31 | <body role="document"> | |
32 | <div aria-live="polite" aria-atomic="true"> | |
33 | <div id="toaster" style="right: 0; bottom: 50px; z-index: 5;" class="position-fixed bottom-0 right-0 p-4"> | |
34 | <!-- insert your javascript bread in here to make toast --> | |
35 | </div> | |
36 | </div> | |
37 | <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> | |
38 | <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script> | |
39 | <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script> | |
40 | <script src="<?php echo get_config("base_url"); ?>js/unrealircd-admin.js"></script> | |
41 | <script> | |
42 | var BASE_URL = "<?php echo get_config("base_url"); ?>"; | |
43 | function timeoutCheck() { | |
44 | var xhttp = new XMLHttpRequest(); | |
45 | xhttp.onreadystatechange = function() { | |
46 | if (this.readyState == 4 && this.status == 200) { | |
47 | var data = JSON.parse(this.responseText); | |
48 | if (data.session == 'none') | |
49 | window.location = BASE_URL + 'login/?timeout=1&redirect=' + encodeURIComponent(window.location.pathname); | |
50 | } | |
51 | }; | |
52 | xhttp.open("GET", BASE_URL + "api/timeout.php", true); | |
53 | xhttp.send(); | |
54 | } | |
55 | ||
56 | timeoutCheck(); | |
57 | StartStreamNotifs(BASE_URL + "api/notification.php"); | |
58 | setInterval(timeoutCheck, 15000); | |
59 | </script> | |
60 | <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> | |
61 | <style> | |
62 | #optionsopen { | |
63 | transition: left 0.3s; | |
64 | } | |
65 | #optionsclose { | |
66 | transition: left 0.3s; | |
67 | } | |
68 | .w3-sidebar { | |
69 | top: 53px; | |
70 | color: white; | |
71 | transition: left 0.3s; | |
72 | width: 160px; | |
73 | } | |
74 | .container-fluid { | |
75 | transition: padding-left 0.3s; | |
76 | } | |
77 | .list-group-item-action { | |
78 | color: #e0e0e0; | |
79 | } | |
80 | </style> | |
81 | <nav id="sidebarlol" style="left: 0" class="w3-sidebar navbar-expand-md bg-dark padding-top me-5 ma-5"> | |
82 | <div class="list-group"> | |
83 | <div class="badge badge-secondary rounded-pill">Main Menu</div> | |
84 | <?php | |
85 | ||
86 | function show_page_item($name, $page, $nestlevel) | |
87 | { | |
88 | $active_page = NULL; | |
89 | $icon = $style = ""; | |
90 | $class = "nav-link nav-item"; | |
91 | if (is_string($active_page) && $page == $active_page) | |
92 | $class .= " active"; | |
93 | ||
94 | if ($nestlevel > 0) | |
95 | { | |
96 | echo "<small>"; | |
97 | $name = " ".$name; | |
98 | $style = "padding-bottom: 1px; padding-top: 1px"; | |
99 | } else { | |
100 | echo "<b>"; | |
101 | } | |
102 | if (is_array($page)) | |
103 | { | |
104 | $style = "padding-bottom: 0px;"; | |
105 | } else { | |
106 | echo "<a href=\"".get_config("base_url").$page."\" style=\"text-decoration: none\">\n"; | |
107 | } | |
108 | echo "<div class=\"big-page-item d-flex justify-content-between align-items-center $class list-group-item-action\" style=\"$style\">$name | |
109 | <div class=\"text-right padding-top\"> | |
110 | <i class=\"fa fa-$icon\"></i> | |
111 | </div></div>\n"; | |
112 | if (!is_array($page)) | |
113 | echo "</a>"; | |
114 | if ($nestlevel > 0) | |
115 | echo "</small>"; | |
116 | else | |
117 | echo "</b>"; | |
118 | if (is_array($page)) | |
119 | { | |
120 | foreach ($page as $subname=>$subpage) | |
121 | show_page_item($subname, $subpage, 1); | |
122 | } | |
123 | } | |
124 | ||
125 | function show_page_item_mobile($name, $page, $nestlevel) | |
126 | { | |
127 | $active_page = NULL; | |
128 | $icon = $style = ""; | |
129 | $class = "nav-link nav-item"; | |
130 | if (is_string($active_page) && $page == $active_page) | |
131 | $class .= " active"; | |
132 | ||
133 | if ($nestlevel > 0) | |
134 | { | |
135 | echo "<small>"; | |
136 | $name = " ".$name; | |
137 | $style = "padding-bottom: 1px; padding-top: 1px"; | |
138 | } else { | |
139 | echo "<b>"; | |
140 | } | |
141 | if (is_array($page)) | |
142 | { | |
143 | $style = "padding-bottom: 0px;"; | |
144 | } else { | |
145 | echo "<a href=\"".get_config("base_url").$page."\" >\n"; | |
146 | } | |
147 | echo "<div class=\"bg-dark lil-page-item d-flex justify-content-between align-items-center $class\" style=\"$style\">$name | |
148 | <div class=\"text-right padding-top\"> | |
149 | <i class=\"fa fa-$icon\"></i> | |
150 | </div></div>\n"; | |
151 | if (!is_array($page)) | |
152 | echo "</a>"; | |
153 | if ($nestlevel > 0) | |
154 | echo "</small>"; | |
155 | else | |
156 | echo "</b>"; | |
157 | if (is_array($page)) | |
158 | { | |
159 | foreach ($page as $subname=>$subpage) | |
160 | show_page_item($subname, $subpage, 1); | |
161 | } | |
162 | } | |
163 | foreach($pages as $name=>$page) | |
164 | show_page_item($name, $page, 0); | |
165 | ?> | |
166 | </div> | |
167 | </nav> | |
168 | ||
169 | <div class="container-fluid"> | |
170 | ||
171 | <!-- Fixed navbar --> | |
172 | <nav class="topbar navbar navbar-expand-md navbar-dark bg-dark fixed-top z-index padding-top"> | |
173 | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar" aria-controls="collapsibleNavbar" aria-expanded="false" aria-label="Toggle navigation"> | |
174 | <span class="navbar-toggler-icon"></span> | |
175 | </button> | |
176 | <a class="navbar-brand" href="<?php echo get_config("base_url"); ?>"><img src="<?php echo get_config("base_url"); ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a> | |
177 | <div class="collapse navbar-collapse" id="collapsibleNavbar"> | |
178 | <ul id="big-nav-items" class="navbar-nav mr-auto"> | |
179 | ||
180 | <?php | |
181 | ||
182 | foreach ($pages as $name => $page) | |
183 | show_page_item($name, $page, 0); | |
184 | ||
185 | ||
186 | ?> | |
187 | ||
188 | </ul> | |
189 | ||
190 | </nav><br> | |
191 | </div> | |
192 | ||
193 | <div id="main_contain" class="container-fluid" style="padding-left: 180px" role="main"> | |
194 | ||
195 | <script> | |
196 | function nav_resize_check() | |
197 | { | |
198 | var width = window.innerWidth; | |
199 | var sidebar = document.getElementById('sidebarlol'); | |
200 | var top = document.getElementById('big-nav-items'); | |
201 | var maincontainer = document.getElementById('main_contain'); | |
202 | ||
203 | if (width < 768) | |
204 | { | |
205 | sidebar.style.display = 'none'; | |
206 | top.style.display = ''; | |
207 | maincontainer.style.paddingLeft = "10px"; | |
208 | } | |
209 | else | |
210 | { | |
211 | sidebar.style.display = ''; | |
212 | top.style.display = 'none'; | |
213 | maincontainer.style.paddingLeft = "180px"; | |
214 | } | |
215 | } | |
216 | nav_resize_check(); | |
217 | window.addEventListener('resize', function() { | |
218 | nav_resize_check(); | |
219 | }); | |
220 | </script> |