當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Individual::getLifeSpan方法代碼示例

本文整理匯總了PHP中Fisharebest\Webtrees\Individual::getLifeSpan方法的典型用法代碼示例。如果您正苦於以下問題:PHP Individual::getLifeSpan方法的具體用法?PHP Individual::getLifeSpan怎麽用?PHP Individual::getLifeSpan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Fisharebest\Webtrees\Individual的用法示例。


在下文中一共展示了Individual::getLifeSpan方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: drawPersonName

 /**
  * 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>';
 }
開發者ID:tunandras,項目名稱:webtrees,代碼行數:34,代碼來源:TreeView.php

示例2: individualBoxSmall

 /**
  * 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>';
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:17,代碼來源:AbstractTheme.php

示例3: getPersonLi

 /**
  * Format an individual in a list.
  *
  * @param Individual $person
  * @param int        $generations
  *
  * @return string
  */
 public function getPersonLi(Individual $person, $generations = 0)
 {
     $icon = $generations > 0 ? 'icon-minus' : 'icon-plus';
     $lifespan = $person->canShow() ? '(' . $person->getLifeSpan() . ')' : '';
     $spouses = $generations > 0 ? $this->loadSpouses($person, 0) : '';
     return '<li class="sb_desc_indi_li">' . '<a class="sb_desc_indi" href="module.php?mod=' . $this->getName() . '&amp;mod_action=descendants&amp;xref=' . $person->getXref() . '">' . '<i class="plusminus ' . $icon . '"></i>' . $person->getSexImage() . $person->getFullName() . $lifespan . '</a>' . '<a class="icon-button_indi" href="' . $person->getHtmlUrl() . '"></a>' . '<div>' . $spouses . '</div>' . '</li>';
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:15,代碼來源:DescendancyModule.php


注:本文中的Fisharebest\Webtrees\Individual::getLifeSpan方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。