diff options
Diffstat (limited to 'includes/navbar.inc')
-rw-r--r-- | includes/navbar.inc | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/includes/navbar.inc b/includes/navbar.inc new file mode 100644 index 0000000..379f102 --- /dev/null +++ b/includes/navbar.inc @@ -0,0 +1,72 @@ +<?php global $isLoggedIn; global $isUserLoggedIn; global $demoHeader; global $pages; global $useNewUI; global $navigation; ?> + +<?php if (!$useNewUI): ?> +<nav class="navbar navbar-expand-<?= $isLoggedIn ? 'xl' : 'lg' ?> bg-dark navbar-dark fixed-top" style="height:60px;"> + <div class="container-fluid"> + <a class="navbar-brand" href="/"><img src="/assets/logo/newlogo.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;"> + <span style="vertical-align: middle;">Cold Haze</span> + </a> + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#collapsibleNavbar"> + <span class="navbar-toggler-icon"></span> + </button> + <div class="collapse navbar-collapse" id="collapsibleNavbar"> + <ul class="navbar-nav"> + <?php foreach ($navigation as $item): if (!$item["admin"] || $isLoggedIn): ?> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"> + <img src="<?= $item["icon"] ?>" <?php if ($item["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;"> + <span style="vertical-align: middle;"><?= $item["name"] ?></span> + </a> + <ul class="dropdown-menu"> + <?php foreach ($item["items"] as $category): ?> + <?php if (isset($category["name"])): ?> + <li><hr class="dropdown-divider"></li> + <li><h5 class="dropdown-header"><?= $category["name"] ?></h5></li> + <?php endif; ?> + + <?php foreach ($category["items"] as $link): ?> + <li><a class="dropdown-item" href="<?= $link["link"] ?>"> + <img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px; border-radius: 5px; vertical-align: middle;"> + <span style="vertical-align: middle;<?= isset($link["stepped"]) ? "color: $link[stepped];" : "" ?>"><?= isset($link["stepped"]) ? "<b>$link[name]</b>" : $link["name"] ?></span> + </a></li> + <?php endforeach; ?> + <?php endforeach; ?> + </ul> + </li> + <?php endif; endforeach; ?> + <?php if ($isLoggedIn && !$useNewUI): ?> + <li class="nav-item" style="margin-left: auto;"> + <a class="nav-link" href="/-/user"> + <?php global $_PROFILE; ?> + <span style="vertical-align: middle;"> + <?= $_PROFILE["name"] ?> + </span> + <img alt="" src="/assets/icons/shield.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> + </a> + </li> + <?php elseif ($isUserLoggedIn && !$useNewUI): ?> + <li class="nav-item" style="margin-left: auto;"> + <a class="nav-link" href="/-/user"> + <?php global $_PROFILE; ?> + <span style="vertical-align: middle;"> + <?= $_PROFILE["name"] ?> + </span> + <img alt="" src="/assets/icons/shield.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> + </a> + </li> + <?php elseif (!$isLoggedIn && !$isUserLoggedIn): ?> + <li class="nav-item" style="<?php if (!$useNewUI): ?>margin-left: auto;<?php endif; ?>"> + <a class="nav-link" href="/-/login"> + <?php global $_PROFILE; ?> + <span style="vertical-align: middle;"> + Not logged in + </span> + <img alt="" src="/assets/icons/login.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> + </a> + </li> + <?php endif; ?> + </ul> + </div> + </div> +</nav> +<?php endif; ?>
\ No newline at end of file |