Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 /**
  * Display an individual in a box - for charts, etc.
  *
  * @param Individual $individual
  *
  * @return string
  */
 public function individualBoxLarge(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 = '';
     }
     $content = '<span class="namedef name1">' . $individual->getFullName() . '</span>';
     $icons = '';
     if ($individual->canShow()) {
         $content = '<a href="' . $individual->getHtmlUrl() . '">' . $content . '</a>' . '<div class="namedef name2">' . $individual->getAddName() . '</div>';
         $icons = '<div class="noprint icons">' . '<span class="iconz icon-zoomin" title="' . I18N::translate('Zoom in/out on this box.') . '"></span>' . '<div class="itr"><i class="icon-pedigree"></i><div class="popup">' . '<ul class="' . $personBoxClass . '">' . implode('', $this->individualBoxMenu($individual)) . '</ul>' . '</div>' . '</div>' . '</div>';
     }
     return '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' box-style2">' . $icons . '<div class="chart_textbox" style="max-height:' . $this->parameter('chart-box-y') . 'px;">' . $thumbnail . $content . '<div class="inout2 details2">' . $this->individualBoxFacts($individual) . '</div>' . '</div>' . '<div class="inout"></div>' . '</div>';
 }
Ejemplo n.º 3
0
 /**
  * Display spouses.
  *
  * @param Individual $person
  * @param int        $generations
  *
  * @return string
  */
 public function loadSpouses(Individual $person, $generations)
 {
     $out = '';
     if ($person && $person->canShow()) {
         foreach ($person->getSpouseFamilies() as $family) {
             $out .= $this->getFamilyLi($family, $person, $generations - 1);
         }
     }
     if ($out) {
         return '<ul>' . $out . '</ul>';
     } else {
         return '';
     }
 }