diff options
| -rw-r--r-- | app/Fact.php | 18 | ||||
| -rw-r--r-- | app/Functions/FunctionsPrintFacts.php | 32 | ||||
| -rw-r--r-- | app/GedcomRecord.php | 2 | ||||
| -rw-r--r-- | app/Http/Controllers/AdminTreesController.php | 8 | ||||
| -rw-r--r-- | app/Http/Controllers/BranchesController.php | 2 | ||||
| -rw-r--r-- | app/Http/Controllers/CalendarController.php | 4 | ||||
| -rw-r--r-- | app/Module/IndividualFactsTabModule.php | 4 | ||||
| -rw-r--r-- | app/Stats.php | 4 | ||||
| -rw-r--r-- | resources/views/edit/new-individual.phtml | 14 | ||||
| -rw-r--r-- | resources/views/edit/reorder-names.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/todo/research-tasks.phtml | 2 |
11 files changed, 46 insertions, 46 deletions
diff --git a/app/Fact.php b/app/Fact.php index e13d3eef30..3a3a9a15a6 100644 --- a/app/Fact.php +++ b/app/Fact.php @@ -232,7 +232,7 @@ class Fact * * @return string */ - public function getAttribute($tag) + public function attribute($tag) { if (preg_match('/\n2 (?:' . $tag . ') ?(.*(?:(?:\n3 CONT ?.*)*)*)/', $this->gedcom, $match)) { return preg_replace("/\n3 CONT ?/", "\n", $match[1]); @@ -304,7 +304,7 @@ class Fact public function getPlace(): Place { if ($this->place === null) { - $this->place = new Place($this->getAttribute('PLAC'), $this->record()->getTree()); + $this->place = new Place($this->attribute('PLAC'), $this->record()->getTree()); } return $this->place; @@ -320,7 +320,7 @@ class Fact public function getDate(): Date { if ($this->date === null) { - $this->date = new Date($this->getAttribute('DATE')); + $this->date = new Date($this->attribute('DATE')); } return $this->date; @@ -386,8 +386,8 @@ class Fact public function getLabel(): string { // Custom FACT/EVEN - with a TYPE - if (($this->tag === 'FACT' || $this->tag === 'EVEN') && $this->getAttribute('TYPE') !== '') { - return I18N::translate(e($this->getAttribute('TYPE'))); + if (($this->tag === 'FACT' || $this->tag === 'EVEN') && $this->attribute('TYPE') !== '') { + return I18N::translate(e($this->attribute('TYPE'))); } return GedcomTag::getLabel($this->tag, $this->record); @@ -621,11 +621,11 @@ class Fact // - Don't let dated after DEAT/BURI facts sort non-dated facts before DEAT/BURI // - Treat dated after BURI facts as BURI instead - if ($a->getAttribute('DATE') !== '' && $factsort[$atag] > $factsort['BURI'] && $factsort[$atag] < $factsort['CHAN']) { + if ($a->attribute('DATE') !== '' && $factsort[$atag] > $factsort['BURI'] && $factsort[$atag] < $factsort['CHAN']) { $atag = 'BURI'; } - if ($b->getAttribute('DATE') !== '' && $factsort[$btag] > $factsort['BURI'] && $factsort[$btag] < $factsort['CHAN']) { + if ($b->attribute('DATE') !== '' && $factsort[$btag] > $factsort['BURI'] && $factsort[$btag] < $factsort['CHAN']) { $btag = 'BURI'; } @@ -633,11 +633,11 @@ class Fact // If facts are the same then put dated facts before non-dated facts if ($ret == 0) { - if ($a->getAttribute('DATE') !== '' && $b->getAttribute('DATE') === '') { + if ($a->attribute('DATE') !== '' && $b->attribute('DATE') === '') { return -1; } - if ($b->getAttribute('DATE') !== '' && $a->getAttribute('DATE') === '') { + if ($b->attribute('DATE') !== '' && $a->attribute('DATE') === '') { return 1; } diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index dd8175ecf3..ddba872e6a 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -242,10 +242,10 @@ class FunctionsPrintFacts // Print the value of this fact/event switch ($fact->getTag()) { case 'ADDR': - echo $fact->getValue(); + echo $fact->value(); break; case 'AFN': - echo '<div class="field"><a href="https://familysearch.org/search/tree/results#count=20&query=afn:', rawurlencode($fact->getValue()), '">', e($fact->getValue()), '</a></div>'; + echo '<div class="field"><a href="https://familysearch.org/search/tree/results#count=20&query=afn:', rawurlencode($fact->value()), '">', e($fact->value()), '</a></div>'; break; case 'ASSO': // we handle this later, in format_asso_rela_record() @@ -253,11 +253,11 @@ class FunctionsPrintFacts case 'EMAIL': case 'EMAI': case '_EMAIL': - echo '<div class="field"><a href="mailto:', e($fact->getValue()), '">', e($fact->getValue()), '</a></div>'; + echo '<div class="field"><a href="mailto:', e($fact->value()), '">', e($fact->value()), '</a></div>'; break; case 'RESN': echo '<div class="field">'; - switch ($fact->getValue()) { + switch ($fact->value()) { case 'none': // Note: "1 RESN none" is not valid gedcom. // However, webtrees privacy rules will interpret it as "show an otherwise private record to public". @@ -273,33 +273,33 @@ class FunctionsPrintFacts echo '<i class="icon-locked-none"></i> ', I18N::translate('Only managers can edit'); break; default: - echo e($fact->getValue()); + echo e($fact->value()); break; } echo '</div>'; break; case 'PUBL': // Publication details might contain URLs. - echo '<div class="field">', Filter::expandUrls($fact->getValue(), $tree), '</div>'; + echo '<div class="field">', Filter::expandUrls($fact->value(), $tree), '</div>'; break; case 'REPO': $repository = $fact->getTarget(); if ($repository instanceof Repository) { echo '<div><a class="field" href="', e($repository->url()), '">', $repository->getFullName(), '</a></div>'; } else { - echo '<div class="error">', e($fact->getValue()), '</div>'; + echo '<div class="error">', e($fact->value()), '</div>'; } break; case 'URL': case '_URL': case 'WWW': - echo '<div class="field"><a href="', e($fact->getValue()), '">', e($fact->getValue()), '</a></div>'; + echo '<div class="field"><a href="', e($fact->value()), '">', e($fact->value()), '</a></div>'; break; case 'TEXT': // 0 SOUR / 1 TEXT - echo '<div class="field">', nl2br(e($fact->getValue()), false), '</div>'; + echo '<div class="field">', nl2br(e($fact->value()), false), '</div>'; break; default: // Display the value for all other facts/events - switch ($fact->getValue()) { + switch ($fact->value()) { case '': // Nothing to display break; @@ -311,15 +311,15 @@ class FunctionsPrintFacts // Do not display "Yes". break; default: - if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) { + if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->value(), $match)) { $target = GedcomRecord::getInstance($match[1], $tree); if ($target) { echo '<div><a href="', e($target->url()), '">', $target->getFullName(), '</a></div>'; } else { - echo '<div class="error">', e($fact->getValue()), '</div>'; + echo '<div class="error">', e($fact->value()), '</div>'; } } else { - echo '<div class="field"><span dir="auto">', e($fact->getValue()), '</span></div>'; + echo '<div class="field"><span dir="auto">', e($fact->value()), '</span></div>'; } break; } @@ -348,7 +348,7 @@ class FunctionsPrintFacts // A blank line between the primary attributes (value, date, place) and the secondary ones echo '<br>'; - $addr = $fact->getAttribute('ADDR'); + $addr = $fact->attribute('ADDR'); if ($addr !== '') { echo GedcomTag::getLabelValue('ADDR', $addr); } @@ -623,7 +623,7 @@ class FunctionsPrintFacts // PUBL $publ = $source->getFirstFact('PUBL'); if ($publ) { - $data .= GedcomTag::getLabelValue('PUBL', $publ->getValue()); + $data .= GedcomTag::getLabelValue('PUBL', $publ->value()); } $data .= self::printSourceStructure($tree, self::getSourceStructure($srec)); $data .= '<div class="indent">'; @@ -828,7 +828,7 @@ class FunctionsPrintFacts // PUBL $publ = $source->getFirstFact('PUBL'); if ($publ) { - echo GedcomTag::getLabelValue('PUBL', $publ->getValue()); + echo GedcomTag::getLabelValue('PUBL', $publ->value()); } // 2 RESN tags. Note, there can be more than one, such as "privacy" and "locked" if (preg_match_all("/\n2 RESN (.+)/", $factrec, $rmatches)) { diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php index b12ef9aca2..55366f7af5 100644 --- a/app/GedcomRecord.php +++ b/app/GedcomRecord.php @@ -1199,7 +1199,7 @@ class GedcomRecord return I18N::translate('Unknown'); } - $chan_user = $chan->getAttribute('_WT_USER'); + $chan_user = $chan->attribute('_WT_USER'); if ($chan_user === '') { return I18N::translate('Unknown'); } diff --git a/app/Http/Controllers/AdminTreesController.php b/app/Http/Controllers/AdminTreesController.php index bd6832d339..cb3497a175 100644 --- a/app/Http/Controllers/AdminTreesController.php +++ b/app/Http/Controllers/AdminTreesController.php @@ -1686,7 +1686,7 @@ class AdminTreesController extends AbstractBaseController foreach ($rows as $row) { $record = Individual::getInstance($row->xref, $tree, $row->gedcom); foreach ($record->getFacts() as $fact) { - $old_place = $fact->getAttribute('PLAC'); + $old_place = $fact->attribute('PLAC'); if (preg_match('/(^|, )' . preg_quote($search, '/') . '$/i', $old_place)) { $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place); $changes[$old_place] = $new_place; @@ -1706,7 +1706,7 @@ class AdminTreesController extends AbstractBaseController foreach ($rows as $row) { $record = Family::getInstance($row->xref, $tree, $row->gedcom); foreach ($record->getFacts() as $fact) { - $old_place = $fact->getAttribute('PLAC'); + $old_place = $fact->attribute('PLAC'); if (preg_match('/(^|, )' . preg_quote($search, '/') . '$/i', $old_place)) { $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place); $changes[$old_place] = $new_place; @@ -1745,7 +1745,7 @@ class AdminTreesController extends AbstractBaseController foreach ($rows as $row) { $record = Individual::getInstance($row->xref, $tree, $row->gedcom); foreach ($record->getFacts() as $fact) { - $old_place = $fact->getAttribute('PLAC'); + $old_place = $fact->attribute('PLAC'); if (preg_match('/(^|, )' . preg_quote($search, '/') . '$/i', $old_place)) { $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place); $changes[$old_place] = $new_place; @@ -1767,7 +1767,7 @@ class AdminTreesController extends AbstractBaseController foreach ($rows as $row) { $record = Family::getInstance($row->xref, $tree, $row->gedcom); foreach ($record->getFacts() as $fact) { - $old_place = $fact->getAttribute('PLAC'); + $old_place = $fact->attribute('PLAC'); if (preg_match('/(^|, )' . preg_quote($search, '/') . '$/i', $old_place)) { $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place); $changes[$old_place] = $new_place; diff --git a/app/Http/Controllers/BranchesController.php b/app/Http/Controllers/BranchesController.php index 658757f8c0..b1aa7b6bdc 100644 --- a/app/Http/Controllers/BranchesController.php +++ b/app/Http/Controllers/BranchesController.php @@ -276,7 +276,7 @@ class BranchesController extends AbstractBaseController $pedi = ''; foreach ($individual->getFacts('FAMC') as $fact) { if ($fact->getTarget() === $parents) { - $pedi = $fact->getAttribute('PEDI'); + $pedi = $fact->attribute('PEDI'); break; } } diff --git a/app/Http/Controllers/CalendarController.php b/app/Http/Controllers/CalendarController.php index 331d0411ef..7dd79d0a44 100644 --- a/app/Http/Controllers/CalendarController.php +++ b/app/Http/Controllers/CalendarController.php @@ -531,8 +531,8 @@ class CalendarController extends AbstractBaseController if ($fact->anniv) { $text .= ' (' . I18N::translate('%s year anniversary', $fact->anniv) . ')'; } - if ($show_places && $fact->getAttribute('PLAC')) { - $text .= ' — ' . $fact->getAttribute('PLAC'); + if ($show_places && $fact->attribute('PLAC')) { + $text .= ' — ' . $fact->attribute('PLAC'); } return $text; diff --git a/app/Module/IndividualFactsTabModule.php b/app/Module/IndividualFactsTabModule.php index 5d03d3f3aa..eed5512acf 100644 --- a/app/Module/IndividualFactsTabModule.php +++ b/app/Module/IndividualFactsTabModule.php @@ -467,9 +467,9 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf ); foreach ($associates as $associate) { foreach ($associate->getFacts() as $fact) { - $arec = $fact->getAttribute('_ASSO'); + $arec = $fact->attribute('_ASSO'); if (!$arec) { - $arec = $fact->getAttribute('ASSO'); + $arec = $fact->attribute('ASSO'); } if ($arec && trim($arec, '@') === $person->getXref()) { // Extract the important details from the fact diff --git a/app/Stats.php b/app/Stats.php index 3a0c0fdeb0..26634fb2c0 100644 --- a/app/Stats.php +++ b/app/Stats.php @@ -221,8 +221,8 @@ class Stats $sour = $head->getFirstFact('SOUR'); if ($sour !== null) { $source = $sour->value(); - $title = $sour->getAttribute('NAME'); - $version = $sour->getAttribute('VERS'); + $title = $sour->attribute('NAME'); + $version = $sour->attribute('VERS'); } return [ diff --git a/resources/views/edit/new-individual.phtml b/resources/views/edit/new-individual.phtml index 78d98befc4..83acc446af 100644 --- a/resources/views/edit/new-individual.phtml +++ b/resources/views/edit/new-individual.phtml @@ -29,13 +29,13 @@ if ($name_fact !== null) { $namerec = $name_fact->getGedcom(); $name_fields = [ 'NAME' => $name_fact->value(), - 'TYPE' => $name_fact->getAttribute('TYPE'), - 'NPFX' => $name_fact->getAttribute('NPFX'), - 'GIVN' => $name_fact->getAttribute('GIVN'), - 'NICK' => $name_fact->getAttribute('NICK'), - 'SPFX' => $name_fact->getAttribute('SPFX'), - 'SURN' => $name_fact->getAttribute('SURN'), - 'NSFX' => $name_fact->getAttribute('NSFX'), + 'TYPE' => $name_fact->attribute('TYPE'), + 'NPFX' => $name_fact->attribute('NPFX'), + 'GIVN' => $name_fact->attribute('GIVN'), + 'NICK' => $name_fact->attribute('NICK'), + 'SPFX' => $name_fact->attribute('SPFX'), + 'SURN' => $name_fact->attribute('SURN'), + 'NSFX' => $name_fact->attribute('NSFX'), ]; // Populate any missing subfields from the NAME field diff --git a/resources/views/edit/reorder-names.phtml b/resources/views/edit/reorder-names.phtml index c8a5e6f836..743cc27ef2 100644 --- a/resources/views/edit/reorder-names.phtml +++ b/resources/views/edit/reorder-names.phtml @@ -17,7 +17,7 @@ <?= $fact->value() ?> </h3> <div class="card-body"> - <?= GedcomTag::getLabelValue('TYPE', GedcomCodeName::getValue($fact->getAttribute('TYPE'), $fact->record())) ?> + <?= GedcomTag::getLabelValue('TYPE', GedcomCodeName::getValue($fact->attribute('TYPE'), $fact->record())) ?> </div> </div> <?php endforeach ?> diff --git a/resources/views/modules/todo/research-tasks.phtml b/resources/views/modules/todo/research-tasks.phtml index 46ee556afb..ec1cb9bd3b 100644 --- a/resources/views/modules/todo/research-tasks.phtml +++ b/resources/views/modules/todo/research-tasks.phtml @@ -30,7 +30,7 @@ </a> </td> <td class="d-none d-md-table-cell wt-side-block-optional"> - <?= e($task->getAttribute('_WT_USER')) ?> + <?= e($task->attribute('_WT_USER')) ?> </td> <td dir="auto"> <?= e($task->value()) ?> |
