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>
27 lines
848 B
PHP
27 lines
848 B
PHP
<?php
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
require_once __DIR__ . '/includes/tactics.php';
|
|
|
|
// Die Struktur der Datenbank zu aendern ist eine Administratoren-Aufgabe - deshalb nicht an
|
|
// map.tactics haengen, sondern an dieselbe Berechtigung wie die Rechteverwaltung.
|
|
require_permission('roles.manage');
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
redirect('/map.php');
|
|
}
|
|
verify_csrf();
|
|
|
|
try {
|
|
tactics_create_tables();
|
|
|
|
$stillMissing = tactics_missing_tables();
|
|
if (!empty($stillMissing)) {
|
|
set_flash('error', 'Diese Tabellen konnten nicht angelegt werden: ' . implode(', ', $stillMissing));
|
|
} else {
|
|
set_flash('success', 'Die Tabellen für Taktiken wurden angelegt.');
|
|
}
|
|
} catch (Throwable $e) {
|
|
set_flash('error', 'Anlegen fehlgeschlagen: ' . $e->getMessage());
|
|
}
|
|
|
|
redirect('/map.php');
|