LuminaWebsite/dashboard.php
Maaxxs 03597f14ad Raidplaner: tactics on the maps of all dungeons and raids, with tokens that move from step to step
Asked for in Discord: "raidplan.io bitte einbauen für die harten Dungeons". raidplan.io has no Aion 2
(only WoW, FFXIV, Lost Ark, New World), so the map tactics got what it offers.

- Dungeon maps: the in-game map textures of 11 expeditions, 7 transcendence dungeons, the 3 sanctuaries
  (Ludra, Corroded Decontamination Facility, Chalice of Muspel), the 6 awakening towers and 3
  subjugations, as published by the DPS meter Waffle-ens/waffle_meter (dotnet/Assets/Maps, pinned
  commit). assets/map/dungeons/dungeons.json is kept by hand: groups, slugs (= tactics.map_slug),
  German names from the Global client (aion2.app), KR/TW-only dungeons marked as unavailable, boss
  hints for the awakening towers. scripts/download_dungeon_maps.py fetches the images, writes
  dungeons/<slug>.webp (2048 px, about 3 MB in total, in Git) and the previews, and finds the dungeon
  area (bounds) by comparing each map with the shared background of all maps. Two empty arenas
  (round, square) are drawn in code.
- Viewer: image maps and arenas next to the tile maps (MapView.drawImageMap/drawArena, half zoom
  steps, opens fitted to the dungeon beside the tactic panel), map picker with the tabs "Welt" and
  "Dungeons & Raids", each area remembers its last map, no category panel without markers. The mouse
  wheel zooms to the cursor.
- New page raidplan.php ("Raidplaner" in the menu, map.view) = map.php started in the dungeon area.
  Location links on dungeon maps point to /raidplan.php and are recognized in texts and by the
  calendar picker.
- Tokens (shape type 'token', TokenIcons.js): classes, roles, players 1-8, markers A-D and symbols,
  boss, add, danger, stack, spread, tower, orb, bomb. Colour and size come from the toolbar, numbers
  and letters count up while placing, tokens are drawn above areas. Server whitelist
  TACTIC_TOKEN_ICONS.
- Move tool (✥) with label/delete actions above the selected shape, double click and Del; new action
  shape_update in tactics_api.php (points and label, same permissions, snapshot before). Undo also
  reverts moves and labels. Rectangle and cone tools, saved as areas.
- Step transitions: tactic_shapes.ref is kept by "Kopie dieses Schritts", tactic copies and restores
  (existing shapes get s<id>), so the same shape glides to its new place when stepping or playing;
  play button (and space) runs through all steps. 🔗 copies a link to the tactic and step
  (?taktik=&schritt=), which opens it after loading.
- Live view: the bot relay only knows the old shape types and events, so placing tokens and moving
  send "changed" and the others reload - no bot deploy needed.
- Schema version 60 (tactic_shapes.icon, .ref, enum 'token'; also in sql/schema.sql), tour step on the
  dashboard, patch notes and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 12:45:00 +02:00

498 lines
28 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require_once __DIR__ . '/includes/bootstrap.php';
require_once __DIR__ . '/includes/raids_api.php';
require_once __DIR__ . '/includes/contributions.php';
require_once __DIR__ . '/includes/bugs.php';
require_once __DIR__ . '/includes/activity_points.php';
require_once __DIR__ . '/includes/premade_banner.php';
require_permission('dashboard.view');
$user = current_user();
$canViewUsers = user_has_permission('users.view');
$canManageRoles = user_has_permission('roles.manage');
$canViewRaids = user_has_permission('raids.view');
$canViewPremades = user_has_permission('premades.view');
$canViewContributions = user_has_permission('contributions.view');
$canViewShop = user_has_permission('shop.view');
$discordId = $user['discord_id'] ? (int) $user['discord_id'] : null;
// In der Reihenfolge der Tags (Berechtigungsgruppen -> Reihenfolge der Tags), wie in der Mitgliederliste
$roleStmt = db()->prepare(
"SELECT COALESCE(NULLIF(r.display_name, ''), r.name) AS name
FROM roles r JOIN user_roles ur ON ur.role_id = r.id WHERE ur.user_id = ?
ORDER BY " . ROLE_TAG_ORDER_SQL
);
$roleStmt->execute([$user['id']]);
$roleNames = array_column($roleStmt->fetchAll(), 'name');
// Lumipunkte fuer abgeschlossene Aktivitaetschecks (fragt den Bot nur, wenn eine Frist abgelaufen ist)
activity_process_points();
$upcomingRaids = [];
$raidsError = null;
if ($canViewRaids) {
try {
$upcomingRaids = fetch_raids('active');
usort($upcomingRaids, static fn (array $a, array $b): int
=> ($a['timestamp'] ?? PHP_INT_MAX) <=> ($b['timestamp'] ?? PHP_INT_MAX));
foreach ($upcomingRaids as &$raid) {
$signups = is_array($raid['signups'] ?? null) ? $raid['signups'] : [];
$raid['_my_signup'] = null;
foreach ($signups as $signup) {
if ($discordId && (string) ($signup['user_id'] ?? '') === (string) $discordId && (int) ($signup['group'] ?? 0) >= 0) {
$raid['_my_signup'] = $signup;
break;
}
}
}
unset($raid);
} catch (Throwable $e) {
$raidsError = $e->getMessage();
}
}
$nextRaids = array_slice($upcomingRaids, 0, 3);
// Eigene Lumipunkte mit Platz in der Rangliste (gleiche Punktzahl = gleicher Platz, danach der naechste -
// wie auf contributions.php): 1 + wie viele verschiedene Punktstaende hoeher sind.
$myPoints = null;
$myRank = null;
if ($canViewContributions) {
$myPoints = contribution_user_balance((int) $user['id']);
$rankStmt = db()->prepare(
"SELECT COUNT(DISTINCT points) + 1 FROM (
SELECT u.id, COALESCE(SUM(e.points), 0) AS points FROM users u
LEFT JOIN contribution_entries e ON e.user_id = u.id
WHERE u.status = 'active' GROUP BY u.id
) balances WHERE points > ?"
);
$rankStmt->execute([$myPoints]);
$myRank = (int) $rankStmt->fetchColumn();
$memberTotal = (int) db()->query("SELECT COUNT(*) FROM users WHERE status = 'active'")->fetchColumn();
}
// Eigene Lumishop-Antraege: offen bzw. bewilligt und noch nicht uebergeben.
$myShopOpen = 0;
$myShopReady = 0;
if ($canViewShop) {
$shopStmt = db()->prepare(
"SELECT COALESCE(SUM(status = 'pending'), 0), COALESCE(SUM(status = 'approved'), 0)
FROM shop_orders WHERE user_id = ?"
);
$shopStmt->execute([(int) $user['id']]);
[$myShopOpen, $myShopReady] = array_map('intval', $shopStmt->fetch(PDO::FETCH_NUM));
}
$memberCount = $canViewUsers ? (int) db()->query("SELECT COUNT(*) FROM users WHERE status = 'active'")->fetchColumn() : null;
$roleCount = $canManageRoles ? (int) db()->query('SELECT COUNT(*) FROM roles')->fetchColumn() : null;
// Eigene Premades fuer die Dashboard-Kurzuebersicht laden (nur Anzeige, keine Verwaltung -
// dafuer verweist das Widget auf /premades.php). Mitglied sein kann man in mehreren, die geleiteten
// stehen vorne. Faellt bei Bot-Ausfall o.ae. still weg, das restliche Dashboard soll trotzdem laden.
$myPremades = [];
$myPremadeNamesByDiscordId = [];
$myPremadeLinkedUsersByDiscordId = [];
if ($canViewPremades && $discordId) {
try {
$myPremades = array_column(find_my_premades(fetch_premades(), $discordId), 'premade');
$premadeDiscordIds = [];
foreach ($myPremades as $myPremade) {
$premadeDiscordIds[] = (int) ($myPremade['owner_id'] ?? 0);
foreach ($myPremade['members'] ?? [] as $m) {
$premadeDiscordIds[] = (int) ($m['user_id'] ?? 0);
}
}
$premadeDiscordIds = array_values(array_unique(array_filter($premadeDiscordIds)));
if (!empty($premadeDiscordIds)) {
$placeholders = implode(',', array_fill(0, count($premadeDiscordIds), '?'));
$stmt = db()->prepare("SELECT id, discord_id, discord_username, display_name, avatar_filename FROM users WHERE discord_id IN ($placeholders)");
$stmt->execute($premadeDiscordIds);
foreach ($stmt->fetchAll() as $row) {
$name = $row['display_name'] !== '' ? $row['display_name'] : $row['discord_username'];
$myPremadeNamesByDiscordId[(int) $row['discord_id']] = $name;
$myPremadeLinkedUsersByDiscordId[(int) $row['discord_id']] = $row;
}
}
} catch (Throwable $e) {
$myPremades = [];
}
}
// Eigene Fehlermeldungen (die neuesten zuerst) und ggf. Eingaben nach einem Fehler.
$myBugs = [];
$myBugImages = [];
try {
$bugStmt = db()->prepare(
'SELECT id, title, area, status, admin_note, created_at, updated_at FROM bug_reports
WHERE user_id = ? ORDER BY created_at DESC LIMIT 10'
);
$bugStmt->execute([(int) $user['id']]);
$myBugs = $bugStmt->fetchAll();
$myBugImages = bug_images_for(array_column($myBugs, 'id'));
} catch (PDOException $e) {
$myBugs = [];
}
$bugForm = $_SESSION['bug_form'] ?? null;
unset($_SESSION['bug_form']);
$pageTitle = 'Dashboard';
include __DIR__ . '/includes/header.php';
?>
<div class="panel" data-tour="overview">
<div class="profile-header">
<?= avatar_html($user, 100) ?>
<div>
<h1>Willkommen, <?= e($user['display_name'] !== '' ? $user['display_name'] : $user['username']) ?>!</h1>
<p class="text-muted">Hier ist dein Überblick über die Legion.</p>
<div class="badge-group">
<?php foreach ($roleNames as $roleName): ?>
<span class="badge"><?= role_icon_html(role_icon_for($roleName)) ?><?= e($roleName) ?></span>
<?php endforeach; ?>
<?php if ($discordId): ?>
<span class="badge badge-active">Discord verbunden</span>
<?php else: ?>
<span class="badge badge-disabled">Discord nicht verbunden</span>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php if ($myPoints !== null): ?>
<div class="panel dashboard-points" data-tour="points">
<img class="dashboard-points-coin" src="/assets/images/lumipunkt.svg" alt="" width="64" height="64">
<div class="dashboard-points-main">
<h2>Lumipunkte</h2>
<div class="dashboard-points-value"><?= e(contribution_format($myPoints)) ?></div>
<p class="text-muted">Platz <?= (int) $myRank ?> von <?= (int) $memberTotal ?> in der Rangliste</p>
</div>
<?php if ($canViewShop && ($myShopOpen > 0 || $myShopReady > 0)): ?>
<div class="dashboard-points-shop">
<?php if ($myShopOpen > 0): ?>
<span class="badge badge-pending"><?= $myShopOpen ?> <?= $myShopOpen === 1 ? 'Antrag wartet' : 'Anträge warten' ?> auf Bewilligung</span>
<?php endif; ?>
<?php if ($myShopReady > 0): ?>
<span class="badge shop-badge-approved"><?= $myShopReady ?> bewilligt – Übergabe im Spiel ausstehend</span>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="dashboard-points-links">
<a class="button button-secondary dashboard-cta" href="/contributions.php"><?= icon('list') ?><span>Rangliste &amp; Verlauf</span></a>
<?php if ($canViewShop): ?>
<a class="button dashboard-cta dashboard-cta-primary" href="/shop.php"><?= icon('bag') ?><span>Zum Lumishop</span></a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if ($canViewRaids || $canViewUsers || $canManageRoles): ?>
<div class="panel">
<div class="card-grid">
<?php if ($canViewRaids): ?>
<a class="panel stat-card stat-card-link" href="/raids.php" title="Zu den Raids">
<div class="icon-badge"><?= icon('calendar') ?></div>
<div>
<h3><?= count($upcomingRaids) ?></h3>
<p class="text-muted">Anstehende Raids</p>
</div>
<span class="stat-card-arrow" aria-hidden="true">&rarr;</span>
</a>
<?php endif; ?>
<?php if ($canViewUsers): ?>
<a class="panel stat-card stat-card-link" href="/admin/users.php" title="Zur Benutzerverwaltung">
<div class="icon-badge"><?= icon('users') ?></div>
<div>
<h3><?= $memberCount ?></h3>
<p class="text-muted">Mitglieder</p>
</div>
<span class="stat-card-arrow" aria-hidden="true">&rarr;</span>
</a>
<?php endif; ?>
<?php if ($canManageRoles): ?>
<a class="panel stat-card stat-card-link" href="/admin/roles.php" title="Zu den Berechtigungsgruppen">
<div class="icon-badge"><?= icon('shield') ?></div>
<div>
<h3><?= $roleCount ?></h3>
<p class="text-muted">Berechtigungsgruppen</p>
</div>
<span class="stat-card-arrow" aria-hidden="true">&rarr;</span>
</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if ($canViewRaids): ?>
<div class="panel" data-tour="raids">
<div class="raid-header">
<h2>Nächste Raids</h2>
<a href="/raids.php">Alle Raids ansehen &rarr;</a>
</div>
<?php if ($raidsError): ?>
<div class="flash flash-error">Raid-Daten konnten nicht geladen werden: <?= e($raidsError) ?></div>
<?php elseif (empty($nextRaids)): ?>
<p class="text-muted">Aktuell sind keine aktiven Raids geplant.</p>
<?php else: ?>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Raid</th>
<th>Termin</th>
<th>Anmeldungen</th>
<th>Mein Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($nextRaids as $raid): ?>
<?php
$title = (string) ($raid['title'] ?? 'Raid');
$dateLabel = !empty($raid['timestamp']) ? date('d.m.Y H:i', (int) $raid['timestamp']) . ' Uhr' : (string) ($raid['date'] ?? '');
$maxSlots = (int) ($raid['max_slots'] ?? 0);
$signups = is_array($raid['signups'] ?? null) ? $raid['signups'] : [];
$activeCount = 0;
foreach ($signups as $signup) {
if ((int) ($signup['group'] ?? 0) >= 1 && ($signup['class'] ?? '') !== 'Ausstehend') {
$activeCount++;
}
}
$mySignup = $raid['_my_signup'] ?? null;
$raidTime = (int) ($raid['timestamp'] ?? 0);
// Kalender: Monat des Raids, direkt zum Tag gesprungen
$calendarUrl = $raidTime > 0 ? '/calendar.php?month=' . date('Y-m', $raidTime) . '#tag-' . date('Y-m-d', $raidTime) : '/calendar.php';
?>
<tr>
<td><a href="/raids.php#raid-<?= (int) ($raid['raid_id'] ?? 0) ?>"><?= e($title) ?></a></td>
<td class="text-muted">
<a class="raid-calendar-link" href="<?= e($calendarUrl) ?>" title="Im Kalender ansehen"><?= icon('calendar') ?><?= e($dateLabel) ?></a>
</td>
<td><?= $activeCount ?> / <?= $maxSlots ?></td>
<td>
<?php if ($mySignup): ?>
<span class="badge badge-active">Angemeldet (<?= e((string) ($mySignup['class'] ?? '')) ?>)</span>
<?php elseif (!$discordId): ?>
<span class="badge badge-disabled">Discord fehlt</span>
<?php else: ?>
<span class="badge">Nicht angemeldet</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($myPremades): ?>
<div class="panel">
<div class="raid-header">
<h2>⚔️ <?= count($myPremades) === 1 ? 'Meine Premade: ' . e((string) ($myPremades[0]['name'] ?? '')) : 'Meine Premades' ?></h2>
<a href="/premades.php">Zu den Premades &rarr;</a>
</div>
<?php foreach ($myPremades as $myPremade): ?>
<?php $myBanner = premade_banner((int) ($myPremade['id'] ?? 0)); ?>
<?php if ($myBanner !== null && $myBanner['url'] !== null): ?>
<?php // Das Banner der Premade - mit Namen nur, wenn es mehrere sind (sonst steht er schon oben) ?>
<div class="premade-banner premade-banner-small" style="<?= premade_banner_style($myBanner) ?>">
<?php if (count($myPremades) > 1): ?><h3><?= e((string) ($myPremade['name'] ?? '')) ?></h3><?php endif; ?>
</div>
<?php elseif (count($myPremades) > 1): ?>
<h3 class="dashboard-premade-name"><?= e((string) ($myPremade['name'] ?? '')) ?></h3>
<?php endif; ?>
<div class="premade-roster">
<?php foreach (build_premade_slots($myPremade, $myPremadeNamesByDiscordId) as $slot): ?>
<?php
$isReserveSlot = !empty($slot['reserve']);
$reserveTag = $isReserveSlot ? '<span class="premade-reserve-tag">Reserve</span>' : '';
?>
<?php if ($slot['type'] === 'empty'): ?>
<div class="premade-slot premade-slot-empty<?= $isReserveSlot ? ' premade-slot-reserve' : '' ?>">
<div class="premade-slot-inner">
<?= $reserveTag ?>
<span class="premade-slot-placeholder">+</span>
</div>
</div>
<?php else: ?>
<?php $slotUser = premade_avatar_user((int) $slot['id'], $myPremadeLinkedUsersByDiscordId, $slot['name']); ?>
<div class="premade-slot premade-slot-<?= e($slot['type']) ?><?= $isReserveSlot ? ' premade-slot-reserve' : '' ?>">
<div class="premade-slot-inner">
<?= $reserveTag ?>
<?= avatar_html($slotUser, 40) ?>
<div class="premade-slot-name">
<strong><?= $slot['type'] === 'pending' ? '⏳ ' : '' ?><?= e($slot['name']) ?></strong>
<?php if ($slot['type'] === 'pending'): ?>
<span class="text-muted">Einladung offen</span>
<?php elseif (!empty($slot['class'])): ?>
<?php $slotClassIcon = class_icon_url($slot['class']); ?>
<span class="premade-slot-class">
<?php if ($slotClassIcon): ?>
<img class="premade-slot-class-icon" src="<?= e($slotClassIcon) ?>" alt="">
<?php endif; ?>
<span class="text-muted"><?= e($slot['class']) ?></span>
</span>
<?php endif; ?>
</div>
<?php if ($slot['type'] === 'lead'): ?>
<span class="premade-crown" title="Lead der Premade"><?= icon('crown') ?></span>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if (user_has_permission('wiki.view')): ?>
<a class="panel dashboard-wiki" href="/wiki.php" data-tour="wiki">
<span class="icon-badge"><?= icon('book') ?></span>
<span>
<strong>Einsteiger-Guide</strong>
<span class="text-muted">Tipps und Infos rund um Aion 2 - Klassen, Dungeons, Gear und mehr. Geschrieben von Mitgliedern für Mitglieder.</span>
</span>
<span class="dashboard-wiki-arrow" aria-hidden="true">→</span>
</a>
<?php endif; ?>
<div class="panel bug-panel" id="fehler-melden" data-tour="bugs">
<details class="bug-report-details"<?= $bugForm !== null ? ' open' : '' ?>>
<summary>
<span class="icon-badge"><?= icon('bug') ?></span>
<span>
<strong>Fehler gefunden?</strong>
<span class="text-muted">Wenn auf der Website etwas nicht funktioniert, sag uns Bescheid.</span>
</span>
<span class="button button-secondary button-small bug-report-toggle">Fehler melden</span>
</summary>
<form method="post" action="/bug_action.php" class="bug-form" enctype="multipart/form-data">
<?= csrf_field() ?>
<input type="hidden" name="action" value="create">
<div class="bug-form-row">
<div>
<label for="bug-title">Kurzer Titel</label>
<input type="text" id="bug-title" name="title" maxlength="150" required
placeholder="z.B. Raid-Anmeldung speichert die Klasse nicht"
value="<?= e((string) ($bugForm['title'] ?? '')) ?>">
</div>
<div>
<label for="bug-area">Wo ist es passiert?</label>
<select id="bug-area" name="area" required>
<option value="">Bitte auswählen …</option>
<?php foreach (BUG_AREAS as $key => $label): ?>
<option value="<?= e($key) ?>"<?= ($bugForm['area'] ?? '') === $key ? ' selected' : '' ?>><?= e($label) ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div>
<label for="bug-description">Was ist passiert?</label>
<textarea id="bug-description" name="description" rows="5" maxlength="5000" required
placeholder="Was hast du gemacht, was ist passiert und was hättest du stattdessen erwartet?"><?= e((string) ($bugForm['description'] ?? '')) ?></textarea>
<div class="field-hint">Je genauer, desto schneller finden wir den Fehler. Browser und Gerät werden automatisch mitgeschickt.</div>
</div>
<div>
<label for="bug-images">Bilder anhängen (optional)</label>
<input type="file" id="bug-images" name="images[]" accept="image/png,image/jpeg,image/gif,image/webp" multiple
data-max-size="1920" data-paste data-max-files="<?= BUG_MAX_IMAGES ?>">
<div class="field-hint">Bis zu <?= BUG_MAX_IMAGES ?> Screenshots, je höchstens 8 MB. Kopierte Bilder einfach mit <kbd>Strg</kbd>+<kbd>V</kbd> einfügen. Nur du und die Leitung sehen die Bilder.</div>
</div>
<div>
<label for="bug-screenshot">Oder Link zu einem Screenshot (optional)</label>
<input type="text" id="bug-screenshot" name="screenshot_url" maxlength="500"
placeholder="https://… (z.B. Bild aus Discord kopieren)"
value="<?= e((string) ($bugForm['screenshot'] ?? '')) ?>">
</div>
<div class="actions">
<button type="submit">Fehler absenden</button>
</div>
</form>
</details>
<?php if (!empty($myBugs)): ?>
<div class="bug-my-list" id="meine-meldungen">
<h3>Meine Meldungen</h3>
<?php foreach ($myBugs as $bug): ?>
<div class="bug-my-item">
<div class="bug-my-head">
<strong><?= e($bug['title']) ?></strong>
<?= bug_status_badge($bug['status']) ?>
</div>
<div class="text-muted bug-my-meta">
<?= e(bug_area_label($bug['area'])) ?> · gemeldet am <?= e(date('d.m.Y H:i', strtotime($bug['created_at']))) ?>
</div>
<?= bug_images_html($myBugImages[(int) $bug['id']] ?? [], (int) $bug['id']) ?>
<?php if (!empty($bug['admin_note'])): ?>
<div class="bug-admin-note"><strong>Antwort der Leitung:</strong> <?= e($bug['admin_note']) ?></div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php
// Einfuehrung fuer neue Mitglieder: startet automatisch, bis sie abgeschlossen oder
// uebersprungen wurde (users.tour_completed_at). Neustart unter "Mein Profil".
if (empty($user['tour_completed_at'])):
$displayName = $user['display_name'] !== '' ? $user['display_name'] : $user['username'];
$link = static fn (string $href): string => '.sidebar a[href="' . $href . '"]';
$tourSteps = [
['title' => 'Willkommen, ' . $displayName . '! 👋', 'text' => 'Schön, dass du bei Lumina Ascendens dabei bist. In ein paar kurzen Schritten zeigen wir dir, wo du hier was findest. Du kannst die Einführung jederzeit überspringen.'],
['target' => '.sidebar-nav', 'title' => 'Das Menü', 'text' => 'Hier links erreichst du alle Bereiche des Mitgliederbereichs. Welche Punkte du siehst, hängt von deinen Rollen in der Legion ab. Mit „Menü anpassen“ ganz unten ordnest du sie so, wie du sie brauchst.'],
['target' => '[data-tour="overview"]', 'title' => 'Dein Überblick', 'text' => 'Ganz oben siehst du deine Rollen in der Legion und ob dein Discord-Account verbunden ist. Die Rollen kommen automatisch von unserem Discord-Server.'],
['target' => $link('/profile.php'), 'title' => 'Mein Profil', 'text' => 'Im Profil änderst du Anzeigename, Profilbild und Klassen und verwaltest deine Discord-Verknüpfung.'
. (user_has_permission('members.view') ? ' Unter „Profilseite gestalten“ zeigst du den anderen deine Charaktere und Screenshots.' : '')
. ' Dort kannst du diese Einführung auch jederzeit neu starten.'],
];
if (user_has_permission('members.view')) {
$tourSteps[] = ['target' => $link('/members.php'), 'title' => 'Mitglieder', 'text' => 'Hier findest du alle Mitglieder der Legion, sortiert nach ihren Rängen. Ein Klick auf einen Namen öffnet die Profilseite mit Charakteren und Galerie.'];
$tourSteps[] = ['target' => $link('/gallery.php'), 'title' => 'Galerie', 'text' => 'Die Screenshots aller Mitglieder auf einer Seite. Die Zahl am Menüpunkt zeigt, wie viele seit deinem letzten Besuch dazugekommen sind. Eigene lädst du auf deiner Profilseite hoch.'];
}
if ($myPoints !== null) {
$tourSteps[] = ['target' => '[data-tour="points"]', 'title' => 'Lumipunkte', 'text' => 'Für deinen Einsatz in der Legion, z.B. bei Raids, bekommst du Lumipunkte - und für jeden Tag, an dem du vorbeischaust, eine kleine Belohnung. Hier siehst du deinen Stand und deinen Platz in der Rangliste.'];
}
if ($canViewShop) {
$tourSteps[] = ['target' => $link('/shop.php'), 'title' => 'Lumishop', 'text' => 'Im Lumishop tauschst du deine Lumipunkte gegen Gegenstände ein. Die Leitung bewilligt deinen Antrag und übergibt dir den Gegenstand im Spiel.'];
}
if ($canViewRaids) {
$tourSteps[] = ['target' => '[data-tour="raids"]', 'title' => 'Nächste Raids', 'text' => 'Die nächsten Raids mit Termin, freien Plätzen und deinem Anmeldestatus. Unter „Raids“ im Menü meldest du dich mit deiner Klasse an'
. (user_has_permission('raids.create') || user_has_permission('raids.manage') ? ' - oder legst selbst einen Raid an und leitest ihn als Raid-Lead' : '')
. '. Die Zahl dort zeigt, wie viele Raids anstehen - golden, wenn ein neuer dazugekommen ist.'];
}
if ($canViewPremades) {
$tourSteps[] = ['target' => $link('/premades.php'), 'title' => 'Premades', 'text' => 'Premades sind feste Gruppen, die zusammen in den Raid gehen. Hier siehst du deine Gruppe oder gründest eine eigene.'];
}
if ($canViewRaids || user_has_permission('events.view')) {
$tourSteps[] = ['target' => $link('/calendar.php'), 'title' => 'Kalender', 'text' => 'Alle Termine im Monatsüberblick: Raids, Events und Termine, die Mitglieder selbst eintragen'
. (user_has_permission('members.view') ? ' - auch du kannst dort einen anlegen.' : '.')];
}
if (user_has_permission('events.view')) {
$tourSteps[] = ['target' => $link('/events.php'), 'title' => 'Events', 'text' => 'Geplante Erinnerungen an wiederkehrende Events, die unser Bot im Discord verschickt.'];
}
if (user_has_permission('map.view')) {
$tourSteps[] = ['target' => $link('/map.php'), 'title' => 'Karte', 'text' => 'Die interaktive Karte von Aion 2 mit allen Fundorten - und mit den Taktiken der Legion, Schritt für Schritt eingezeichnet.'];
$tourSteps[] = ['target' => $link('/raidplan.php'), 'title' => 'Raidplaner', 'text' => 'Die Karten aller Dungeons und Raids: stell Figuren für Klassen, Rollen und Bosse auf und plane die Mechaniken Schritt für Schritt - beim Durchblättern laufen die Figuren an ihre neue Stelle.'];
}
if (user_has_permission('gear.view')) {
$tourSteps[] = ['target' => $link('/gear.php'), 'title' => 'Gear-Planer', 'text' => 'Stell deine Ausrüstung zusammen, plane Skills und Stigmen und vergleiche deine Sets. Ein Set kannst du auch auf deiner Profilseite zeigen.'];
}
if (user_has_permission('warehouse.view')) {
$tourSteps[] = ['target' => $link('/warehouse.php'), 'title' => 'Lagerhaus', 'text' => 'Der Bestand im Lager der Legion und wer wann etwas eingelagert oder entnommen hat.'];
}
if (user_has_permission('wiki.view')) {
$tourSteps[] = ['target' => '[data-tour="wiki"]', 'title' => 'Einsteiger-Guide', 'text' => 'Im Wiki findest du den Einsteiger-Guide der Legion: Klassen, Dungeons, Gear und viele Tipps. Er wird von Mitgliedern geschrieben - wenn du mithelfen möchtest, sprich die Leitung an.'];
}
$tourSteps[] = ['target' => $link('/patchnotes.php'), 'title' => 'Patchnotes', 'text' => 'Was sich an der Website ändert, steht in den Patchnotes. Steht hier „Neu“, ist seit deinem letzten Besuch etwas dazugekommen.'];
$tourSteps[] = ['target' => '[data-tour="bugs"]', 'title' => 'Fehler gefunden?', 'text' => 'Wenn auf der Website etwas nicht funktioniert, melde es uns hier. Unter „Meine Meldungen“ siehst du, was daraus geworden ist.'];
$tourSteps[] = ['title' => 'Das war\'s! 🎉', 'text' => 'Jetzt kennst du dich aus. Viel Spaß in der Legion - und wenn du Fragen hast, melde dich einfach im Discord bei den Sedes Luminis.'];
?>
<script>window.LUMINA_TOUR = <?= json_encode(['steps' => $tourSteps, 'endpoint' => '/tour_action.php'], JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) ?>;</script>
<script src="<?= e(asset_url('/assets/js/tour.js')) ?>" defer></script>
<?php endif; ?>
<?php if ($myBugImages): ?><script src="<?= e(asset_url('/assets/js/lightbox.js')) ?>" defer></script><?php endif; ?>
<?php include __DIR__ . '/includes/footer.php'; ?>