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