aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/user/_course_files.php
blob: c4276195c210c2a4d47979c993bf91e4307fd522 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<section class="contentbox">
    <header>
        <h1>
            <?= _('Dateiübersicht Veranstaltungen') ?>
        </h1>
    </header>
    <? foreach ($course_files as $semester_name => $file_date) : ?>
        <article id="<?= $semester_name ?>" class="<?= ContentBoxHelper::classes($semester_name) ?>">
            <header>
                <h1>
                    <a href="<?= ContentBoxHelper::href($semester_name) ?>">
                        <?= htmlReady($semester_name) ?>
                    </a>
                </h1>
            </header>
            <section>
                <table class="default">
                    <colgroup>
                        <col style="width: 200px">
                        <col>
                        <col style="width: 120px">
                        <col style="width: 120px">
                        <col style="width: 20px">
                    </colgroup>
                    <thead>
                        <tr>
                            <th><?= _('Veranstaltungsnummer') ?></th>
                            <th><?= _('Veranstaltung') ?></th>
                            <th><?= _('Typ') ?></th>
                            <th><?= _('Anzahl') ?></th>
                            <th class="actions"><?= _('Aktionen') ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <? foreach ($file_date as $data): ?>
                            <tr>
                                <td><?= htmlReady($data['course']->veranstaltungsnummer) ?></td>
                                <td>
                                    <?= htmlReady($data['course']->name) ?>
                                </td>
                                <td>
                                    <?= htmlReady($data['course']->getSemType()['name'])?>
                                </td>
                                <td>
                                    <? if ($data['files']) : ?>
                                        <?= sprintf('%u %s', $data['files'], _('Dokumente')) ?>
                                    <? else : ?>
                                        -
                                    <? endif ?>
                                </td>
                                <td class="actions">
                                    <? if ($data['files']) : ?>
                                        <?
                                        $actionMenu = ActionMenu::get();
                                        $actionMenu->addLink($controller->url_for('admin/user/list_files/' . $user['user_id'] . '/' . $data['course']->id, $params),
                                                _('Dateien auflisten'),
                                                Icon::create('folder-full', 'clickable'),
                                                ['data-dialog' => 'size=50%']);
                                        $actionMenu->addLink($controller->url_for('admin/user/download_user_files/' . $user['user_id'] . '/' . $data['course']->id),
                                                _('Dateien als ZIP herunterladen'),
                                                Icon::create('download', 'clickable'));

                                        ?>

                                        <?= $actionMenu->render() ?>
                                    <? endif ?>
                                </td>

                            </tr>
                        <? endforeach; ?>
                    </tbody>
                </table>
            </section>
        </article>
    <? endforeach; ?>
</section>