aboutsummaryrefslogtreecommitdiff
path: root/templates/contact/header-groups.php
blob: ae7d2624c8cf980034c67018ec7dd274e93b39f8 (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
<?
    $tooltip = function ($size) {
        if (!$size) {
            $tip = _('Keine Einträge');
        } else {
            $template = ngettext(
                '%d Eintrag',
                '%d Einträge',
                $size
            );
            $tip = sprintf($template, $size);
        }
        return tooltip($tip, false);
    }
?>
<table class="contact-header" width="70%">
    <tr>
        <td nobreak <? if (($filter ?: 'all') == 'all') echo 'class="active"'; ?>>
            <a href="<?= URLHelper::getLink('?filter=all&view=gruppen') ?>"
                <?= $tooltip($size_of_book) ?>>
                <?= _('Alle Gruppen') ?>
            </a>
            <a href="<?= URLHelper::getLink('?groupid=all')?>">
            </a>
        </td>
    <? foreach ($groups as $group_id => $name): ?>
        <td nobreak class="<? if ($filter == $group_id) echo 'active'; ?><? if (!$sizes[$group_id]) echo ' empty'; ?>">
            <a href="<?= URLHelper::getLink('', compact('view') + ['filter' => $group_id]) ?>"
                <?= $tooltip($sizes[$group_id]) ?>
            >
                <?= htmlReady($name) ?>
            </a>
        <? if ($filter == $group_id): ?>
            <a href="<?= URLHelper::getLink('dispatch.php/messages/write?', compact('group_id')) ?>">
                <?= Icon::create('mail')->asImg(['title' => _('Nachricht an alle Personen dieser Gruppe schicken')]) ?>
            </a>
        <? endif; ?>
        </td>
    <? endforeach; ?>
    </tr>
</table>