]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - inc/header.php
Merge pull request #40 from d3xt3r01/main
[irc/unrealircd/unrealircd-webpanel.git] / inc / header.php
index f153f0c438b3d73b399e9757a07cec27e04bae18..322bce38d06877b849daf14431fcc143a63acc11 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 $nav_shown = true;
 $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr);
+
 ?>
 <!DOCTYPE html>
 <head>
@@ -11,6 +12,12 @@ $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr);
        <meta name="HandheldFriendly" content="true">
 
 <link href="<?php echo get_config("base_url"); ?>css/unrealircd-admin.css" rel="stylesheet">
+<link href="<?php echo get_config("base_url"); ?>css/right-click.css" rel="stylesheet">
+<style>
+.big-page-item:hover, .big-page-item:active, .nav-link {
+       color: black;
+}
+</style>
 
 <link rel="stylesheet" href="<?php echo get_config("base_url"); ?>css/datatables.min.css" />
 
@@ -36,9 +43,13 @@ $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr);
 <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
 <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
 <script src="<?php echo get_config("base_url"); ?>js/unrealircd-admin.js"></script>
+<!-- <script defer src="<?php echo get_config("base_url"); ?>js/right-click-menus.js"></script> -- We're not doing this yet XD -->
+<script src="<?php echo get_config("base_url"); ?>js/bs-modal.js"></script>
+<script src="<?php echo get_config("base_url"); ?>js/bs-toast.js"></script>
 <script src="<?php echo get_config("base_url"); ?>js/datatables.min.js"></script>
 <script src="<?php echo get_config("base_url"); ?>js/datatables-natural-sort.js"></script>
 <script src="<?php echo get_config("base_url"); ?>js/datatables-ellipsis.js"></script>
+<script src="<?php echo get_config("base_url"); ?>js/moment-with-locales.min.js"></script>
 <script>
                var BASE_URL = "<?php echo get_config("base_url"); ?>";
                function timeoutCheck() {
@@ -94,17 +105,23 @@ $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr);
        .list-group-item-action {
                color: #e0e0e0;
        }
+       .list-group-item-action:visited{
+               color: black;
+       }
 </style>
-<nav id="sidebarlol" style="left: 0" class="w3-sidebar navbar-expand-md bg-dark padding-top me-5 ma-5">
+<?php $a = []; Hook::run(HOOKTYPE_HEADER, $a); ?>
+<nav id="sidebarlol" style="left:0;overflow:auto" class="w3-sidebar navbar-expand-md bg-dark padding-top me-5 ma-5">
 <div class="list-group">
        <div class="badge badge-secondary rounded-pill">Main Menu</div>
        <?php 
 
-function show_page_item($name, $page, $nestlevel)
+function show_page_item($name, $page, $nestlevel, $small = false)
 {
        $active_page = NULL;
        $icon = $style = "";
        $class = "nav-link nav-item";
+       if ($small)
+               $class .= " list-group-item-action";
        //if (is_string($active_page) && $page == $active_page)
        //      $class .= " active";
 
@@ -125,9 +142,11 @@ function show_page_item($name, $page, $nestlevel)
                $url = $page["script"];
                if (str_ends_with($url, "/index.php"))
                        $url = str_replace('/index.php', '', $url);
+                if (!str_ends_with($url, ".php") && !empty($url))
+                        $url = $url.'/';
                echo "<a href=\"".get_config("base_url").$url."\" style=\"text-decoration: none\">\n";
        }
-       echo "<div class=\"big-page-item d-flex justify-content-between align-items-center $class list-group-item-action\" style=\"$style\">$name
+       echo "<div class=\"big-page-item d-flex justify-content-between align-items-center $class\" style=\"$style\">$name
                <div class=\"text-right padding-top\">
                        <i class=\"fa fa-$icon\"></i>
                </div></div>\n";
@@ -140,7 +159,7 @@ function show_page_item($name, $page, $nestlevel)
        if (!$is_link)
        {
                foreach ($page as $subname=>$subpage)
-                       show_page_item($subname, $subpage, 1);
+                       show_page_item($subname, $subpage, 1, $small);
        }
 }
 
@@ -191,8 +210,9 @@ function rpc_server_nav()
        $servers = get_config("unrealircd");
        $cnt = count($servers);
 ?>
-               <div class="dropdown" style="color: #d0d0d0">
-                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $active_server ?> <span class="caret"></span></a>
+
+               <div class="dropdown navbar-expand-md navbar-nav">
+                       <a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $active_server ?></a>
                        <div class="dropdown-menu">
 <?php
                        foreach($servers as $name=>$d)
@@ -211,7 +231,7 @@ function rpc_server_nav()
 
 
 foreach($pages as $name=>$page)
-       show_page_item($name, $page, 0);
+       show_page_item($name, $page, 0, true);
 ?>
 </div>
 </nav>