'; return; } $module_service = app(ModuleService::class); $menus = $module_service->findByComponent(ModuleChartInterface::class, $individual->tree(), Auth::user())->map(static function (ModuleChartInterface $module) use ($individual): ?Menu { return $module->chartBoxMenu($individual); })->filter(); foreach ($individual->spouseFamilies() as $family) { $menus->push(new Menu('' . I18N::translate('Family with spouse') . '', $family->url())); $spouse = $family->spouse($individual); if ($spouse && $spouse->canShow()) { $menus->push(new Menu($spouse->fullName(), $spouse->url())); } foreach ($family->children() as $child) { if ($child->canShow()) { $menus->push(new Menu($child->fullName(), $child->url())); } } } // Do not show these facts in the expanded chart boxes. $exclude = [ 'FAM:CHAN', 'FAM:CHIL', 'FAM:HUSB', 'FAM:NOTE', 'FAM:OBJE', 'FAM:RESN', 'FAM:SOUR', 'FAM:WIFE', 'INDI:ADDR', 'INDI:ALIA', 'INDI:ASSO', 'INDI:CHAN', 'INDI:EMAIL', 'INDI:FAMC', 'INDI:FAMS', 'INDI:NAME', 'INDI:NOTE', 'INDI:OBJE', 'INDI:PHON', 'INDI:RESI', 'INDI:RESN', 'INDI:SEX', 'INDI:SOUR', 'INDI:SSN', 'INDI:SUBM', 'INDI:TITL', 'INDI:URL', 'INDI:WWW', 'INDI:_EMAIL', 'INDI:_TODO', 'INDI:_UID', ]; /** @var Collection|Fact[] $all_facts */ $all_facts = $individual->facts(); foreach ($individual->spouseFamilies() as $family) { foreach ($family->facts() as $fact) { $all_facts->push($fact); } } $all_facts = $all_facts->filter(static function (Fact $fact) use ($exclude): bool { return !in_array($fact->tag(), $exclude, true); }); $all_facts = Fact::sortFacts($all_facts); $id = Uuid::uuid4()->toString(); ?>