xref: /webtrees/resources/views/media-page-menu.phtml (revision 3cfcc809af53e831fa6cafac7b274a2cb407db6e)
1<?php use Fisharebest\Webtrees\Auth; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3
4<div class="dropdown wt-page-menu">
5    <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">
6        <?= view('icons/edit') ?>
7        <?= I18N::translate('edit') ?>
8    </button>
9
10    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
11        <a class="dropdown-item" href="#" data-href="<?= e(route('link-media-to-individual', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal">
12            <?= view('icons/link') ?>
13            <?= I18N::translate('Link this media object to an individual') ?>
14        </a>
15
16        <a class="dropdown-item" href="#" data-href="<?= e(route('link-media-to-family', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal">
17            <?= view('icons/link') ?>
18            <?= I18N::translate('Link this media object to a family') ?>
19        </a>
20
21        <a class="dropdown-item" href="#" data-href="<?= e(route('link-media-to-source', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal">
22            <?= view('icons/link') ?>
23            <?= I18N::translate('Link this media object to a source') ?>
24        </a>
25
26        <div class="dropdown-divider"></div>
27
28        <a class="dropdown-item" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->fullName())) ?>" onclick="return confirm(this.dataset.confirm) && delete_record('<?= e($record->xref()) ?>', '<?= e($record->tree()->name()) ?>');">
29            <?= view('icons/delete') ?>
30            <?= I18N::translate('Delete') ?>
31        </a>
32
33        <?php if (Auth::isAdmin() || $record->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
34            <a class="dropdown-item" href="<?= e(route('edit-raw-record', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
35                <?= view('icons/edit') ?>
36                <?= I18N::translate('Edit the raw GEDCOM') ?>
37            </a>
38        <?php endif ?>
39    </div>
40</div>
41