xref: /webtrees/resources/views/modals/create-media-from-file.phtml (revision b11cdcd45131b1585d66693fab363cfeb18c51a4)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectFromFile;
6use Fisharebest\Webtrees\I18N;
7
8/**
9 * @var array<int|string,string> $media_types
10 */
11?>
12
13<div class="modal" id="modal-create-media-from-file">
14    <form method="post" action="<?= e(route(CreateMediaObjectFromFile::class)) ?>" id="modal-create-media-from-file-form">
15        <input type="hidden" name="action" value="create-media-object-from-file">
16        <input type="hidden" name="tree" id="tree" value="">
17        <div class="modal-dialog modal-lg" role="document">
18            <div class="modal-content">
19                <div class="modal-header">
20                    <h3 class="modal-title"><?= I18N::translate('Create a media object') ?></h3>
21                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?= I18N::translate('close') ?>">
22                    </button>
23                </div>
24                <div class="modal-body">
25                    <div class="row mb-3">
26                        <label class="col-form-label col-sm-2" for="file">
27                            <?= I18N::translate('Media file') ?>
28                        </label>
29                        <div class="col-sm-10">
30                            <input type="text" class="form-control" id="file" name="file" value="" readonly>
31                        </div>
32                    </div>
33                    <div class="row mb-3">
34                        <label class="col-form-label col-sm-2" for="title">
35                            <?= I18N::translate('Title') ?>
36                        </label>
37                        <div class="col-sm-10">
38                            <input type="text" class="form-control" name="title" id="title">
39                        </div>
40                    </div>
41                    <div class="row mb-3">
42                        <label class="col-form-label col-sm-2" for="type">
43                            <?= I18N::translate('Media type') ?>
44                        </label>
45                        <div class="col-sm-10">
46                            <?= view('components/select', ['name' => 'type', 'selected' => '', 'options' => $media_types]) ?>
47                        </div>
48                    </div>
49                    <div class="row mb-3">
50                        <label class="col-form-label col-sm-2" for="note">
51                            <?= I18N::translate('Note') ?>
52                        </label>
53                        <div class="col-sm-10">
54                            <textarea class="form-control" id="note" name="note" rows="5" dir="auto"></textarea>
55                        </div>
56                    </div>
57                </div>
58                <div class="modal-footer">
59                    <button type="submit" class="btn btn-primary">
60                        <?= view('icons/save') ?>
61                        <?= I18N::translate('save') ?>
62                    </button>
63                    <button type="button" class="btn btn-text" data-bs-dismiss="modal">
64                        <?= view('icons/cancel') ?>
65                        <?= I18N::translate('cancel') ?>
66                    </button>
67                </div>
68            </div>
69        </div>
70
71        <?= csrf_field() ?>
72    </form>
73</div>
74