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


PHP GedcomTag::isTag方法代码示例

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


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

示例1: strlen

	</p></form></div>';
}
// Show facts
if ($type == "factINDI" || $type == "factFAM" || $type == "factSOUR" || $type == "factREPO" || $type == "factNAME" || $type == "factPLAC") {
    echo '<div id="find-facts-header">
	<form name="filterfacts" method="get" action="find.php"
	input type="hidden" name="type" value="facts">
	<input type="hidden" name="tags" value="', $qs, '">
	<input type="hidden" name="callback" value="', $callback, '">
	<table class="list_table width100" border="0">
	<tr><td class="list_label" style="padding: 5px; font-weight: normal; white-space: normal;">';
    $all = strlen($qs) ? explode(',', strtoupper($qs)) : array();
    $preselDefault = array();
    $preselCustom = array();
    foreach ($all as $one) {
        if (GedcomTag::isTag($one)) {
            $preselDefault[] = $one;
        } else {
            $preselCustom[] = $one;
        }
    }
    echo '<script>';
    ?>
	// A class representing a default tag
	function DefaultTag(id, name, selected) {
		this.Id=id;
		this.Name=name;
		this.LowerName=name.toLowerCase();
		this._counter=DefaultTag.prototype._newCounter++;
		this.selected=!!selected;
	}
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:31,代码来源:find.php

示例2: printFact

    /**
     * Print a fact record, for the individual/family/source/repository/etc. pages.
     *
     * Although a Fact has a parent object, we also need to know
     * the GedcomRecord for which we are printing it.  For example,
     * we can show the death of X on the page of Y, or the marriage
     * of X+Y on the page of Z.  We need to know both records to
     * calculate ages, relationships, etc.
     *
     * @param Fact $fact
     * @param GedcomRecord $record
     */
    public static function printFact(Fact $fact, GedcomRecord $record)
    {
        static $n_chil = 0, $n_gchi = 0;
        $parent = $fact->getParent();
        // Some facts don't get printed here ...
        switch ($fact->getTag()) {
            case 'NOTE':
                self::printMainNotes($fact, 1);
                return;
            case 'SOUR':
                self::printMainSources($fact, 1);
                return;
            case 'OBJE':
                self::printMainMedia($fact, 1);
                return;
            case 'FAMC':
            case 'FAMS':
            case 'CHIL':
            case 'HUSB':
            case 'WIFE':
                // These are internal links, not facts
                return;
            case '_WT_OBJE_SORT':
                // These links are used internally to record the sort order.
                return;
            default:
                // Hide unrecognized/custom tags?
                if ($fact->getParent()->getTree()->getPreference('HIDE_GEDCOM_ERRORS') && !GedcomTag::isTag($fact->getTag())) {
                    return;
                }
                break;
        }
        // Who is this fact about?  Need it to translate fact label correctly
        if ($parent instanceof Family && $record instanceof Individual) {
            // Family event
            $label_person = $fact->getParent()->getSpouse($record);
        } else {
            // Individual event
            $label_person = $parent;
        }
        // New or deleted facts need different styling
        $styleadd = '';
        if ($fact->isPendingAddition()) {
            $styleadd = 'new';
        }
        if ($fact->isPendingDeletion()) {
            $styleadd = 'old';
        }
        // Event of close relative
        if (preg_match('/^_[A-Z_]{3,5}_[A-Z0-9]{4}$/', $fact->getTag())) {
            $styleadd = trim($styleadd . ' rela');
        }
        // Event of close associates
        if ($fact->getFactId() == 'asso') {
            $styleadd = trim($styleadd . ' rela');
        }
        // historical facts
        if ($fact->getFactId() == 'histo') {
            $styleadd = trim($styleadd . ' histo');
        }
        // Does this fact have a type?
        if (preg_match('/\\n2 TYPE (.+)/', $fact->getGedcom(), $match)) {
            $type = $match[1];
        } else {
            $type = '';
        }
        switch ($fact->getTag()) {
            case 'EVEN':
            case 'FACT':
                if (GedcomTag::isTag($type)) {
                    // Some users (just Meliza?) use "1 EVEN/2 TYPE BIRT".  Translate the TYPE.
                    $label = GedcomTag::getLabel($type, $label_person);
                    $type = '';
                    // Do not print this again
                } elseif ($type) {
                    // We don't have a translation for $type - but a custom translation might exist.
                    $label = I18N::translate(Filter::escapeHtml($type));
                    $type = '';
                    // Do not print this again
                } else {
                    // An unspecified fact/event
                    $label = $fact->getLabel();
                }
                break;
            case 'MARR':
                // This is a hack for a proprietory extension.  Is it still used/needed?
                $utype = strtoupper($type);
                if ($utype == 'CIVIL' || $utype == 'PARTNERS' || $utype == 'RELIGIOUS') {
//.........这里部分代码省略.........
开发者ID:jflash,项目名称:webtrees,代码行数:101,代码来源:FunctionsPrintFacts.php


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