Clean up
All checks were successful
Deploy / deploy (push) Successful in 54s

This commit is contained in:
2026-08-21 02:20:46 +02:00
parent fae2dcc830
commit c8ed8fab3b
12 changed files with 130 additions and 80 deletions

View File

@@ -3,10 +3,7 @@ $app = app();
$isLoggedIn = isset($_SESSION['user_id']);
$displayName = 'Profil';
$profileInitial = 'P';
$showAdminLink = false;
$showSystemLink = false;
$showProfileLevelsLink = false;
$showCategoriesLink = false;
$showAdminSettingsLink = false;
if ($isLoggedIn) {
try {
@@ -29,19 +26,14 @@ if ($isLoggedIn) {
$community = new \App\Community($pdo, $communityConfig);
$communityAccess = new \App\CommunityAccess($pdo, $communityConfig);
$navCommunityPoints = $community->computePoints((int)$_SESSION['user_id']);
$showAdminLink = $communityAccess->canAccessCommunityAdmin((int)$_SESSION['user_id'], $navCommunityPoints);
$showSystemLink = $communityAccess->canManageApplications((int)$_SESSION['user_id']);
$showProfileLevelsLink = $communityAccess->canManageRoles((int)$_SESSION['user_id']);
$showCategoriesLink = $communityAccess->canManageCategories((int)$_SESSION['user_id'], $navCommunityPoints);
$showAdminSettingsLink = $communityAccess->canAccessCommunityAdmin((int)$_SESSION['user_id'], $navCommunityPoints)
|| $communityAccess->canManageCategories((int)$_SESSION['user_id'], $navCommunityPoints);
}
}
} catch (\Throwable) {
$displayName = 'Profil';
$profileInitial = 'P';
$showAdminLink = false;
$showSystemLink = false;
$showProfileLevelsLink = false;
$showCategoriesLink = false;
$showAdminSettingsLink = false;
}
}
?>
@@ -68,22 +60,8 @@ if ($isLoggedIn) {
</button>
<div class="profile-menu__dropdown" role="menu">
<a href="/dashboard?section=profile" role="menuitem">Profil</a>
<a href="/dashboard?section=children" role="menuitem">Kinder</a>
<a href="/dashboard?section=events" role="menuitem">Events</a>
<a href="/dashboard?section=places" role="menuitem">Orte &amp; Veranstaltungen</a>
<a href="/dashboard?section=community" role="menuitem">Community</a>
<a href="/dashboard?section=settings" role="menuitem">Einstellungen</a>
<?php if ($showCategoriesLink): ?>
<a href="/dashboard?section=categories" role="menuitem">Kategorien</a>
<?php endif; ?>
<?php if ($showProfileLevelsLink): ?>
<a href="/dashboard?section=profile-levels" role="menuitem">Profil-Levels</a>
<?php endif; ?>
<?php if ($showSystemLink): ?>
<a href="/dashboard?section=system" role="menuitem">System</a>
<?php endif; ?>
<?php if ($showAdminLink): ?>
<a href="/community-admin" role="menuitem">Admin</a>
<?php if ($showAdminSettingsLink): ?>
<a href="/dashboard?area=admin&section=admin-home" role="menuitem">Admin-Einstellungen</a>
<?php endif; ?>
<a href="/logout" role="menuitem">Abmelden</a>
</div>
@@ -101,22 +79,8 @@ if ($isLoggedIn) {
<a href="/community">Community</a>
<?php if ($isLoggedIn): ?>
<a class="btn ghost" href="/dashboard?section=profile">Profil</a>
<a class="btn ghost" href="/dashboard?section=children">Kinder</a>
<a class="btn ghost" href="/dashboard?section=events">Events</a>
<a class="btn ghost" href="/dashboard?section=places">Orte &amp; Veranstaltungen</a>
<a class="btn ghost" href="/dashboard?section=community">Community</a>
<a class="btn ghost" href="/dashboard?section=settings">Einstellungen</a>
<?php if ($showCategoriesLink): ?>
<a class="btn ghost" href="/dashboard?section=categories">Kategorien</a>
<?php endif; ?>
<?php if ($showProfileLevelsLink): ?>
<a class="btn ghost" href="/dashboard?section=profile-levels">Profil-Levels</a>
<?php endif; ?>
<?php if ($showSystemLink): ?>
<a class="btn ghost" href="/dashboard?section=system">System</a>
<?php endif; ?>
<?php if ($showAdminLink): ?>
<a class="btn ghost" href="/community-admin">Admin</a>
<?php if ($showAdminSettingsLink): ?>
<a class="btn ghost" href="/dashboard?area=admin&section=admin-home">Admin-Einstellungen</a>
<?php endif; ?>
<a class="btn block" href="/logout">Abmelden</a>
<?php else: ?>