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