diff options
| -rw-r--r-- | app/Functions/Functions.php | 18 | ||||
| -rw-r--r-- | app/Functions/FunctionsPrintFacts.php | 2 | ||||
| -rw-r--r-- | app/Module/FamilyNavigatorModule.php | 6 | ||||
| -rw-r--r-- | app/Module/RelativesTabModule.php | 10 |
4 files changed, 13 insertions, 23 deletions
diff --git a/app/Functions/Functions.php b/app/Functions/Functions.php index bfc3d07236..4b77eaf92d 100644 --- a/app/Functions/Functions.php +++ b/app/Functions/Functions.php @@ -249,24 +249,6 @@ class Functions { */ public static function getCloseRelationshipName(Individual $individual1, Individual $individual2) { if ($individual1 === $individual2) { - $label = '<i class="icon-selected"></i> ' . self::reflexivePronoun($individual1); - } else { - $label = self::getRelationshipName(self::getRelationship($individual1, $individual2)); - } - - return $label; - } - - /** - * For facts on the individual/family pages. - * - * @param Individual $individual1 - * @param Individual $individual2 - * - * @return string - */ - public static function getAssociateRelationshipName(Individual $individual1, Individual $individual2) { - if ($individual1 === $individual2) { $label = self::reflexivePronoun($individual1); } else { $label = self::getRelationshipName(self::getRelationship($individual1, $individual2)); diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index f82258a571..62b30f099c 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -531,7 +531,7 @@ class FunctionsPrintFacts { $values = ['<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>']; foreach ($associates as $associate) { - $relationship_name = Functions::getAssociateRelationshipName($associate, $person); + $relationship_name = Functions::getCloseRelationshipName($associate, $person); if (!$relationship_name) { $relationship_name = GedcomTag::getLabel('RELA'); } diff --git a/app/Module/FamilyNavigatorModule.php b/app/Module/FamilyNavigatorModule.php index 7a1918be44..2f9a0393fe 100644 --- a/app/Module/FamilyNavigatorModule.php +++ b/app/Module/FamilyNavigatorModule.php @@ -123,7 +123,8 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter <tbody> <?php foreach ($family->getSpouses() as $spouse) { - $menu = new Menu(Functions::getCloseRelationshipName($controller->record, $spouse)); + $icon = $controller->record === $spouse ? '<i class="icon-selected"></i>' : ''; + $menu = new Menu($icon . Functions::getCloseRelationshipName($controller->record, $spouse)); $menu->addSubmenu(new Menu($this->getParents($spouse))); ?> <tr class="text-center wt-parent wt-gender-<?= $spouse->getSex() ?>"> @@ -149,7 +150,8 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter } foreach ($family->getChildren() as $child) { - $menu = new Menu(Functions::getCloseRelationshipName($controller->record, $child)); + $icon = $controller->record === $child ? '<i class="icon-selected"></i>' : ''; + $menu = new Menu($icon . Functions::getCloseRelationshipName($controller->record, $child)); $menu->addSubmenu(new Menu($this->getFamily($child))); ?> <tr class="text-center wt-child wt-gender-<?= $child->getSex() ?>"> diff --git a/app/Module/RelativesTabModule.php b/app/Module/RelativesTabModule.php index b32c482f61..b6fbba491a 100644 --- a/app/Module/RelativesTabModule.php +++ b/app/Module/RelativesTabModule.php @@ -137,9 +137,11 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { } elseif ($fact->isPendingDeletion()) { $row_class .= ' old'; } + $icon = $controller->record === $person ? '<i class="icon-selected"></i>' : ''; ?> <tr class="<?= $row_class ?>"> <th scope="row"> + <?= $icon ?> <?= Functions::getCloseRelationshipName($controller->record, $person) ?> </th> <td class="border-0 p-0"> @@ -174,10 +176,12 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { } elseif ($fact->isPendingDeletion()) { $row_class .= ' old'; } - ?> + $icon = $controller->record === $person ? '<i class="icon-selected"></i>' : ''; + ?> <tr class="<?= $row_class ?>"> <th scope="row"> - <?= Functions::getCloseRelationshipName($controller->record, $person) ?> + <?= $icon ?> + <?= Functions::getCloseRelationshipName($controller->record, $person) ?> </th> <td class="border-0 p-0"> <?= Theme::theme()->individualBoxLarge($person) ?> @@ -260,9 +264,11 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { break; } } + $icon = $controller->record === $person ? '<i class="icon-selected"></i>' : ''; ?> <tr class="<?= $row_class ?>"> <th scope="row"> + <?= $icon ?> <?= self::ageDifference($prev, $next, $child_number) ?> <?= Functions::getCloseRelationshipName($controller->record, $person) ?> </th> |
