xref: /webtrees/resources/views/individual-page-menu.phtml (revision 60f314e90d2e819966cff33832a5a92e8b16b067)
15229eadeSGreg Roach<?php
25229eadeSGreg Roach
35229eadeSGreg Roachuse Fisharebest\Webtrees\Auth;
47c7d1e03SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddName;
52917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
63b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
7a53fee79SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditFactPage;
83b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
95229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaPage;
105229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesPage;
111afbbc50SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderFamiliesPage;
125229eadeSGreg Roachuse Fisharebest\Webtrees\I18N;
13203146cfSGreg Roachuse Fisharebest\Webtrees\Individual;
145229eadeSGreg Roach
15203146cfSGreg Roach/**
16203146cfSGreg Roach * @var Individual $record
17203146cfSGreg Roach */
18*60f314e9SGreg Roach
19*60f314e9SGreg Roach$record = $record ?? $individual; /** @deprecated - will be removed in 2.1.0 - use $record */
205229eadeSGreg Roach?>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<div class="dropdown wt-page-menu">
23dd6b2bfcSGreg Roach    <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">
24d993d560SGreg Roach        <?= view('icons/edit') ?>
25dd6b2bfcSGreg Roach        <?= I18N::translate('edit') ?>
26dd6b2bfcSGreg Roach    </button>
2704fe0783SGreg Roach
28dd6b2bfcSGreg Roach    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
29203146cfSGreg Roach        <a class="dropdown-item" href="<?= e(route(AddName::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
3004fe0783SGreg Roach            <?= view('icons/add') ?>
31dd6b2bfcSGreg Roach            <?= I18N::translate('Add a name') ?>
32dd6b2bfcSGreg Roach        </a>
33dd6b2bfcSGreg Roach
34203146cfSGreg Roach        <?php if ($record->facts(['NAME'], false, null, true)->count() > 1) : ?>
35203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderNamesPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
3604fe0783SGreg Roach                <?= view('icons/reorder') ?>
37dd6b2bfcSGreg Roach                <?= I18N::translate('Re-order names') ?>
38dd6b2bfcSGreg Roach            </a>
398e64ca84SGreg Roach        <?php else : ?>
408e64ca84SGreg Roach            <div class="dropdown-item disabled">
418e64ca84SGreg Roach                <?= view('icons/spacer') ?>
428e64ca84SGreg Roach                <?= I18N::translate('Re-order names') ?>
438e64ca84SGreg Roach            </div>
44dd6b2bfcSGreg Roach        <?php endif ?>
45dd6b2bfcSGreg Roach
4604fe0783SGreg Roach        <div class="dropdown-divider"></div>
4704fe0783SGreg Roach
48203146cfSGreg Roach        <?php if ($record->facts(['SEX'], false, null, true)->isEmpty()) : ?>
49203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['fact' => 'SEX', 'tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
5004fe0783SGreg Roach                <?= view('icons/edit') ?>
51dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the gender') ?>
52dd6b2bfcSGreg Roach            </a>
538e64ca84SGreg Roach        <?php endif ?>
548e64ca84SGreg Roach
55203146cfSGreg Roach        <?php foreach ($record->facts(['SEX'], false, null, true) as $fact) : ?>
568e64ca84SGreg Roach            <?php if ($fact->canEdit()) : ?>
57203146cfSGreg Roach                <a class="dropdown-item" href="<?= e(route(EditFactPage::class, ['xref' => $record->xref(), 'fact_id' => $fact->id(), 'tree' => $record->tree()->name()])) ?>">
588e64ca84SGreg Roach                    <?= view('icons/edit') ?>
598e64ca84SGreg Roach                    <?= I18N::translate('Edit the gender') ?>
608e64ca84SGreg Roach                </a>
618e64ca84SGreg Roach            <?php endif ?>
628e64ca84SGreg Roach        <?php endforeach ?>
6304fe0783SGreg Roach
6404fe0783SGreg Roach        <div class="dropdown-divider"></div>
658e64ca84SGreg Roach
66203146cfSGreg Roach        <?php if ($record->spouseFamilies()->count() > 1 || $record->childFamilies()->count() > 1) : ?>
67203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderFamiliesPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
6883615acfSGreg Roach                <?= view('icons/reorder') ?>
6983615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
7083615acfSGreg Roach            </a>
7183615acfSGreg Roach        <?php else : ?>
7283615acfSGreg Roach            <div class="dropdown-item disabled">
7383615acfSGreg Roach                <?= view('icons/spacer') ?>
7483615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
7583615acfSGreg Roach            </div>
7683615acfSGreg Roach        <?php endif ?>
7783615acfSGreg Roach
7883615acfSGreg Roach        <div class="dropdown-divider"></div>
7983615acfSGreg Roach
80203146cfSGreg Roach        <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE'])) ?>">
818e64ca84SGreg Roach            <?= view('icons/add') ?>
828e64ca84SGreg Roach            <?= I18N::translate('Add a media object') ?>
838e64ca84SGreg Roach        </a>
848e64ca84SGreg Roach
85203146cfSGreg Roach        <?php if ($record->facts(['OBJE'], false, null, true)->count() > 1) : ?>
86203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderMediaPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
87a6c1d617SGreg Roach                <?= view('icons/reorder') ?>
888e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
898e64ca84SGreg Roach            </a>
908e64ca84SGreg Roach        <?php else : ?>
918e64ca84SGreg Roach            <div class="dropdown-item disabled">
928e64ca84SGreg Roach                <?= view('icons/spacer') ?>
938e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
948e64ca84SGreg Roach            </div>
95dd6b2bfcSGreg Roach        <?php endif ?>
96dd6b2bfcSGreg Roach
978e64ca84SGreg Roach        <div class="dropdown-divider"></div>
988e64ca84SGreg Roach
99203146cfSGreg Roach        <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()])) ?>">
10004fe0783SGreg Roach            <?= view('icons/delete') ?>
101dd6b2bfcSGreg Roach            <?= I18N::translate('Delete') ?>
102dd6b2bfcSGreg Roach        </a>
103dd6b2bfcSGreg Roach
104203146cfSGreg Roach        <?php if (Auth::isAdmin() || $record->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
105203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(EditRawRecordPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
10604fe0783SGreg Roach                <?= view('icons/edit') ?>
107dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the raw GEDCOM') ?>
108dd6b2bfcSGreg Roach            </a>
109dd6b2bfcSGreg Roach        <?php endif ?>
110dd6b2bfcSGreg Roach    </div>
111dd6b2bfcSGreg Roach</div>
112