]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - header.php
Rather large update, please see commit notes
[irc/unrealircd/unrealircd-webpanel.git] / header.php
1 <?php $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr); ?>
2 <!DOCTYPE html>
3 <head>
4 <div class="media">
5 <div class="media-body">
6
7 <meta name="viewport" content="width=device-width, initial-scale=1">
8 <meta name="HandheldFriendly" content="true">
9
10
11 <!-- Latest compiled and minified CSS -->
12 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
13
14 <!-- jQuery library -->
15 <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script>
16
17 <!-- Popper JS -->
18 <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
19
20 <!-- Latest compiled JavaScript -->
21 <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></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
26 <script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script>
27 <title>UnrealIRCd Panel</title>
28 <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
29 <link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
30 </head>
31 <body role="document">
32 <div class="container-fluid">
33
34 <!-- Fixed navbar -->
35 <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top z-index padding-top">
36 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
37 <span class="navbar-toggler-icon"></span>
38 </button>
39 <div class="collapse navbar-collapse" id="collapsibleNavbar">
40 <ul class="navbar-nav mr-auto">
41 <a class="navbar-brand" href="<?php echo BASE_URL; ?>"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
42 <?php
43
44 $active_page = NULL;
45
46 foreach ($pages as $name => $page)
47 {
48 $script = $_SERVER['SCRIPT_FILENAME'];
49 $tok = split($script, "/");
50 if (is_array($page))
51 continue;
52 if (is_string($page) && strlen($page) == 0) {
53 $active_page = "";
54 }
55 else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
56 {
57 $active_page = $tok[0];
58 }
59 else if (!str_ends_with($page, ".php"))
60 {
61 $script2 = rtrim($script, "/index.php");
62 if (str_ends_with($script2, $page))
63 $active_page = $page;
64 }
65 else if (str_ends_with($script, $page))
66 {
67 $active_page = $page;
68 } elseif (!$active_page)
69 $active_page = false;
70 }
71 foreach($pages as $name=>$page)
72 {
73 $class = "class=\"nav-item\"";
74 if (is_string($active_page) && $page == $active_page)
75 $class = str_replace("\"nav-item\"", "\"nav-item active\"", $class);
76
77 if (is_string($page))
78 echo "<li $class><a class=\"nav-link\" href=\"".BASE_URL.$page."\">$name</a></li>\n";
79
80 elseif (is_array($page))
81 {
82 foreach ($page as $k => $v)
83 {
84 $first_page = $v;
85 break;
86 }
87 ?>
88 <li class="nav-item dropdown">
89 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
90 <?php echo $name; ?>
91 </a>
92 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
93 <?php foreach($page as $k => $p)
94 {
95 ?>
96 <a class="dropdown-item" href="<?php echo BASE_URL.$p;?>"><?php echo $k; ?></a>
97 <?php
98 } ?>
99 </div>
100 </li>
101 <?php
102
103 }
104
105 }
106 ?>
107
108 </ul></div>
109 </nav><br>
110 </div>
111
112 <div class="container-fluid" role="main">