当前位置: 首页>>代码示例>>PHP>>正文


PHP Functions::getRelationshipNameFromPath方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions::getRelationshipNameFromPath方法的具体用法?PHP Functions::getRelationshipNameFromPath怎么用?PHP Functions::getRelationshipNameFromPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Functions\Functions的用法示例。


在下文中一共展示了Functions::getRelationshipNameFromPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkRelationship

 /**
  * check (blood) relationship between partners
  * 
  * @param type $person
  * @param type $spouse
  * @return string (relationship name)
  */
 private function checkRelationship($person, $spouse)
 {
     $controller = new RelationshipController();
     $paths = $controller->calculateRelationships($person, $spouse, 1);
     foreach ($paths as $path) {
         $relationships = $controller->oldStyleRelationshipPath($path);
         if (empty($relationships)) {
             // Cannot see one of the families/individuals, due to privacy;
             continue;
         }
         foreach (array_keys($path) as $n) {
             if ($n % 2 === 1) {
                 switch ($relationships[$n]) {
                     case 'sis':
                     case 'bro':
                     case 'sib':
                         return Functions::getRelationshipNameFromPath(implode('', $relationships), $person, $spouse);
                 }
             }
         }
     }
 }
开发者ID:bxbroze,项目名称:webtrees,代码行数:29,代码来源:FancyTreeviewClass.php

示例2: htmlAncestorDispersionG3

 /**
  * Returns HTML code for a graph showing the dispersion of ancestors across grand-parents
  * @return string HTML code
  */
 private function htmlAncestorDispersionG3()
 {
     $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3);
     $size = '700x300';
     $color_motmot = 'ffd1dc';
     $color_motfat = 'b998a0';
     $color_fatfat = '577292';
     $color_fatmot = '84beff';
     $color_shared = '777777';
     $total_fatfat = array_key_exists(1, $ancestorsDispGen2) ? $ancestorsDispGen2[1] : 0;
     $total_fatmot = array_key_exists(2, $ancestorsDispGen2) ? $ancestorsDispGen2[2] : 0;
     $total_motfat = array_key_exists(4, $ancestorsDispGen2) ? $ancestorsDispGen2[4] : 0;
     $total_motmot = array_key_exists(8, $ancestorsDispGen2) ? $ancestorsDispGen2[8] : 0;
     $total_sha = array_key_exists(-1, $ancestorsDispGen2) ? $ancestorsDispGen2[-1] : 0;
     $total = $total_fatfat + $total_fatmot + $total_motfat + $total_motmot + $total_sha;
     $chd = $this->arrayToExtendedEncoding(array(4095 * Functions::safeDivision($total_fatfat, $total), 4095 * Functions::safeDivision($total_fatmot, $total), 4095 * Functions::safeDivision($total_sha, $total), 4095 * Functions::safeDivision($total_motfat, $total), 4095 * Functions::safeDivision($total_motmot, $total)));
     $chart_title = I18N::translate('Known Sosa ancestors\' dispersion - G3');
     $chl = \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1) . '|' . \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1) . '|' . I18N::translate('Shared') . ' - ' . I18N::percentage(Functions::safeDivision($total_sha, $total), 1) . '|' . \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_motfat, $total), 1) . '|' . \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_motmot, $total), 1);
     return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:24,代码来源:SosaStatsController.php

示例3: getSosaName

 /**
  * builds and returns sosa relationship name in the active language
  *
  * @param string $sosa sosa number
  *
  * @return string
  */
 public static function getSosaName($sosa)
 {
     $path = '';
     while ($sosa > 1) {
         if ($sosa % 2 == 1) {
             $sosa -= 1;
             $path = 'mot' . $path;
         } else {
             $path = 'fat' . $path;
         }
         $sosa /= 2;
     }
     return Functions::getRelationshipNameFromPath($path, null, null);
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:21,代码来源:FunctionsCharts.php

示例4: max

                 if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) {
                     $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px; text-align: start;">' . $down_arrow . '</div></div>';
                     $x += 2;
                 } else {
                     $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme()->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . $down_arrow . '</div></div>';
                 }
                 $y -= 2;
                 break;
             case 'fat':
             case 'mot':
             case 'par':
                 if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) {
                     $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px; text-align: end;">' . $up_arrow . '</div></div>';
                     $x += 2;
                 } else {
                     $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme()->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . $up_arrow . '</div></div>';
                 }
                 $y += 2;
                 break;
         }
         $max_x = max($max_x, $x);
         $min_y = min($min_y, $y);
         $max_y = max($max_y, $y);
     } else {
         $individual = Individual::getInstance($xref, $WT_TREE);
         ob_start();
         FunctionsPrint::printPedigreePerson($individual, $show_full);
         $table[$x][$y] = ob_get_clean();
     }
 }
 echo '<table style="border-collapse: collapse; margin: 20px 50px;">';
开发者ID:josefpavlik,项目名称:webtrees,代码行数:31,代码来源:relationship.php

示例5: renderContent


//.........这里部分代码省略.........
                ?>
</th>
        						<th><?php 
                echo GedcomTag::getLabel('INDI');
                ?>
</th>
        						<th><?php 
                echo GedcomTag::getLabel('GIVN');
                ?>
</th>
        						<th><?php 
                echo GedcomTag::getLabel('SURN');
                ?>
</th>
        						<th>GIVN</th>
        						<th>SURN</th>
        						<?php 
                if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                    ?>
        						<th><i class="icon-source" title="<?php 
                    echo I18N::translate('Sourced individual');
                    ?>
" border="0"></i></th>
        						<th>SORT_BIRTSC</th>
        						<?php 
                } else {
                    ?>
        						<th></th>
        						<th></th>
        						<?php 
                }
                ?>
        						<th><?php 
                echo Functions::getRelationshipNameFromPath('fat');
                ?>
</th>
								<th><?php 
                echo Functions::getRelationshipNameFromPath('mot');
                ?>
</th>        						
        						<th><?php 
                echo GedcomTag::getLabel('BIRT');
                ?>
</th>
        						<th>SORT_BIRT</th>
        						<th><?php 
                echo GedcomTag::getLabel('PLAC');
                ?>
</th>
        						<?php 
                if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                    ?>
        						<th><i class="icon-source" title="<?php 
                    echo I18N::translate('Sourced birth');
                    ?>
" border="0"></i></th>
        						<th>SORT_BIRTSC</th>
        						<?php 
                } else {
                    ?>
        						<th></th>
        						<th></th>
        						<?php 
                }
                ?>
        						<th>SEX</th>
开发者ID:jon48,项目名称:webtrees-lib,代码行数:67,代码来源:SosaListMissingView.php


注:本文中的Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。