aboutsummaryrefslogtreecommitdiff
path: root/app/views/file/update.php
blob: ba88f9d9ffd96bad26f2613bd9077acbc141d894 (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
<form action="<?= $controller->link_for('file/update/' . $file->getId(), ['from_plugin' => $from_plugin]) ?>"
      enctype="multipart/form-data" method="post" class="default">

    <?= CSRFProtection::tokenTag() ?>
    <fieldset>
        <legend><?= _('Neue Dateiversion') ?></legend>
        <label class="file-upload">
            <?= sprintf(
                _('Bitte die neue Version der Datei %s auswählen.'),
                htmlReady($file->getFilename())
            ) ?>
            <input type="file" name="file">
        </label>
        <label>
            <input type="checkbox" name="update_filename" value="1">
            <?= _('Dateinamen aus neuer Dateiversion übernehmen.') ?>
        </label>
        <? if ($file_ref) : ?>
            <? $count = count($file_ref->file->refs) ?>
            <? if ($count > 1) : ?>
                <label>
                    <input type="checkbox" name="update_all_instances" value="1">
                    <?= sprintf(_('Alle weiteren %u Vorkommen aktualisieren.'), $count - 1) ?>
                </label>
            <? endif ?>
        <? endif ?>


    </fieldset>
    <footer data-dialog-button>
        <?= Studip\Button::createAccept(_('Aktualisieren'), 'confirm') ?>
        <?= Studip\LinkButton::createCancel(
            _('Abbrechen'),
            $controller->url_for(
                (in_array($folder->range_type, ['course', 'institute']) ? $folder->range_type . '/' : '')
                . 'files/index/' . $folder->parent_id
            )
        ) ?>
    </footer>
</form>