aboutsummaryrefslogtreecommitdiff
path: root/templates/userfilter/display.php
blob: 189f6cdfc90327a00c42dd4dce8a241033d73a43 (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
<?php
$i=0;
$fieldText = '';
foreach ($filter->getFields() as $field) {
    if ($i > 0) {
        $fieldText .= ' <b>'._('und').'</b> ';
    }
    $valueNames = $field->getValidValues();
    $ops = $field->getValidCompareOperators();
    $fieldText .= htmlReady($field->getName()." ".$field->getCompareOperatorAsText().
        " " . ($valueNames[$field->getValue()] ?? $field->getValue()));
    $i++;

}
if ($filter->show_user_count) {
    $user_count = count($filter->getUsers());
    $fieldText .= ' (' . sprintf(ngettext('Eine Person', '%s Personen', $user_count), $user_count);
    if ($user_count === 0) {
        $fieldText .= '&nbsp;' . Icon::create('exclaim-circle', Icon::ROLE_ATTENTION)
                ->asImg(['title' => _('Niemand erfüllt diese Bedingung.')]);
    }
    $fieldText .= ')';
}
echo $fieldText;