예제 #1
0
 /**
  * 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
0
if ($person1 && $person2) {
    if (I18N::direction() === 'ltr') {
        $horizontal_arrow = '<br><i class="icon-rarrow"></i>';
        $diagonal1 = Theme::theme()->parameter('image-dline');
        $diagonal2 = Theme::theme()->parameter('image-dline2');
    } else {
        $horizontal_arrow = '<br><i class="icon-larrow"></i>';
        $diagonal1 = Theme::theme()->parameter('image-dline2');
        $diagonal2 = Theme::theme()->parameter('image-dline');
    }
    $up_arrow = ' <i class="icon-uarrow"></i>';
    $down_arrow = ' <i class="icon-darrow"></i>';
    $num_paths = 0;
    foreach ($paths as $path) {
        // Extract the relationship names between pairs of individuals
        $relationships = $controller->oldStyleRelationshipPath($path);
        if (empty($relationships)) {
            // Cannot see one of the families/individuals, due to privacy;
            continue;
        }
        echo '<h3>', I18N::translate('Relationship: %s', Functions::getRelationshipNameFromPath(implode('', $relationships), $person1, $person2)), '</h3>';
        $num_paths++;
        // Use a table/grid for layout.
        $table = array();
        // Current position in the grid.
        $x = 0;
        $y = 0;
        // Extent of the grid.
        $min_y = 0;
        $max_y = 0;
        $max_x = 0;