<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
+<!-- Font Awesome icons -->
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
+
<script src="js/unrealircd-admin.js"></script>
<title>UnrealIRCd Panel</title>
<link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
<a class="navbar-brand" href="index.php"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
<?php
-$active_page = false;
+$active_page = NULL;
/* Needs to be a separate step due to multiple matches */
foreach ($pages as $name => $page)
{
$script = $_SERVER['SCRIPT_FILENAME'];
-
if (str_ends_with($script, BASE_URL . "index.php") || !strlen($page))
{
$active_page = "";
else if (str_ends_with($script, $page))
{
$active_page = $page;
- }
+ } elseif (!$active_page)
+ $active_page = false;
}
foreach($pages as $name=>$page)
{
$class = "class=\"nav-item\"";
- if ($page == $active_page)
+ if (is_string($active_page) && $page == $active_page)
$class = str_replace("\"nav-item\"", "\"nav-item active\"", $class);
echo " <li $class><a class=\"nav-link\" href=\"".BASE_URL.$page."\">$name</a></li> \n";