aboutsummaryrefslogtreecommitdiff
path: root/templates/secondary_tabs.php
blob: e38d6dbd66697753d57f6e816b51581e3585b2e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<div class="tabs_wrapper">
    <? SkipLinks::addIndex(_('Dritte Navigationsebene'), 'navigation-level-3', 10, false); ?>
    <ul id="tabs">
        <? if (!empty($subnavigation)): ?>
            <? foreach ($subnavigation as $path => $nav): ?>
                <? if ($nav->isVisible()): ?>
                    <li id="nav_<?= $path1 ?? '' ?>_<?= $path ?>" <?= $nav->isActive() ? ' class="current"' : '' ?>>
                        <? if ($nav->isEnabled()): ?>
                            <?
                            $attr = array_merge(['class' => ''], $nav->getLinkAttributes());
                            if ($nav->hasBadgeNumber()) {
                                $attr['class'] = trim("{$attr['class']} badge");
                                $attr['data-badge-number'] = (int) $nav->getBadgeNumber();
                            }
                            ?>
                            <a href="<?= URLHelper::getLink($nav->getURL()) ?>" <?= arrayToHtmlAttributes($attr) ?>>
                                <? if ($image = $nav->getImage()): ?>
                                    <?= $image->asImg(['class' => "tab-icon", 'title' => $nav->getTitle() ? $nav->getTitle() : $nav->getDescription()]) ?>
                                <? endif ?>
                                <span
                                    title="<?= $nav->getDescription() ? htmlReady($nav->getDescription()) : htmlReady($nav->getTitle()) ?>"
                                    class="tab-title"><?= htmlReady($nav->getTitle()) ?></span>
                            </a>
                        <? else: ?>
                            <span class="quiet tab-title">
                                <? if ($image = $nav->getImage()): ?>
                                    <?= $image->asImg(['class' => "tab-icon", 'title' => $nav->getTitle()]) ?>
                                <? endif ?>
                                <?= htmlReady($nav->getTitle()) ?>
                            </span>
                        <? endif ?>
                    </li>
                <? endif; ?>
            <? endforeach ?>
        <? endif; ?>
    </ul>
</div>