/** * Return HTML Code to display individual in non structured list (e.g. Patronymic Lineages) * * @param \Fisharebest\Webtrees\Individual $individual Individual to print * @param bool $isStrong Bolden the name ? * @return string HTML Code for individual item */ public static function htmlIndividualForList(\Fisharebest\Webtrees\Individual $individual, $isStrong = true) { $html = ''; $tag = 'em'; if ($isStrong) { $tag = 'strong'; } if ($individual && $individual->canShow()) { $dindi = new Individual($individual); $html = $individual->getSexImage(); $html .= '<a class="list_item" href="' . $individual->getHtmlUrl() . '" title="' . I18N::translate('Informations for individual %s', $individual->getXref()) . '">'; $html .= '<' . $tag . '>' . $individual->getFullName() . '</' . $tag . '> (' . $individual->getXref() . ') '; $html .= FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'small'); $html .= ' <span><small><em>' . $dindi->formatFirstMajorFact(WT_EVENTS_BIRT, 10) . '</em></small></span>'; $html .= ' <span><small><em>' . $dindi->formatFirstMajorFact(WT_EVENTS_DEAT, 10) . '</em></small></span>'; $html .= '</a>'; } else { $html .= '<span class=\\"list_item\\"><' . $tag . '>' . I18N::translate('Private') . '</' . $tag . '></span>'; } return $html; }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNameAppend() */ public function hRecordNameAppend(GedcomRecord $grec) { if ($grec instanceof \Fisharebest\Webtrees\Individual) { // Only apply to individuals $dindi = new Individual($grec); return FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'small'); } return ''; }