コード例 #1
0
ファイル: class_treeview.php プロジェクト: brambravo/webtrees
 /**
  * Draw a person name preceded by sex icon, with parents as tooltip
  *
  * @param WT_Individual $individual an individual
  * @param string        $dashed     if = 'dashed' print dashed top border to separate multiple spuses
  *
  * @return string
  */
 private function drawPersonName(WT_Individual $individual, $dashed = '')
 {
     if ($this->all_partners === 'true') {
         $family = $individual->getPrimaryChildFamily();
         if ($family) {
             switch ($individual->getSex()) {
                 case 'M':
                     $title = ' title="' . strip_tags(WT_I18N::translate('Son of %s', $family->getFullName())) . '"';
                     break;
                 case 'F':
                     $title = ' title="' . strip_tags(WT_I18N::translate('Daughter of %s', $family->getFullName())) . '"';
                     break;
                 case 'U':
                     $title = ' title="' . strip_tags(WT_I18N::translate('Child of %s', $family->getFullName())) . '"';
                     break;
             }
         } else {
             $title = '';
         }
     } 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>';
 }
コード例 #2
0
ファイル: module.php プロジェクト: brambravo/webtrees
    public function getFamilyLi(WT_Family $family, WT_Individual $person, $generations = 0)
    {
        $marryear = $family->getMarriageYear();
        $marr = $marryear ? '<i class="icon-rings"></i>' . $marryear : '';
        $fam = '<a href="' . $family->getHtmlUrl() . '" class="icon-button_family"></a>';
        $kids = $this->loadChildren($family, $generations);
        return sprintf('<li class="sb_desc_indi_li">
		                  <a class="sb_desc_indi" href="#"><i class="plusminus icon-minus"></i>%s %s %s</a>
		                  <a class="icon-button_indi" href="%s"></a>
		                  %s
		                  <div>%s</div>
		                </li>', $person->getSexImage(), $person->getFullName(), $marr, $person->getHtmlUrl(), $fam, $kids);
    }