156 lines
7.0 KiB
PHP
156 lines
7.0 KiB
PHP
<?php
|
||
/** @var array|null $user (current_user(), wird von der aufrufenden Seite gesetzt) */
|
||
$user = current_user();
|
||
$activePage = $activePage ?? '';
|
||
$logo = get_setting('logo_path');
|
||
$displayName = get_setting('display_name', config()['site']['name']);
|
||
|
||
// Wartungsmodus: Wenn der Helpdesk-Status auf "offline" steht, wird dem
|
||
// Kundenportal eine Wartungsmeldung angezeigt. Der Mitarbeiterbereich ist
|
||
// davon nicht betroffen (eigenes Header-Template), damit Admins den Status
|
||
// jederzeit wieder zurücksetzen können.
|
||
if (get_setting('helpdesk_status', 'online') === 'offline') {
|
||
$offlineMessage = get_setting('offline_message', 'Das Supportcenter ist derzeit nicht erreichbar. Bitte versuchen Sie es später erneut.');
|
||
?>
|
||
<!DOCTYPE html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title><?= e($displayName) ?> – Wartungsmodus</title>
|
||
<link rel="stylesheet" href="/assets/css/style.css?v=<?= @filemtime(__DIR__ . "/../assets/css/style.css") ?: time() ?>">
|
||
<?= site_icon_links() ?>
|
||
<link rel="manifest" href="/manifest.php">
|
||
<meta name="theme-color" content="#0f6f6a">
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||
<script>
|
||
if ('serviceWorker' in navigator) {
|
||
navigator.serviceWorker.register('/sw.js').catch(function(){});
|
||
}
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div class="auth-wrap">
|
||
<div class="auth-card" style="text-align:center">
|
||
<?php require __DIR__ . '/brand_block.php'; ?>
|
||
<h1>Vorübergehend nicht erreichbar</h1>
|
||
<p class="sub"><?= nl2br(e($offlineMessage)) ?></p>
|
||
<p style="margin-top:18px;font-size:.8rem"><a href="/staff/login.php" class="muted">Mitarbeiter-Login →</a></p>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|
||
<?php
|
||
exit;
|
||
}
|
||
?>
|
||
<!DOCTYPE html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<!-- Verhindert, dass Safari/iOS Zahlenfolgen im Live-Chat-Widget automatisch als
|
||
Telefonnummern erkennt und farbig/als Link darstellt (z.B. Postleitzahlen, Codes). -->
|
||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||
<title><?= e($pageTitle ?? $displayName) ?> – <?= e($displayName) ?></title>
|
||
<link rel="stylesheet" href="/assets/css/style.css?v=<?= @filemtime(__DIR__ . "/../assets/css/style.css") ?: time() ?>">
|
||
<?php $customThemeStylesheet = active_custom_theme_stylesheet(); ?>
|
||
<?php if ($customThemeStylesheet): ?>
|
||
<link rel="stylesheet" href="<?= e($customThemeStylesheet) ?>">
|
||
<?php endif; ?>
|
||
<link rel="manifest" href="/manifest.php">
|
||
<meta name="theme-color" content="#0f6f6a">
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||
<?= site_icon_links() ?>
|
||
<script>
|
||
if ('serviceWorker' in navigator) {
|
||
navigator.serviceWorker.register('/sw.js').catch(function(){});
|
||
}
|
||
</script>
|
||
</head>
|
||
<?php $globalBanner = get_setting('banner_path'); ?>
|
||
<body>
|
||
|
||
<?php if (!$globalBanner && !$customThemeStylesheet): ?>
|
||
<style>
|
||
.auth-wrap { background: linear-gradient(135deg, #16202a 0%, #20303d 55%, #16202a 100%) !important; }
|
||
.auth-wrap::before { background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 24px 24px; }
|
||
.hero-search { background: linear-gradient(135deg, #16202a 0%, #20303d 55%, #16202a 100%) !important; }
|
||
.hero-search::before { background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 24px 24px; }
|
||
</style>
|
||
<?php endif; ?>
|
||
<header class="site-header">
|
||
<div class="topbar-thin">
|
||
<span class="welcome">Willkommen, <?= $user ? e($user['name']) : 'Gast' ?></span>
|
||
<nav>
|
||
<a href="/home.php" class="<?= $activePage==='home'?'active':'' ?>">Supportcenter-Startseite</a>
|
||
<a href="/ticket_new.php" class="<?= $activePage==='new'?'active':'' ?>">Neues Ticket eröffnen</a>
|
||
<?php if ($user): ?>
|
||
<a href="/dashboard.php" class="<?= $activePage==='dashboard'?'active':'' ?>">Meine Tickets</a>
|
||
<?php else: ?>
|
||
<a href="/ticket_lookup.php" class="<?= $activePage==='lookup'?'active':'' ?>">Ticketstatus überprüfen</a>
|
||
<?php endif; ?>
|
||
<?php if (get_setting('kb_enabled', '1') === '1'): ?>
|
||
<a href="/kb.php" class="<?= $activePage==='kb'?'active':'' ?>">Wissensdatenbank</a>
|
||
<?php endif; ?>
|
||
<?php if ($user): ?>
|
||
<a href="/logout.php">Abmelden</a>
|
||
<?php else: ?>
|
||
<a href="/login.php" class="<?= $activePage==='login'?'active':'' ?>">Anmelden</a>
|
||
<?php endif; ?>
|
||
</nav>
|
||
|
||
</div>
|
||
<div class="logo-row" style="display:flex; align-items:center; gap:12px">
|
||
<a href="/home.php" style="line-height:0; flex-shrink:0">
|
||
<?php if ($logo): ?>
|
||
<img src="<?= e($logo) ?>" alt="<?= e($displayName) ?>">
|
||
<?php else: ?>
|
||
<span class="text-brand">Desk<span>Hub</span></span>
|
||
<?php endif; ?>
|
||
</a>
|
||
<?php if ($logo && $displayName && get_setting('logo_hide_name', '0') !== '1'): ?>
|
||
<span style="font-size:1.15rem; font-weight:700; color:var(--ink); letter-spacing:-.01em"><?= e($displayName) ?></span>
|
||
<?php endif; ?>
|
||
</div>
|
||
</header>
|
||
|
||
<?php if (!empty($showHeroBanner)): ?>
|
||
<?php
|
||
$kbEnabledForHero = get_setting('kb_enabled', '1') === '1';
|
||
$heroEyebrow = $heroEyebrow ?? 'Supportcenter';
|
||
$heroTitle = $heroTitle ?? ($kbEnabledForHero ? 'Wie können wir helfen?' : 'Willkommen im Supportcenter');
|
||
$heroSubtitle = $heroSubtitle ?? ($kbEnabledForHero
|
||
? 'Wissensdatenbank durchsuchen oder direkt ein Ticket eröffnen – wir antworten so schnell wie möglich.'
|
||
: 'Eröffnen Sie ein Ticket – wir antworten so schnell wie möglich.');
|
||
$heroSearchPlaceholder = $heroSearchPlaceholder ?? 'z. B. Passwort zurücksetzen, Rechnung, Versand …';
|
||
$heroSearchValue = $heroSearchValue ?? '';
|
||
$banner = !empty($showHeroImage) ? get_setting('banner_path') : null;
|
||
?>
|
||
<div class="hero-search<?= $banner ? ' has-image' : '' ?>"<?= $banner ? ' style="background-image:url(' . e($banner) . ')"' : '' ?>>
|
||
<div class="hero-inner">
|
||
<span class="eyebrow"><?= e($heroEyebrow) ?></span>
|
||
<h1><?= e($heroTitle) ?></h1>
|
||
<p class="sub"><?= e($heroSubtitle) ?></p>
|
||
<?php if ($kbEnabledForHero): ?>
|
||
<form method="get" action="/kb.php" class="search-form">
|
||
<input type="search" name="q" placeholder="<?= e($heroSearchPlaceholder) ?>" value="<?= e($heroSearchValue) ?>">
|
||
<button type="submit">Suchen</button>
|
||
</form>
|
||
<div class="quick-links">oder direkt <a href="/ticket_new.php">ein Ticket eröffnen</a></div>
|
||
<?php else: ?>
|
||
<div class="btn-row" style="justify-content:center">
|
||
<a href="/ticket_new.php" class="btn">Neues Ticket eröffnen</a>
|
||
</div>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<div class="page-content">
|
||
<?php foreach (get_flashes() as $f): ?>
|
||
<div class="flash <?= e($f['type']) ?>"><?= e($f['message']) ?></div>
|
||
<?php endforeach; ?>
|