This commit is contained in:
@@ -147,7 +147,19 @@ $sectionLinks = $isAdminArea
|
||||
'settings' => 'Einstellungen',
|
||||
];
|
||||
$showEventTypeChoice = !$editing && (($section ?? 'events') === 'places') && $requestedCreateListingKind === null;
|
||||
$modalSectionTarget = ($editingListing || ($section ?? '') === 'places') ? 'places' : 'events';
|
||||
$modalSectionTarget = $isAdminArea && $editingListing
|
||||
? 'listing-review'
|
||||
: (($editingListing || ($section ?? '') === 'places') ? 'places' : 'events');
|
||||
$modalActionArea = $isAdminArea && $editingListing ? 'area=admin&' : '';
|
||||
if ($isAdminArea && !empty($canReviewListings)) {
|
||||
$sectionLinks['listing-review'] = 'Orte & Veranstaltungen freigeben';
|
||||
}
|
||||
if ($isAdminArea && (!empty($canModerateForum) || !empty($canManageSystemSettings))) {
|
||||
$sectionLinks['community-moderation'] = 'Community-Moderation';
|
||||
}
|
||||
if ($isAdminArea && !empty($canManageUserManagement)) {
|
||||
$sectionLinks['user-management'] = 'User Management';
|
||||
}
|
||||
if ($isAdminArea && !empty($canManageCategories)) {
|
||||
$sectionLinks['categories'] = 'Kategorien';
|
||||
}
|
||||
@@ -188,10 +200,6 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
<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; ?>
|
||||
@@ -208,16 +216,25 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
</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">
|
||||
<?php if (!empty($canReviewListings)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/dashboard?area=admin&section=listing-review">
|
||||
<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>
|
||||
<p class="muted small">Noch nicht veröffentlichte Orte und Veranstaltungen prüfen.</p>
|
||||
</a>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/community-admin">
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canModerateForum) || !empty($canManageSystemSettings)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/dashboard?area=admin&section=community-moderation">
|
||||
<span class="profile-summary-card__eyebrow">Moderation</span>
|
||||
<strong>Community</strong>
|
||||
<p class="muted small">Meldungen, Bewerbungen und Rollen verwalten.</p>
|
||||
<p class="muted small">Offene Bewerbungen und Meldungen bearbeiten.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canManageUserManagement)): ?>
|
||||
<a class="profile-summary-card profile-summary-card--link" href="/dashboard?area=admin&section=user-management">
|
||||
<span class="profile-summary-card__eyebrow">Zugriffe</span>
|
||||
<strong>User Management</strong>
|
||||
<p class="muted small">Systemrollen und Benutzerzugriffe verwalten.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canManageCategories)): ?>
|
||||
@@ -231,7 +248,7 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
<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>
|
||||
<p class="muted small">Community-Level und Community-Punkte verwalten.</p>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($canManageSystemSettings)): ?>
|
||||
@@ -245,6 +262,45 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php if ($section === 'listing-review' && !empty($canReviewListings)): ?>
|
||||
<section class="account-panel">
|
||||
<div class="account-panel__head"><h2>Orte & Veranstaltungen freigeben</h2><p class="muted">Nur noch nicht freigegebene Orte und Veranstaltungen prüfen und bei Bedarf vor der Freigabe bearbeiten.</p></div>
|
||||
<div class="account-panel__body">
|
||||
<?php if (!$listingReviewRequests): ?><p class="muted">Keine offenen Orte oder Veranstaltungen zur Freigabe.</p><?php endif; ?>
|
||||
<div class="stack gap-12">
|
||||
<?php foreach ($listingReviewRequests as $request): ?>
|
||||
<article class="card" style="padding:18px;">
|
||||
<strong><?= htmlspecialchars((string)$request['title'], ENT_QUOTES) ?></strong>
|
||||
<span class="badge"><?= (string)($request['listing_type'] ?? '') === 'place' ? 'Ort' : 'Veranstaltung' ?></span>
|
||||
<p class="muted small"><?= htmlspecialchars(trim(implode(', ', array_filter([(string)($request['street'] ?? ''), trim((string)($request['zip'] ?? '') . ' ' . (string)($request['city'] ?? '')), (string)($request['region'] ?? '')]))), ENT_QUOTES) ?></p>
|
||||
<p class="muted small">Eingereicht von <?= htmlspecialchars((string)($request['requested_by_name'] ?: 'Mitglied'), ENT_QUOTES) ?>.</p>
|
||||
<div class="flex gap-12" style="flex-wrap:wrap; margin:14px 0;"><a class="btn ghost" href="/dashboard?area=admin&section=listing-review&edit_listing=<?= (int)$request['listing_id'] ?>">Bearbeiten</a></div>
|
||||
<form method="post" class="stack gap-8">
|
||||
<input type="hidden" name="action" value="listing_request_decide"><input type="hidden" name="request_id" value="<?= (int)$request['id'] ?>">
|
||||
<textarea name="review_note" class="textarea" rows="2" placeholder="Hinweis für die Entscheidung"></textarea>
|
||||
<div class="flex gap-12"><button class="btn" type="submit" name="decision" value="approved">Freigeben</button><button class="btn ghost" type="submit" name="decision" value="rejected">Ablehnen</button></div>
|
||||
</form>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php if ($section === 'community-moderation' && (!empty($canModerateForum) || !empty($canManageSystemSettings))): ?>
|
||||
<section class="account-panel"><div class="account-panel__head"><h2>Community-Moderation</h2><p class="muted">Offene Bewerbungen und gemeldete Inhalte bearbeiten.</p></div><div class="account-panel__body stack gap-18">
|
||||
<?php if (!empty($canManageSystemSettings)): ?><div class="card"><strong>Offene Bewerbungen</strong><?php if (!$communityApplications): ?><p class="muted small">Keine offenen Bewerbungen.</p><?php endif; ?><?php foreach ($communityApplications as $application): ?><div class="card" style="margin-top:12px; padding:14px;"><strong><?= htmlspecialchars((string)($application['display_name'] ?: $application['email']), ENT_QUOTES) ?></strong><p><?= nl2br(htmlspecialchars((string)$application['motivation'], ENT_QUOTES)) ?></p><form method="post" class="stack gap-8"><input type="hidden" name="action" value="application_decide"><input type="hidden" name="application_id" value="<?= (int)$application['id'] ?>"><textarea name="decision_reason" class="textarea" rows="2" placeholder="Begründung"></textarea><div class="flex gap-12"><button class="btn" type="submit" name="decision" value="approved">Annehmen</button><button class="btn ghost" type="submit" name="decision" value="rejected">Ablehnen</button></div></form></div><?php endforeach; ?></div><?php endif; ?>
|
||||
<?php if (!empty($canModerateForum)): ?><div class="card"><strong>Offene Meldungen</strong><?php if (!$communityReports): ?><p class="muted small">Keine offenen Meldungen.</p><?php endif; ?><?php foreach ($communityReports as $report): ?><div class="card" style="margin-top:12px; padding:14px;"><strong><?= htmlspecialchars((string)$report['target_type'], ENT_QUOTES) ?> #<?= (int)$report['target_id'] ?></strong><p><?= nl2br(htmlspecialchars((string)$report['reason'], ENT_QUOTES)) ?></p><form method="post" class="stack gap-8"><input type="hidden" name="action" value="report_resolve"><input type="hidden" name="report_id" value="<?= (int)$report['id'] ?>"><textarea name="moderator_note" class="textarea" rows="2" placeholder="Moderationsnotiz"></textarea><button class="btn" type="submit">Als erledigt markieren</button></form></div><?php endforeach; ?></div><?php endif; ?>
|
||||
</div></section>
|
||||
<?php endif; ?>
|
||||
<?php if ($section === 'user-management' && !empty($canManageUserManagement)): ?>
|
||||
<section class="account-panel"><div class="account-panel__head"><h2>User Management</h2><p class="muted">Benutzer suchen und Systemrollen verwalten.</p></div><div class="account-panel__body">
|
||||
<form method="get" class="form-grid"><input type="hidden" name="area" value="admin"><input type="hidden" name="section" value="user-management"><div class="stack gap-6"><label class="label" for="userManagementQuery">Name oder E-Mail</label><input id="userManagementQuery" name="user_management_query" class="input" value="<?= htmlspecialchars((string)$userManagementSearchQuery, ENT_QUOTES) ?>"></div><div class="stack gap-6" style="justify-content:end;"><span class="label"> </span><button class="btn" type="submit">Suchen</button></div></form>
|
||||
<?php foreach ($userManagementSearchResults as $candidate): ?><?php $candidateRoles = $communityAccess->getUserRoles((int)$candidate['id']); $assignableRoles = !empty($canManageProfileLevels) ? ['forum_admin', 'site_admin', 'owner'] : ['forum_admin']; ?><div class="card" style="margin-top:14px; padding:14px;"><strong><?= htmlspecialchars((string)($candidate['display_name'] ?: trim(((string)($candidate['first_name'] ?? '')) . ' ' . ((string)($candidate['last_name'] ?? ''))) ?: 'Mitglied'), ENT_QUOTES) ?></strong><p class="muted small">Aktuelle Rollen: <?= htmlspecialchars($candidateRoles ? implode(', ', $candidateRoles) : 'Keine', ENT_QUOTES) ?></p><div class="flex gap-8" style="flex-wrap:wrap;"><?php foreach ($assignableRoles as $roleKey): ?><?php if (!in_array($roleKey, $candidateRoles, true)): ?><form method="post"><input type="hidden" name="action" value="role_assign"><input type="hidden" name="target_user_id" value="<?= (int)$candidate['id'] ?>"><input type="hidden" name="role" value="<?= $roleKey ?>"><button class="btn ghost" type="submit"><?= htmlspecialchars($roleKey, ENT_QUOTES) ?> vergeben</button></form><?php elseif (!empty($canManageProfileLevels)): ?><form method="post"><input type="hidden" name="action" value="role_revoke"><input type="hidden" name="target_user_id" value="<?= (int)$candidate['id'] ?>"><input type="hidden" name="role" value="<?= $roleKey ?>"><button class="btn ghost" type="submit"><?= htmlspecialchars($roleKey, ENT_QUOTES) ?> entziehen</button></form><?php endif; ?><?php endforeach; ?></div></div><?php endforeach; ?>
|
||||
<?php if ($userManagementSearchQuery !== '' && !$userManagementSearchResults): ?><p class="muted small" style="margin-top:14px;">Keine passenden Benutzer gefunden.</p><?php endif; ?>
|
||||
<?php if (!empty($canManageProfileLevels)): ?><div class="card" style="margin-top:18px;"><strong>Vergebene Systemrollen</strong><?php if (!$systemRoleAssignments): ?><p class="muted small">Keine Rollen vergeben.</p><?php endif; ?><?php foreach ($systemRoleAssignments as $assignment): ?><div class="flex between center-y" style="gap:12px; flex-wrap:wrap; margin-top:12px;"><span><?= htmlspecialchars((string)($assignment['display_name'] ?: 'Mitglied'), ENT_QUOTES) ?> · <?= htmlspecialchars((string)$assignment['role'], ENT_QUOTES) ?></span><form method="post"><input type="hidden" name="action" value="role_revoke"><input type="hidden" name="target_user_id" value="<?= (int)$assignment['user_id'] ?>"><input type="hidden" name="role" value="<?= htmlspecialchars((string)$assignment['role'], ENT_QUOTES) ?>"><button class="btn ghost" type="submit">Entziehen</button></form></div><?php endforeach; ?></div><?php endif; ?>
|
||||
<div class="card" style="margin-top:18px;"><strong>System-Levels</strong><div class="stack gap-12" style="margin-top:14px;"><?php foreach (($systemLevelDefinitions ?? []) as $systemLevel): ?><div><strong><?= htmlspecialchars((string)$systemLevel['label'], ENT_QUOTES) ?></strong><ul class="dash-list"><?php foreach (($systemLevel['rights'] ?? []) as $right): ?><li><?= htmlspecialchars((string)$right, ENT_QUOTES) ?></li><?php endforeach; ?></ul></div><?php endforeach; ?></div></div>
|
||||
</div></section>
|
||||
<?php endif; ?>
|
||||
<?php if ($section === 'profile'): ?>
|
||||
<section class="account-panel">
|
||||
<div class="account-panel__head">
|
||||
@@ -384,16 +440,6 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($section === 'profile-levels' && !empty($canManageProfileLevels)): ?>
|
||||
<?php
|
||||
$systemRoleAssignmentsByRole = [];
|
||||
foreach (($systemRoleAssignments ?? []) as $assignment) {
|
||||
$roleKey = (string)($assignment['role'] ?? '');
|
||||
if ($roleKey === '') {
|
||||
continue;
|
||||
}
|
||||
$systemRoleAssignmentsByRole[$roleKey][] = $assignment;
|
||||
}
|
||||
?>
|
||||
<section class="account-panel">
|
||||
<div class="account-panel__head">
|
||||
<h2>Profil-Levels</h2>
|
||||
@@ -451,9 +497,6 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
Punkte: <?= number_format((float)($searchedUser['community_points'] ?? 0), 1, ',', '.') ?> ·
|
||||
Level: <?= htmlspecialchars(trim(((string)(($searchedUser['community_level']['icon'] ?? ''))) . ' ' . ((string)(($searchedUser['community_level']['label'] ?? '')))), ENT_QUOTES) ?>
|
||||
</div>
|
||||
<?php if (!empty($searchedUser['roles'])): ?>
|
||||
<div class="muted small" style="margin-top:6px;">System-Level: <?= htmlspecialchars(implode(', ', array_map('strval', (array)$searchedUser['roles'])), ENT_QUOTES) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" class="stack gap-12" style="margin-top:14px;">
|
||||
@@ -569,33 +612,6 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-top:18px;">
|
||||
<strong>System-Level</strong>
|
||||
<div class="stack gap-12" style="margin-top:14px;">
|
||||
<?php foreach (($systemLevelDefinitions ?? []) as $systemLevel): ?>
|
||||
<div class="card" style="padding:14px;">
|
||||
<strong><?= htmlspecialchars((string)($systemLevel['label'] ?? ''), ENT_QUOTES) ?></strong>
|
||||
<?php if (!empty($systemRoleAssignmentsByRole[(string)($systemLevel['key'] ?? '')])): ?>
|
||||
<div class="muted small" style="margin-top:8px;">
|
||||
Aktuell:
|
||||
<?php
|
||||
$assignmentLabels = [];
|
||||
foreach ($systemRoleAssignmentsByRole[(string)$systemLevel['key']] as $assignment) {
|
||||
$assignmentLabels[] = (string)($assignment['display_name'] ?? 'Mitglied');
|
||||
}
|
||||
echo htmlspecialchars(implode(', ', $assignmentLabels), ENT_QUOTES);
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<ul class="dash-list" style="margin-top:12px;">
|
||||
<?php foreach (($systemLevel['rights'] ?? []) as $systemRight): ?>
|
||||
<li><?= htmlspecialchars((string)$systemRight, ENT_QUOTES) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
@@ -1015,6 +1031,15 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
<li>Fehlende Tabellen: <?= !empty($listingCatalogStatus['missing']) ? htmlspecialchars(implode(', ', $listingCatalogStatus['missing']), ENT_QUOTES) : 'Keine' ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ($communityMigrationStatus): ?>
|
||||
<div class="card" style="margin-top:18px;">
|
||||
<strong>Community-Migration</strong>
|
||||
<p class="muted small">Status: <?= !empty($communityMigrationStatus['complete']) ? 'Vollständig eingerichtet' : 'Migration noch offen' ?></p>
|
||||
<p class="muted small">Fehlende Bausteine: <?= !empty($communityMigrationStatus['missing']) ? htmlspecialchars(implode(', ', $communityMigrationStatus['missing']), ENT_QUOTES) : 'Keine' ?></p>
|
||||
<form method="post" style="margin-top:14px;"><input type="hidden" name="action" value="community_migrate"><button class="btn" type="submit">Community-Migration ausführen</button></form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
@@ -1530,7 +1555,7 @@ if ($isAdminArea && !empty($canManageSystemSettings)) {
|
||||
<h3><?= htmlspecialchars($eventTitle, ENT_QUOTES) ?></h3>
|
||||
<button class="btn ghost" type="button" data-modal-close>✕</button>
|
||||
</div>
|
||||
<form id="eventEditorForm" class="stack gap-12" style="margin-top: 10px;" method="post" action="/dashboard?section=<?= htmlspecialchars($modalSectionTarget, ENT_QUOTES) ?>#<?= htmlspecialchars($modalSectionTarget, ENT_QUOTES) ?>" enctype="multipart/form-data">
|
||||
<form id="eventEditorForm" class="stack gap-12" style="margin-top: 10px;" method="post" action="/dashboard?<?= $modalActionArea ?>section=<?= htmlspecialchars($modalSectionTarget, ENT_QUOTES) ?>#<?= htmlspecialchars($modalSectionTarget, ENT_QUOTES) ?>" enctype="multipart/form-data">
|
||||
<input type="hidden" name="action" value="<?= htmlspecialchars($actionEvent, ENT_QUOTES) ?>">
|
||||
<input type="hidden" name="entry_kind" id="entryKind" value="<?= htmlspecialchars($currentEntryKind, ENT_QUOTES) ?>">
|
||||
<?php if ($editingEvent && $editEvent): ?>
|
||||
|
||||
Reference in New Issue
Block a user