2025-02-19 06:15:27 +01:00
|
|
|
<?php
|
2025-04-23 07:41:37 +02:00
|
|
|
$ext = (substr($_SERVER["SERVER_SOFTWARE"] ?? "", 0, 3) == "PHP" ? ".php" : "");
|
2025-03-12 21:19:08 +01:00
|
|
|
$path = strtok($_SERVER["REQUEST_URI"], '?');
|
2025-02-19 06:15:27 +01:00
|
|
|
?>
|
2025-04-03 00:40:50 +02:00
|
|
|
<nav class="navbar navbar-expand-sm bg-body-tertiary">
|
2025-02-19 06:15:27 +01:00
|
|
|
<div class="container">
|
2025-04-23 07:41:37 +02:00
|
|
|
<a class="navbar-brand" href="/" <?php if ($path == "/"): ?> onclick="event.preventDefault();" <?php endif; ?>>OpenWF</a>
|
2025-04-03 00:40:50 +02:00
|
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-content" aria-controls="navbar-content" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="navbar-content">
|
|
|
|
<ul class="navbar-nav me-auto mb-0">
|
|
|
|
<li class="nav-item dropdown">
|
2025-04-23 07:41:37 +02:00
|
|
|
<a class="nav-link dropdown-toggle<?=((substr($path, 0, 6) == "/guide" || substr($path, 0, 25) == "/asset-replacements-guide") ? " active" : ""); ?>" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Guides</a>
|
2025-04-03 00:40:50 +02:00
|
|
|
<ul class="dropdown-menu">
|
2025-04-23 07:41:37 +02:00
|
|
|
<li><a class="dropdown-item<?=(substr($path, 0, 6) == "/guide" ? " active" : ""); ?>" href="/guide<?=$ext;?>">Setup</a></li>
|
|
|
|
<li><a class="dropdown-item<?=(substr($path, 0, 7) == "/import" ? " active" : ""); ?>" href="/import<?=$ext;?>">Importing</a></li>
|
|
|
|
<li><a class="dropdown-item<?=(substr($path, 0, 25) == "/asset-replacements-guide" ? " active" : ""); ?>" href="/asset-replacements-guide<?=$ext;?>">Asset Replacements</a></li>
|
2025-04-03 00:40:50 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2025-04-23 07:41:37 +02:00
|
|
|
<li class="nav-item"><a class="nav-link<?=(substr($path, 0, 11) == "/contribute" ? " active" : ""); ?>" href="/contribute<?=$ext;?>">Contribute</a></li>
|
2025-04-03 00:40:50 +02:00
|
|
|
<li class="nav-item"><a class="nav-link" href="https://discord.gg/PNNZ3asUuY" target="_blank">Discord</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2025-02-19 06:15:27 +01:00
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<script>
|
|
|
|
// Disable navbar links that point back to this page.
|
|
|
|
document.querySelectorAll(".navbar-nav .nav-link.active, .navbar-nav .dropdown-item.active").forEach(elm =>
|
|
|
|
{
|
|
|
|
elm.onclick = (event) => { event.preventDefault() };
|
|
|
|
});
|
2025-04-23 07:50:23 +02:00
|
|
|
|
|
|
|
// User-facing stuff really has no reason to be served over insecure HTTP.
|
|
|
|
if (location.host == "openwf.io" && location.protocol == "http:")
|
|
|
|
{
|
|
|
|
location.protocol = "https:";
|
|
|
|
}
|
2025-02-19 06:15:27 +01:00
|
|
|
</script>
|