aboutsummaryrefslogtreecommitdiff
path: root/templates/sidebar/list-widget.php
blob: 5aed1881bfee736b6148835451fe7f1cb4a2f2f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<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) ?>"
            <?= isset($icon) ? 'style="' . $icon->asCSS() .'"' : '' ?>
            <?= !empty($element->active) ? 'class="active"' : '' ?>>
            <?= $element->render() ?>
        </li>
    <? endforeach; ?>
    </ul>
</form>