xref: /webtrees/resources/views/modals/create-media-object.phtml (revision 45ed5d1da4c96dfa127d64310f69874a59da5921)
1d4265d07SGreg Roach<?php
2dd6b2bfcSGreg Roach
3d4265d07SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectAction;
4d4265d07SGreg Roachuse Fisharebest\Webtrees\I18N;
5edbd59d9SGreg Roachuse Fisharebest\Webtrees\Tree;
6edbd59d9SGreg Roach
7edbd59d9SGreg Roach/**
8edbd59d9SGreg Roach * @var string                   $max_upload_size
9455a30feSGreg Roach * @var array<int|string,string> $media_types
10edbd59d9SGreg Roach * @var Tree                     $tree
11edbd59d9SGreg Roach * @var array<string>            $unused_files
12edbd59d9SGreg Roach */
13d4265d07SGreg Roach
14d4265d07SGreg Roach?>
15d4265d07SGreg Roach
16d4265d07SGreg Roach<form method="post" action="<?= e(route(CreateMediaObjectAction::class, ['tree' => $tree->name()])) ?>" id="wt-modal-form">
17dd6b2bfcSGreg Roach    <?= csrf_field() ?>
18dd6b2bfcSGreg Roach
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') ?>
26dd6b2bfcSGreg Roach</form>
27dd6b2bfcSGreg Roach
28dd6b2bfcSGreg Roach<script>
29*45ed5d1dSGreg Roach  document.getElementById('wt-modal-form').addEventListener('submit', webtrees.createRecordModalSubmit);
30dd6b2bfcSGreg Roach</script>
31