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