Fix bug that prevented the active page from being marked in nav

This commit is contained in:
Yorin Anne De Jong 2018-02-13 14:53:33 +01:00
parent 02f54c4458
commit 0d0305cf04
1 changed files with 2 additions and 1 deletions

View File

@ -11,10 +11,11 @@ function navbar($depth, $active = NULL) {
'wiki' => 'pvv',
];
foreach($menuItems as $caption => $link) {
$isActive = $active === $link;
if ($caption !== 'webmail') {
$link = rtrim(str_repeat('../', $depth) . $link, '/') . '/';
}
$result .= "\t\t<li" . ($active === $link ? ' class="active"' : '') . '>'
$result .= "\t\t<li" . ($isActive ? ' class="active"' : '') . '>'
. '<a href="' . $link . '">'
. $caption
. "</a></li>\n"