aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/user/list_files.php
blob: 0e7ed2b7b021652d7c78299e6e63afa1c8e54edb (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
<?php
/**
 * @var Admin_UserController $controller
 * @var array $params
 * @var FolderType $folders
 * @var User $user
 */
?>
<section class="contentbox">
    <header>
        <h1><?= _('Dateiübersicht') ?></h1>
    </header>
<? foreach ($folders as $folder) : ?>
    <? foreach($folder->getFiles() as $file): ?>
        <? if ($file->user_id === $user->id): ?>
            <article id="<?= $file->id ?>" class="<?= ContentBoxHelper::classes($file->id) ?>">
                <header>
                    <h1>
                        <a href="<?= ContentBoxHelper::href($file->id) ?>">
                            <?= htmlReady($file->name) ?>
                        </a>
                    </h1>
                <? if ($folder->isFileDownloadable($file->id, $user->id)): ?>
                    <?= ActionMenu::get()->setContext($file->name)->addLink(
                        $file->getDownloadURL(),
                        _('Datei herunterladen'),
                        Icon::create('download')
                    )->render() ?>
                <? endif ?>
                </header>
                <section>
                    <article>
                        <p>
                            <?= htmlReady($file->description ?: _('Keine Beschreibung vorhanden'), true, true) ?>
                        </p>
                        <p>
                            <strong><?= _('Dateigröße') ?>:</strong>
                            <?= relsize($file->file->size) ?>
                        </p>
                        <p>
                            <strong><?= _('Dateiname') ?>:</strong>
                            <?= htmlReady($file->name) ?>
                        </p>
                    </article>

                <? if ($file->terms_of_use->download_condition > 0): ?>
                    <article>
                        <?= MessageBox::warning(_('Das Herunterladen dieser Datei ist aufgrund von Nutzungsbedingungen nur eingeschränkt möglich!')) ?>
                    </article>
                <? endif ?>
                </section>
            </article>
        <? endif ?>
    <? endforeach ?>
<? endforeach ?>
</section>

<? if (Request::int('from_index')) : ?>
    <footer data-dialog-button>
        <?= Studip\LinkButton::create(
            _('Zurück zur Übersicht'),
            $controller->url_for('admin/user/activities/' . $user->user_id, $params),
            ['data-dialog' => 'size=50%']
        ) ?>
    </footer>
<? endif ?>