xref: /webtrees/resources/views/admin/media-upload.phtml (revision 33c343964203a24deeb34413eac7f48bee172865)
1<?php use Fisharebest\Webtrees\I18N; ?>
2
3<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-media') => I18N::translate('Manage media'), $title]]) ?>
4
5<h1><?= $title ?></h1>
6
7<p>
8    <?= I18N::translate('Upload one or more media files from your local computer. Media files can be pictures, video, audio, or other formats.') ?>
9    <?= I18N::translate('Maximum upload size: ') ?><?= e($filesize) ?>
10</p>
11
12<form name="uploadmedia" enctype="multipart/form-data" method="post">
13    <?= csrf_field() ?>
14
15    <?php for ($i = 1; $i <= $max_upload_files; $i++) : ?>
16        <h2><?= I18N::translate('Media file') ?> <?= I18N::number($i) ?></h2>
17
18        <div class="form-group row">
19            <label class="form-control-label col-sm-3" for="mediafile<?= e($i) ?>">
20                <?= I18N::translate('Media file to upload') ?>
21                <span class="sr-only"><?= e($i) ?></span>
22            </label>
23            <div class="col-sm-9">
24                <input class="form-control-file" id="mediafile<?= e($i) ?>" name="mediafile<?= e($i) ?>" type="file">
25            </div>
26        </div>
27
28        <div class="form-group row">
29            <label class="form-control-label col-sm-3" for="filename<?= e($i) ?>">
30                <?= I18N::translate('Filename on server') ?>
31                <span class="sr-only"><?= e($i) ?></span>
32            </label>
33            <div class="col-sm-9">
34                <input class="form-control" id="filename<?= e($i) ?>" name="filename<?= e($i) ?>" type="text">
35                <p class="small text-muted">
36                    <?= I18N::translate('Leave this entry blank to keep the original filename') ?>
37                </p>
38            </div>
39        </div>
40
41        <div class="form-group row">
42            <label class="form-control-label col-sm-3" for="folder_list<?= e($i) ?>">
43                <?= I18N::translate('Folder name on server') ?>
44                <span class="sr-only"><?= e($i) ?></span>
45            </label>
46            <div class="col-sm-9">
47                <select class="form-control" id="folder_list<?= e($i) ?>"name="folder<?= e($i) ?>">
48                    <?php foreach ($media_folders as $media_folder) : ?>
49                        <option value="<?= e($media_folder) ?>">
50                            <?= e($media_folder) ?>
51                        </option>
52                    <?php endforeach ?>
53                </select>
54            </div>
55        </div>
56    <?php endfor ?>
57
58    <button class="btn btn-primary" type="submit">
59        <?= /* I18N: A button label. */ I18N::translate('upload') ?>
60    </button>
61</form>
62