]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - header.php
Update overview
[irc/unrealircd/unrealircd-webpanel.git] / header.php
index d249dc4a1a8fe31d457e4f2887d260997557a8f3..92051d270f18c227cb54d6363acf35231eda0745 100644 (file)
@@ -12,6 +12,9 @@
 <!-- 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 = "";
@@ -45,12 +47,13 @@ foreach ($pages as $name => $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";