xref: /webtrees/resources/views/modals/create-media-object.phtml (revision 75ed689eddcf20bfb18d1b792102452dce07ffd5)
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    <?= csrf_field() ?>
18
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</form>
27
28<script>
29  document.getElementById('wt-modal-form').addEventListener('submit', webtrees.createRecordModalSubmit);
30</script>
31