![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/webtrees/resources/views/modules/sources_tab/ |
Upload File : |
<?php declare(strict_types=1); use Fisharebest\Webtrees\Fact; use Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; use Illuminate\Support\Collection; /** * @var bool $can_edit * @var Collection<int,Fact> $clipboard_facts * @var Collection<int,Fact> $facts * @var Individual $individual */ ?> <div class="wt-tab-sources"> <table class="table wt-facts-table"> <tr> <td colspan="2"> <label> <input id="show-level-2-sources" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-level-two-source" data-wt-persist="level-two-sources" autocomplete="off"> <?= I18N::translate('Show all sources') ?> </label> </td> </tr> <?php foreach ($facts as $fact) : ?> <?php if (str_ends_with($fact->tag(), ':SOUR')) : ?> <?= view('fact', ['fact' => $fact, 'record' => $individual]) ?> <?php else : ?> <?php if ($fact->isPendingAddition()) { $styleadd = 'wt-new '; } elseif ($fact->isPendingDeletion()) { $styleadd = 'wt-old '; } else { $styleadd = ''; } ?> <tr class="wt-level-two-source collapse"> <th scope="row" class="rela <?= $styleadd ?>"> <?= $fact->label() ?> <?= view('fact-edit-links', ['fact' => $fact, 'url' => $fact->record()->url() . '#tab-sources']) ?> </th> <td class="<?= $styleadd ?>"> <?php if (preg_match_all('/\n(2 SOUR\b.*(?:\n[^2].*)*)/', $fact->gedcom(), $matches, PREG_SET_ORDER) > 0) : ?> <?php foreach ($matches as $match) : ?> <?= view('fact-gedcom-fields', ['gedcom' => $match[1], 'parent' => $fact->tag(), 'tree' => $fact->record()->tree()]) ?> <?php endforeach ?> <?php endif ?> </td> </tr> <?php endif ?> <?php endforeach ?> <?php if ($facts->isEmpty()) : ?> <tr> <td colspan="2"> <?= I18N::translate('There are no source citations for this individual.') ?> </td> </tr> <?php endif ?> <?php if ($can_edit) : ?> <tr> <th scope="row"> <?= I18N::translate('Source') ?> </th> <td> <a href="<?= e(route(AddNewFact::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'SOUR'])) ?>"> <?= I18N::translate('Add a source citation') ?> </a> </td> </tr> <?php endif ?> </table> </div>