aboutsummaryrefslogtreecommitdiff
path: root/app/views/file/_file_aside.php
blob: b748e732db609a63f496ed24908b0cdf1bf926a2 (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
<aside id="file_aside">
    <div class="file-icon">
        <?= $file->getIcon(Icon::ROLE_INFO) ?>
    </div>

    <table class="default nohover">
        <caption><?= htmlReady($file->getFilename()) ?></caption>
        <tbody>
            <tr>
                <td><?= _('Größe') ?></td>
                <? $size = $file->getSize() ?>
                <td><?= $size !== null ? relSize($file->getSize(), false) : "-" ?></td>
            </tr>
            <tr>
                <td><?= _('Downloads') ?></td>
                <td><?= htmlReady($file->getDownloads()) ?></td>
            </tr>
            <tr>
                <td><?= _('Erstellt') ?></td>
                <td><?= date('d.m.Y H:i', $file->getMakeDate()) ?></td>
            </tr>
            <tr>
                <td><?= _('Geändert') ?></td>
                <td><?= date('d.m.Y H:i', $file->getLastChangeDate()) ?></td>
            </tr>
            <tr>
                <td><?= _('Besitzer/-in') ?></td>
                <td>
                    <? $user_id = $file->getUserId() ?>
                    <? if ($user_id) : ?>
                        <a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => get_username($user_id)]) ?>">
                            <?= htmlReady($file->getUserName()) ?>
                        </a>
                    <? else : ?>
                        <?= htmlReady($file->getUserName()) ?>
                    <? endif ?>
                </td>
            </tr>
            <tr>
                <td><?= _('Barrierefrei') ?></td>
                <td>
                    <?= $file->getAccessibility() ? _('ja') : _('nein') ?>
                </td>
            </tr>

            <? $content_terms_of_use = $file->getTermsOfUse() ?>

            <? if ($content_terms_of_use && !is_a($file, LibraryFile::class)) : ?>
            <tr>
                <td colspan="2">
                    <h3><?=_('Hinweis zur Nutzung und Weitergabe:')?></h3>
                    <?= Icon::create($content_terms_of_use->icon, Icon::ROLE_INFO) ?>
                    <article><?= htmlReady($content_terms_of_use->student_description) ?></article>

                    <? if ($content_terms_of_use->download_condition) : ?>
                        <h3><?= _('Bedingung zum Herunterladen') ?></h3>
                        <p>
                            <?= htmlReady(ContentTermsOfUse::describeCondition(
                                $content_terms_of_use->download_condition
                            )) ?>
                        </p>
                    <? endif ?>
                </td>
            </tr>
            <? endif ?>
        </tbody>
    </table>
</aside>