3 $arr = []; Hook
::run(HOOKTYPE_PRE_HEADER
, $arr);
8 <div
class="media-body">
10 <meta name
="viewport" content
="width=device-width, initial-scale=1">
11 <meta name
="HandheldFriendly" content
="true">
13 <link href
="<?php echo get_config("base_url
"); ?>css/unrealircd-admin.css" rel
="stylesheet">
15 .big
-page
-item
:hover
, .big
-page
-item
:active
, .nav
-link
{
20 <link rel
="stylesheet" href
="<?php echo get_config("base_url
"); ?>css/datatables.min.css" />
22 <!-- Latest compiled
and minified CSS
-->
23 <link rel
="stylesheet" href
="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
25 <!-- Font Awesome JS
-->
26 <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
>
27 <script defer src
="https://use.fontawesome.com/releases/v6.2.1/js/fontawesome.js" integrity
="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin
="anonymous"></script
>
29 <!-- Font Awesome icons
-->
30 <link rel
="stylesheet" href
="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
31 <title
>UnrealIRCd Panel
</title
>
32 <link rel
="icon" type
="image/x-icon" href
="<?php echo get_config("base_url
"); ?>img/favicon.ico">
34 <body role
="document">
35 <div aria
-live
="polite" aria
-atomic
="true">
36 <div id
="toaster" style
="right: 0; bottom: 50px; z-index: 5;" class="position-fixed bottom-0 right-0 p-4">
37 <!-- insert your javascript bread in here to make toast
-->
40 <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
>
41 <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
>
42 <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
>
43 <script src
="<?php echo get_config("base_url
"); ?>js/unrealircd-admin.js"></script
>
44 <script src
="<?php echo get_config("base_url
"); ?>js/datatables.min.js"></script
>
45 <script src
="<?php echo get_config("base_url
"); ?>js/datatables-natural-sort.js"></script
>
46 <script src
="<?php echo get_config("base_url
"); ?>js/datatables-ellipsis.js"></script
>
47 <script src
="<?php echo get_config("base_url
"); ?>js/moment-with-locales.min.js"></script
>
49 var BASE_URL
= "<?php echo get_config("base_url
"); ?>";
50 function timeoutCheck() {
51 var xhttp
= new XMLHttpRequest();
52 xhttp
.onreadystatechange
= function() {
53 if (this
.readyState
== 4 && this
.status
== 200) {
54 var data
= JSON
.parse(this
.responseText
);
55 if (data
.session
== 'none')
56 window
.location
= BASE_URL +
'login/?timeout=1&redirect=' +
encodeURIComponent(window
.location
.pathname
);
59 xhttp
.open("GET", BASE_URL +
"api/timeout.php", true);
64 StartStreamNotifs(BASE_URL +
"api/notification.php");
65 setInterval(timeoutCheck
, 15000);
67 function change_active_server(name
)
69 fetch(BASE_URL +
'api/set_rpc_server.php', {
71 headers
: {'Content-Type':'application/x-www-form-urlencoded'},
72 body
: 'server='+
encodeURIComponent(name
)
74 .then(response
=> response
.json())
83 <link rel
="stylesheet" href
="https://www.w3schools.com/w3css/4/w3.css">
86 transition
: left
0.3s
;
89 transition
: left
0.3s
;
94 transition
: left
0.3s
;
98 transition
: padding
-left
0.3s
;
100 .list-group
-item
-action
{
103 .list-group
-item
-action
:visited
{
107 <nav id
="sidebarlol" style
="left: 0" class="w3-sidebar navbar-expand-md bg-dark padding-top me-5 ma-5">
108 <div
class="list-group">
109 <div
class="badge badge-secondary rounded-pill">Main Menu
</div
>
112 function show_page_item($name, $page, $nestlevel, $small = false)
116 $class = "nav-link nav-item";
118 $class .= " list-group-item-action";
119 //if (is_string($active_page) && $page == $active_page)
120 // $class .= " active";
122 $is_link = isset($page["script"]) ? true : false;
127 $name = " ".$name;
128 $style = "padding-bottom: 1px; padding-top: 1px";
134 $style = "padding-bottom: 0px;";
136 $url = $page["script"];
137 if (str_ends_with($url, "/index.php"))
138 $url = str_replace('/index.php', '', $url);
139 echo "<a href=\"".get_config("base_url").$url."\" style=\"text-decoration: none\">\n";
141 echo "<div class=\"big-page-item d-flex justify-content-between align-items-center $class\" style=\"$style\">$name
142 <div class=\"text-right padding-top\">
143 <i class=\"fa fa-$icon\"></i>
153 foreach ($page as $subname=>$subpage)
154 show_page_item($subname, $subpage, 1, $small);
158 function show_page_item_mobile($name, $page, $nestlevel)
162 $class = "nav-link nav-item";
163 if (is_string($active_page) && $page == $active_page)
169 $name = " ".$name;
170 $style = "padding-bottom: 1px; padding-top: 1px";
176 $style = "padding-bottom: 0px;";
178 echo "<a href=\"".get_config("base_url").$page."\" >\n";
180 echo "<div class=\"bg-dark lil-page-item d-flex justify-content-between align-items-center $class\" style=\"$style\">$name
181 <div class=\"text-right padding-top\">
182 <i class=\"fa fa-$icon\"></i>
184 if (!is_array($page))
192 foreach ($page as $subname=>$subpage)
193 show_page_item($subname, $subpage, 1);
197 function rpc_server_nav()
199 $active_server = get_active_rpc_server();
201 return; // eg empty servers
202 $servers = get_config("unrealircd");
203 $cnt = count($servers);
206 <div
class="dropdown navbar-expand-md navbar-nav">
207 <a href
="#" class="dropdown-toggle nav-link" data
-toggle
="dropdown" role
="button" aria
-haspopup
="true" aria
-expanded
="false"><?php
echo $active_server ?></a
>
208 <div
class="dropdown-menu">
210 foreach($servers as $name=>$d)
213 if ($name != $active_server)
214 echo "<a class=\"dropdown-item\" href=\"javascript:change_active_server('".htmlspecialchars($name)."')\">".htmlspecialchars($name)."</a>\n";
216 echo "<div class=\"dropdown-item\">".htmlspecialchars($name)." <i>(current)</i></div>\n"; // current
225 foreach($pages as $name=>$page)
226 show_page_item($name, $page, 0, true);
231 <div
class="container-fluid">
233 <!-- Fixed navbar
-->
234 <nav
class="topbar navbar navbar-expand-md navbar-dark bg-dark fixed-top z-index padding-top">
235 <button
class="navbar-toggler" type
="button" data
-toggle
="collapse" data
-target
="#collapsibleNavbar" aria
-controls
="collapsibleNavbar" aria
-expanded
="false" aria
-label
="Toggle navigation">
236 <span
class="navbar-toggler-icon"></span
>
239 <a
class="navbar-brand" href
="<?php echo get_config("base_url
"); ?>">
240 <img src
="<?php echo get_config("base_url
"); ?>img/favicon.ico" height
="25" width
="25"> UnrealIRCd Admin Panel
</a
>
242 <?php
rpc_server_nav(); ?>
243 <div
class="collapse navbar-collapse" id
="collapsibleNavbar">
244 <ul id
="big-nav-items" class="navbar-nav mr-auto">
248 foreach ($pages as $name => $page)
249 show_page_item($name, $page, 0);
259 <div id
="main_contain" class="container-fluid" style
="padding-left: 180px" role
="main">
262 function nav_resize_check()
264 var width
= window
.innerWidth
;
265 var sidebar
= document
.getElementById('sidebarlol');
266 var top
= document
.getElementById('big-nav-items');
267 var maincontainer
= document
.getElementById('main_contain');
271 sidebar
.style
.display
= 'none';
272 top
.style
.display
= '';
273 maincontainer
.style
.paddingLeft
= "10px";
277 sidebar
.style
.display
= '';
278 top
.style
.display
= 'none';
279 maincontainer
.style
.paddingLeft
= "180px";
283 window
.addEventListener('resize', function() {
291 if (!(isset($current_page["no_irc_server_required"]) &&
292 ($current_page["no_irc_server_required"] == true)) &&
293 !get_active_rpc_server())
295 Message
::Fail("No RPC server configured. Go to Settings - RPC Servers.");
296 require_once('footer.php');
299 $current_page_title = "UnrealIRCd Panel";
300 if (!empty($current_page_name))
301 $current_page_title = "$current_page_name - $current_page_title";
302 echo "<script
>document
.title
='".htmlspecialchars($current_page_title)."';</script
>\n";