'; return; } $module_service = app(ModuleService::class); $menus = $module_service->findByComponent('chart', $individual->tree(), Auth::user())->map(function (ModuleChartInterface $module) use ($individual): ?Menu { return $module->chartBoxMenu($individual); })->filter(); foreach ($individual->getSpouseFamilies() as $family) { $menus[] = new Menu('' . I18N::translate('Family with spouse') . '', $family->url()); $spouse = $family->getSpouse($individual); if ($spouse && $spouse->canShow()) { $menus->push(new Menu($spouse->getFullName(), $spouse->url())); } foreach ($family->getChildren() as $child) { if ($child->canShow()) { $menus->push(new Menu($child->getFullName(), $child->url())); } } } // Do not show these facts in the expanded chart boxes. $exclude = [ 'ADDR', 'ALIA', 'ASSO', 'CHAN', 'CHIL', 'EMAIL', 'FAMC', 'FAMS', 'HUSB', 'NAME', 'NOTE', 'OBJE', 'PHON', 'RESI', 'RESN', 'SEX', 'SOUR', 'SSN', 'SUBM', 'TITL', 'URL', 'WIFE', 'WWW', '_EMAIL', '_TODO', '_UID', '_WT_OBJE_SORT', ]; /** @var Fact[] $all_facts */ $all_facts = $individual->facts(); foreach ($individual->getSpouseFamilies() as $family) { foreach ($family->facts() as $fact) { $all_facts[] = $fact; } } Functions::sortFacts($all_facts); $all_facts = array_filter($all_facts, function (Fact $fact) use ($exclude): bool { return !in_array($fact->getTag(), $exclude); }); $id = Uuid::uuid4()->toString(); /** * @var Individual $individual */ ?>
canShow() && $individual->tree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) : ?>
displayImage(40, 50, 'crop', ['class' => 'wt-chart-box-thumbnail']) ?>
getFullName() ?>
getAddName() ?>
getLifeSpan() ?>
tree()->getPreference('CHART_BOX_TAGS'), 0, PREG_SPLIT_NO_EMPTY); // Show BIRT or equivalent event foreach (Gedcom::BIRTH_EVENTS as $birttag) { if (!in_array($birttag, $opt_tags)) { $event = $individual->getFirstFact($birttag); if ($event instanceof Fact) { echo $event->summary(); break; } } } // Show optional events (before death) foreach ($opt_tags as $key => $tag) { if (!in_array($tag, Gedcom::DEATH_EVENTS)) { $event = $individual->getFirstFact($tag); if ($event instanceof Fact) { echo $event->summary(); unset($opt_tags[$key]); } } } // Show DEAT or equivalent event foreach (Gedcom::DEATH_EVENTS as $deattag) { $event = $individual->getFirstFact($deattag); if ($event instanceof Fact) { echo $event->summary(); if (in_array($deattag, $opt_tags)) { unset($opt_tags[array_search($deattag, $opt_tags)]); } break; } } // Show remaining optional events (after death) foreach ($opt_tags as $tag) { $event = $individual->getFirstFact($tag); if ($event instanceof Fact) { echo $event->summary(); } } ?>