aboutsummaryrefslogtreecommitdiff
path: root/templates/header-navigation-item.php
blob: 511b803d14c351e3fb65f1e110b58ba3ad8ca88a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$attributes = $nav->getLinkAttributes();

$image_attributes = $nav->getImage()->getAttributes();
if (!empty($image_attributes['title'])) {
    $attributes['title'] = $image_attributes['title'];
}

// Add badge number to link attributes
if ($nav->getBadgeNumber()) {
    $attributes['data-badge'] = (int)$nav->getBadgeNumber();
}

// Convert link attributes array to proper attribute string
$attr_str = arrayToHtmlAttributes($attributes);
?>

<li id="nav_<?= $path ?>"<? if ($nav->isActive()) : ?> class="active"<? endif ?>>
    <a href="<?= URLHelper::getLink($nav->getURL(), $link_params) ?>" <?= $attr_str ?>>
        <?= $nav->getImage()->asSvg(32, ['class' => 'headericon original', 'title' => null]) ?>
        <div class="navtitle"><?= htmlReady($nav->getTitle()) ?></div>
    </a>
</li>