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