Exemple #1
0
 /**
  * Draw a person name preceded by sex icon, with parents as tooltip
  *
  * @param Individual $individual an individual
  * @param string        $dashed     if = 'dashed' print dashed top border to separate multiple spuses
  *
  * @return string
  */
 private function drawPersonName(Individual $individual, $dashed = '')
 {
     if ($this->all_partners === 'true') {
         $family = $individual->getPrimaryChildFamily();
         if ($family) {
             $family_name = strip_tags($family->getFullName());
         } else {
             $family_name = I18N::translateContext('unknown family', 'unknown');
         }
         switch ($individual->getSex()) {
             case 'M':
                 $title = ' title="' . I18N::translate('Son of %s', $family_name) . '"';
                 break;
             case 'F':
                 $title = ' title="' . I18N::translate('Daughter of %s', $family_name) . '"';
                 break;
             default:
                 $title = ' title="' . I18N::translate('Child of %s', $family_name) . '"';
                 break;
         }
     } else {
         $title = '';
     }
     $sex = $individual->getSex();
     return '<div class="tv' . $sex . ' ' . $dashed . '"' . $title . '><a href="' . $individual->getHtmlUrl() . '"></a>' . $individual->getFullName() . ' <span class="dates">' . $individual->getLifeSpan() . '</span></div>';
 }
Exemple #2
0
 /**
  * Display an individual in a box - for charts, etc.
  *
  * @param Individual $individual
  *
  * @return string
  */
 public function individualBoxSmall(Individual $individual)
 {
     $personBoxClass = array_search($individual->getSex(), array('person_box' => 'M', 'person_boxF' => 'F', 'person_boxNN' => 'U'));
     if ($individual->getTree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) {
         $thumbnail = $individual->displayImage();
     } else {
         $thumbnail = '';
     }
     return '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' iconz box-style0" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px">' . '<div class="compact_view">' . $thumbnail . '<a href="' . $individual->getHtmlUrl() . '">' . '<span class="namedef name0">' . $individual->getFullName() . '</span>' . '</a>' . '<div class="inout2 details0">' . $individual->getLifeSpan() . '</div>' . '</div>' . '<div class="inout"></div>' . '</div>';
 }
 /**
  * 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;
 }