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