The category panel gets "Alle anzeigen" / "Alle verstecken" buttons. Tactics belong to a region and are split into steps, each its own drawing layer: pen, arrow, line, area, circle, labelled point, text and eraser, with colour, stroke width and undo. A new step can start empty or as a copy of the current one, earlier steps can be shown faded underneath, and steps can be renamed, reordered and deleted. Viewing needs map.view, editing map.tactics. Drawings are stored per shape in world coordinates (the same as the markers) through tactics_api.php in three new tables; the map page offers to create them when they are missing. The viewer's own code only gains two hooks (view change, map change) and the show/hide-all method. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
39 lines
1.6 KiB
PHP
39 lines
1.6 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
require_once __DIR__ . '/includes/tactics.php';
|
|
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;
|
|
}
|
|
|
|
// 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.
|
|
$pageTitle = '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="/assets/map/index.html" title="Interaktive Karte"></iframe>
|
|
<?php include __DIR__ . '/includes/footer.php'; ?>
|