]>
Commit | Line | Data |
---|---|---|
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 | <link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet"> | |
11 | ||
12 | ||
13 | <!-- Latest compiled and minified CSS --> | |
14 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"> | |
15 | ||
16 | <!-- jQuery library --> | |
17 | <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script> | |
18 | ||
19 | <!-- Popper JS --> | |
20 | <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> | |
21 | ||
22 | <!-- Latest compiled JavaScript --> | |
23 | <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script> | |
24 | ||
25 | <!-- Font Awesome icons --> | |
26 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"> | |
27 | ||
28 | <script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script> | |
29 | <title>UnrealIRCd Panel</title> | |
30 | <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico"> | |
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"><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> | |
37 | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar"> | |
38 | <span class="navbar-toggler-icon"></span> | |
39 | </button> | |
40 | <div class="collapse navbar-collapse" id="collapsibleNavbar"> | |
41 | <ul class="navbar-nav mr-auto"> | |
42 | ||
43 | <?php | |
44 | ||
45 | $active_page = NULL; | |
46 | ||
47 | foreach ($pages as $name => $page) | |
48 | { | |
49 | $script = $_SERVER['SCRIPT_FILENAME']; | |
50 | $tok = split($script, "/"); | |
51 | if (is_array($page)) | |
52 | continue; | |
53 | if (is_string($page) && strlen($page) == 0) { | |
54 | $active_page = ""; | |
55 | } | |
56 | else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0])) | |
57 | { | |
58 | $active_page = $tok[0]; | |
59 | } | |
60 | else if (!str_ends_with($page, ".php")) | |
61 | { | |
62 | $script2 = rtrim($script, "/index.php"); | |
63 | if (str_ends_with($script2, $page)) | |
64 | $active_page = $page; | |
65 | } | |
66 | else if (str_ends_with($script, $page)) | |
67 | { | |
68 | $active_page = $page; | |
69 | } elseif (!$active_page) | |
70 | $active_page = false; | |
71 | } | |
72 | foreach($pages as $name=>$page) | |
73 | { | |
74 | $class = "class=\"nav-item\""; | |
75 | if (is_string($active_page) && $page == $active_page) | |
76 | $class = str_replace("\"nav-item\"", "\"nav-item active\"", $class); | |
77 | ||
78 | if (is_string($page)) | |
79 | echo "<li $class><a class=\"nav-link\" href=\"".BASE_URL.$page."\">$name</a></li>\n"; | |
80 | ||
81 | elseif (is_array($page)) | |
82 | { | |
83 | foreach ($page as $k => $v) | |
84 | { | |
85 | $first_page = $v; | |
86 | break; | |
87 | } | |
88 | ?> | |
89 | <li class="nav-item dropdown"> | |
90 | <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
91 | <?php echo $name; ?> | |
92 | </a> | |
93 | <div class="dropdown-menu" aria-labelledby="navbarDropdown"> | |
94 | <?php foreach($page as $k => $p) | |
95 | { | |
96 | ?> | |
97 | <a class="dropdown-item" href="<?php echo BASE_URL.$p;?>"><?php echo $k; ?></a> | |
98 | <?php | |
99 | } ?> | |
100 | </div> | |
101 | </li> | |
102 | <?php | |
103 | ||
104 | } | |
105 | ||
106 | } | |
107 | ?> | |
108 | ||
109 | </ul> | |
110 | </nav><br> | |
111 | </div> | |
112 | ||
113 | <div class="container-fluid" role="main"> |