xref: /webtrees/resources/views/media-page-menu.phtml (revision 39ca88ba08cefcfcaf891abfcf748f9c808eb326)
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    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
12
13        <?php if (false && app()->make(ModuleService::class)->findByClass(CensusAssistantModule::class)) : ?>
14            <a class="dropdown-item menu-obje-link" href="#" onclick="return ilinkitem('<?= e($record->xref()) ?>','manage','<?= e($record->tree()->name()) ?>');">
15                <?= I18N::translate('Manage the links') ?>
16            </a>
17        <?php else : ?>
18            <a class="dropdown-item menu-obje-link" href="#" data-href="<?= e(route('link-media-to-individual', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal">
19                <?= I18N::translate('Link this media object to an individual') ?>
20            </a>
21
22            <a class="dropdown-item menu-obje-link" href="#" data-href="<?= e(route('link-media-to-family', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal">
23                <?= I18N::translate('Link this media object to a family') ?>
24            </a>
25
26            <a class="dropdown-item menu-obje-link" href="#" data-href="<?= e(route('link-media-to-source', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>" data-target="#wt-ajax-modal" data-toggle="modal">
27                <?= I18N::translate('Link this media object to a source') ?>
28            </a>
29        <?php endif ?>
30
31        <a class="dropdown-item menu-obje-del" 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()) ?>');">
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 menu-obje-editraw" href="<?= e(route('edit-raw-record', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
39                <?= I18N::translate('Edit the raw GEDCOM') ?>
40            </a>
41        <?php endif ?>
42    </div>
43</div>
44