xref: /webtrees/resources/views/media-page-menu.phtml (revision 4874f72da8279544d9c0a459e2920a9986acfaa0)
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', ['tree' => $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', ['tree' => $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', ['tree' => $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())) ?>" data-post-url="<?= e(route('delete-record', ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
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', ['tree' => $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