/webtrees/app/Services/ |
H A D | GedcomEditService.php | 73 ->filter(static fn (string $tag): bool => $tag !== ''); 74 $facts = $tags->map(fn (string $tag): Fact => $this->createNewFact($dummy, $tag)); 90 ->filter(static fn (string $tag): bool => $tag !== ''); 91 $facts = $tags->map(fn (string $tag): Fact => $this->createNewFact($dummy, $tag)); 100 * @param string $tag 104 private function createNewFact(GedcomRecord $record, string $tag): Fact argument 106 $element = Registry::elementFactory()->make($record->tag() . ':' . $tag); 108 $gedcom = trim('1 ' . $tag . ' ' . $default); 200 …return $this->insertMissingLevels($fact->record()->tree(), $fact->tag(), $gedcom, $include_hidden); 216 … $gedcom = $this->insertMissingLevels($record->tree(), $record->tag(), $gedcom, $include_hidden); [all …]
|
H A D | GedcomService.php | 164 * @param string $tag 168 public function canonicalTag(string $tag): string argument 170 $tag = strtoupper($tag); 172 $tag = self::TAG_NAMES[$tag] ?? self::TAG_SYNONYMS[$tag] ?? $tag; 174 return $tag;
|
H A D | IndividualFactsService.php | 67 ->filter(fn (Fact $fact): bool => !$exclude_facts->contains($fact->tag())); 83 ->filter(fn (Fact $fact): bool => !$exclude_facts->contains($fact->tag())); 515 …$facts[] = $this->convertEvent($fact, $birth_of_a_grandchild1[$fact->tag()], $fact->record()->sex(… 518 …$facts[] = $this->convertEvent($fact, $birth_of_a_grandchild2[$fact->tag()], $fact->record()->sex(… 521 …$facts[] = $this->convertEvent($fact, $birth_of_a_grandchild[$fact->tag()], $fact->record()->sex()… 526 … $facts[] = $this->convertEvent($fact, $birth_of_a_sibling[$fact->tag()], $fact->record()->sex()); 529 …$facts[] = $this->convertEvent($fact, $birth_of_a_half_sibling[$fact->tag()], $fact->record()->sex… 532 … $facts[] = $this->convertEvent($fact, $birth_of_a_child[$fact->tag()], $fact->record()->sex()); 546 …$facts[] = $this->convertEvent($fact, $death_of_a_grandchild1[$fact->tag()], $fact->record()->sex(… 549 …$facts[] = $this->convertEvent($fact, $death_of_a_grandchild2[$fact->tag()], $fact->record()->sex(… [all …]
|
H A D | GedcomImportService.php | 93 [, $level, $xref, $tag, $data] = $match; 95 $tag = $gedcom_service->canonicalTag($tag); 97 switch ($tag) { 188 switch ($tag) { 196 …$level . ' ' . ($level === '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag !== 'NO… 202 …$level . ' ' . ($level === '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag !== 'NO… 213 …$level . ' ' . ($level === '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag !== 'NO…
|
H A D | ClipboardService.php | 48 $record_type = $fact->record()->tag(); 74 $record_type = $record->tag(); 106 $facts = $clipboard[$record->tag()] ?? []; 131 … ->filter(static fn (Fact $fact): bool => $types->contains(explode(':', $fact->tag())[1]));
|
/webtrees/app/ |
H A D | Fact.php | 156 private string $tag; variable in Fisharebest\\Webtrees\\Fact 190 $this->tag = $match[1]; 204 if (preg_match('/^1 ' . $this->tag . ' ?(.*(?:\n2 CONT ?.*)*)/', $this->gedcom, $match)) { 207 return Registry::elementFactory()->make($this->tag())->canonical($value); 226 switch ($this->tag) { 264 * @param string $tag 268 public function attribute(string $tag): string argument 270 if (preg_match('/\n2 ' . $tag . '\b ?(.*(?:(?:\n3 CONT ?.*)*)*)/', $this->gedcom, $match)) { 273 return Registry::elementFactory()->make($this->tag() . ':' . $tag)->canonical($value); 337 if ($target instanceof GedcomRecord && $target->tag() === $this->tag) { [all …]
|
H A D | GedcomRecord.php | 164 public function tag(): string function in Fisharebest\\Webtrees\\GedcomRecord 625 $filter = array_map(fn (string $tag): string => $this->tag() . ':' . $tag, $filter); 630 … if (($filter === [] || in_array($fact->tag(), $filter, true)) && $fact->canShow($access_level)) { 637 switch ($this->tag()) { 644 $subtags = Registry::elementFactory()->make($this->tag())->subtags(); 645 … $subtags = array_map(fn (string $tag): string => $this->tag() . ':' . $tag, array_keys($subtags)); 654 $sort_x = array_search($x->tag(), $subtags, true) ?: PHP_INT_MAX; 655 $sort_y = array_search($y->tag(), $subtags, true) ?: PHP_INT_MAX; 677 foreach (Registry::elementFactory()->make($this->tag())->subtags() as $subtag => $repeat) { 683 … $missing_facts[$subtag] = Registry::elementFactory()->make($this->tag() . ':' . $subtag)->label(); [all …]
|
/webtrees/app/Report/ |
H A D | ReportParserGenerate.php | 219 … * @param string $tag a gedcom tag or string to search for in the record (ie 1 BIRT or 2 DATE) 228 … public static function getSubRecord(int $level, string $tag, string $gedrec, int $num = 1): string argument 235 $tag = trim($tag); 236 $searchTarget = "~[\n]" . $tag . "[\s]~"; 693 $tag = $attrs['id']; 694 $tag = str_replace('@fact', $this->fact, $tag); 695 $tags = explode(':', $tag); 704 foreach ($tags as $tag) { 705 if (preg_match('/\$(.+)/', $tag, $match)) { 713 if (preg_match('/@(.+)/', $tag, $match)) { [all …]
|
/webtrees/resources/views/ |
H A D | fact.phtml | 29 [, $tag] = explode(':', $fact->tag()); 35 $element = Registry::elementFactory()->make($fact->tag()); 47 if ($tag === 'EVEN' && $value === 'CLOSE_RELATIVE') { 68 if ($tag === 'MARR') { 78 …<?php if ($id !== 'histo' && $id !== 'asso' && $fact->canEdit() && !in_array($tag, ['HUSB', 'WIFE'… 83 … <span class="wt-fact-icon wt-fact-icon-<?= e($tag) ?>" title="<?= strip_tags($label) ?>"></span> 100 …gedcom-fields', ['gedcom' => $note->gedcom(), 'parent' => $fact->target()->tag(), 'tree' => $fact-… 134 <?php if ($type !== '' && $tag !== 'EVEN' && $tag !== 'FACT') : ?> 136 …<?= Registry::elementFactory()->make($fact->tag() . ':TYPE')->labelValue(I18N::translate($type), $… 148 …<?= view('fact-gedcom-fields', ['gedcom' => $match[0], 'parent' => $fact->tag() . ':' . $match[1],…
|
H A D | fact-date.phtml | 28 …$fact_age = Registry::elementFactory()->make($fact->tag() . ':AGE')->value($match[1], $record->tre… 34 …$husb_age = Registry::elementFactory()->make($fact->tag() . ':HUSB:AGE')->value($match[1], $record… 40 …$wife_age = Registry::elementFactory()->make($fact->tag() . ':WIFE:AGE')->value($match[1], $record… 46 [, $tag] = explode(':', $fact->tag()); 58 in_array($tag, Gedcom::BIRTH_EVENTS, true) && 66 …if ($tag !== 'BIRT' && Registry::elementFactory()->make($fact->tag()) instanceof AbstractEventElem… 80 if ($tag === 'DEAT' || Date::compare($date, $death_date) <= 0 || !$record->isDead()) { 110 if ($tag !== 'DEAT' && $death_date->isOK() && Date::compare($death_date, $date) <= 0) {
|
H A D | individual-page-name.phtml | 47 …<?= Registry::elementFactory()->make($fact->tag() . ':TYPE')->value($fact->attribute('TYPE'), $tre… 61 <?php [, $tag, $value] = $match ?> 62 <?php $element = Registry::elementFactory()->make($fact->tag() . ':' . $tag) ?> 63 <?php if ($tag !== 'SOUR' && $tag !== 'NOTE') : ?>
|
H A D | chart-box.phtml | 92 return !in_array($fact->tag(), $exclude, true); 172 foreach ($opt_tags as $key => $tag) { 173 if (!in_array($tag, Gedcom::DEATH_EVENTS, true)) { 174 $event = $individual->facts([$tag])->first(); 193 foreach ($opt_tags as $tag) { 194 $event = $individual->facts([$tag])->first();
|
H A D | fact-add-new.phtml | 23 switch ($record->tag()) { 80 $filter_fn = static fn (string $tag): bool => !in_array($tag, $unique_facts, true) || $record->fact… 86 $label_fn = static fn (string $subtag): string => Registry::elementFactory()->make($record->tag() .…
|
H A D | fact-place.phtml | 43 …<?= view('fact-gedcom-fields', ['gedcom' => $match[1], 'parent' => $fact->tag() . ':PLAC:NOTE', 't… 49 …<?= Registry::elementFactory()->make($fact->tag() . ':TEMP')->labelValue($match[1], $record->tree(… 53 …<?= Registry::elementFactory()->make($fact->tag() . ':STAT')->labelValue($match[1], $record->tree(… 56 …<?= Registry::elementFactory()->make($fact->tag() . ':STAT:DATE')->labelValue((new Date($match[1])…
|
/webtrees/app/Factories/ |
H A D | ElementFactory.php | 41 * @param string $tag Colon delimited hierarchy, e.g. 'INDI:BIRT:PLAC' 45 public function make(string $tag): ElementInterface argument 47 … return $this->elements[$tag] ?? $this->findElementByWildcard($tag) ?? new UnknownElement($tag); 67 foreach ($subtags as $tag => $children) { 69 $this->make($tag)->subtag(...$child); 74 private function findElementByWildcard(string $tag): ElementInterface|null argument 80 if (preg_match($regex, $tag)) {
|
/webtrees/resources/views/admin/ |
H A D | trees-check.phtml | 32 <li class="list-group-item list-group-item-danger" data-wt-tag="<?= e($error->tag) ?>"> 36 <?php if ($error->tag !== '') : ?> 39 <?= I18N::translate('Hide these errors') ?> — <?= e($error->tag) ?> 48 <li class="list-group-item list-group-item-warning" data-wt-tag="<?= e($warning->tag) ?>"> 52 <?php if ($warning->tag !== '') : ?> 55 <?= I18N::translate('Hide these errors') ?> — <?= e($warning->tag) ?> 64 <li class="list-group-item list-group-item-info" data-wt-tag="<?= e($info->tag) ?>"> 68 <?php if ($info->tag !== '') : ?> 71 <?= I18N::translate('Hide these errors') ?> — <?= e($info->tag) ?>
|
/webtrees/resources/views/modules/recent_changes/ |
H A D | changes-table.phtml | 59 … <td data-sort="<?= $row->record->tag() ?>" class="text-centre wt-side-block-optional"> 60 <?php if ($row->record->tag() === Individual::RECORD_TYPE) : ?> 63 <?php elseif ($row->record->tag() === Family::RECORD_TYPE) : ?> 66 <?php elseif ($row->record->tag() === Media::RECORD_TYPE) : ?> 69 <?php elseif ($row->record->tag() === Note::RECORD_TYPE) : ?> 72 <?php elseif ($row->record->tag() === Source::RECORD_TYPE) : ?> 75 <?php elseif ($row->record->tag() === Submitter::RECORD_TYPE) : ?> 78 <?php elseif ($row->record->tag() === Repository::RECORD_TYPE) : ?> 81 <?php elseif ($row->record->tag() === Location::RECORD_TYPE) : ?>
|
/webtrees/resources/views/icons/ |
H A D | record.phtml | 19 if ($record->tag() === Individual::RECORD_TYPE) : ?> 21 <?php elseif ($record->tag() === Family::RECORD_TYPE) : ?> 23 <?php elseif ($record->tag() === Source::RECORD_TYPE) : ?> 25 <?php elseif ($record->tag() === Repository::RECORD_TYPE) : ?> 27 <?php elseif ($record->tag() === Note::RECORD_TYPE) : ?> 29 <?php elseif ($record->tag() === Media::RECORD_TYPE) : ?> 31 <?php elseif ($record->tag() === Submitter::RECORD_TYPE) : ?> 33 <?php elseif ($record->tag() === Location::RECORD_TYPE) : ?>
|
/webtrees/app/Http/RequestHandlers/ |
H A D | SiteTagsPage.php | 57 …static fn (string $tag): array => [$tag => Registry::elementFactory()->make('FAM:' . $tag)->label(… 61 …static fn (string $tag): array => [$tag => Registry::elementFactory()->make('INDI:' . $tag)->label…
|
H A D | RenumberTreeAction.php | 103 foreach (['CHIL', 'ASSO', '_ASSO'] as $tag) { 111 ->where('l_type', '=', $tag) 114 … 'f_gedcom' => new Expression("REPLACE(f_gedcom, ' $tag @$old_xref@', ' $tag @$new_xref@')"), 119 foreach (['ALIA', 'ASSO', '_ASSO'] as $tag) { 127 ->where('link.l_type', '=', $tag) 130 … 'i_gedcom' => new Expression("REPLACE(i_gedcom, ' $tag @$old_xref@', ' $tag @$new_xref@')"), 167 foreach (['FAMC', 'FAMS'] as $tag) { 175 ->where('l_type', '=', $tag) 178 … 'i_gedcom' => new Expression("REPLACE(i_gedcom, ' $tag @$old_xref@', ' $tag @$new_xref@')"),
|
H A D | CheckTree.php | 202 $tag = $match[2]; 204 $hierarchy[$level] = $tag; 209 if ($tag === 'CONT') { 214 …if (str_starts_with($tag, '_') || str_starts_with($full_tag, '_') || str_contains($full_tag, ':_')… 229 …lineError($tree, $record->type, $record->xref, $line_number, $line, $message, $tag . '-' . $xref1); 279 …lineError($tree, $record->type, $record->xref, $line_number, $line, $message, $tag . '-' . $xref1); 281 } elseif ($tag === 'SOUR') { 404 * @param string $tag 415 string $tag argument 427 'tag' => $tag, [all …]
|
H A D | ReorderFamiliesAction.php | 60 $tag = $fact->tag(); 62 if ($tag === 'INDI:FAMC' || $tag === 'INDI:FAMS') {
|
H A D | MergeFactsPage.php | 62 $record1->tag() !== $record2->tag() || 81 if (!$fact->isPendingDeletion() && !str_ends_with($fact->tag(), ':CHAN')) { 87 if (!$fact->isPendingDeletion() && !str_ends_with($fact->tag(), ':CHAN')) {
|
/webtrees/app/Elements/ |
H A D | EventsRecorded.php | 128 …->mapWithKeys(static fn (string $tag): array => [explode(':', $tag)[1] => $factory->make($tag)->la… 160 $events = array_map(static function (string $tag): string { 162 $element = Registry::elementFactory()->make($record_type . ':' . $tag); 169 return e($tag);
|
/webtrees/tests/ |
H A D | TestCase.php | 246 $tag = $match[1]; 249 $message = 'Tag ' . $tag . ' is not allowed at ' . implode(':', $stack) . '.'; 251 switch ($tag) { 265 $stack[] = $tag; 268 if ($tag === 'script' && !$self_closing) {
|