1b315f3e1SGreg Roach<?php 2b315f3e1SGreg Roach 3b315f3e1SGreg Roachuse Fisharebest\Webtrees\Date; 4b315f3e1SGreg Roachuse Fisharebest\Webtrees\Fact; 5b315f3e1SGreg Roachuse Fisharebest\Webtrees\GedcomRecord; 6b315f3e1SGreg Roachuse Fisharebest\Webtrees\I18N; 7b315f3e1SGreg Roachuse Fisharebest\Webtrees\Module\ModuleMapLinkInterface; 8b315f3e1SGreg Roachuse Fisharebest\Webtrees\Place; 9b315f3e1SGreg Roachuse Fisharebest\Webtrees\Registry; 10b315f3e1SGreg Roachuse Fisharebest\Webtrees\Services\ModuleService; 11b315f3e1SGreg Roach 12b315f3e1SGreg Roach/** 13b315f3e1SGreg Roach * @var bool $cal_link 14b315f3e1SGreg Roach * @var Fact $fact 15b315f3e1SGreg Roach * @var GedcomRecord $record 16b315f3e1SGreg Roach * @var bool $time 17b315f3e1SGreg Roach */ 18b315f3e1SGreg Roach 19b315f3e1SGreg Roach?> 20b315f3e1SGreg Roach<div class="wt-fact-place"> 21b315f3e1SGreg Roach <?php if (preg_match('/\n(2 PLAC.*(?:\n[3-9].*)*)/', $fact->gedcom(), $match) === 1) : ?> 22b315f3e1SGreg Roach <?php $placerec = $match[1]; ?> 23b315f3e1SGreg Roach <?= $fact->place()->fullName($fact->id() !== 'histo') ?> 24b315f3e1SGreg Roach 25*bd29d468SGreg Roach <?php if (preg_match_all('/\n3 (?:_HEB|ROMN|FONE) (.+)/', $placerec, $matches) === 1) : ?> 26b315f3e1SGreg Roach <?php foreach ($matches[1] as $match) : ?> 27b315f3e1SGreg Roach — <?= (new Place($match, $record->tree()))->fullName() ?> 28b315f3e1SGreg Roach <?php endforeach ?> 29b315f3e1SGreg Roach <?php endif ?> 30b315f3e1SGreg Roach 31b315f3e1SGreg Roach <?php if ($fact->latitude() !== null && $fact->longitude() !== null) : ?> 32b315f3e1SGreg Roach <div class="wt-fact-coordinates"> 33b315f3e1SGreg Roach <span class="label"><?= I18N::translate('Latitude') ?>: </span><?= $fact->latitude() ?> 34b315f3e1SGreg Roach <span class="label"><?= I18N::translate('Longitude') ?>: </span><?= $fact->longitude()?> 35b315f3e1SGreg Roach <?= app(ModuleService::class)->findByInterface(ModuleMapLinkInterface::class)->map(fn (ModuleMapLinkInterface $module): string => ' ' . $module->mapLink($fact))->implode('') ?> 36b315f3e1SGreg Roach </div> 37b315f3e1SGreg Roach <?php endif ?> 38b315f3e1SGreg Roach 39b315f3e1SGreg Roach <?php if (preg_match_all('/\n(3 NOTE\b.*(?:\n[^3].*)*)/', $placerec, $matches, PREG_SET_ORDER) > 0) : ?> 40b315f3e1SGreg Roach <?php foreach ($matches as $match) : ?> 41b315f3e1SGreg Roach <?= view('fact-gedcom-fields', ['gedcom' => $match[1], 'parent' => $fact->tag() . ':PLAC:NOTE', 'tree' => $record->tree()]) ?> 42b315f3e1SGreg Roach <?php endforeach ?> 43b315f3e1SGreg Roach <?php endif ?> 44b315f3e1SGreg Roach <?php endif ?> 45b315f3e1SGreg Roach 46b315f3e1SGreg Roach <?php if (preg_match('/2 TEMP (.+)/', $fact->gedcom(), $match)) : ?> 47b315f3e1SGreg Roach <?= Registry::elementFactory()->make($fact->tag() . ':TEMP')->labelValue($match[1], $record->tree()) ?> 48b315f3e1SGreg Roach <?php endif ?> 49b315f3e1SGreg Roach 50b315f3e1SGreg Roach <?php if (preg_match('/2 STAT (.+)/', $fact->gedcom(), $match)) : ?> 51b315f3e1SGreg Roach <?= Registry::elementFactory()->make($fact->tag() . ':STAT')->labelValue($match[1], $record->tree()) ?> 52b315f3e1SGreg Roach 53b315f3e1SGreg Roach <?php if (preg_match('/3 DATE (.+)/', $fact->gedcom(), $match)) : ?> 54b315f3e1SGreg Roach <?= Registry::elementFactory()->make($fact->tag() . ':STAT:DATE')->labelValue((new Date($match[1]))->display(), $record->tree()) ?> 55b315f3e1SGreg Roach <?php endif ?> 56b315f3e1SGreg Roach <?php endif ?> 57b315f3e1SGreg Roach</div> 58