89 lines
5.0 KiB
PHP
89 lines
5.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/intranet_repo/general_files/initialise.php';
|
|
require_once __DIR__ . '/util/camera_remote_helpers.php';
|
|
|
|
if (!camera_remote_is_authorized(is_array($groups ?? null) ? $groups : [])) {
|
|
http_response_code(403);
|
|
exit('Keine Berechtigung für die Kamera-Fernbedienung.');
|
|
}
|
|
|
|
$configured = camera_remote_is_configured();
|
|
$clientConfig = [
|
|
'csrfToken' => camera_remote_csrf_token(),
|
|
'configured' => $configured,
|
|
];
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="de" dir="ltr">
|
|
<head>
|
|
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/intranet_repo/projects/_central/php/html_head.php'; ?>
|
|
<link rel="stylesheet" href="/intranet_repo/projects/camera_remote/camera_remote.css?v=<?= (int) filemtime(__DIR__ . '/camera_remote.css') ?>">
|
|
<script id="cameraRemoteConfig" type="application/json"><?= json_encode($clientConfig, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_THROW_ON_ERROR) ?></script>
|
|
<script src="/intranet_repo/projects/camera_remote/camera_remote.js?v=<?= (int) filemtime(__DIR__ . '/camera_remote.js') ?>" defer></script>
|
|
</head>
|
|
<body class="theme-admin">
|
|
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/intranet_repo/projects/_central/php/header.php'; ?>
|
|
<?php include $g_phpSnippetsPath . 'overlay_message.php'; ?>
|
|
|
|
<div class="header_title ht_admin text_white" id="header_title">
|
|
<span class="header_title_text">Kamera-Fernbedienung</span>
|
|
</div>
|
|
|
|
<main class="content camera-remote" id="base">
|
|
<div class="content_flexcontainer camera-remote-layout">
|
|
<section class="content_panel camera-remote-main" aria-labelledby="cameraRemoteTitle">
|
|
<div class="camera-remote-heading">
|
|
<div>
|
|
<h1 id="cameraRemoteTitle">Kamera steuern</h1>
|
|
<p>Wählen Sie eine Kameraposition oder schalten Sie die Kamera ein beziehungsweise aus.</p>
|
|
</div>
|
|
<div class="camera-power-control">
|
|
<input class="button" type="button" data-camera-action="power" value="Kamera ein/aus"<?= $configured ? '' : ' disabled' ?>>
|
|
</div>
|
|
</div>
|
|
|
|
<?php $statusText = $configured ? '' : 'Home Assistant ist noch nicht konfiguriert. Bitte HA_BASE_URL und HA_TOKEN in der Umgebung hinterlegen.'; ?>
|
|
<div class="mainpage_notice mainpage_notice--error" id="cameraRemoteStatus" role="alert"<?= $configured ? ' hidden' : '' ?>>
|
|
<?= htmlspecialchars($statusText, ENT_QUOTES, 'UTF-8') ?>
|
|
</div>
|
|
|
|
<div class="camera-sections" aria-label="Kamerapositionen">
|
|
<section class="content_panel camera-remote-panel" aria-labelledby="cameraGeneralTitle">
|
|
<h2 id="cameraGeneralTitle">Allgemein</h2>
|
|
<div class="camera-presets">
|
|
<input class="button_fullwidth" type="button" data-camera-action="total" value="Totale"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="lectern" value="Pult"<?= $configured ? '' : ' disabled' ?>>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="content_panel camera-remote-panel" aria-labelledby="cameraAltarTitle">
|
|
<h2 id="cameraAltarTitle">Altar</h2>
|
|
<div class="camera-presets">
|
|
<input class="button_fullwidth" type="button" data-camera-action="altar" value="Altar"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="chancel" value="Altarraum"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="before_altar" value="Vor dem Altar"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="flowers" value="Blumenschmuck"<?= $configured ? '' : ' disabled' ?>>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="content_panel camera-remote-panel" aria-labelledby="cameraMusicTitle">
|
|
<h2 id="cameraMusicTitle">Musik</h2>
|
|
<div class="camera-presets">
|
|
<input class="button_fullwidth" type="button" data-camera-action="choir" value="Chor"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="piano" value="Klavier"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="organ" value="Orgel"<?= $configured ? '' : ' disabled' ?>>
|
|
<input class="button_fullwidth" type="button" data-camera-action="orchestra" value="Orchester/Kinderchor"<?= $configured ? '' : ' disabled' ?>>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</main>
|
|
|
|
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/intranet_repo/projects/_central/php/footer.php'; ?>
|
|
</body>
|
|
</html>
|