diff options
| -rw-r--r-- | app/Functions/Functions.php | 17 | ||||
| -rw-r--r-- | app/Functions/FunctionsRtl.php | 2 | ||||
| -rw-r--r-- | app/Http/Controllers/AdminTreesController.php | 109 | ||||
| -rw-r--r-- | app/Schema/Migration38.php | 3 | ||||
| -rw-r--r-- | app/Theme/AbstractTheme.php | 9 |
5 files changed, 58 insertions, 82 deletions
diff --git a/app/Functions/Functions.php b/app/Functions/Functions.php index 550374cc88..9a4c0f8170 100644 --- a/app/Functions/Functions.php +++ b/app/Functions/Functions.php @@ -2059,19 +2059,23 @@ class Functions default: return I18N::translate('great ×%s grandchild', I18N::number($up - 3)); } - case 'it': // Source: Michele Locati - case 'es': // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched) + case 'it': + // Source: Michele Locati + case 'es': + // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched) case 'en_AU': case 'en_GB': case 'en_US': default: switch ($sex2) { - - case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required + case 'M': + // I18N: if you need a different number for %s, contact the developers, as a code-change is required return I18N::translate('great ×%s grandson', I18N::number($up - 2)); case 'F': + // I18N: if you need a different number for %s, contact the developers, as a code-change is required return I18N::translate('great ×%s granddaughter', I18N::number($up - 2)); default: + // I18N: if you need a different number for %s, contact the developers, as a code-change is required return I18N::translate('great ×%s grandchild', I18N::number($up - 2)); } } @@ -2167,10 +2171,11 @@ class Functions $path1 = substr($path, 0, 3); $path2 = substr($path, 3); while ($path2) { - $tmp = I18N::translate( + // @TODO need the actual people // I18N: A complex relationship, such as “third-cousin’s great-uncle” + $tmp = I18N::translate( '%1$s’s %2$s', - self::getRelationshipNameFromPath($path1, null, null), // TODO: need the actual people + self::getRelationshipNameFromPath($path1, null, null), self::getRelationshipNameFromPath($path2, null, null) ); if (!$relationship || strlen($tmp) < strlen($relationship)) { diff --git a/app/Functions/FunctionsRtl.php b/app/Functions/FunctionsRtl.php index 5439875d7d..26ab52a3ef 100644 --- a/app/Functions/FunctionsRtl.php +++ b/app/Functions/FunctionsRtl.php @@ -170,7 +170,6 @@ class FunctionsRtl } $workingText = substr($workingText, $currentLen); break; - // fall through case '{': if (substr($workingText, 1, 1) == '{') { // Assume this '{{' starts a TCPDF directive @@ -185,6 +184,7 @@ class FunctionsRtl self::$waitingText = ''; break; } + // no break default: // Look for strings of numbers with optional leading or trailing + or - // and with optional embedded numeric punctuation diff --git a/app/Http/Controllers/AdminTreesController.php b/app/Http/Controllers/AdminTreesController.php index d4f3f7da23..7544d86ea7 100644 --- a/app/Http/Controllers/AdminTreesController.php +++ b/app/Http/Controllers/AdminTreesController.php @@ -278,12 +278,12 @@ class AdminTreesController extends AbstractBaseController { /* I18N: The placeholders are GEDCOM XREFs and tags. e.g. “INDI I123 contains a FAMC link to F234.” */ return I18N::translate( - '%1$s %2$s has a %3$s link to %4$s.', - $this->formatType($type1), - $this->checkLink($tree, $xref1), - $this->formatType($type2), - $this->checkLink($tree, $xref2) - ); + '%1$s %2$s has a %3$s link to %4$s.', + $this->formatType($type1), + $this->checkLink($tree, $xref1), + $this->formatType($type2), + $this->checkLink($tree, $xref2) + ); } @@ -900,22 +900,17 @@ class AdminTreesController extends AbstractBaseController ]; $tags = array_unique(array_merge( - explode(',', $tree->getPreference('INDI_FACTS_ADD')), explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')), - explode(',', $tree->getPreference('FAM_FACTS_ADD')), explode(',', $tree->getPreference('FAM_FACTS_UNIQUE')), - explode(',', $tree->getPreference('NOTE_FACTS_ADD')), explode(',', $tree->getPreference('NOTE_FACTS_UNIQUE')), - explode(',', $tree->getPreference('SOUR_FACTS_ADD')), explode(',', $tree->getPreference('SOUR_FACTS_UNIQUE')), - explode(',', $tree->getPreference('REPO_FACTS_ADD')), explode(',', $tree->getPreference('REPO_FACTS_UNIQUE')), - [ - 'SOUR', - 'REPO', - 'OBJE', - '_PRIM', - 'NOTE', - 'SUBM', - 'SUBN', - '_UID', - 'CHAN', - ] + explode(',', $tree->getPreference('INDI_FACTS_ADD')), + explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')), + explode(',', $tree->getPreference('FAM_FACTS_ADD')), + explode(',', $tree->getPreference('FAM_FACTS_UNIQUE')), + explode(',', $tree->getPreference('NOTE_FACTS_ADD')), + explode(',', $tree->getPreference('NOTE_FACTS_UNIQUE')), + explode(',', $tree->getPreference('SOUR_FACTS_ADD')), + explode(',', $tree->getPreference('SOUR_FACTS_UNIQUE')), + explode(',', $tree->getPreference('REPO_FACTS_ADD')), + explode(',', $tree->getPreference('REPO_FACTS_UNIQUE')), + ['SOUR', 'REPO', 'OBJE', '_PRIM', 'NOTE', 'SUBM', 'SUBN', '_UID', 'CHAN'] )); $all_tags = []; @@ -1868,15 +1863,11 @@ class AdminTreesController extends AbstractBaseController 'tree_id' => $tree->getTreeId(), ])->fetchAll(); - $repositories = array_map( - function (stdClass $x) use ($tree) { - $tmp = explode(',', $x->xrefs); - - return array_map(function ($y) use ($tree) { - return Repository::getInstance($y, $tree); - }, $tmp); - }, $repositories - ); + $repositories = array_map(function (stdClass $x) use ($tree) { + return array_map(function ($y) use ($tree) { + return Repository::getInstance($y, $tree); + }, explode(',', $x->xrefs)); + }, $repositories); $sources = Database::prepare( "SELECT GROUP_CONCAT(n_id) AS xrefs " . @@ -1889,15 +1880,11 @@ class AdminTreesController extends AbstractBaseController 'tree_id' => $tree->getTreeId(), ])->fetchAll(); - $sources = array_map( - function (stdClass $x) use ($tree) { - $tmp = explode(',', $x->xrefs); - - return array_map(function ($y) use ($tree) { - return Source::getInstance($y, $tree); - }, $tmp); - }, $sources - ); + $sources = array_map(function (stdClass $x) use ($tree) { + return array_map(function ($y) use ($tree) { + return Source::getInstance($y, $tree); + }, explode(',', $x->xrefs)); + }, $sources); $individuals = Database::prepare( "SELECT DISTINCT GROUP_CONCAT(d_gid ORDER BY d_gid) AS xrefs" . @@ -1910,15 +1897,11 @@ class AdminTreesController extends AbstractBaseController 'tree_id' => $tree->getTreeId(), ])->fetchAll(); - $individuals = array_map( - function (stdClass $x) use ($tree) { - $tmp = explode(',', $x->xrefs); - - return array_map(function ($y) use ($tree) { - return Individual::getInstance($y, $tree); - }, $tmp); - }, $individuals - ); + $individuals = array_map(function (stdClass $x) use ($tree) { + return array_map(function ($y) use ($tree) { + return Individual::getInstance($y, $tree); + }, explode(',', $x->xrefs)); + }, $individuals); $families = Database::prepare( "SELECT GROUP_CONCAT(f_id) AS xrefs " . @@ -1930,15 +1913,11 @@ class AdminTreesController extends AbstractBaseController 'tree_id' => $tree->getTreeId(), ])->fetchAll(); - $families = array_map( - function (stdClass $x) use ($tree) { - $tmp = explode(',', $x->xrefs); - - return array_map(function ($y) use ($tree) { - return Family::getInstance($y, $tree); - }, $tmp); - }, $families - ); + $families = array_map(function (stdClass $x) use ($tree) { + return array_map(function ($y) use ($tree) { + return Family::getInstance($y, $tree); + }, explode(',', $x->xrefs)); + }, $families); $media = Database::prepare( "SELECT GROUP_CONCAT(m_id) AS xrefs " . @@ -1951,15 +1930,11 @@ class AdminTreesController extends AbstractBaseController 'tree_id' => $tree->getTreeId(), ])->fetchAll(); - $media = array_map( - function (stdClass $x) use ($tree) { - $tmp = explode(',', $x->xrefs); - - return array_map(function ($y) use ($tree) { - return Media::getInstance($y, $tree); - }, $tmp); - }, $media - ); + $media = array_map(function (stdClass $x) use ($tree) { + return array_map(function ($y) use ($tree) { + return Media::getInstance($y, $tree); + }, explode(',', $x->xrefs)); + }, $media); return [ I18N::translate('Repositories') => $repositories, diff --git a/app/Schema/Migration38.php b/app/Schema/Migration38.php index 4c97c13c1a..861f86e7e6 100644 --- a/app/Schema/Migration38.php +++ b/app/Schema/Migration38.php @@ -70,7 +70,8 @@ class Migration38 implements MigrationInterface } try { - Database::exec("ALTER TABLE `##placelocation`" . + Database::exec( + "ALTER TABLE `##placelocation`" . " DROP COLUMN pl_media," . " DROP COLUMN sv_long," . " DROP COLUMN sv_lati," . diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php index f6630532b7..261d72ca9c 100644 --- a/app/Theme/AbstractTheme.php +++ b/app/Theme/AbstractTheme.php @@ -1597,8 +1597,7 @@ abstract class AbstractTheme */ public function menuListsSources() { - return new Menu( - I18N::translate('Sources'), route('source-list', ['ged' => $this->tree->getName()]), 'menu-list-sour', ['rel' => 'nofollow']); + return new Menu(I18N::translate('Sources'), route('source-list', ['ged' => $this->tree->getName()]), 'menu-list-sour', ['rel' => 'nofollow']); } /** @@ -1804,11 +1803,7 @@ abstract class AbstractTheme public function menuSearchPhonetic() { /* I18N: search using “sounds like”, rather than exact spelling */ - return new Menu( - I18N::translate('Phonetic search'), route('search-phonetic', [ - 'ged' => $this->tree->getName(), - 'action' => 'soundex', - ]), 'menu-search-soundex', ['rel' => 'nofollow']); + return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']); } /** |
