aboutsummaryrefslogtreecommitdiff
path: root/templates/shared/contentgroup-row.php
blob: 8b3419ce384902fa23336c7b33bd7ea5e50bf94b (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
38
39
40
41
42
43
44
45
46
47
48
49
50
<? // class "action-menu" will be set from API ?>
<nav <?= arrayToHtmlAttributes($attributes) ?>>
    <a class="action-menu-icon" title="<?= htmlReady($label) ?>"
       aria-expanded="false" aria-label="<?= htmlReady($aria_label) ?>" role="button" href="#"
        <?= $image_link_attributes ? arrayToHtmlAttributes($image_link_attributes) : '' ?>>
        <?= $image ?>
    </a>
    <div class="action-menu-content">
        <? if (!empty($label)): ?>
        <div class="action-menu-title" aria-hidden="true">
            <?= htmlReady(_($label)) ?>
        </div>
        <? endif; ?>
        <ul class="action-menu-list" aria-label="<?= _('Inhalt') ?>">
        <? foreach ($actions as $action): ?>
            <li class="action-menu-item">
            <? if ($action['type'] === 'link'): ?>
                <a href="<?= $action['link'] ?>" <?= arrayToHtmlAttributes($action['attributes']) ?>>

                <? if ($has_link_icons): ?>
                    <? if ($action['icon']): ?>
                        <?= $action['icon']->asImg(false, ['class' => 'action-menu-item-icon']) ?>
                    <? else: ?>
                        <span class="action-menu-no-icon"></span>
                    <? endif; ?>
                <? endif; ?>
                    <?= htmlReady($action['label']) ?>
                </a>
            <? elseif ($action['type'] === 'button'): ?>
                <label>
                <? if ($action['icon']): ?>
                    <?= $action['icon']->asInput(false, array_merge($action['attributes'], [
                        'class' => 'action-menu-item-icon',
                        'name'  => $action['name'],
                        'title' => $action['label'],
                    ])) ?>
                <? else: ?>
                    <span class="action-menu-no-icon"></span>
                    <button type="submit" name="<?= htmlReady($action['name']) ?>" style="display: none;"></button>
                <? endif; ?>
                    <?= htmlReady($action['label']) ?>
                </label>
            <? elseif ($action['type'] === 'multi-person-search'): ?>
                <?= $action['object']->render() ?>
            <? endif; ?>
            </li>
        <? endforeach; ?>
        </ul>
    </div>
</nav>