xref: /webtrees/resources/views/modals/add-media-file.phtml (revision 2ebcf907ed34213f816592af04e6c160335d6311)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\AddMediaFileAction;
4use Fisharebest\Webtrees\I18N;
5use Fisharebest\Webtrees\Media;
6use Fisharebest\Webtrees\Tree;
7
8/**
9 * @var string                   $max_upload_size
10 * @var Media                    $media
11 * @var array<int|string,string> $media_types
12 * @var Tree                     $tree
13 * @var array<string,string>     $unused_files
14 */
15
16?>
17
18<form method="post" action="<?= e(route(AddMediaFileAction::class, ['xref' => $media->xref(), 'tree' => $media->tree()->name()])) ?>" enctype="multipart/form-data">
19    <?= csrf_field() ?>
20
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</form>
29