Fix navigation

This commit is contained in:
Bruno Rybársky 2024-02-05 22:02:16 +01:00
parent a562e0bf22
commit 9d26c19ee2
2 changed files with 3 additions and 3 deletions

@ -145,7 +145,7 @@ function logout() {
}
function initAjax() {
let links = document.querySelectorAll('.navsite_item, .navpage_item');
let links = document.querySelectorAll('.navsite_link, .navpage_link');
// Add click event listener to each link
links.forEach(function (link) {

@ -83,12 +83,12 @@ function generateNavigation(): string
}
if($page_required_permission <= $_SESSION["privilege_level"]) {
$navpages .= "<li class='navpage_item' data-site='$site_dir' data-page='$page_basename'><a href='$page_location' $page_class>$page_name</a></li>";
$navpages .= "<li class='navpage_item' data-site='$site_dir' data-page='$page_basename'><a data-site='$site_dir' data-page='$page_basename' href='$page_location' $page_class>$page_name</a></li>";
}
}
if(!empty($navpages)){
$default_page = $routerConfig["default_page"];
$nav_out .= "<li class='navsite_item' data-page='$default_page' data-site='$site_dir'><a href='$site_location' $site_class>$site_name</a><ul class='navpage_list'>$navpages</ul></li>";
$nav_out .= "<li class='navsite_item' data-page='$default_page' data-site='$site_dir'><a data-page='$default_page' data-site='$site_dir' href='$site_location' $site_class>$site_name</a><ul class='navpage_list'>$navpages</ul></li>";
}
}