80 lines
4.0 KiB
PHP
80 lines
4.0 KiB
PHP
<?php
|
|
|
|
$lang = $lang ?? 'cs';
|
|
$branch = $branch ?? 'cz';
|
|
$navPrefix = $navPrefix ?? '';
|
|
$langUrls = $langUrls ?? ['cs'=>'/cs/', 'en'=>'/en/', 'de'=>'/de/'];
|
|
|
|
require_once __DIR__ . '/content.php';
|
|
$t = az_content('header/' . (in_array($lang, ['cs','de','en','hu'], true) ? $lang : 'cs') . '.json');
|
|
$anchors = ['#hero','#sluzby','#skladovani','#tym'];
|
|
if ($branch === 'hu') {
|
|
$anchors[] = '#carrier';
|
|
$t['nav'][] = $t['careers'] ?? 'Careers';
|
|
}
|
|
|
|
$czBase = $SITES['cz']['base'] ?? 'https://www.alba-zochling.cz';
|
|
$huBase = $SITES['hu']['base'] ?? 'https://www.alba-zochling.hu';
|
|
if ($branch === 'cz') {
|
|
$branchHome = ['cs'=>'/cs/','de'=>'/de/','en'=>'/en/'];
|
|
$otherUrlMap = ['cs'=>$huBase.'/hu/','de'=>$huBase.'/de/','en'=>$huBase.'/en/'];
|
|
$activeCountry = $t['cz']; $otherCountry = $t['hu']; $otherSub = 'Alba-Zöchling Kft.';
|
|
$langOrder = ['cs','en','de']; $langLabels = ['cs'=>'CS','en'=>'EN','de'=>'DE'];
|
|
} else {
|
|
$branchHome = ['hu'=>'/hu/','de'=>'/de/','en'=>'/en/'];
|
|
$otherUrlMap = ['hu'=>$czBase.'/cs/','de'=>$czBase.'/de/','en'=>$czBase.'/en/'];
|
|
$activeCountry = $t['hu']; $otherCountry = $t['cz']; $otherSub = 'Alba-Zöchling s.r.o.';
|
|
$langOrder = ['hu','en','de']; $langLabels = ['hu'=>'HU','en'=>'EN','de'=>'DE'];
|
|
}
|
|
$homeUrl = $branchHome[$lang];
|
|
$otherUrl = $otherUrlMap[$lang];
|
|
$logoHref = ($navPrefix === '') ? '#hero' : $homeUrl;
|
|
?>
|
|
<a href="#main-content" class="skip-link"><?= $t['skip'] ?></a>
|
|
<?php include __DIR__ . '/icons.php'; ?>
|
|
<div class="scroll-progress" id="scrollProgress" aria-hidden="true"></div>
|
|
|
|
<header class="hdr" id="hdr" role="banner">
|
|
<div class="hdr__inner">
|
|
<a href="<?= $logoHref ?>" class="hdr__logo" aria-label="<?= $t['logo'] ?>">
|
|
<img src="/assets/img/logo/logo_white.webp" alt="Alba-Zöchling" class="logo" width="176" height="30">
|
|
</a>
|
|
<nav class="hdr__nav" aria-label="<?= $t['navAria'] ?>">
|
|
<div class="hdr__glass" id="navGlass"></div>
|
|
<?php foreach ($anchors as $i => $a): ?> <a href="<?= $navPrefix . $a ?>"><?= $t['nav'][$i] ?></a>
|
|
<?php endforeach; ?> </nav>
|
|
<div class="hdr__right">
|
|
<details class="hdr__country" data-country-select aria-label="<?= $t['countryAria'] ?>">
|
|
<summary><span><?= $activeCountry ?></span></summary>
|
|
<div class="hdr__country-menu">
|
|
<a href="<?= $homeUrl ?>" class="active"><?= $activeCountry ?></a>
|
|
<a href="<?= $otherUrl ?>"><?= $otherCountry ?></a>
|
|
</div>
|
|
</details>
|
|
<div class="hdr__lang" aria-label="<?= $t['langAria'] ?>">
|
|
<div class="hdr__lang-glass" id="langGlass"></div>
|
|
<?php foreach ($langOrder as $code): ?> <a href="<?= $langUrls[$code] ?>"<?= $code === $lang ? ' class="active"' : '' ?>><?= $langLabels[$code] ?></a>
|
|
<?php endforeach; ?> </div>
|
|
<button class="hdr__burger" aria-label="<?= $t['burger'] ?>" id="menuOpen">
|
|
<svg class="icon" aria-hidden="true"><use href="#icon-bars"/></svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="mob-overlay" id="mobOverlay"></div>
|
|
<aside class="mob-menu" id="mobMenu" aria-label="<?= $t['mobmenu'] ?>">
|
|
<button class="mob-menu__close" id="menuClose" aria-label="<?= $t['close'] ?>"><svg class="icon" aria-hidden="true"><use href="#icon-xmark"/></svg></button>
|
|
<nav class="mob-menu__nav">
|
|
<?php foreach ($anchors as $i => $a): ?> <a href="<?= $navPrefix . $a ?>"><?= $t['nav'][$i] ?></a>
|
|
<?php endforeach; ?> </nav>
|
|
<div class="mob-menu__country" aria-label="<?= $t['countryAria'] ?>">
|
|
<span class="mob-menu__country-title"><?= $t['countryAria'] ?></span>
|
|
<a href="<?= $homeUrl ?>" class="active"><strong><?= $activeCountry ?></strong><span><?= $t['current'] ?></span></a>
|
|
<a href="<?= $otherUrl ?>"><strong><?= $otherCountry ?></strong><span><?= $otherSub ?></span></a>
|
|
</div>
|
|
<div class="mob-menu__lang">
|
|
<?php foreach ($langOrder as $code): ?> <a href="<?= $langUrls[$code] ?>"<?= $code === $lang ? ' class="active"' : '' ?>><?= $langLabels[$code] ?></a>
|
|
<?php endforeach; ?> </div>
|
|
</aside>
|