xref: /webtrees/resources/views/modals/add-media-file.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\AddMediaFileAction;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Media;
8use Fisharebest\Webtrees\Tree;
9
10/**
11 * @var string                   $max_upload_size
12 * @var Media                    $media
13 * @var array<int|string,string> $media_types
14 * @var Tree                     $tree
15 * @var array<string,string>     $unused_files
16 */
17
18?>
19
20<form method="post" action="<?= e(route(AddMediaFileAction::class, ['xref' => $media->xref(), 'tree' => $media->tree()->name()])) ?>" enctype="multipart/form-data">
21    <?= view('modals/header', ['title' => I18N::translate('Add a media file')]) ?>
22
23    <div class="modal-body">
24        <?= view('modals/media-file-fields', ['max_upload_size' => $max_upload_size, 'media_file' => null, 'media_types' => $media_types, 'tree' => $tree, 'unused_files' => $unused_files]) ?>
25    </div>
26
27    <?= view('modals/footer-save-cancel') ?>
28
29    <?= csrf_field() ?>
30</form>
31