xref: /webtrees/resources/views/media-page-menu.phtml (revision 051c822d024c344f8050d1178cd077a864982c84)
1<?php use Fisharebest\Webtrees\Auth; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3<?php use Fisharebest\Webtrees\Module\CensusAssistantModule; ?>
4<?php use Fisharebest\Webtrees\Services\ModuleService; ?>
5
6<div class="dropdown wt-page-menu">
7    <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">
8        <?= view('icons/edit') ?>
9        <?= I18N::translate('edit') ?>
10    </button>
11
12    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
13        <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">
14            <?= view('icons/link') ?>
15            <?= I18N::translate('Link this media object to an individual') ?>
16        </a>
17
18        <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">
19            <?= view('icons/link') ?>
20            <?= I18N::translate('Link this media object to a family') ?>
21        </a>
22
23        <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">
24            <?= view('icons/link') ?>
25            <?= I18N::translate('Link this media object to a source') ?>
26        </a>
27
28        <div class="dropdown-divider"></div>
29
30        <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()) ?>');">
31            <?= view('icons/delete') ?>
32            <?= I18N::translate('Delete') ?>
33        </a>
34
35        <?php if (Auth::isAdmin() || $record->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
36            <div class="dropdown-divider"></div>
37
38            <a class="dropdown-item" href="<?= e(route('edit-raw-record', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
39                <?= view('icons/edit') ?>
40                <?= I18N::translate('Edit the raw GEDCOM') ?>
41            </a>
42        <?php endif ?>
43    </div>
44</div>
45