topbar anpassungen

This commit is contained in:
2026-03-05 12:51:53 +01:00
parent c5f657c8c8
commit b2dab5bd6c
14 changed files with 494 additions and 113 deletions

View File

@@ -16,7 +16,7 @@ $publicTarget = ltrim($publicTarget, '/');
<?php if ($variant === 'dropdown'): ?>
<details class="dropdown">
<summary>
<summary aria-label="<?php e(t('Language switcher')); ?>">
<i class="bi bi-translate"></i>
</summary>
<ul dir="rtl">
@@ -38,6 +38,24 @@ $publicTarget = ltrim($publicTarget, '/');
<?php endforeach; ?>
</ul>
</details>
<?php elseif ($variant === 'menu-items'): ?>
<?php foreach ($locales as $locale): ?>
<?php
$isActive = $locale === I18n::$locale;
$label = strtoupper((string) $locale);
$publicUrl = $base . '/' . $locale . ($publicTarget !== '' ? '/' . $publicTarget : '');
$switchUrl = $isLoggedIn
? ($baseUrl . '?locale=' . $locale . '&return=' . urlencode($returnTarget))
: $publicUrl;
?>
<li>
<a href="<?php e($switchUrl); ?>"
class="<?php e($isActive ? 'active' : ''); ?>"
<?php if ($isActive) { ?>aria-current="true"<?php } ?>>
<?php e(t('Language')); ?>: <?php e($label); ?>
</a>
</li>
<?php endforeach; ?>
<?php else: ?>
<?php if ($isLoggedIn): ?>
<form class="nav nav--lang" method="get" action="<?php e($baseUrl); ?>" aria-label="Language switcher">