aboutsummaryrefslogtreecommitdiff
path: root/app/views/file/add_files_window.php
blob: bdde120ad27a10fd1be10a96e219c32518d1df73 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
$options = [];
if (Request::get('to_plugin')) {
    $options['to_plugin'] = Request::get('to_plugin');
}
if (Request::get('from_plugin')) {
    $options['from_plugin'] = Request::get('from_plugin');
}
if (Request::get('to_folder_id')) {
    $options['to_folder_id'] = Request::get('to_folder_id');
}
if ($folder_id) {
    $options['to_folder_id'] = $folder_id;
}

?>
<div class="files_source_selector" data-folder_id="<?= htmlReady($folder_id) ?>" <? if (!empty($hidden)) echo ' style="display: none;"'; ?>>
    <h2 class="dialog-subtitle"><?= _('Quelle auswählen') ?></h2>
    <div class="file_select_possibilities">
        <? if ($range instanceof Course && !$range->getSemClass()['studygroup_mode'] && $GLOBALS['perm']->have_studip_perm('tutor', $range->id)
            && $GLOBALS['LIBRARY_CATALOGS'] && $show_library_functions && $library_search_description) : ?>
            <div>
                <a class="important-item" data-dialog="size=medium-43"
                   href="<?= $controller->link_for('file/add_from_library/' . $folder_id)?>">
                    <div class="icon">
                        <?= Icon::create('literature')->asSvg(50) ?>
                        <div><?= _('Bibliothek') ?></div>
                    </div>
                    <div class="description">
                        <strong><?= _('Originaldokument aus Bibliotheksverzeichnissen einbinden') ?></strong>
                        <div><?= htmlReady($library_search_description) ?></div>
                    </div>
                </a>
            </div>
        <? endif ?>
        <div>
            <a href="#" onclick="jQuery('.file_selector input[type=file]').first().click(); return false;">
                <?= Icon::create('computer')->asSvg(50) ?>
                <?= _('Mein Computer') ?>
            </a>
            <a href="<?= $controller->link_for('file/add_url/' . $folder_id, array_merge($options, ['from_plugin' => ""])) ?>" data-dialog="size=medium">
                <?= Icon::create('globe')->asSvg(50) ?>
                <?= _('Webadresse') ?>
            </a>
            <a href="<?= $controller->link_for('file/choose_file/' . Folder::findTopFolder($GLOBALS['user']->id)->getId(), array_merge($options, ['from_plugin' => ""])) ?>" data-dialog>
                <?= Icon::create('files')->asSvg(50) ?>
                <?= _('Persönlicher Dateibereich') ?>
            </a>
            <a href="<?= $controller->link_for('file/choose_file_from_course/' . $folder_id, array_merge($options, ['from_plugin' => ""])) ?>" data-dialog>
                <?= Icon::create('seminar')->asSvg(50) ?>
                <?= _('Meine Veranstaltungen') ?>
            </a>
            <? if ($range instanceof Course && $GLOBALS['perm']->have_studip_perm('tutor', $range->id) && $show_library_functions) : ?>
                <a href="<?= $controller->link_for('library_file/select_type/' . $folder_id) ?>" data-dialog="size=auto">
                    <?= Icon::create('literature')->asSvg(50) ?>
                    <?= _('Literatur') ?>
                </a>
                <? if ($GLOBALS['LIBRARY_CATALOGS'] && !$range->getSemClass()['studygroup_mode'] && !$library_search_description) : ?>
                    <a href="<?= $controller->link_for('file/add_from_library/' . $folder_id) ?>" data-dialog="size=medium-43">
                        <?= Icon::create('literature')->asSvg(50) ?>
                        <?= _('Originaldokument aus Bibliothek') ?>
                    </a>
                <? endif ?>
            <? endif ?>
            <? if (Config::get()->OERCAMPUS_ENABLED && $GLOBALS['perm']->have_perm(Config::get()->OERCAMPUS_PUBLIC_STATUS)) : ?>
                <a href="<?= $controller->link_for('oer/addfile/choose_file', array_merge($options, ['from_plugin' => ""])) ?>"
                   data-dialog="size=800x800">
                    <?= Icon::create('oer-campus')->asSvg(50) ?>
                    <?= _('OER Campus') ?>
                </a>
            <? endif ?>
            <? foreach (PluginManager::getInstance()->getPlugins(FilesystemPlugin::class) as $plugin) : ?>
                <? if ($plugin->isSource()) : ?>
                    <? $nav = $plugin->getFileSelectNavigation() ?>
                    <? if ($nav): ?>
                        <a href="<?= $controller->link_for('file/choose_file/', array_merge($options, ['from_plugin' => get_class($plugin)])) ?>" data-dialog>
                            <?= $nav->getImage()->asSvg(50) ?>
                            <?= htmlReady($nav->getTitle()) ?>
                        </a>
                    <? endif; ?>
                <? endif; ?>
            <? endforeach; ?>
        </div>
    </div>
    <div>
        <?=sprintf(_('Sie dürfen Dateien bis zu einer Größe von %s in diesem Bereich einstellen.'), '<b>' . relsize($upload_type['file_size']) . '</b>')?>
    </div>
    <? if (count($upload_type['file_types']) && $upload_type['type'] == 'allow') : ?>
        <div>
            <?=sprintf(_('Sie dürfen die Dateitypen %s nicht hochladen!'), '<b>' . join(',', $upload_type['file_types']) . '</b>')?>
        </div>
    <? endif ?>
    <? if (count($upload_type['file_types']) && $upload_type['type'] == 'deny') : ?>
        <div>
            <?=sprintf(_('Sie dürfen nur die Dateitypen %s hochladen!'), '<b>' . join(',', $upload_type['file_types']) . '</b>')?>
        </div>
    <? endif ?>
    <form style="display: none;" class="file_selector">

        <input type="file" name="files[]" multiple onchange="STUDIP.Files.upload(this.files);">
    </form>
</div>

<div style="display: none;">
    <?= _('Soll die hochgeladene ZIP-Datei entpackt werden?') ?>
</div>