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