本文整理汇总了PHP中Fisharebest\Webtrees\Functions\FunctionsEdit::addNewSex方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionsEdit::addNewSex方法的具体用法?PHP FunctionsEdit::addNewSex怎么用?PHP FunctionsEdit::addNewSex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Functions\FunctionsEdit
的用法示例。
在下文中一共展示了FunctionsEdit::addNewSex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
$text = Filter::postArray('text');
$islink = Filter::postArray('islink', '[01]');
$family = Family::getInstance($xref, $WT_TREE);
check_record_access($family);
if (!Filter::checkCsrf()) {
$famtag = Filter::get('famtag', 'HUSB|WIFE');
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME . '?action=add_spouse_to_family&xref=' . $xref . '&famtag=' . $famtag);
return;
}
$controller->pageHeader();
// Create the new spouse
FunctionsEdit::splitSource();
// separate SOUR record from the rest
$gedrec = '0 @REF@ INDI';
$gedrec .= FunctionsEdit::addNewName();
$gedrec .= FunctionsEdit::addNewSex();
if (preg_match_all('/([A-Z0-9_]+)/', $WT_TREE->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
foreach ($matches[1] as $match) {
$gedrec .= FunctionsEdit::addNewFact($match);
}
}
if (Filter::postBool('SOUR_INDI')) {
$gedrec = FunctionsEdit::handleUpdates($gedrec);
} else {
$gedrec = FunctionsEdit::updateRest($gedrec);
}
$gedrec .= "\n1 FAMS @" . $family->getXref() . '@';
$spouse = $family->getTree()->createRecord($gedrec);
// Update the existing family - add marriage, etc
if ($family->getFirstFact('HUSB')) {
$family->createFact('1 WIFE @' . $spouse->getXref() . '@', true);