summaryrefslogtreecommitdiff
path: root/resources/views/modules
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-11-17 15:22:08 +0000
committerGreg Roach <fisharebest@webtrees.net>2018-11-18 18:18:42 +0000
commit8d0ebef0d075981bd943e8256e2c81a3b1e92b4b (patch)
tree6ce584137d2125125417a6c749d5d5e9a11611f1 /resources/views/modules
parentada1c84947c5c97bcc08a94582e9443f18df3d13 (diff)
downloadwebtrees-8d0ebef0d075981bd943e8256e2c81a3b1e92b4b.tar.gz
webtrees-8d0ebef0d075981bd943e8256e2c81a3b1e92b4b.tar.bz2
webtrees-8d0ebef0d075981bd943e8256e2c81a3b1e92b4b.zip
Prefer class-constants to global-constants
Diffstat (limited to 'resources/views/modules')
-rw-r--r--resources/views/modules/ckeditor/ckeditor-js.phtml7
-rw-r--r--resources/views/modules/relatives/family.phtml11
2 files changed, 10 insertions, 8 deletions
diff --git a/resources/views/modules/ckeditor/ckeditor-js.phtml b/resources/views/modules/ckeditor/ckeditor-js.phtml
index 30a7bf8118..46bb3d9156 100644
--- a/resources/views/modules/ckeditor/ckeditor-js.phtml
+++ b/resources/views/modules/ckeditor/ckeditor-js.phtml
@@ -1,13 +1,14 @@
<?php use Fisharebest\Webtrees\Module; ?>
<?php use Fisharebest\Webtrees\View; ?>
+<?php use Fisharebest\Webtrees\Webtrees; ?>
<?php if (Module::getModuleByName('ckeditor')) : ?>
<?php View::push('javascript') ?>
- <script src="<?= e(WT_CKEDITOR_BASE_URL) ?>ckeditor.js"></script>
- <script src="<?= e(WT_CKEDITOR_BASE_URL) ?>adapters/jquery.js"></script>
+ <script src="<?= e(Webtrees::CKEDITOR_PATH) ?>ckeditor.js"></script>
+ <script src="<?= e(Webtrees::CKEDITOR_PATH) ?>adapters/jquery.js"></script>
<script>
- var CKEDITOR_BASEPATH = <?= json_encode(WT_CKEDITOR_BASE_URL) ?>;
+ var CKEDITOR_BASEPATH = <?= json_encode(Webtrees::CKEDITOR_PATH) ?>;
// Enable for all browsers
CKEDITOR.env.isCompatible = true;
diff --git a/resources/views/modules/relatives/family.phtml b/resources/views/modules/relatives/family.phtml
index 0c8c20348d..f5a1a85456 100644
--- a/resources/views/modules/relatives/family.phtml
+++ b/resources/views/modules/relatives/family.phtml
@@ -1,5 +1,6 @@
<?php use Fisharebest\Webtrees\Date; ?>
<?php use Fisharebest\Webtrees\Functions\Functions; ?>
+<?php use Fisharebest\Webtrees\Gedcom; ?>
<?php use Fisharebest\Webtrees\GedcomTag; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Individual; ?>
@@ -14,7 +15,7 @@
<tbody>
<?php
$found = false;
- foreach ($family->facts('HUSB', false, $fam_access_level) as $fact) {
+ foreach ($family->facts(['HUSB'], false, $fam_access_level) as $fact) {
$found |= !$fact->isPendingDeletion();
$person = $fact->target();
if ($person instanceof Individual) {
@@ -51,7 +52,7 @@
}
$found = false;
- foreach ($family->facts('WIFE', false, $fam_access_level) as $fact) {
+ foreach ($family->facts(['WIFE'], false, $fam_access_level) as $fact) {
$person = $fact->target();
if ($person instanceof Individual) {
$found |= !$fact->isPendingDeletion();
@@ -91,7 +92,7 @@
///// MARR /////
$found = false;
$prev = new Date('');
- foreach ($family->facts(WT_EVENTS_MARR . '|' . WT_EVENTS_DIV, true) as $fact) {
+ foreach ($family->facts(array_merge(Gedcom::MARRIAGE_EVENTS, Gedcom::DIVORCE_EVENTS), true) as $fact) {
$found |= !$fact->isPendingDeletion();
if ($fact->isPendingAddition()) {
$row_class = 'new';
@@ -132,7 +133,7 @@
///// CHIL /////
$child_number = 0;
- foreach ($family->facts('CHIL', false, $fam_access_level) as $fact) {
+ foreach ($family->facts(['CHIL'], false, $fam_access_level) as $fact) {
$person = $fact->target();
if ($person instanceof Individual) {
$row_class = 'wt-gender-' . $person->getSex();
@@ -145,7 +146,7 @@
$child_number++;
}
$next = new Date('');
- foreach ($person->facts(WT_EVENTS_BIRT, true) as $bfact) {
+ foreach ($person->facts(Gedcom::BIRTH_EVENTS, true) as $bfact) {
if ($bfact->date()->isOK()) {
$next = $bfact->date();
break;