xref: /webtrees/resources/views/modals/create-media-object.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectAction;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var string                   $max_upload_size
11 * @var array<int|string,string> $media_types
12 * @var Tree                     $tree
13 * @var array<string>            $unused_files
14 */
15
16?>
17
18<form method="post" action="<?= e(route(CreateMediaObjectAction::class, ['tree' => $tree->name()])) ?>" id="wt-modal-form">
19    <?= view('modals/header', ['title' => I18N::translate('Create a media object')]) ?>
20
21    <div class="modal-body">
22        <?= view('modals/media-object-fields', ['max_upload_size' => $max_upload_size, 'media_types' => $media_types, 'unused_files' => $unused_files, 'tree' => $tree]) ?>
23    </div>
24
25    <?= view('modals/footer-save-cancel') ?>
26
27    <?= csrf_field() ?>
28</form>
29
30<script>
31  document.getElementById('wt-modal-form').addEventListener('submit', webtrees.createRecordModalSubmit);
32</script>
33