]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - header.php
Make it not highlight overview when not on any navigation page
[irc/unrealircd/unrealircd-webpanel.git] / header.php
CommitLineData
e98b5a51 1<!DOCTYPE html>
911a6472
BM
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
c88945a1 15<script src="js/unrealircd-admin.js"></script>
e98b5a51 16<title>UnrealIRCd Panel</title>
27efe895
BM
17<link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
18<link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
911a6472
BM
19</head>
20<body role="document">
4896fbb9
VP
21<div class="container-fluid">
22
5cc8ca4a
VP
23 <!-- Fixed navbar -->
24 <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
25 <ul class="nav navbar-nav">
27efe895 26 <a class="navbar-brand" href="index.php"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
1e6ffd06 27<?php
d1d9caa9 28
4d71d431 29$active_page = NULL;
27efe895 30/* Needs to be a separate step due to multiple matches */
a2712ef5
VP
31foreach ($pages as $name => $page)
32{
33 $script = $_SERVER['SCRIPT_FILENAME'];
a2712ef5
VP
34 if (str_ends_with($script, BASE_URL . "index.php") || !strlen($page))
35 {
36 $active_page = "";
37 }
38 else if (!str_ends_with($page, ".php"))
39 {
40 $script2 = rtrim($script, "/index.php");
41 if (str_ends_with($script2, $page))
42 $active_page = $page;
43 }
44 else if (str_ends_with($script, $page))
45 {
27efe895 46 $active_page = $page;
4d71d431
VP
47 } elseif (!$active_page)
48 $active_page = false;
a2712ef5 49}
1e6ffd06
BM
50foreach($pages as $name=>$page)
51{
96de0b9c 52 $class = "class=\"nav-item\"";
4d71d431 53 if (is_string($active_page) && $page == $active_page)
96de0b9c 54 $class = str_replace("\"nav-item\"", "\"nav-item active\"", $class);
5cc8ca4a 55
27efe895 56 echo " <li $class><a class=\"nav-link\" href=\"".BASE_URL.$page."\">$name</a></li> \n";
1e6ffd06 57}
1e6ffd06 58?>
4896fbb9 59
5cc8ca4a 60 </ul>
d843c1de 61 </nav><br>
e98b5a51 62</div>
911a6472
BM
63
64<div class="container-fluid" role="main">