Files
plugi/themes/theme-one/layouts/master/view.php
T
deepDiverPaul ed8ae3200b refresh theme-one starter blocks and layout
Redesign the master layout and content blocks with responsive styling, accessible navigation, and configurable CTA and quote sections. Add about-me, embedded-code, and FAQ blocks, and update the generated theme assets. Replace Alpine-based locale handling with vanilla JavaScript for locale flags and gallery lightboxes, and remove Alpine and DaisyUI dependencies.
2026-11-25 17:50:12 +01:00

131 lines
6.0 KiB
PHP

<?php
use Plugi\Extensions;
use Plugi\Repositories\MenuRepository;
?>
<!doctype html>
<html lang="<?= phpb_current_language() ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?= phpb_e($page->getTranslation("meta_title")) ?></title>
<meta name="description" content="<?= phpb_e(
$page->getTranslation("meta_description"),
) ?>">
<link href="<?= phpb_asset("icons/duotone/style.css") ?>" rel="stylesheet">
<link href="<?= phpb_asset("icons/regular/style.css") ?>" rel="stylesheet">
<link href="<?= phpb_asset("icons/bold/style.css") ?>" rel="stylesheet">
<link href="<?= phpb_theme_asset("dist/style.css") ?>" rel="stylesheet">
<?= Extensions::getHtmlBlocks() ?>
<?= Extensions::getHeaderAssets() ?>
<?php phpb_registered_assets('header'); ?>
</head>
<body>
<?= Extensions::getHtmlBlocks("body-start") ?>
<?php
$menuRepo = new MenuRepository();
$mainMenu = $menuRepo->getHydratedMenu("Main");
?>
<header class="border-b border-slate-200 bg-white">
<div class="mx-auto flex max-w-7xl items-center justify-between px-4 py-4 sm:px-6 lg:px-8">
<a href="/" class="text-xl font-semibold tracking-tight text-slate-900">
<?= phpb_e($page->getTranslation("meta_title") ?: "Home") ?>
</a>
<nav aria-label="Main navigation">
<details class="relative lg:hidden">
<summary class="flex cursor-pointer list-none items-center rounded-md p-2 text-slate-700 hover:bg-slate-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-700">
<span class="sr-only">Main menu</span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /></svg>
</summary>
<ul class="absolute right-0 z-10 mt-2 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg">
<?php if ($mainMenu): ?>
<?php foreach ($mainMenu["pages"] as $menuPage): ?>
<li>
<a class="block rounded-md px-3 py-2 text-slate-700 hover:bg-slate-100" href="<?= phpb_e($menuPage["route"]) ?>"><?= phpb_e($menuPage["title"]) ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</details>
<ul class="hidden items-center gap-6 lg:flex">
<?php if ($mainMenu): ?>
<?php foreach ($mainMenu["pages"] as $menuPage): ?>
<li>
<a class="text-sm font-medium text-slate-700 hover:text-slate-950" href="<?= phpb_e($menuPage["route"]) ?>"><?= phpb_e($menuPage["title"]) ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</nav>
</div>
</header>
<main id="main-content" class="min-h-screen">
<?= $body ?>
</main>
<footer class="border-t border-slate-200 bg-slate-50 text-slate-700">
<div class="mx-auto flex max-w-7xl flex-col items-center gap-4 px-4 py-8 sm:px-6 lg:px-8">
<nav aria-label="Footer navigation">
<ul class="flex flex-wrap items-center justify-center gap-x-6 gap-y-3">
<?php
$footerMenu = $menuRepo->getHydratedMenu("Footer");
?>
<?php if ($footerMenu): ?>
<?php foreach ($footerMenu["pages"] as $menuPage): ?>
<li>
<a href="<?= phpb_e($menuPage["route"]) ?>" class="text-sm hover:underline"><?= phpb_e($menuPage["title"]) ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
<li>
<details class="relative">
<summary class="flex cursor-pointer list-none items-center rounded-md p-2 hover:bg-slate-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-700">
<span class="sr-only">Choose language</span>
<i class="ph ph-translate" aria-hidden="true"></i>
</summary>
<ul class="absolute bottom-full right-0 z-10 mb-2 w-52 rounded-lg border border-slate-200 bg-white p-2 shadow-lg">
<?php
$languageMenu = $menuRepo->getLanguageMenu(
$page->getTranslation("page_id"),
);
?>
<?php if ($languageMenu): ?>
<?php foreach ($languageMenu as $lang): ?>
<li>
<a class="flex items-center gap-2 rounded-md px-3 py-2 hover:bg-slate-100" href="<?= phpb_e($lang["route"]) ?>">
<span data-locale-flag data-locale="<?= phpb_e($lang["locale"]) ?>" aria-hidden="true"></span>
<?= phpb_e($lang["title"]) ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</details>
</li>
</ul>
</nav>
<p class="text-sm">Copyright © <?= phpb_e(date("Y")) ?></p>
</div>
</footer>
<script src="<?= phpb_theme_asset("dist/script.js") ?>"></script>
<!-- Run Plugi script.js files -->
<script type="text/javascript">
document.querySelectorAll("script").forEach(function(scriptTag) {
scriptTag.dispatchEvent(new Event('run-script'));
});
</script>
<?= Extensions::getHtmlBlocks("body-end") ?>
<?php phpb_registered_assets('footer'); ?>
</body>
</html>