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