xref: /webtrees/resources/views/admin/media-upload.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5d70512abSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
68ce3bd73SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ManageMediaPage;
78ce3bd73SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UploadMediaPage;
8d70512abSGreg Roachuse Fisharebest\Webtrees\I18N;
97c2c99faSGreg Roachuse Illuminate\Support\Collection;
107c2c99faSGreg Roach
117c2c99faSGreg Roach/**
127c2c99faSGreg Roach * @var string                       $filesize
137c2c99faSGreg Roach * @var int                          $max_upload_files
1436779af1SGreg Roach * @var Collection<array-key,string> $media_folders
157c2c99faSGreg Roach * @var string                       $title
167c2c99faSGreg Roach */
17d70512abSGreg Roach
18d70512abSGreg Roach?>
19dd6b2bfcSGreg Roach
208ce3bd73SGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageMediaPage::class) => I18N::translate('Manage media'), $title]]) ?>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
23dd6b2bfcSGreg Roach
24dd6b2bfcSGreg Roach<p>
25dd6b2bfcSGreg Roach    <?= I18N::translate('Upload one or more media files from your local computer. Media files can be pictures, video, audio, or other formats.') ?>
26dd6b2bfcSGreg Roach    <?= I18N::translate('Maximum upload size: ') ?><?= e($filesize) ?>
27dd6b2bfcSGreg Roach</p>
28dd6b2bfcSGreg Roach
298ce3bd73SGreg Roach<form method="post" action="<?= e(route(UploadMediaPage::class)) ?>" name="uploadmedia" enctype="multipart/form-data">
30dd6b2bfcSGreg Roach    <?php for ($i = 1; $i <= $max_upload_files; $i++) : ?>
31dd6b2bfcSGreg Roach        <h2><?= I18N::translate('Media file') ?> <?= I18N::number($i) ?></h2>
32dd6b2bfcSGreg Roach
339e3c2cf9SGreg Roach        <div class="row mb-3">
34dd6b2bfcSGreg Roach            <label class="form-control-label col-sm-3" for="mediafile<?= e($i) ?>">
35dd6b2bfcSGreg Roach                <?= I18N::translate('Media file to upload') ?>
36315eb316SGreg Roach                <span class="visually-hidden"><?= e($i) ?></span>
37dd6b2bfcSGreg Roach            </label>
38dd6b2bfcSGreg Roach            <div class="col-sm-9">
399e3c2cf9SGreg Roach                <input class="form-control" id="mediafile<?= e($i) ?>" name="mediafile<?= e($i) ?>" type="file">
40dd6b2bfcSGreg Roach            </div>
41dd6b2bfcSGreg Roach        </div>
42dd6b2bfcSGreg Roach
439e3c2cf9SGreg Roach        <div class="row mb-3">
44dd6b2bfcSGreg Roach            <label class="form-control-label col-sm-3" for="filename<?= e($i) ?>">
45dd6b2bfcSGreg Roach                <?= I18N::translate('Filename on server') ?>
46315eb316SGreg Roach                <span class="visually-hidden"><?= e($i) ?></span>
47dd6b2bfcSGreg Roach            </label>
48dd6b2bfcSGreg Roach            <div class="col-sm-9">
49dd6b2bfcSGreg Roach                <input class="form-control" id="filename<?= e($i) ?>" name="filename<?= e($i) ?>" type="text">
50315eb316SGreg Roach                <div class="form-text">
51dd6b2bfcSGreg Roach                    <?= I18N::translate('Leave this entry blank to keep the original filename') ?>
52315eb316SGreg Roach                </div>
53dd6b2bfcSGreg Roach            </div>
54dd6b2bfcSGreg Roach        </div>
55dd6b2bfcSGreg Roach
569e3c2cf9SGreg Roach        <div class="row mb-3">
57dd6b2bfcSGreg Roach            <label class="form-control-label col-sm-3" for="folder_list<?= e($i) ?>">
58dd6b2bfcSGreg Roach                <?= I18N::translate('Folder name on server') ?>
59315eb316SGreg Roach                <span class="visually-hidden"><?= e($i) ?></span>
60dd6b2bfcSGreg Roach            </label>
61dd6b2bfcSGreg Roach            <div class="col-sm-9">
624b9213b3SGreg Roach                <select class="form-select" id="folder_list<?= e($i) ?>" name="folder<?= e($i) ?>">
63dd6b2bfcSGreg Roach                    <?php foreach ($media_folders as $media_folder) : ?>
64dd6b2bfcSGreg Roach                        <option value="<?= e($media_folder) ?>">
65dd6b2bfcSGreg Roach                            <?= e($media_folder) ?>
66dd6b2bfcSGreg Roach                        </option>
67dd6b2bfcSGreg Roach                    <?php endforeach ?>
68dd6b2bfcSGreg Roach                </select>
69dd6b2bfcSGreg Roach            </div>
70dd6b2bfcSGreg Roach        </div>
71dd6b2bfcSGreg Roach    <?php endfor ?>
72dd6b2bfcSGreg Roach
73dd6b2bfcSGreg Roach    <button class="btn btn-primary" type="submit">
74dd6b2bfcSGreg Roach        <?= /* I18N: A button label. */ I18N::translate('upload') ?>
75dd6b2bfcSGreg Roach    </button>
7681443e3cSGreg Roach
7781443e3cSGreg Roach    <?= csrf_field() ?>
78dd6b2bfcSGreg Roach</form>
79