Asked for: "das consilium elyseum wurde umbenannt zu DACH Elyos. pass das bitte an auf der website". - CONSILIUM_NAME is 'DACH Elyos', and every visible text follows it: sidebar, the alliance page, member tab, raid area, calendar audience and badge, iCal note, map live sessions and share buttons, admin pages (Verwaltung -> DACH Elyos, Discord-Bot, Berechtigungsgruppen), flash messages, log entries, permission descriptions (synced to the database by schema_sync_core_permissions()) and the privacy page. - The name takes no article, so the sentences around it changed too: "von DACH Elyos", "in DACH Elyos", "für DACH Elyos" instead of "des Consiliums", "im Consilium", "für das Consilium". The bot channel label is now "Raid-Kanal DACH Elyos". - Internal names stay "consilium": permission keys, tables, settings, files and URLs (?bereich=consilium, ?tab=consilium), so nothing in the database or in existing links changes. includes/consilium.php says so. - README: section renamed to "DACH Elyos" (anchor #dach-elyos). - No patch note (alliance topics stay out of them). The bot's two "Consilium" error texts in live_tactics.py never reach the page - the map only reads the status code - so the bot needs no update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
149 lines
8.4 KiB
PHP
149 lines
8.4 KiB
PHP
<?php
|
||
require_once __DIR__ . '/includes/bootstrap.php';
|
||
require_once __DIR__ . '/includes/tactics.php';
|
||
require_once __DIR__ . '/includes/consilium.php';
|
||
require_login();
|
||
|
||
// Mitglieder verbuendeter Legionen (Consilium Elyseum) sehen keine Taktiken der Legion - nur die Live-Sitzungen,
|
||
// die gerade fuer das Consilium freigegeben sind (includes/tactics.php). Beitreten oeffnet die Karte mit der Taktik.
|
||
if (consilium_only()) {
|
||
$sessionsError = false;
|
||
try {
|
||
$sessions = tactics_missing_tables() ? [] : tactics_consilium_sessions();
|
||
} catch (Throwable $e) {
|
||
$sessions = [];
|
||
$sessionsError = true;
|
||
}
|
||
$joinId = (int) ($_GET['taktik'] ?? 0);
|
||
$joined = null;
|
||
foreach ($sessions as $session) {
|
||
if ($session['tactic_id'] === $joinId) {
|
||
$joined = $session;
|
||
}
|
||
}
|
||
$canDraw = user_has_permission('consilium.draw');
|
||
// Zurueck aus einer Sitzung, die vorbei ist (?beendet=, TacticController.endGuestSession) - oder ihr Link ist alt
|
||
$ended = (string) ($_GET['beendet'] ?? '');
|
||
$endedMessage = match (true) {
|
||
$ended === 'stopped' => 'Die Legion hat die Freigabe für ' . CONSILIUM_NAME . ' beendet.',
|
||
$ended === 'ended' => 'Die Live-Sitzung ist beendet – niemand aus der Legion ist mehr dabei.',
|
||
$ended !== '' || ($joinId > 0 && $joined === null) => 'Diese Live-Sitzung ist beendet oder nicht mehr für ' . CONSILIUM_NAME . ' freigegeben.',
|
||
default => '',
|
||
};
|
||
|
||
$pageTitle = $joined !== null ? $joined['name'] . ' – Live' : 'Karte';
|
||
$containerWide = $joined !== null;
|
||
include __DIR__ . '/includes/header.php';
|
||
|
||
if ($joined !== null) {
|
||
// Der Viewer laedt als Gast nur freigegebene Sitzungen (tactics_api.php) und oeffnet diese Taktik
|
||
$frameSrc = '/map_frame.php?' . http_build_query(array_filter([
|
||
'bereich' => str_starts_with($joined['url'], '/raidplan.php') ? 'dungeons' : '',
|
||
'karte' => $joined['map_slug'],
|
||
'taktik' => (string) $joined['tactic_id'],
|
||
]));
|
||
?>
|
||
<?php // data-watch-session: endet die Sitzung, geht es zurueck zur Liste - falls die Karte es selbst nicht merkt ?>
|
||
<div class="panel consilium-live-bar" data-watch-session="<?= (int) $joined['tactic_id'] ?>">
|
||
<a class="button button-secondary button-small" href="/map.php">← Alle Live-Sitzungen</a>
|
||
<strong><?= e($joined['name']) ?></strong>
|
||
<span class="text-muted"><?= e($joined['map_name']) ?><?= $joined['author'] !== '' ? ' · von ' . e($joined['author']) : '' ?></span>
|
||
<span class="consilium-live-mode"><?= $canDraw
|
||
? '✏️ <span class="consilium-live-long">Du darfst mitzeichnen</span><span class="consilium-live-short">Mitzeichnen</span>'
|
||
: '👁 <span class="consilium-live-long">Du schaust zu</span><span class="consilium-live-short">Zuschauen</span>' ?></span>
|
||
</div>
|
||
<iframe class="map-frame consilium-map-frame" src="<?= e($frameSrc) ?>" title="Live-Sitzung: <?= e($joined['name']) ?>"></iframe>
|
||
<script src="<?= e(asset_url('/assets/js/consilium-map.js')) ?>"></script>
|
||
<?php
|
||
} else {
|
||
?>
|
||
<div class="panel">
|
||
<h1>Karte – Live-Sitzungen</h1>
|
||
<p class="text-muted">
|
||
Hier erscheinen die Taktiken, die gerade live besprochen und für <?= e(CONSILIUM_NAME) ?> freigegeben werden.
|
||
Du schaust zu<?= $canDraw ? ' und darfst mitzeichnen – nur zeichnen, nichts löschen oder verschieben' : '' ?>.
|
||
Die Freigabe gilt nur für die laufende Sitzung.
|
||
</p>
|
||
<?php if ($endedMessage !== ''): ?>
|
||
<div class="flash flash-info"><?= e($endedMessage) ?></div>
|
||
<?php endif; ?>
|
||
<div class="flash flash-error" id="consilium-sessions-error"<?= $sessionsError ? '' : ' hidden' ?>>Die Live-Sitzungen sind gerade nicht erreichbar – die Liste versucht es gleich noch einmal.</div>
|
||
<?php // Dieselbe Darstellung baut assets/js/consilium-map.js beim Aktualisieren ?>
|
||
<ul class="consilium-upcoming consilium-sessions" id="consilium-sessions" data-source="/tactics_api.php?sitzungen=1">
|
||
<?php foreach ($sessions as $session): ?>
|
||
<li>
|
||
<a href="<?= e($session['url']) ?>">
|
||
<span class="consilium-upcoming-date">seit <?= e(date('H:i', $session['since'])) ?> Uhr</span>
|
||
<strong><?= e($session['name']) ?></strong>
|
||
<span class="text-muted"><?= e($session['map_name']) ?> · <?= $session['members'] > 0 ? $session['members'] . ' aus der Legion' : 'Legion gerade nicht verbunden' ?><?= $session['guests'] > 0 ? ' · ' . $session['guests'] . ($session['guests'] === 1 ? ' Gast' : ' Gäste') : '' ?></span>
|
||
<span class="consilium-session-join">Beitreten →</span>
|
||
</a>
|
||
</li>
|
||
<?php endforeach; ?>
|
||
</ul>
|
||
<p class="text-muted" id="consilium-sessions-empty"<?= $sessions ? ' hidden' : '' ?>>
|
||
Gerade läuft keine freigegebene Live-Sitzung. Sobald die Legion eine Taktik für <?= e(CONSILIUM_NAME) ?> freigibt, erscheint sie hier von selbst.
|
||
</p>
|
||
</div>
|
||
<script src="<?= e(asset_url('/assets/js/consilium-map.js')) ?>"></script>
|
||
<?php
|
||
}
|
||
include __DIR__ . '/includes/footer.php';
|
||
exit;
|
||
}
|
||
|
||
require_permission('map.view');
|
||
|
||
// Bestehende Installationen kennen die Taktik-Tabellen noch nicht. Die Karte selbst
|
||
// funktioniert trotzdem, nur die Taktiken brauchen die Datenbank.
|
||
try {
|
||
$missingTables = tactics_missing_tables();
|
||
} catch (Throwable $e) {
|
||
$missingTables = TACTIC_TABLES;
|
||
}
|
||
|
||
// Dieselbe Seite ist auch der Raidplaner (raidplan.php setzt $mapArea): der Viewer startet dann bei
|
||
// den Dungeon- und Raid-Karten statt bei den Weltkarten.
|
||
$mapArea = ($mapArea ?? 'welt') === 'dungeons' ? 'dungeons' : 'welt';
|
||
|
||
// Die Karte ist ein eigenstaendiger Viewer (assets/map/) mit eigenem Stylesheet, das
|
||
// global auf body/button/* greift. Im iframe bleibt er vom Seitenlayout getrennt.
|
||
// Die Taktiken laedt und speichert er selbst ueber tactics_api.php.
|
||
// Geteilter Ort (/map.php?karte=verteron&x=1234&y=2345&zoom=5&ort=Treffpunkt) bzw. geteilte Taktik
|
||
// (/raidplan.php?karte=reforged-abyss&taktik=12&schritt=3): an den Viewer weiterreichen.
|
||
$linkParams = array_filter([
|
||
'bereich' => $mapArea === 'dungeons' ? 'dungeons' : '',
|
||
'karte' => preg_match('/^[a-z0-9-]{1,40}$/', (string) ($_GET['karte'] ?? '')) ? (string) $_GET['karte'] : '',
|
||
'x' => is_numeric($_GET['x'] ?? null) ? (string) (int) $_GET['x'] : '',
|
||
'y' => is_numeric($_GET['y'] ?? null) ? (string) (int) $_GET['y'] : '',
|
||
'zoom' => is_numeric($_GET['zoom'] ?? null) ? (string) (int) $_GET['zoom'] : '',
|
||
'ort' => mb_substr(trim((string) ($_GET['ort'] ?? '')), 0, 60),
|
||
'taktik' => (int) ($_GET['taktik'] ?? 0) > 0 ? (string) (int) $_GET['taktik'] : '',
|
||
'schritt' => (int) ($_GET['schritt'] ?? 0) > 0 ? (string) (int) $_GET['schritt'] : '',
|
||
], static fn (string $v): bool => $v !== '');
|
||
// map_frame.php haengt Versionskennungen an die Skripte (sonst alte Dateien aus dem Browser-Cache)
|
||
$frameSrc = '/map_frame.php' . ($linkParams ? '?' . http_build_query($linkParams) : '');
|
||
|
||
$pageTitle = $mapArea === 'dungeons' ? 'Raidplaner' : 'Karte';
|
||
$containerWide = true;
|
||
include __DIR__ . '/includes/header.php';
|
||
?>
|
||
<?php if (!empty($missingTables)): ?>
|
||
<div class="panel map-setup">
|
||
<p>
|
||
<strong>Taktiken einrichten:</strong>
|
||
<span class="text-muted">Der Datenbank fehlen noch die Tabellen für Taktiken
|
||
(<?= e(implode(', ', $missingTables)) ?>). Die Karte funktioniert auch ohne sie.</span>
|
||
</p>
|
||
<?php if (user_has_permission('roles.manage')): ?>
|
||
<form method="post" action="/tactics_install_action.php">
|
||
<?= csrf_field() ?>
|
||
<button type="submit">Tabellen jetzt anlegen</button>
|
||
</form>
|
||
<?php else: ?>
|
||
<p class="text-muted">Dafür fehlt dir die Berechtigung <code>roles.manage</code> - bitte einen Administrator.</p>
|
||
<?php endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
<iframe class="map-frame" src="<?= e($frameSrc) ?>" title="<?= $mapArea === 'dungeons' ? 'Raidplaner: Taktiken für Dungeons und Raids' : 'Interaktive Karte' ?>"></iframe>
|
||
<?php include __DIR__ . '/includes/footer.php'; ?>
|