MainNavBar: hide navigation when not logged in

This commit is contained in:
Aaron van Geffen 2023-03-11 16:39:30 +01:00
parent 0a8da104cc
commit febe7bb405

View File

@ -31,7 +31,11 @@ class MainNavBar extends NavBar
</a> </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#', $this->innerMenuId, '" aria-controls="', $this->innerMenuId, '" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#', $this->innerMenuId, '" aria-controls="', $this->innerMenuId, '" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>';
if (Registry::get('user')->isLoggedIn())
{
echo '
<div class="collapse navbar-collapse justify-content-end" id="', $this->innerMenuId, '"> <div class="collapse navbar-collapse justify-content-end" id="', $this->innerMenuId, '">
<ul class="navbar-nav mb-2 mb-lg-0">'; <ul class="navbar-nav mb-2 mb-lg-0">';
@ -49,7 +53,10 @@ class MainNavBar extends NavBar
echo ' echo '
</ul> </ul>
</div> </div>';
}
echo '
</div> </div>
</nav>'; </nav>';
} }