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


PHP Family::getSpouses方法代码示例

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


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

示例1: print_navigator_family

/**
 * Display family members with clickable links
 *
 * @param Family     $family
 * @param Individual $individual
 */
function print_navigator_family(Family $family, Individual $individual)
{
    foreach ($family->getSpouses() as $spouse) {
        ?>
		<tr class="fact_value">
			<td class="facts_value">
				<a href="edit_interface.php?action=addmedia_links&amp;noteid=newnote&amp;pid=<?php 
        echo $spouse->getXref();
        ?>
&amp;gedcom=<?php 
        echo $spouse->getTree()->getNameUrl();
        ?>
">
					<i class="headimg vmiddle icon-button_head"></i>
				</a>
			</td>
			<td class="facts_value" >
				<a href="#" onclick="opener.insertRowToTable('<?php 
        echo $spouse->getXref();
        ?>
', '<?php 
        echo Filter::escapeJs($spouse->getFullName());
        ?>
', '', '', '', '', '', '', '', '');">
					<?php 
        echo $spouse === $individual ? '<b>' : '';
        ?>
					<?php 
        echo $spouse->getFullName();
        ?>
 <?php 
        echo $spouse->getLifeSpan();
        ?>
					<?php 
        echo $spouse === $individual ? '</b>' : '';
        ?>
				</a>
			</td>
		<tr>
	<?php 
    }
    foreach ($family->getChildren() as $child) {
        ?>
		<tr>
			<td class="facts_value" >
				<a href="edit_interface.php?action=addmedia_links&amp;noteid=newnote&amp;pid=<?php 
        echo $child->getXref();
        ?>
&amp;gedcom=<?php 
        echo $child->getTree()->getNameUrl();
        ?>
">
					<i class="headimg vmiddle icon-button_head"></i>
				</a>
			</td>
			<td class="facts_value">
				<a href="#" onclick="opener.insertRowToTable('<?php 
        echo $child->getXref();
        ?>
', '<?php 
        echo Filter::escapeJs($child->getFullName());
        ?>
', '', '', '', '', '', '', '', '');">
					<?php 
        echo $child === $individual ? '<b>' : '';
        ?>
					<?php 
        echo $child->getFullName();
        ?>
 <?php 
        echo $child->getLifeSpan();
        ?>
				<?php 
        echo $child === $individual ? '</b>' : '';
        ?>
				</a>
			</td>
		</tr>
	<?php 
    }
}
开发者ID:jflash,项目名称:webtrees,代码行数:87,代码来源:MEDIA_ctrl.php

示例2: getStepFamilyLabel

 /**
  * Create a label for a step family
  *
  * @param Family $step_family
  *
  * @return string
  */
 public function getStepFamilyLabel(Family $step_family)
 {
     foreach ($this->getChildFamilies() as $family) {
         if ($family !== $step_family) {
             // Must be a step-family
             foreach ($family->getSpouses() as $parent) {
                 foreach ($step_family->getSpouses() as $step_parent) {
                     if ($parent === $step_parent) {
                         // One common parent - must be a step family
                         if ($parent->getSex() == 'M') {
                             // Father’s family with someone else
                             if ($step_family->getSpouse($step_parent)) {
                                 return I18N::translate('Father’s family with %s', $step_family->getSpouse($step_parent)->getFullName());
                             } else {
                                 return I18N::translate('Father’s family with an unknown individual');
                             }
                         } else {
                             // Mother’s family with someone else
                             if ($step_family->getSpouse($step_parent)) {
                                 return I18N::translate('Mother’s family with %s', $step_family->getSpouse($step_parent)->getFullName());
                             } else {
                                 return I18N::translate('Mother’s family with an unknown individual');
                             }
                         }
                     }
                 }
             }
         }
     }
     // Perahps same parents - but a different family record?
     return I18N::translate('Family with parents');
 }
开发者ID:bmhm,项目名称:webtrees,代码行数:39,代码来源:Individual.php

示例3: drawFamily

    /**
     * Format a family.
     *
     * @param Family $family
     * @param string $title
     */
    private function drawFamily(Family $family, $title)
    {
        global $controller;
        ?>
		<tr>
			<td class="center" colspan="2">
				<a class="famnav_title" href="<?php 
        echo $family->getHtmlUrl();
        ?>
">
					<?php 
        echo $title;
        ?>
				</a>
			</td>
		</tr>
		<?php 
        foreach ($family->getSpouses() as $spouse) {
            $menu = new Menu(Functions::getCloseRelationshipName($controller->record, $spouse));
            $menu->addClass('', 'submenu flyout');
            $menu->addSubmenu(new Menu($this->getParents($spouse)));
            ?>
			<tr>
				<td class="facts_label">
					<?php 
            echo $menu->getMenu();
            ?>
				</td>
				<td class="center <?php 
            echo $controller->getPersonStyle($spouse);
            ?>
 nam">
					<a class="famnav_link" href="<?php 
            echo $spouse->getHtmlUrl();
            ?>
">
						<?php 
            echo $spouse->getFullName();
            ?>
					</a>
					<div class="font9">
						<?php 
            echo $spouse->getLifeSpan();
            ?>
					</div>
				</td>
			</tr>
		<?php 
        }
        foreach ($family->getChildren() as $child) {
            $menu = new Menu(Functions::getCloseRelationshipName($controller->record, $child));
            $menu->addClass('', 'submenu flyout');
            $menu->addSubmenu(new Menu($this->getFamily($child)));
            ?>
			<tr>
				<td class="facts_label">
					<?php 
            echo $menu->getMenu();
            ?>
				</td>
				<td class="center <?php 
            echo $controller->getPersonStyle($child);
            ?>
 nam">
					<a class="famnav_link" href="<?php 
            echo $child->getHtmlUrl();
            ?>
">
						<?php 
            echo $child->getFullName();
            ?>
					</a>
					<div class="font9">
						<?php 
            echo $child->getLifeSpan();
            ?>
					</div>
				</td>
			</tr>
		<?php 
        }
    }
开发者ID:tunandras,项目名称:webtrees,代码行数:88,代码来源:FamilyNavigatorModule.php

示例4: censusNavigatorFamily

    /**
     * Create a family on the census navigator.
     *
     * @param CensusInterface $census
     * @param Family          $family
     * @param Individual      $head
     *
     * @return string
     */
    public static function censusNavigatorFamily(CensusInterface $census, Family $family, Individual $head)
    {
        $headImg2 = '<i class="icon-button_head" title="' . I18N::translate('Head of household') . '"></i>';
        foreach ($family->getSpouses() as $spouse) {
            $menu = new Menu(Functions::getCloseRelationshipName($head, $spouse));
            foreach ($spouse->getChildFamilies() as $grandparents) {
                foreach ($grandparents->getSpouses() as $grandparent) {
                    $submenu = new Menu(Functions::getCloseRelationshipName($head, $grandparent) . ' - ' . $grandparent->getFullName(), '#', '', array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $grandparent, $head)) . '");'));
                    $submenu->addClass('submenuitem', '');
                    $menu->addSubmenu($submenu);
                    $menu->addClass('', 'submenu');
                }
            }
            ?>
			<tr>
				<td class="optionbox">
					<?php 
            echo $menu->getMenu();
            ?>
				</td>
				<td class="facts_value nowrap">
					<a href="#" onclick="return appendCensusRow('<?php 
            echo Filter::escapeJs(self::censusTableRow($census, $spouse, $head));
            ?>
');">
						<?php 
            echo $spouse->getFullName();
            ?>
					</a>
				</td>
				<td class="facts_value">
					<?php 
            if ($head !== $spouse) {
                ?>
						<a href="edit_interface.php?action=addnewnote_assisted&amp;noteid=newnote&amp;xref=<?php 
                echo $spouse->getXref();
                ?>
&amp;gedcom=<?php 
                echo $spouse->getTree()->getNameUrl();
                ?>
&amp;census=<?php 
                echo get_class($census);
                ?>
">
							<?php 
                echo $headImg2;
                ?>
						</a>
					<?php 
            }
            ?>
				</td>
			</tr>
			<?php 
        }
        foreach ($family->getChildren() as $child) {
            $menu = new Menu(Functions::getCloseRelationshipName($head, $child));
            foreach ($child->getSpouseFamilies() as $spouse_family) {
                foreach ($spouse_family->getSpouses() as $spouse_family_spouse) {
                    if ($spouse_family_spouse != $child) {
                        $submenu = new Menu(Functions::getCloseRelationshipName($head, $spouse_family_spouse) . ' - ' . $spouse_family_spouse->getFullName(), '#', '', array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_spouse, $head)) . '");'));
                        $submenu->addClass('submenuitem', '');
                        $menu->addSubmenu($submenu);
                        $menu->addClass('', 'submenu');
                    }
                }
                foreach ($spouse_family->getChildren() as $spouse_family_child) {
                    $submenu = new Menu(Functions::getCloseRelationshipName($head, $spouse_family_child) . ' - ' . $spouse_family_child->getFullName(), '#', '', array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_child, $head)) . '");'));
                    $submenu->addClass('submenuitem', '');
                    $menu->addSubmenu($submenu);
                    $menu->addClass('', 'submenu');
                }
            }
            ?>
			<tr>
				<td class="optionbox">
					<?php 
            echo $menu->getMenu();
            ?>
				</td>
				<td class="facts_value">
					<a href="#" onclick="return appendCensusRow('<?php 
            echo Filter::escapeJs(self::censusTableRow($census, $child, $head));
            ?>
');">
						<?php 
            echo $child->getFullName();
            ?>
					</a>
				</td>
				<td class="facts_value">
//.........这里部分代码省略.........
开发者ID:tronsmit,项目名称:webtrees,代码行数:101,代码来源:CensusAssistantModule.php

示例5: addFamilyDescendancy

 /**
  * Recursive function to traverse the tree
  *
  * @param Family|null $family
  * @param int         $level
  */
 public function addFamilyDescendancy(Family $family = null, $level = PHP_INT_MAX)
 {
     if (!$family) {
         return;
     }
     foreach ($family->getSpouses() as $spouse) {
         $this->addClipping($spouse);
     }
     foreach ($family->getChildren() as $child) {
         $this->addClipping($child);
         foreach ($child->getSpouseFamilies() as $child_family) {
             $this->addClipping($child_family);
             if ($level > 0) {
                 $this->addFamilyDescendancy($child_family, $level - 1);
                 // recurse on the childs family
             }
         }
     }
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:25,代码来源:ClippingsCartController.php


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