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