65 lines
2.8 KiB
PHP
65 lines
2.8 KiB
PHP
<?php
|
|
$projectRoot = dirname(__DIR__, 2);
|
|
if (!defined('APP_ENV') && is_file($projectRoot . '/config/fileload.php')) {
|
|
require_once $projectRoot . '/config/fileload.php';
|
|
}
|
|
|
|
require_once __DIR__ . '/app_config.php';
|
|
require_once __DIR__ . '/../../inc/helpers.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'),
|
|
];
|
|
|
|
foreach ($sharedCss as $href) {
|
|
tpl_add_style($href, 'header', 'high');
|
|
}
|
|
if ($debugRedirect) {
|
|
tpl_add_script(app_asset_url('/assets/js/debug-location.js'), 'header');
|
|
}
|
|
?>
|
|
<!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 tpl_render_styles(null, 'header'); ?>
|
|
<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; ?>
|
|
<?php tpl_render_scripts(null, 'header'); ?>
|
|
</head>
|
|
<body class="<?= htmlspecialchars($bodyClass) ?>" <?= $pageId ? 'data-page="' . htmlspecialchars($pageId) . '"' : '' ?>>
|
|
<?php require __DIR__ . '/header.php'; ?>
|