xref: /webtrees/resources/views/record-page-menu-clipboard.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
10f5fd22fSGreg Roach<?php
20f5fd22fSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
50f5fd22fSGreg Roachuse Fisharebest\Webtrees\Fact;
60f5fd22fSGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
79927f70fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EmptyClipboard;
80f5fd22fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PasteFact;
90f5fd22fSGreg Roachuse Fisharebest\Webtrees\I18N;
100f5fd22fSGreg Roachuse Illuminate\Support\Collection;
110f5fd22fSGreg Roach
120f5fd22fSGreg Roach/**
1336779af1SGreg Roach * @var Collection<int,Fact> $clipboard_facts
140f5fd22fSGreg Roach * @var GedcomRecord         $record
150f5fd22fSGreg Roach */
160f5fd22fSGreg Roach
170f5fd22fSGreg Roach?>
180f5fd22fSGreg Roach
190f5fd22fSGreg Roach<div class="dropdown-header">
200f5fd22fSGreg Roach    <?= I18N::translate('Add from clipboard') ?>
210f5fd22fSGreg Roach</div>
220f5fd22fSGreg Roach
230f5fd22fSGreg Roach<?php foreach ($clipboard_facts as $fact) : ?>
24315eb316SGreg Roach    <form method="post" class="dropdown-item" action="<?= route(PasteFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()]) ?>">
250f5fd22fSGreg Roach        <?= view('icons/copy') ?>
2681443e3cSGreg Roach
270f5fd22fSGreg Roach        <input type="hidden" name="fact_id" value="<?= e($fact->id()) ?>">
2881443e3cSGreg Roach
299927f70fSGreg Roach        <button type="submit" class="btn btn-text p-0 text-truncate" style="max-width: 12rem;" title="<?= strip_tags($fact->name()) ?>">
309927f70fSGreg Roach            <?= $fact->name() ?>
310f5fd22fSGreg Roach        </button>
3281443e3cSGreg Roach
3381443e3cSGreg Roach        <?= csrf_field() ?>
340f5fd22fSGreg Roach    </form>
350f5fd22fSGreg Roach<?php endforeach ?>
369927f70fSGreg Roach
37315eb316SGreg Roach<form method="post" class="dropdown-item" action="<?= route(EmptyClipboard::class) ?>">
389927f70fSGreg Roach    <input type="hidden" value="<?= e($record->url()) ?>">
3981443e3cSGreg Roach
409927f70fSGreg Roach    <?= view('icons/delete') ?>
4181443e3cSGreg Roach
429927f70fSGreg Roach    <button type="submit" class="btn btn-text p-0">
439927f70fSGreg Roach        <?= I18N::translate('Empty the clipboard') ?>
449927f70fSGreg Roach    </button>
4581443e3cSGreg Roach
4681443e3cSGreg Roach    <?= csrf_field() ?>
479927f70fSGreg Roach</form>
48