aboutsummaryrefslogtreecommitdiff
path: root/app/views/studiengaenge/fachbereiche/index.php
blob: bfdad37d01bb9c2349a8fb8f15ff18a29443e54a (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
51
52
<?php
/**
 * @var Studiengaenge_FachbereicheController $controller
 * @var Fachbereich[] $fachbereiche
 * @var string $fachbereich_id
 */
?>
<table class="default collapsable" style="width: 100%;">
    <thead>
        <tr class="sortable">
            <?= $controller->renderSortLink('/index', _('Fachbereich'), 'name') ?>
            <?= $controller->renderSortLink('/index', _('Studiengänge'), 'count_objects', ['style' => 'text-align: center; width: 10%;']) ?>
            <th style="width: 5%; text-align: right;"><?= _('Aktionen') ?></th>
        </tr>
    </thead>
    <? foreach ($fachbereiche as $fachbereich) : ?>
        <?php
        // skip unknown Fachbereiche
        if (is_null($fachbereich->name)) {
            continue;
        }
        ?>
        <tbody class="<?= ($fachbereich->count_objects ? '' : 'empty') ?> <?= ($fachbereich_id === $fachbereich->id ? 'not-collapsed' : 'collapsed') ?>">
            <tr class="header-row" id="fachbereich_<?= $fachbereich->id ?>">
                <td class="toggle-indicator">
                    <? if (is_null($fachbereich->name) && $fachbereich->count_objects) : ?>
                        <a class="mvv-load-in-new-row"
                           href="<?= $controller->action_link('details/' . $fachbereich->id) ?>">
                            <?= _('Keinem Fachbereich zugeordnet') ?>
                        </a>
                    <? else : ?>
                        <? if ($fachbereich->count_objects) : ?>
                            <a class="mvv-load-in-new-row"
                               href="<?= $controller->action_link('details/' . $fachbereich->id) ?>">
                                <?= htmlReady($fachbereich->getDisplayName()) ?>
                            </a>
                        <? else : ?>
                            <?= htmlReady($fachbereich->getDisplayName()) ?>
                        <? endif; ?>
                    <? endif; ?>
                </td>
                <td style="text-align: center;" class="dont-hide"><?= $fachbereich->count_objects ?></td>
                <td></td>
            </tr>
            <? if (isset($fachbereich_id) && $fachbereich_id === $fachbereich->id) : ?>
                <tr class="loaded-details nohover">
                    <?= $this->render_partial('studiengaenge/studiengaenge/details') ?>
                </tr>
            <? endif; ?>
        </tbody>
    <? endforeach; ?>
</table>