]>
Commit | Line | Data |
---|---|---|
39206f24 | 1 | <?php |
830edb25 BM |
2 | $nav_shown = true; |
3 | $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr); | |
4 | ?> | |
fdebc6e7 | 5 | <!DOCTYPE html> |
4642afa5 | 6 | <head> |
ce9cf366 VP |
7 | <div class="media"> |
8 | <div class="media-body"> | |
9 | ||
33f512fa VP |
10 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
11 | <meta name="HandheldFriendly" content="true"> | |
12 | ||
ea90b321 | 13 | <link href="<?php echo get_config("base_url"); ?>css/unrealircd-admin.css" rel="stylesheet"> |
31ef838c | 14 | |
ce9cf366 | 15 | |
0ab180bf VP |
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 | ||
185d5d5d VP |
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 | ||
bca6dbd2 VP |
23 | <!-- Font Awesome icons --> |
24 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"> | |
e98b5a51 | 25 | <title>UnrealIRCd Panel</title> |
ea90b321 | 26 | <link rel="icon" type="image/x-icon" href="<?php echo get_config("base_url"); ?>img/favicon.ico"> |
911a6472 BM |
27 | </head> |
28 | <body role="document"> | |
1c363d5e VP |
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> | |
b2f66fb7 | 34 | <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous"></script> |
dcc312ec VP |
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> | |
ea90b321 | 37 | <script src="<?php echo get_config("base_url"); ?>js/unrealircd-admin.js"></script> |
2751c89d VP |
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 | } | |
1c363d5e | 52 | |
2751c89d VP |
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"> | |
71b40b19 VP |
58 | <style> |
59 | #optionsopen { | |
60 | transition: left 0.3s; | |
61 | } | |
62 | #optionsclose { | |
63 | transition: left 0.3s; | |
64 | } | |
65 | .w3-sidebar { | |
f60a30c1 | 66 | top: 52px; |
71b40b19 VP |
67 | color: white; |
68 | transition: left 0.3s; | |
2751c89d | 69 | width: 160px; |
71b40b19 VP |
70 | } |
71 | .container-fluid { | |
72 | transition: padding-left 0.3s; | |
73 | } | |
74 | .list-group-item-action { | |
242b9f53 | 75 | color: #e0e0e0; |
71b40b19 VP |
76 | } |
77 | </style> | |
b6762d6f | 78 | <nav id="sidebarlol" style="left: 0" class="w3-sidebar navbar-expand-md bg-dark padding-top me-5 ma-5"> |
2751c89d | 79 | <div class="list-group"> |
71b40b19 VP |
80 | <div class="badge badge-secondary rounded-pill">Main Menu</div> |
81 | <?php | |
71b40b19 | 82 | |
d6f10d25 | 83 | function show_page_item($name, $page, $nestlevel) |
71b40b19 | 84 | { |
dcc312ec | 85 | $active_page = NULL; |
19f86a66 | 86 | $icon = $style = ""; |
71b40b19 VP |
87 | $class = "nav-link nav-item"; |
88 | if (is_string($active_page) && $page == $active_page) | |
89 | $class .= " active"; | |
90 | ||
d6f10d25 BM |
91 | if ($nestlevel > 0) |
92 | { | |
8178904e BM |
93 | echo "<small>"; |
94 | $name = " ".$name; | |
242b9f53 BM |
95 | $style = "padding-bottom: 1px; padding-top: 1px"; |
96 | } else { | |
97 | echo "<b>"; | |
98 | } | |
19f86a66 | 99 | if (is_array($page)) |
242b9f53 | 100 | { |
19f86a66 | 101 | $style = "padding-bottom: 0px;"; |
242b9f53 | 102 | } else { |
ea90b321 | 103 | echo "<a href=\"".get_config("base_url").$page."\" style=\"text-decoration: none\">\n"; |
242b9f53 | 104 | } |
380c96a8 VP |
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 | |
71b40b19 VP |
145 | <div class=\"text-right padding-top\"> |
146 | <i class=\"fa fa-$icon\"></i> | |
242b9f53 BM |
147 | </div></div>\n"; |
148 | if (!is_array($page)) | |
149 | echo "</a>"; | |
d6f10d25 | 150 | if ($nestlevel > 0) |
8178904e | 151 | echo "</small>"; |
242b9f53 BM |
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 | } | |
d6f10d25 BM |
159 | } |
160 | foreach($pages as $name=>$page) | |
161 | show_page_item($name, $page, 0); | |
162 | ?> | |
71b40b19 VP |
163 | </div> |
164 | </nav> | |
165 | ||
4896fbb9 VP |
166 | <div class="container-fluid"> |
167 | ||
5cc8ca4a | 168 | <!-- Fixed navbar --> |
b6762d6f | 169 | <nav class="topbar navbar navbar-expand-md navbar-dark bg-dark fixed-top z-index padding-top"> |
b3b4c428 BM |
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> | |
ea90b321 | 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> |
33f512fa | 174 | <div class="collapse navbar-collapse" id="collapsibleNavbar"> |
380c96a8 | 175 | <ul id="big-nav-items" class="navbar-nav mr-auto"> |
0ce9e377 | 176 | |
1e6ffd06 | 177 | <?php |
d1d9caa9 | 178 | |
a2712ef5 | 179 | foreach ($pages as $name => $page) |
380c96a8 VP |
180 | show_page_item($name, $page, 0); |
181 | ||
33f512fa | 182 | |
1e6ffd06 | 183 | ?> |
4896fbb9 | 184 | |
9e2a2ac0 | 185 | </ul> |
380c96a8 | 186 | |
d843c1de | 187 | </nav><br> |
e98b5a51 | 188 | </div> |
911a6472 | 189 | |
1c363d5e | 190 | <div id="main_contain" class="container-fluid" style="padding-left: 180px" role="main"> |
71b40b19 | 191 | |
380c96a8 VP |
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'); | |
2f915b1a | 198 | var maincontainer = document.getElementById('main_contain'); |
380c96a8 | 199 | |
b6762d6f | 200 | if (width < 768) |
380c96a8 VP |
201 | { |
202 | sidebar.style.display = 'none'; | |
203 | top.style.display = ''; | |
2f915b1a | 204 | maincontainer.style.paddingLeft = "10px"; |
380c96a8 VP |
205 | } |
206 | else | |
207 | { | |
208 | sidebar.style.display = ''; | |
209 | top.style.display = 'none'; | |
2f915b1a | 210 | maincontainer.style.paddingLeft = "180px"; |
380c96a8 VP |
211 | } |
212 | } | |
213 | nav_resize_check(); | |
214 | window.addEventListener('resize', function() { | |
215 | nav_resize_check(); | |
216 | }); | |
399c9625 | 217 | </script> |