]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - header.php
Indentate
[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 <!-- This will make it so that it "works" on mobile device. Not sure it's a good idea yet though
8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 <meta name="HandheldFriendly" content="true">
10 -->
11
12 <!-- Latest compiled and minified CSS -->
13 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
14
15 <!-- jQuery library -->
16 <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script>
17
18 <!-- Popper JS -->
19 <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
20
21 <!-- Latest compiled JavaScript -->
22 <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
23
24 <!-- Font Awesome icons -->
25 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
26
27 <script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script>
28 <title>UnrealIRCd Panel</title>
29 <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
30 <link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
31 </head>
32 <body role="document">
33 <div class="container-fluid">
34
35 <!-- Fixed navbar -->
36 <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top z-index padding-top">
37 <ul class="nav navbar-nav">
38 <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>
39 <?php
40
41 $active_page = NULL;
42
43 foreach ($pages as $name => $page)
44 {
45 $script = $_SERVER['SCRIPT_FILENAME'];
46 $tok = split($script, "/");
47 if (strlen($page) == 0) {
48 $active_page = "";
49 }
50 else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
51 {
52 $active_page = $tok[0];
53 }
54 else if (!str_ends_with($page, ".php"))
55 {
56 $script2 = rtrim($script, "/index.php");
57 if (str_ends_with($script2, $page))
58 $active_page = $page;
59 }
60 else if (str_ends_with($script, $page))
61 {
62 $active_page = $page;
63 } elseif (!$active_page)
64 $active_page = false;
65 }
66 foreach($pages as $name=>$page)
67 {
68 $class = "class=\"nav-item\"";
69 if (is_string($active_page) && $page == $active_page)
70 $class = str_replace("\"nav-item\"", "\"nav-item active\"", $class);
71
72 echo " <li $class><a class=\"nav-link\" href=\"".BASE_URL.$page."\">$name</a></li> \n";
73 }
74 ?>
75
76 </ul>
77 </nav><br>
78 </div>
79
80 <div class="container-fluid" role="main">