]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - header.php
44f1268ebf3c7b9e083aba4c7225e1693a95e783
[irc/unrealircd/unrealircd-webpanel.git] / header.php
1 <!DOCTYPE html>
2 <head>
3 <!-- Latest compiled and minified CSS -->
4 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
5
6 <!-- jQuery library -->
7 <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script>
8
9 <!-- Popper JS -->
10 <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
11
12 <!-- Latest compiled JavaScript -->
13 <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
14
15 <!-- Font Awesome icons -->
16 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
17
18 <script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script>
19 <title>UnrealIRCd Panel</title>
20 <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
21 <link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
22 </head>
23 <body role="document">
24 <div class="container-fluid">
25
26 <!-- Fixed navbar -->
27 <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
28 <ul class="nav navbar-nav">
29 <a class="navbar-brand" href="<?php echo BASE_URL; ?>/index.php"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
30 <?php
31
32 $active_page = NULL;
33 /* Needs to be a separate step due to multiple matches */
34 foreach ($pages as $name => $page)
35 {
36 $script = $_SERVER['SCRIPT_FILENAME'];
37 $tok = split($script, "/");
38 if (strlen($page) == 0) {
39 $active_page = "";
40 }
41 else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
42 {
43 echo "2";
44 $active_page = $tok[0];
45 }
46 else if (!str_ends_with($page, ".php"))
47 {
48 $script2 = rtrim($script, "/index.php");
49 if (str_ends_with($script2, $page))
50 $active_page = $page;
51 }
52 else if (str_ends_with($script, $page))
53 {
54 $active_page = $page;
55 } elseif (!$active_page)
56 $active_page = false;
57 }
58 foreach($pages as $name=>$page)
59 {
60 $class = "class=\"nav-item\"";
61 if (is_string($active_page) && $page == $active_page)
62 $class = str_replace("\"nav-item\"", "\"nav-item active\"", $class);
63
64 echo " <li $class><a class=\"nav-link\" href=\"".BASE_URL.$page."\">$name</a></li> \n";
65 }
66 ?>
67
68 </ul>
69 </nav><br>
70 </div>
71
72 <div class="container-fluid" role="main">