Files
emailtemplate.it/partials/structure/layout_start.php
2025-12-10 01:14:30 +01:00

56 lines
2.6 KiB
PHP

<?php
require_once __DIR__ . '/app_config.php';
$pageTitle = $pageTitle ?? 'Email Template System';
$bodyClass = trim(($bodyClass ?? 'bg-slate-50 text-slate-800') . ' page-shell');
$pageId = $pageId ?? null;
$navActive = $navActive ?? null;
$layoutExtraHead = $layoutExtraHead ?? [];
if (!is_array($layoutExtraHead)) {
$layoutExtraHead = [$layoutExtraHead];
}
$sharedCss = [
app_asset_url('/assets/css/admin.css'),
app_asset_url('/assets/css/toast.css'),
];
?>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title><?= htmlspecialchars($pageTitle) ?></title>
<script>document.documentElement.classList.add('auth-pending');</script>
<style>html.auth-pending body{visibility:hidden;}</style>
<script>
window.APP_BASE_URL = <?= json_encode($appBaseUrl, JSON_UNESCAPED_SLASHES) ?>;
window.APP_API_BASE = <?= json_encode($appApiBase, JSON_UNESCAPED_SLASHES) ?>;
<?php if ($debugRedirect): ?>
window.DISABLE_AUTH_REDIRECT = true;
<?php endif; ?>
</script>
<script src="https://cdn.tailwindcss.com"></script>
<?php if ($debugRedirect): ?>
<script src="<?= app_asset_url('/assets/js/debug-location.js') ?>"></script>
<?php endif; ?>
<?php foreach ($sharedCss as $href): ?>
<link rel="stylesheet" href="<?= htmlspecialchars($href, ENT_QUOTES) ?>">
<?php endforeach; ?>
<style>
.btn{display:inline-flex;align-items:center;gap:.4rem;padding:.35rem .7rem;border-radius:.75rem;border:1px solid #e5e7eb;background:#fff;font-size:.9rem;cursor:pointer;}
.btn:hover{background:#f8fafc}
.btn-avatar{padding:.35rem;border-radius:999px;width:42px;height:42px;justify-content:center;font-weight:600;background:#0ea5e9;color:#fff;border:none}
.btn-avatar:hover{background:#0284c7}
.user-menu{position:absolute;top:calc(100% + .5rem);right:0;min-width:200px;background:#fff;border:1px solid #e2e8f0;border-radius:.9rem;box-shadow:0 20px 35px rgba(15,23,42,.15);padding:.4rem;z-index:40}
.user-menu-item{display:block;width:100%;text-align:left;padding:.45rem .75rem;border-radius:.65rem;font-size:.9rem;color:#0f172a}
.user-menu-item:hover{background:#f1f5f9}
.page-shell{min-height:100vh;display:flex;flex-direction:column;}
</style>
<?php foreach ($layoutExtraHead as $snippet): ?>
<?= $snippet . PHP_EOL ?>
<?php endforeach; ?>
</head>
<body class="<?= htmlspecialchars($bodyClass) ?>" <?= $pageId ? 'data-page="' . htmlspecialchars($pageId) . '"' : '' ?>>
<?php require __DIR__ . '/header.php'; ?>