Example #1
0
 /**
  * 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 . '>&nbsp;(' . $individual->getXref() . ')&nbsp;';
         $html .= FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'small');
         $html .= '&nbsp;<span><small><em>' . $dindi->formatFirstMajorFact(WT_EVENTS_BIRT, 10) . '</em></small></span>';
         $html .= '&nbsp;<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;
 }
Example #2
0
 /**
  * {@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 '';
 }