This commit is contained in:
@@ -77,7 +77,7 @@ $migrationStatus = ($migration && $canManageApplications) ? $migration->status()
|
||||
<div class="forum-breadcrumbs">
|
||||
<a href="/">Home</a>
|
||||
<span>/</span>
|
||||
<a href="/dashboard">Mitgliederbereich</a>
|
||||
<a href="/dashboard?area=admin&section=admin-home">Admin-Einstellungen</a>
|
||||
<span>/</span>
|
||||
<span>Community-Admin</span>
|
||||
</div>
|
||||
@@ -88,7 +88,7 @@ $migrationStatus = ($migration && $canManageApplications) ? $migration->status()
|
||||
<p class="forum-hero__copy">Moderation, Bewerbungen und Rollen an einem Ort.</p>
|
||||
</div>
|
||||
<div class="forum-hero__cta">
|
||||
<a class="btn ghost" href="/dashboard">Zurück zum Mitgliederbereich</a>
|
||||
<a class="btn ghost" href="/dashboard?area=admin&section=admin-home">Zurück zu den Admin-Einstellungen</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -101,7 +101,7 @@ $migrationStatus = ($migration && $canManageApplications) ? $migration->status()
|
||||
|
||||
<div class="forum-admin-grid">
|
||||
<?php if ($canReviewListings): ?>
|
||||
<section class="forum-board">
|
||||
<section class="forum-board" id="listing-requests">
|
||||
<div class="forum-board__head">
|
||||
<div>
|
||||
<h2>Offene Orts- und Veranstaltungsanfragen</h2>
|
||||
|
||||
@@ -135,23 +135,26 @@ if ($priceRows === []) {
|
||||
$editingChild = isset($editChild) && $editChild !== null;
|
||||
$childAction = $editingChild ? 'child_update' : 'child_add';
|
||||
$childModalTitle = $editingChild ? 'Kind bearbeiten' : 'Kind hinzufügen';
|
||||
$sectionLinks = [
|
||||
'profile' => 'Profil',
|
||||
'children' => 'Kinder',
|
||||
'events' => 'Events',
|
||||
'places' => 'Orte & Veranstaltungen',
|
||||
'community' => 'Community',
|
||||
'settings' => 'Einstellungen',
|
||||
];
|
||||
if (!empty($canManageProfileLevels)) {
|
||||
$sectionLinks['profile-levels'] = 'Profil-Levels';
|
||||
}
|
||||
$isAdminArea = ($area ?? 'profile') === 'admin';
|
||||
$sectionLinks = $isAdminArea
|
||||
? ['admin-home' => 'Übersicht']
|
||||
: [
|
||||
'profile' => 'Profil',
|
||||
'children' => 'Kinder',
|
||||
'events' => 'Events',
|
||||
'places' => 'Orte & Veranstaltungen',
|
||||
'community' => 'Community',
|
||||
'settings' => 'Einstellungen',
|
||||
];
|
||||
$showEventTypeChoice = !$editing && (($section ?? 'events') === 'places') && $requestedCreateListingKind === null;
|
||||
$modalSectionTarget = ($editingListing || ($section ?? '') === 'places') ? 'places' : 'events';
|
||||
if (!empty($canManageCategories)) {
|
||||
if ($isAdminArea && !empty($canManageCategories)) {
|
||||
$sectionLinks['categories'] = 'Kategorien';
|
||||
}
|
||||
if (!empty($canManageSystemSettings)) {
|
||||
if ($isAdminArea && !empty($canManageProfileLevels)) {
|
||||
$sectionLinks['profile-levels'] = 'Profil-Levels';
|
||||
}
|
||||
if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
$sectionLinks['system'] = 'System';
|
||||
}
|
||||
?>
|
||||
@@ -159,7 +162,7 @@ if (!empty($canManageSystemSettings)) {
|
||||
<div class="container" style="display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;">
|
||||
<div>
|
||||
<h1>Hallo, <span style="color: var(--color-primary);"><?= htmlspecialchars($profile['display_name'] ?: 'Papa', ENT_QUOTES) ?></span>!</h1>
|
||||
<p class="muted">Verwalte dein Profil, Kinder, Events und Teilnahmen.</p>
|
||||
<p class="muted"><?= $isAdminArea ? 'Verwalte Moderation, Freigaben und Systemeinstellungen.' : 'Verwalte dein Profil, Kinder, eigene Orte und Veranstaltungen sowie Einstellungen.' ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -181,15 +184,67 @@ if (!empty($canManageSystemSettings)) {
|
||||
<div class="account-sidebar__inner">
|
||||
<nav class="account-sidebar__nav">
|
||||
<?php foreach ($sectionLinks as $sectionKey => $sectionLabel): ?>
|
||||
<a href="/dashboard?section=<?= rawurlencode($sectionKey) ?>" class="<?= $section === $sectionKey ? 'is-active' : '' ?>">
|
||||
<a href="/dashboard?<?= $isAdminArea ? 'area=admin&' : '' ?>section=<?= rawurlencode($sectionKey) ?>" class="<?= $section === $sectionKey ? 'is-active' : '' ?>">
|
||||
<span><?= htmlspecialchars($sectionLabel, ENT_QUOTES) ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($isAdminArea && !empty($canAccessCommunityAdmin)): ?>
|
||||
<a href="/community-admin#listing-requests"><span>Orte & Veranstaltungen freigeben</span></a>
|
||||
<a href="/community-admin"><span>Community-Moderation</span></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($isAdminArea): ?>
|
||||
<a class="account-sidebar__back" href="/dashboard?section=profile"><span>Zum Profil</span></a>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="account-main">
|
||||
<?php if ($section === 'admin-home' && $isAdminArea): ?>
|
||||
<section class="account-panel">
|
||||
<div class="account-panel__head">
|
||||
<h2>Admin-Einstellungen</h2>
|
||||
<p class="muted">Hier liegen ausschließlich Funktionen zur Moderation und Verwaltung der Plattform.</p>
|
||||
</div>
|
||||
<div class="account-panel__body">
|
||||
<div class="profile-summary-grid">
|
||||
<?php if (!empty($canAccessCommunityAdmin)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/community-admin#listing-requests">
|
||||
<span class="profile-summary-card__eyebrow">Freigaben</span>
|
||||
<strong>Orte & Veranstaltungen</strong>
|
||||
<p class="muted small">Neue Einträge sowie Änderungs- und Löschanfragen prüfen.</p>
|
||||
</a>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/community-admin">
|
||||
<span class="profile-summary-card__eyebrow">Moderation</span>
|
||||
<strong>Community</strong>
|
||||
<p class="muted small">Meldungen, Bewerbungen und Rollen verwalten.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canManageCategories)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/dashboard?area=admin&section=categories">
|
||||
<span class="profile-summary-card__eyebrow">Inhalte</span>
|
||||
<strong>Kategorien</strong>
|
||||
<p class="muted small">Neue Kategorien bestätigen und zusammenführen.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canManageProfileLevels)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/dashboard?area=admin&section=profile-levels">
|
||||
<span class="profile-summary-card__eyebrow">Community</span>
|
||||
<strong>Profil-Levels</strong>
|
||||
<p class="muted small">Level, Punkte und Systemrollen verwalten.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canManageSystemSettings)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/dashboard?area=admin&section=system">
|
||||
<span class="profile-summary-card__eyebrow">Betrieb</span>
|
||||
<strong>System</strong>
|
||||
<p class="muted small">Wartungs- und Diensteschalter konfigurieren.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php if ($section === 'profile'): ?>
|
||||
<section class="account-panel">
|
||||
<div class="account-panel__head">
|
||||
|
||||
@@ -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 & 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§ion=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 & 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§ion=admin-home">Admin-Einstellungen</a>
|
||||
<?php endif; ?>
|
||||
<a class="btn block" href="/logout">Abmelden</a>
|
||||
<?php else: ?>
|
||||
|
||||
Reference in New Issue
Block a user