本文整理汇总了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);
}
}
}
}
}
示例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&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
}
示例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);
}
示例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;">';
示例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>