xref: /webtrees/resources/views/media-page-menu.phtml (revision 53a83c54b8b942be5ba4e73683d0401e77cc44e4)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
4use Fisharebest\Webtrees\Http\RequestHandlers\EditRecordPage;
5use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToFamilyModal;
6use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToIndividualModal;
7use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToSourceModal;
8use Fisharebest\Webtrees\I18N;
9use Fisharebest\Webtrees\Media;
10
11/**
12 * @var Media $record
13 */
14
15?>
16
17<div class="dropdown wt-page-menu">
18    <button class="btn btn-primary dropdown-toggle wt-page-menu-button" type="button" id="page-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
19        <?= view('icons/menu') ?>
20        <?= I18N::translate('edit') ?>
21    </button>
22
23    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
24        <a class="dropdown-item" href="<?= route(EditRecordPage::class, ['xref' => $record->xref(), 'tree' => $record->tree()->name()]) ?>">
25            <?= view('icons/edit') ?>
26            <?= I18N::translate('Edit') ?>
27        </a>
28
29        <a class="dropdown-item" href="#" data-href="<?= e(route(LinkMediaToIndividualModal::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal" data-backdrop="static">
30            <?= view('icons/link') ?>
31            <?= I18N::translate('Link this media object to an individual') ?>
32        </a>
33
34        <a class="dropdown-item" href="#" data-href="<?= e(route(LinkMediaToFamilyModal::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal" data-backdrop="static">
35            <?= view('icons/link') ?>
36            <?= I18N::translate('Link this media object to a family') ?>
37        </a>
38
39        <a class="dropdown-item" href="#" data-href="<?= e(route(LinkMediaToSourceModal::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal" data-backdrop="static">
40            <?= view('icons/link') ?>
41            <?= I18N::translate('Link this media object to a source') ?>
42        </a>
43
44        <div class="dropdown-divider"></div>
45
46        <a class="dropdown-item" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->fullName())) ?>" data-post-url="<?= e(route(DeleteRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
47            <?= view('icons/delete') ?>
48            <?= I18N::translate('Delete') ?>
49        </a>
50    </div>
51</div>
52