aboutsummaryrefslogtreecommitdiff
path: root/templates/sidebar/list-widget.php
blob: 33da0f485d0ef2fac54ce87f16c51ba18fa2a513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<form class="default" method="post">
    <?= CSRFProtection::tokenTag() ?>
    <ul class="<?= implode(' ', $css_classes) ?>" aria-label="<?= htmlReady($title) ?>">
    <? foreach ($elements as $index => $element): ?>
        <? $icon = $element->icon ?? null ?>
        <? if ($icon && $element instanceof LinkElement && $element->isDisabled()): ?>
            <? $icon = $icon->copyWithRole(Icon::ROLE_INACTIVE) ?>
        <? endif ?>
        <li id="<?= htmlReady($index) ?>"
            <?= !empty($element->active) ? 'class="active"' : '' ?>>
            <? if (isset($icon) && $element instanceof LinkElement): ?>
                <?= $element->renderWithIcon($icon) ?>
            <? else: ?>
                <?= $element->render() ?>
            <? endif ?>
        </li>
    <? endforeach; ?>
    </ul>
</form>