xref: /webtrees/resources/views/admin/media-upload.phtml (revision 315eb31683006273e24c08b447e6e1095d6f2147)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3d70512abSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
48ce3bd73SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ManageMediaPage;
58ce3bd73SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\UploadMediaPage;
6d70512abSGreg Roachuse Fisharebest\Webtrees\I18N;
77c2c99faSGreg Roachuse Illuminate\Support\Collection;
87c2c99faSGreg Roach
97c2c99faSGreg Roach/**
107c2c99faSGreg Roach * @var string                    $filesize
117c2c99faSGreg Roach * @var int                       $max_upload_files
127c2c99faSGreg Roach * @var Collection<string,string> $media_folders
137c2c99faSGreg Roach * @var string                    $title
147c2c99faSGreg Roach */
15d70512abSGreg Roach
16d70512abSGreg Roach?>
17dd6b2bfcSGreg Roach
188ce3bd73SGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageMediaPage::class) => I18N::translate('Manage media'), $title]]) ?>
19dd6b2bfcSGreg Roach
20dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<p>
23dd6b2bfcSGreg Roach    <?= I18N::translate('Upload one or more media files from your local computer. Media files can be pictures, video, audio, or other formats.') ?>
24dd6b2bfcSGreg Roach    <?= I18N::translate('Maximum upload size: ') ?><?= e($filesize) ?>
25dd6b2bfcSGreg Roach</p>
26dd6b2bfcSGreg Roach
278ce3bd73SGreg Roach<form method="post" action="<?= e(route(UploadMediaPage::class)) ?>" name="uploadmedia" enctype="multipart/form-data">
28dd6b2bfcSGreg Roach    <?= csrf_field() ?>
29dd6b2bfcSGreg Roach
30dd6b2bfcSGreg Roach    <?php for ($i = 1; $i <= $max_upload_files; $i++) : ?>
31dd6b2bfcSGreg Roach        <h2><?= I18N::translate('Media file') ?> <?= I18N::number($i) ?></h2>
32dd6b2bfcSGreg Roach
33*315eb316SGreg Roach        <div class="row form-group">
34dd6b2bfcSGreg Roach            <label class="form-control-label col-sm-3" for="mediafile<?= e($i) ?>">
35dd6b2bfcSGreg Roach                <?= I18N::translate('Media file to upload') ?>
36*315eb316SGreg Roach                <span class="visually-hidden"><?= e($i) ?></span>
37dd6b2bfcSGreg Roach            </label>
38dd6b2bfcSGreg Roach            <div class="col-sm-9">
39dd6b2bfcSGreg Roach                <input class="form-control-file" id="mediafile<?= e($i) ?>" name="mediafile<?= e($i) ?>" type="file">
40dd6b2bfcSGreg Roach            </div>
41dd6b2bfcSGreg Roach        </div>
42dd6b2bfcSGreg Roach
43*315eb316SGreg Roach        <div class="row form-group">
44dd6b2bfcSGreg Roach            <label class="form-control-label col-sm-3" for="filename<?= e($i) ?>">
45dd6b2bfcSGreg Roach                <?= I18N::translate('Filename on server') ?>
46*315eb316SGreg 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">
50*315eb316SGreg Roach                <div class="form-text">
51dd6b2bfcSGreg Roach                    <?= I18N::translate('Leave this entry blank to keep the original filename') ?>
52*315eb316SGreg Roach                </div>
53dd6b2bfcSGreg Roach            </div>
54dd6b2bfcSGreg Roach        </div>
55dd6b2bfcSGreg Roach
56*315eb316SGreg Roach        <div class="row form-group">
57dd6b2bfcSGreg Roach            <label class="form-control-label col-sm-3" for="folder_list<?= e($i) ?>">
58dd6b2bfcSGreg Roach                <?= I18N::translate('Folder name on server') ?>
59*315eb316SGreg Roach                <span class="visually-hidden"><?= e($i) ?></span>
60dd6b2bfcSGreg Roach            </label>
61dd6b2bfcSGreg Roach            <div class="col-sm-9">
62dd6b2bfcSGreg Roach                <select class="form-control" 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>
76dd6b2bfcSGreg Roach</form>
77