summaryrefslogtreecommitdiff
path: root/src/application/views/nav_guest.php
blob: 95c236e252cf3a8b1d886fcd5a113e01c3814406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

$nextParam = "";

switch ($GLOBALS["action"]) {
    case "auth":
    case "register":
        $nextParam = $_GET["next"] ?? "";
        break;
    default:
        $nextParam = $_SERVER["REQUEST_URI"];
}

if ($GLOBALS["action"] === "login")

?>
<ul class="nav navbar-nav navbar-right">
<li<?= $GLOBALS["action"] === "search" ? ' class="active"' : '' ?>><a href="?_action=search"><span class="fa fa-search" aria-hidden="true"></span><span class="sr-only"><?= __("Search") ?></span></a></li>
<li<?= $GLOBALS["action"] === "auth" ? ' class="active"' : '' ?>><a href="?_action=auth&amp;next=<?= htmlentities(urlencode($nextParam)) ?>"><?= __("Log in") ?></a></li>
<?php if (REGISTRATION_ENABLED): ?>
<li<?= $GLOBALS["action"] === "register" ? ' class="active"' : '' ?>><a href="?_action=register&amp;next=<?= htmlentities(urlencode($nextParam)) ?>"><?= __("Register") ?></a></li>
<?php endif; ?>
</ul>