You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.7 KiB
PHP
39 lines
1.7 KiB
PHP
<nav class="navbar navbar-expand-sm navbar-light bg-light">
|
|
<a class="navbar-brand" href="./">
|
|
<?php
|
|
// Use custom icon if it exists
|
|
$iconsrc = "img/icon.svg";
|
|
if (file_exists(__DIR__ . "/../custom/icon.svg")) {
|
|
$iconsrc = "custom/icon.svg";
|
|
}
|
|
?>
|
|
<img src="<?php echo SITE_PATH . $iconsrc; ?>" width="30" height="30" alt="" class="mr-2 mb-1">
|
|
<?php echo SITE_TITLE; ?>
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
<ul class="navbar-nav mr-auto">
|
|
<?php
|
|
$navbar = [
|
|
["pageid" => "", "title" => "Home", "icon" => "fas fa-home"],
|
|
["pageid" => "create", "title" => "Create", "icon" => "fas fa-edit"],
|
|
];
|
|
foreach ($navbar as $item) {
|
|
$link = SITE_PATH . $item['pageid'];
|
|
?>
|
|
<li class="nav-item<?php echo $pageid == $item['pageid'] ? " active" : ""; ?>">
|
|
<a class="nav-link" href="<?php echo $link; ?>">
|
|
<span class="<?php echo $item['icon']; ?>"></span>
|
|
<?php echo $item['title']; ?>
|
|
<?php echo $pageid == $item['pageid'] ? "<span class=\"sr-only\">(current)</span>" : ""; ?>
|
|
</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</nav>
|