diff options
Diffstat (limited to 'app/Module')
76 files changed, 430 insertions, 430 deletions
diff --git a/app/Module/AbstractModule.php b/app/Module/AbstractModule.php index 151c4f1ad4..1a57325a76 100644 --- a/app/Module/AbstractModule.php +++ b/app/Module/AbstractModule.php @@ -56,10 +56,10 @@ abstract class AbstractModule { public function getBlockSetting($block_id, $setting_name, $default_value = null) { $setting_value = Database::prepare( "SELECT SQL_CACHE setting_value FROM `##block_setting` WHERE block_id = :block_id AND setting_name = :setting_name" - )->execute(array( + )->execute([ 'block_id' => $block_id, 'setting_name' => $setting_name, - ))->fetchOne(); + ])->fetchOne(); return $setting_value === null ? $default_value : $setting_value; } @@ -77,18 +77,18 @@ abstract class AbstractModule { if ($setting_value === null) { Database::prepare( "DELETE FROM `##block_setting` WHERE block_id = :block_id AND setting_name = :setting_name" - )->execute(array( + )->execute([ 'block_id' => $block_id, 'setting_name' => $setting_name, - )); + ]); } else { Database::prepare( "REPLACE INTO `##block_setting` (block_id, setting_name, setting_value) VALUES (:block_id, :setting_name, :setting_value)" - )->execute(array( + )->execute([ 'block_id' => $block_id, 'setting_name' => $setting_name, 'setting_value' => $setting_value, - )); + ]); } return $this; @@ -139,7 +139,7 @@ abstract class AbstractModule { if ($this->settings === null) { $this->settings = Database::prepare( "SELECT SQL_CACHE setting_name, setting_value FROM `##module_setting` WHERE module_name = ?" - )->execute(array($this->getName()))->fetchAssoc(); + )->execute([$this->getName()])->fetchAssoc(); } } @@ -176,17 +176,17 @@ abstract class AbstractModule { if ($setting_value === null) { Database::prepare( "DELETE FROM `##module_setting` WHERE module_name = ? AND setting_name = ?" - )->execute(array($this->getName(), $setting_name)); + )->execute([$this->getName(), $setting_name]); unset($this->settings[$setting_name]); } elseif (!array_key_exists($setting_name, $this->settings)) { Database::prepare( "INSERT INTO `##module_setting` (module_name, setting_name, setting_value) VALUES (?, ?, ?)" - )->execute(array($this->getName(), $setting_name, $setting_value)); + )->execute([$this->getName(), $setting_name, $setting_value]); $this->settings[$setting_name] = $setting_value; } elseif ($setting_value != $this->settings[$setting_name]) { Database::prepare( "UPDATE `##module_setting` SET setting_value = ? WHERE module_name = ? AND setting_name = ?" - )->execute(array($setting_value, $this->getName(), $setting_name)); + )->execute([$setting_value, $this->getName(), $setting_name]); $this->settings[$setting_name] = $setting_value; } else { // Setting already exists, but with the same value - do nothing. @@ -213,11 +213,11 @@ abstract class AbstractModule { public function getAccessLevel(Tree $tree, $component) { $access_level = Database::prepare( "SELECT access_level FROM `##module_privacy` WHERE gedcom_id = :gedcom_id AND module_name = :module_name AND component = :component" - )->execute(array( + )->execute([ 'gedcom_id' => $tree->getTreeId(), 'module_name' => $this->getName(), 'component' => $component, - ))->fetchOne(); + ])->fetchOne(); if ($access_level === null) { return $this->defaultAccessLevel(); diff --git a/app/Module/AhnentafelReportModule.php b/app/Module/AhnentafelReportModule.php index c0b1e2357b..9a5daf2834 100644 --- a/app/Module/AhnentafelReportModule.php +++ b/app/Module/AhnentafelReportModule.php @@ -66,7 +66,7 @@ class AhnentafelReportModule extends AbstractModule implements ModuleReportInter $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/AlbumModule.php b/app/Module/AlbumModule.php index 186af104a9..86a35ceb4a 100644 --- a/app/Module/AlbumModule.php +++ b/app/Module/AlbumModule.php @@ -133,9 +133,9 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface { // View Notes if (strpos($media->getGedcom(), "\n1 NOTE")) { - $submenu = new Menu(I18N::translate('View the notes'), '#', '', array( + $submenu = new Menu(I18N::translate('View the notes'), '#', '', [ 'onclick' => 'modalNotes("' . Filter::escapeJs($notes) . '","' . I18N::translate('View the notes') . '"); return false;', - )); + ]); $submenu->addClass("submenuitem"); $menu->addSubmenu($submenu); } @@ -156,40 +156,40 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface { if (Auth::isEditor($media->getTree())) { // Edit Media - $submenu = new Menu(I18N::translate('Edit the media object'), '#', '', array( + $submenu = new Menu(I18N::translate('Edit the media object'), '#', '', [ 'onclick' => 'return window.open("addmedia.php?action=editmedia&pid=' . $media->getXref() . '", "_blank", edit_window_specs);', - )); + ]); $submenu->addClass("submenuitem"); $menu->addSubmenu($submenu); if (Auth::isAdmin()) { if (Module::getModuleByName('GEDFact_assistant')) { - $submenu = new Menu(I18N::translate('Manage the links'), '#', '', array( + $submenu = new Menu(I18N::translate('Manage the links'), '#', '', [ 'onclick' => 'return window.open("inverselink.php?mediaid=' . $media->getXref() . '&linkto=manage", "_blank", find_window_specs);', - )); + ]); $submenu->addClass("submenuitem"); $menu->addSubmenu($submenu); } else { - $submenu = new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', array( + $submenu = new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', [ 'onclick' => 'return ilinkitem("' . $media->getXref() . '","person");', - )); + ]); $submenu->addClass('submenuitem'); $menu->addSubmenu($submenu); - $submenu = new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', array( + $submenu = new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', [ 'onclick' => 'return ilinkitem("' . $media->getXref() . '","family");', - )); + ]); $submenu->addClass('submenuitem'); $menu->addSubmenu($submenu); - $submenu = new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', array( + $submenu = new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', [ 'onclick' => 'return ilinkitem("' . $media->getXref() . '","source");', - )); + ]); $submenu->addClass('submenuitem'); $menu->addSubmenu($submenu); } - $submenu = new Menu(I18N::translate('Unlink the media object'), '#', '', array( + $submenu = new Menu(I18N::translate('Unlink the media object'), '#', '', [ 'onclick' => 'return unlink_media("' . I18N::translate('Are you sure you want to remove links to this media object?') . '", "' . $controller->record->getXref() . '", "' . $media->getXref() . '");', - )); + ]); $submenu->addClass("submenuitem"); $menu->addSubmenu($submenu); } @@ -222,7 +222,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface { } } // Use all media from each fact - $this->media_list = array(); + $this->media_list = []; foreach ($facts as $fact) { // Don't show pending edits, as the user just sees duplicates if (!$fact->isPendingDeletion()) { @@ -238,7 +238,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface { // If a media object is linked twice, only show it once $this->media_list = array_unique($this->media_list); // Sort these using _WT_OBJE_SORT - $wt_obje_sort = array(); + $wt_obje_sort = []; foreach ($controller->record->getFacts('_WT_OBJE_SORT') as $fact) { $wt_obje_sort[] = trim($fact->getValue(), '@'); } diff --git a/app/Module/AncestorsChartModule.php b/app/Module/AncestorsChartModule.php index ae14654867..d6f8190bef 100644 --- a/app/Module/AncestorsChartModule.php +++ b/app/Module/AncestorsChartModule.php @@ -63,7 +63,7 @@ class AncestorsChartModule extends AbstractModule implements ModuleChartInterfac $this->getTitle(), 'ancestry.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-ancestry', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/BatchUpdate/BatchUpdateBasePlugin.php b/app/Module/BatchUpdate/BatchUpdateBasePlugin.php index 37b944ddb6..1a858e821c 100644 --- a/app/Module/BatchUpdate/BatchUpdateBasePlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateBasePlugin.php @@ -41,7 +41,7 @@ class BatchUpdateBasePlugin { * @return string[] */ public function getRecordTypesToUpdate() { - return array('INDI'); + return ['INDI']; } /** @@ -61,7 +61,7 @@ class BatchUpdateBasePlugin { '<div class="form-group">' . '<label class="control-label col-sm-3">' . I18N::translate('Keep the existing “last change” information') . '</label>' . '<div class="col-sm-9">' . - FunctionsEdit::radioButtons('chan', array(0 => I18N::translate('no'), 1 => I18N::translate('yes')), ($this->chan ? 1 : 0), 'class="radio-inline" onchange="this.form.submit();"') . + FunctionsEdit::radioButtons('chan', [0 => I18N::translate('no'), 1 => I18N::translate('yes')], ($this->chan ? 1 : 0), 'class="radio-inline" onchange="this.form.submit();"') . '</div></div>'; } @@ -74,14 +74,14 @@ class BatchUpdateBasePlugin { */ public function getActionButtons($xref) { if (Auth::user()->getPreference('auto_accept')) { - return array( + return [ BatchUpdateModule::createSubmitButton(I18N::translate('Update'), $xref, 'update'), BatchUpdateModule::createSubmitButton(I18N::translate('Update all'), $xref, 'update_all'), - ); + ]; } else { - return array( + return [ BatchUpdateModule::createSubmitButton(I18N::translate('Update'), $xref, 'update'), - ); + ]; } } @@ -97,7 +97,7 @@ class BatchUpdateBasePlugin { $new_lines = preg_split('/[\n]+/', $this->updateRecord($record->getXref(), $record->getGedcom())); $algorithm = new MyersDiff; $differences = $algorithm->calculate($old_lines, $new_lines); - $diff_lines = array(); + $diff_lines = []; foreach ($differences as $difference) { switch ($difference[1]) { diff --git a/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php b/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php index 6cc6723254..4dfdc89f08 100644 --- a/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php @@ -45,7 +45,7 @@ class BatchUpdateDuplicateLinksPlugin extends BatchUpdateBasePlugin { * @return string[] */ public function getRecordTypesToUpdate() { - return array('INDI', 'FAM', 'SOUR', 'REPO', 'NOTE', 'OBJE'); + return ['INDI', 'FAM', 'SOUR', 'REPO', 'NOTE', 'OBJE']; } /** @@ -73,11 +73,11 @@ class BatchUpdateDuplicateLinksPlugin extends BatchUpdateBasePlugin { */ public function updateRecord($xref, $gedrec) { return preg_replace( - array( + [ '/(\n1.*@.+@.*(?:(?:\n[2-9].*)*))((?:\n1.*(?:\n[2-9].*)*)*\1)/', '/(\n2.*@.+@.*(?:(?:\n[3-9].*)*))((?:\n2.*(?:\n[3-9].*)*)*\1)/', '/(\n3.*@.+@.*(?:(?:\n[4-9].*)*))((?:\n3.*(?:\n[4-9].*)*)*\1)/', - ), + ], '$2', $gedrec ); diff --git a/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php b/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php index f65d6a8936..26a88fba8e 100644 --- a/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php @@ -71,7 +71,7 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin { preg_match('/^1 NAME (.*)/m', $gedrec, $match); $wife_name = $match[1]; - $married_names = array(); + $married_names = []; foreach (self::surnamesToAdd($xref, $gedrec) as $surname) { switch ($this->surname) { case 'add': @@ -79,7 +79,7 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin { break; case 'replace': if ($SURNAME_TRADITION === 'polish') { - $surname = preg_replace(array('/ski$/', '/cki$/', '/dzki$/'), array('ska', 'cka', 'dzka'), $surname); + $surname = preg_replace(['/ski$/', '/cki$/', '/dzki$/'], ['ska', 'cka', 'dzka'], $surname); } $married_names[] = "\n2 _MARNM " . preg_replace('!/.*/!', '/' . $surname . '/', $wife_name); break; @@ -99,8 +99,8 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin { */ private function surnamesToAdd($xref, $gedrec) { $wife_surnames = self::surnames($xref, $gedrec); - $husb_surnames = array(); - $missing_surnames = array(); + $husb_surnames = []; + $missing_surnames = []; preg_match_all('/^1 FAMS @(.+)@/m', $gedrec, $fmatch); foreach ($fmatch[1] as $famid) { $famrec = BatchUpdateModule::getLatestRecord($famid, 'FAM'); @@ -130,7 +130,7 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin { if (preg_match_all('/^(?:1 NAME|2 _MARNM) .*\/(.+)\//m', $gedrec, $match)) { return $match[1]; } else { - return array(); + return []; } } diff --git a/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php b/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php index f45178b58e..49932d521c 100644 --- a/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php @@ -63,14 +63,14 @@ class BatchUpdateNameFormatPlugin extends BatchUpdateBasePlugin { */ public function updateRecord($xref, $gedrec) { return preg_replace( - array( + [ '/^((?:1 NAME|2 (?:FONE|ROMN|_MARNM|_AKA|_HEB)) [^\/\n]*\/[^\/\n]*)$/m', '/^((?:1 NAME|2 (?:FONE|ROMN|_MARNM|_AKA|_HEB)) [^\/\n]*[^\/ ])(\/)/m', - ), - array( + ], + [ '$1/', '$1 $2', - ), + ], $gedrec ); } diff --git a/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php b/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php index 6c0290a07e..fe6e829dfb 100644 --- a/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php @@ -65,7 +65,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin { * @return string[] */ public function getRecordTypesToUpdate() { - return array('INDI', 'FAM', 'SOUR', 'REPO', 'NOTE', 'OBJE'); + return ['INDI', 'FAM', 'SOUR', 'REPO', 'NOTE', 'OBJE']; } /** @@ -113,7 +113,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin { $this->regex = '\b' . preg_quote($this->search, '/') . '\b'; break; case 'wildcards': - $this->regex = '\b' . str_replace(array('\*', '\?'), array('.*', '.'), preg_quote($this->search, '/')) . '\b'; + $this->regex = '\b' . str_replace(['\*', '\?'], ['.*', '.'], preg_quote($this->search, '/')) . '\b'; break; case 'regex': $this->regex = $this->search; @@ -135,12 +135,12 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin { * @return string */ public function getOptionsForm() { - $descriptions = array( + $descriptions = [ 'exact' => I18N::translate('Match the exact text, even if it occurs in the middle of a word.'), 'words' => I18N::translate('Match the exact text, unless it occurs in the middle of a word.'), 'wildcards' => I18N::translate('Use a “?” to match a single character, use “*” to match zero or more characters.'), 'regex' => /* I18N: http://en.wikipedia.org/wiki/Regular_expression */ I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . /* I18N: %s is a URL */ I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'), - ); + ]; return '<div class="form-group">' . @@ -169,7 +169,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin { '<div class="form-group">' . '<label class="control-label col-sm-3">' . I18N::translate('Case insensitive') . '</label>' . '<div class="col-sm-9">' . - FunctionsEdit::radioButtons('case', array('I' => I18N::translate('no'), 'i' => I18N::translate('yes')), ($this->case ? 'i' : 'I'), 'class="radio-inline" onchange="this.form.submit();"') . + FunctionsEdit::radioButtons('case', ['I' => I18N::translate('no'), 'i' => I18N::translate('yes')], ($this->case ? 'i' : 'I'), 'class="radio-inline" onchange="this.form.submit();"') . '<p class="small text-muted">' . /* I18N: Help text for "Case insensitive" searches */ I18N::translate('Match both upper and lower case letters.') . '</p>' . '</div></div>' . parent::getOptionsForm(); diff --git a/app/Module/BatchUpdateModule.php b/app/Module/BatchUpdateModule.php index e216dcb9b7..46bdafad4e 100644 --- a/app/Module/BatchUpdateModule.php +++ b/app/Module/BatchUpdateModule.php @@ -309,8 +309,8 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface private function getAllXrefs() { global $WT_TREE; - $sql = array(); - $vars = array(); + $sql = []; + $vars = []; foreach ($this->PLUGIN->getRecordTypesToUpdate() as $type) { switch ($type) { case 'INDI': @@ -349,7 +349,7 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface * @return BatchUpdateBasePlugin[] */ private function getPluginList() { - $plugins = array(); + $plugins = []; $dir_handle = opendir(__DIR__ . '/BatchUpdate'); while (($file = readdir($dir_handle)) !== false) { if (substr($file, -10) == 'Plugin.php' && $file !== 'BatchUpdateBasePlugin.php') { diff --git a/app/Module/BirthDeathMarriageReportModule.php b/app/Module/BirthDeathMarriageReportModule.php index 7bfe9113b9..11a158e901 100644 --- a/app/Module/BirthDeathMarriageReportModule.php +++ b/app/Module/BirthDeathMarriageReportModule.php @@ -66,7 +66,7 @@ class BirthDeathMarriageReportModule extends AbstractModule implements ModuleRep $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/BirthReportModule.php b/app/Module/BirthReportModule.php index 2ac75ae1c8..74f03a9f97 100644 --- a/app/Module/BirthReportModule.php +++ b/app/Module/BirthReportModule.php @@ -58,7 +58,7 @@ class BirthReportModule extends AbstractModule implements ModuleReportInterface $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/CemeteryReportModule.php b/app/Module/CemeteryReportModule.php index e58c0a4215..f1b2ae08bc 100644 --- a/app/Module/CemeteryReportModule.php +++ b/app/Module/CemeteryReportModule.php @@ -58,7 +58,7 @@ class CemeteryReportModule extends AbstractModule implements ModuleReportInterfa $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/CensusAssistantModule.php b/app/Module/CensusAssistantModule.php index e2e9cc082a..7ed40cffde 100644 --- a/app/Module/CensusAssistantModule.php +++ b/app/Module/CensusAssistantModule.php @@ -96,7 +96,7 @@ class CensusAssistantModule extends AbstractModule { // Output Individual for GEDFact Assistant ====================== echo '<table class="list_table width90">'; - $myindilist = FunctionsDb::searchIndividualNames($filter_array, array($WT_TREE)); + $myindilist = FunctionsDb::searchIndividualNames($filter_array, [$WT_TREE]); if ($myindilist) { echo '<tr><td class="list_value_wrap"><ul>'; usort($myindilist, '\Fisharebest\Webtrees\GedcomRecord::compare'); @@ -192,7 +192,7 @@ class CensusAssistantModule extends AbstractModule { $filter = trim($filter); $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); echo '<table class="tabs_table width90"><tr>'; - $myindilist = FunctionsDb::searchIndividualNames($filter_array, array($WT_TREE)); + $myindilist = FunctionsDb::searchIndividualNames($filter_array, [$WT_TREE]); if ($myindilist) { echo '<td class="list_value_wrap"><ul>'; usort($myindilist, '\Fisharebest\Webtrees\GedcomRecord::compare'); @@ -291,7 +291,7 @@ class CensusAssistantModule extends AbstractModule { // Get the column headers for the census to which this note refers // requires the fact place & date to match the specific census // censusPlace() (Soundex match) and censusDate() functions - $fmt_headers = array(); + $fmt_headers = []; $linkedRecords = array_merge($note->linkedIndividuals('NOTE'), $note->linkedFamilies('NOTE')); $firstRecord = array_shift($linkedRecords); if ($firstRecord) { @@ -427,7 +427,7 @@ class CensusAssistantModule extends AbstractModule { Functions::getCloseRelationshipName($head, $grandparent) . ' - ' . $grandparent->getFullName(), '#', '', - array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $grandparent, $head)) . '");') + ['onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $grandparent, $head)) . '");'] ); $submenu->addClass('submenuitem', ''); $menu->addSubmenu($submenu); @@ -465,7 +465,7 @@ class CensusAssistantModule extends AbstractModule { Functions::getCloseRelationshipName($head, $spouse_family_spouse) . ' - ' . $spouse_family_spouse->getFullName(), '#', '', - array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_spouse, $head)) . '");') + ['onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_spouse, $head)) . '");'] ); $submenu->addClass('submenuitem', ''); $menu->addSubmenu($submenu); @@ -477,7 +477,7 @@ class CensusAssistantModule extends AbstractModule { Functions::getCloseRelationshipName($head, $spouse_family_child) . ' - ' . $spouse_family_child->getFullName(), '#', '', - array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_child, $head)) . '");') + ['onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_child, $head)) . '");'] ); $submenu->addClass('submenuitem', ''); $menu->addSubmenu($submenu); diff --git a/app/Module/ChangeReportModule.php b/app/Module/ChangeReportModule.php index dfc6b45a07..a2141b4153 100644 --- a/app/Module/ChangeReportModule.php +++ b/app/Module/ChangeReportModule.php @@ -58,7 +58,7 @@ class ChangeReportModule extends AbstractModule implements ModuleReportInterface $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/ChartsBlockModule.php b/app/Module/ChartsBlockModule.php index 5795b6361b..cc7a38d5db 100644 --- a/app/Module/ChartsBlockModule.php +++ b/app/Module/ChartsBlockModule.php @@ -48,7 +48,7 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $WT_TREE, $ctype, $controller; $PEDIGREE_ROOT_ID = $WT_TREE->getPreference('PEDIGREE_ROOT_ID'); @@ -58,7 +58,7 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { $type = $this->getBlockSetting($block_id, 'type', 'pedigree'); $pid = $this->getBlockSetting($block_id, 'pid', Auth::check() ? ($gedcomid ? $gedcomid : $PEDIGREE_ROOT_ID) : $PEDIGREE_ROOT_ID); - foreach (array('details', 'type', 'pid', 'block') as $name) { + foreach (['details', 'type', 'pid', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -181,12 +181,12 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { $type = $this->getBlockSetting($block_id, 'type', 'pedigree'); $pid = $this->getBlockSetting($block_id, 'pid', Auth::check() ? ($gedcomid ? $gedcomid : $PEDIGREE_ROOT_ID) : $PEDIGREE_ROOT_ID); - $charts = array( + $charts = [ 'pedigree' => I18N::translate('Pedigree'), 'descendants' => I18N::translate('Descendants'), 'hourglass' => I18N::translate('Hourglass chart'), 'treenav' => I18N::translate('Interactive tree'), - ); + ]; uasort($charts, 'Fisharebest\Webtrees\I18N::strcasecmp'); $controller diff --git a/app/Module/ClippingsCart/ClippingsCartController.php b/app/Module/ClippingsCart/ClippingsCartController.php index 845ee6499c..5e21d9aa8c 100644 --- a/app/Module/ClippingsCart/ClippingsCartController.php +++ b/app/Module/ClippingsCart/ClippingsCartController.php @@ -74,10 +74,10 @@ class ClippingsCartController { global $WT_TREE; // Our cart is an array of items in the session - $this->cart = Session::get('cart', array()); + $this->cart = Session::get('cart', []); if (!array_key_exists($WT_TREE->getTreeId(), $this->cart)) { - $this->cart[$WT_TREE->getTreeId()] = array(); + $this->cart[$WT_TREE->getTreeId()] = []; } $this->action = Filter::get('action'); @@ -159,27 +159,27 @@ class ClippingsCartController { $this->addFamilyDescendancy($family, $this->level3); } } - uksort($this->cart[$WT_TREE->getTreeId()], array($this, 'compareClippings')); + uksort($this->cart[$WT_TREE->getTreeId()], [$this, 'compareClippings']); } } elseif ($this->action === 'remove') { unset($this->cart[$WT_TREE->getTreeId()][$this->id]); } elseif ($this->action === 'empty') { - $this->cart[$WT_TREE->getTreeId()] = array(); + $this->cart[$WT_TREE->getTreeId()] = []; } elseif ($this->action === 'download') { - $media = array(); + $media = []; $mediacount = 0; $filetext = FunctionsExport::gedcomHeader($WT_TREE); // Include SUBM/SUBN records, if they exist $subn = Database::prepare("SELECT o_gedcom FROM `##other` WHERE o_type=? AND o_file=?") - ->execute(array('SUBN', $WT_TREE->getTreeId())) + ->execute(['SUBN', $WT_TREE->getTreeId()]) ->fetchOne(); if ($subn) { $filetext .= $subn . "\n"; } $subm = Database::prepare("SELECT o_gedcom FROM `##other` WHERE o_type=? AND o_file=?") - ->execute(array('SUBM', $WT_TREE->getTreeId())) + ->execute(['SUBM', $WT_TREE->getTreeId()]) ->fetchOne(); if ($subm) { $filetext .= $subm . "\n"; @@ -257,10 +257,10 @@ class ClippingsCartController { for ($k = 0; $k < $ft; $k++) { // Skip external files and non-existant files if (file_exists(WT_DATA_DIR . $MEDIA_DIRECTORY . $match[$k][1])) { - $media[$mediacount] = array( + $media[$mediacount] = [ \PCLZIP_ATT_FILE_NAME => WT_DATA_DIR . $MEDIA_DIRECTORY . $match[$k][1], \PCLZIP_ATT_FILE_NEW_FULL_NAME => $match[$k][1], - ); + ]; $mediacount++; } } @@ -273,7 +273,7 @@ class ClippingsCartController { if ($this->IncludeMedia === "yes") { $this->media_list = $media; } else { - $this->media_list = array(); + $this->media_list = []; } $filetext .= "0 @WEBTREES@ SOUR\n1 TITL " . WT_BASE_URL . "\n"; if ($user_id = $WT_TREE->getPreference('CONTACT_EMAIL')) { @@ -305,7 +305,7 @@ class ClippingsCartController { $comment = "Created by " . WT_WEBTREES . " " . WT_VERSION . " on " . date("d M Y") . "."; $archive = new PclZip($fname); // add the ged file to the root of the zip file (strip off the data folder) - $this->media_list[] = array(\PCLZIP_ATT_FILE_NAME => WT_DATA_DIR . $tempFileName, \PCLZIP_ATT_FILE_NEW_FULL_NAME => $tempFileName); + $this->media_list[] = [\PCLZIP_ATT_FILE_NAME => WT_DATA_DIR . $tempFileName, \PCLZIP_ATT_FILE_NEW_FULL_NAME => $tempFileName]; $v_list = $archive->create($this->media_list, \PCLZIP_OPT_COMMENT, $comment); if ($v_list == 0) { echo "Error : " . $archive->errorInfo(true) . "</td></tr>"; diff --git a/app/Module/ClippingsCartModule.php b/app/Module/ClippingsCartModule.php index 6ebc4bd25c..a511758b92 100644 --- a/app/Module/ClippingsCartModule.php +++ b/app/Module/ClippingsCartModule.php @@ -554,18 +554,18 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, public function getMenu() { global $controller, $WT_TREE; - $submenus = array(); + $submenus = []; if (isset($controller->record)) { - $submenus[] = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippingscart', array('rel' => 'nofollow')); + $submenus[] = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippingscart', ['rel' => 'nofollow']); } if (!empty($controller->record) && $controller->record->canShow()) { - $submenus[] = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd', array('rel' => 'nofollow')); + $submenus[] = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd', ['rel' => 'nofollow']); } if ($submenus) { - return new Menu($this->getTitle(), '#', 'menu-clippings', array('rel' => 'nofollow'), $submenus); + return new Menu($this->getTitle(), '#', 'menu-clippings', ['rel' => 'nofollow'], $submenus); } else { - return new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings', array('rel' => 'nofollow')); + return new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings', ['rel' => 'nofollow']); } } @@ -651,7 +651,7 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, unset($cart[$WT_TREE->getTreeId()][$remove]); Session::put('cart', $cart); } elseif (isset($_REQUEST['empty'])) { - $cart[$WT_TREE->getTreeId()] = array(); + $cart[$WT_TREE->getTreeId()] = []; Session::put('cart', $cart); } elseif (isset($_REQUEST['download'])) { return $this->downloadForm($clip_ctrl); @@ -668,9 +668,9 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, public function getCartList() { global $WT_TREE; - $cart = Session::get('cart', array()); + $cart = Session::get('cart', []); if (!array_key_exists($WT_TREE->getTreeId(), $cart)) { - $cart[$WT_TREE->getTreeId()] = array(); + $cart[$WT_TREE->getTreeId()] = []; } $pid = Filter::get('pid', WT_REGEX_XREF); diff --git a/app/Module/CompactTreeChartModule.php b/app/Module/CompactTreeChartModule.php index 07146e52c9..a6705df279 100644 --- a/app/Module/CompactTreeChartModule.php +++ b/app/Module/CompactTreeChartModule.php @@ -63,7 +63,7 @@ class CompactTreeChartModule extends AbstractModule implements ModuleChartInterf $this->getTitle(), 'compact.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-compact', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/DeathReportModule.php b/app/Module/DeathReportModule.php index 72285e675c..84716db882 100644 --- a/app/Module/DeathReportModule.php +++ b/app/Module/DeathReportModule.php @@ -58,7 +58,7 @@ class DeathReportModule extends AbstractModule implements ModuleReportInterface $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/DescendancyChartModule.php b/app/Module/DescendancyChartModule.php index f074aa8886..27a59ef9c5 100644 --- a/app/Module/DescendancyChartModule.php +++ b/app/Module/DescendancyChartModule.php @@ -63,7 +63,7 @@ class DescendancyChartModule extends AbstractModule implements ModuleChartInterf $this->getTitle(), 'descendancy.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-descendants', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/DescendancyModule.php b/app/Module/DescendancyModule.php index a674b25de0..01a005eac4 100644 --- a/app/Module/DescendancyModule.php +++ b/app/Module/DescendancyModule.php @@ -212,10 +212,10 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface " JOIN `##name` ON i_id = n_id AND i_file = n_file" . " WHERE n_sort LIKE CONCAT('%', :query, '%') AND i_file = :tree_id" . " ORDER BY n_sort" - )->execute(array( + )->execute([ 'query' => $query, 'tree_id' => $tree->getTreeId(), - ))->fetchAll(); + ])->fetchAll(); $out = ''; foreach ($rows as $row) { diff --git a/app/Module/DescendancyReportModule.php b/app/Module/DescendancyReportModule.php index 715a5dfa39..bfdc7d1946 100644 --- a/app/Module/DescendancyReportModule.php +++ b/app/Module/DescendancyReportModule.php @@ -58,7 +58,7 @@ class DescendancyReportModule extends AbstractModule implements ModuleReportInte $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/ExtraInformationModule.php b/app/Module/ExtraInformationModule.php index df9fedc188..c27357739c 100644 --- a/app/Module/ExtraInformationModule.php +++ b/app/Module/ExtraInformationModule.php @@ -52,7 +52,7 @@ class ExtraInformationModule extends AbstractModule implements ModuleSidebarInte public function getSidebarContent() { global $controller; - $indifacts = array(); + $indifacts = []; // The individual’s own facts foreach ($controller->record->getFacts() as $fact) { if (self::showFact($fact)) { diff --git a/app/Module/FactSourcesReportModule.php b/app/Module/FactSourcesReportModule.php index d29fd08d8c..a3712ad035 100644 --- a/app/Module/FactSourcesReportModule.php +++ b/app/Module/FactSourcesReportModule.php @@ -58,7 +58,7 @@ class FactSourcesReportModule extends AbstractModule implements ModuleReportInte $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/FamiliesSidebarModule.php b/app/Module/FamiliesSidebarModule.php index d7e00f1d3c..10a7b7d4db 100644 --- a/app/Module/FamiliesSidebarModule.php +++ b/app/Module/FamiliesSidebarModule.php @@ -242,19 +242,19 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter " AND i_id = n_id AND i_file = n_file AND i_file = :tree_id" . " ORDER BY n_sort COLLATE :collation" . " LIMIT 50" - )->execute(array( + )->execute([ 'query_1' => $query, 'query_2' => $query, 'tree_id' => $tree->getTreeId(), 'collation' => I18N::collation(), - ))->fetchAll(); + ])->fetchAll(); - $ids = array(); + $ids = []; foreach ($rows as $row) { $ids[] = $row->xref; } - $vars = array(); + $vars = []; if (empty($ids)) { //-- no match : search for FAM id $where = "f_id LIKE CONCAT('%', ?, '%')"; diff --git a/app/Module/FamilyBookChartModule.php b/app/Module/FamilyBookChartModule.php index 46f2d0bcb6..d7acc136d1 100644 --- a/app/Module/FamilyBookChartModule.php +++ b/app/Module/FamilyBookChartModule.php @@ -63,7 +63,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa $this->getTitle(), 'familybook.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-familybook', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/FamilyGroupReportModule.php b/app/Module/FamilyGroupReportModule.php index b3eb7963b9..acdc4d6db2 100644 --- a/app/Module/FamilyGroupReportModule.php +++ b/app/Module/FamilyGroupReportModule.php @@ -58,7 +58,7 @@ class FamilyGroupReportModule extends AbstractModule implements ModuleReportInte $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&famid=' . $controller->getSignificantFamily()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/FamilyTreeFavoritesModule.php b/app/Module/FamilyTreeFavoritesModule.php index 1276b51629..4ad70fd461 100644 --- a/app/Module/FamilyTreeFavoritesModule.php +++ b/app/Module/FamilyTreeFavoritesModule.php @@ -80,7 +80,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $controller, $WT_TREE; $action = Filter::get('action'); @@ -100,7 +100,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt if ($gid) { $record = GedcomRecord::getInstance($gid, $WT_TREE); if ($record && $record->canShow()) { - self::addFavorite(array( + self::addFavorite([ 'user_id' => $ctype === 'user' ? Auth::id() : null, 'gedcom_id' => $WT_TREE->getTreeId(), 'gid' => $record->getXref(), @@ -108,10 +108,10 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt 'url' => null, 'note' => $favnote, 'title' => $favtitle, - )); + ]); } } elseif ($url) { - self::addFavorite(array( + self::addFavorite([ 'user_id' => $ctype === 'user' ? Auth::id() : null, 'gedcom_id' => $WT_TREE->getTreeId(), 'gid' => null, @@ -119,14 +119,14 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt 'url' => $url, 'note' => $favnote, 'title' => $favtitle ? $favtitle : $url, - )); + ]); } break; } $block = $this->getBlockSetting($block_id, 'block', '0'); - foreach (array('block') as $name) { + foreach (['block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -134,7 +134,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt $userfavs = $this->getFavorites($ctype === 'user' ? Auth::id() : $WT_TREE->getTreeId()); if (!is_array($userfavs)) { - $userfavs = array(); + $userfavs = []; } $id = $this->getName() . $block_id; @@ -299,7 +299,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt public static function deleteFavorite($favorite_id) { return (bool) Database::prepare("DELETE FROM `##favorite` WHERE favorite_id=?") - ->execute(array($favorite_id)); + ->execute([$favorite_id]); } /** @@ -319,10 +319,10 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt $sql = "SELECT SQL_NO_CACHE 1 FROM `##favorite` WHERE"; if (!empty($favorite['gid'])) { $sql .= " xref=?"; - $vars = array($favorite['gid']); + $vars = [$favorite['gid']]; } else { $sql .= " url=?"; - $vars = array($favorite['url']); + $vars = [$favorite['url']]; } $sql .= " AND gedcom_id=?"; $vars[] = $favorite['gedcom_id']; @@ -340,7 +340,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt //-- add the favorite to the database return (bool) Database::prepare("INSERT INTO `##favorite` (user_id, gedcom_id, xref, favorite_type, url, title, note) VALUES (? ,? ,? ,? ,? ,? ,?)") - ->execute(array($favorite['user_id'], $favorite['gedcom_id'], $favorite['gid'], $favorite['type'], $favorite['url'], $favorite['title'], $favorite['note'])); + ->execute([$favorite['user_id'], $favorite['gedcom_id'], $favorite['gid'], $favorite['type'], $favorite['url'], $favorite['title'], $favorite['note']]); } /** @@ -355,7 +355,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt Database::prepare( "SELECT SQL_CACHE favorite_id AS id, user_id, gedcom_id, xref AS gid, favorite_type AS type, title, note, url" . " FROM `##favorite` WHERE gedcom_id=? AND user_id IS NULL") - ->execute(array($gedcom_id)) + ->execute([$gedcom_id]) ->fetchAll(PDO::FETCH_ASSOC); } } diff --git a/app/Module/FamilyTreeNewsModule.php b/app/Module/FamilyTreeNewsModule.php index 03cc2623ca..c6c4478ece 100644 --- a/app/Module/FamilyTreeNewsModule.php +++ b/app/Module/FamilyTreeNewsModule.php @@ -71,14 +71,14 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; switch (Filter::get('action')) { case 'deletenews': $news_id = Filter::get('news_id'); if ($news_id) { - Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute(array($news_id)); + Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute([$news_id]); } break; } @@ -88,17 +88,17 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac $articles = Database::prepare( "SELECT SQL_CACHE news_id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) + :offset AS updated, subject, body FROM `##news` WHERE gedcom_id = :tree_id ORDER BY updated DESC LIMIT :limit" - )->execute(array( + )->execute([ 'offset' => WT_TIMESTAMP_OFFSET, 'tree_id' => $WT_TREE->getTreeId(), 'limit' => $limit, - ))->fetchAll(); + ])->fetchAll(); $count = Database::prepare( "SELECT SQL_CACHE COUNT(*) FROM `##news` WHERE gedcom_id = :tree_id" - )->execute(array( + )->execute([ 'tree_id' => $WT_TREE->getTreeId(), - ))->fetchOne(); + ])->fetchOne(); $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php index 2e681cb0f8..86359e95df 100644 --- a/app/Module/FamilyTreeStatisticsModule.php +++ b/app/Module/FamilyTreeStatisticsModule.php @@ -51,7 +51,7 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $WT_TREE, $ctype; $show_last_update = $this->getBlockSetting($block_id, 'show_last_update', '1'); @@ -77,7 +77,7 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn // This can be overriden when embedding in an HTML block $block = '0'; - foreach (array('show_common_surnames', 'number_common_surnames', 'stat_indi', 'stat_fam', 'stat_sour', 'stat_media', 'stat_surname', 'stat_events', 'stat_users', 'stat_first_birth', 'stat_last_birth', 'stat_first_death', 'stat_last_death', 'stat_long_life', 'stat_avg_life', 'stat_most_chil', 'stat_avg_chil', 'block') as $name) { + foreach (['show_common_surnames', 'number_common_surnames', 'stat_indi', 'stat_fam', 'stat_sour', 'stat_media', 'stat_surname', 'stat_events', 'stat_users', 'stat_first_birth', 'stat_last_birth', 'stat_first_death', 'stat_last_death', 'stat_long_life', 'stat_avg_life', 'stat_most_chil', 'stat_avg_chil', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -201,7 +201,7 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn if ($show_common_surnames) { $surnames = FunctionsDb::getTopSurnames($WT_TREE->getTreeId(), 0, (int) $number_of_surnames); - $all_surnames = array(); + $all_surnames = []; foreach (array_keys($surnames) as $surname) { $all_surnames = array_merge($all_surnames, QueryName::surnames($WT_TREE, $surname, '', false, false)); } diff --git a/app/Module/FanChartModule.php b/app/Module/FanChartModule.php index 24f2afe9aa..25a8819243 100644 --- a/app/Module/FanChartModule.php +++ b/app/Module/FanChartModule.php @@ -66,7 +66,7 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface { $this->getTitle(), 'fanchart.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-fanchart', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } else { return null; diff --git a/app/Module/FrequentlyAskedQuestionsModule.php b/app/Module/FrequentlyAskedQuestionsModule.php index 423a721e77..b444163234 100644 --- a/app/Module/FrequentlyAskedQuestionsModule.php +++ b/app/Module/FrequentlyAskedQuestionsModule.php @@ -99,19 +99,19 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen if ($block_id) { Database::prepare( "UPDATE `##block` SET gedcom_id = NULLIF(:tree_id, '0'), block_order = :block_order WHERE block_id = :block_id" - )->execute(array( + )->execute([ 'tree_id' => Filter::postInteger('gedcom_id'), 'block_order' => Filter::postInteger('block_order'), 'block_id' => $block_id, - )); + ]); } else { Database::prepare( "INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(:tree_id, '0'), :module_name, :block_order)" - )->execute(array( + )->execute([ 'tree_id' => Filter::postInteger('gedcom_id'), 'module_name' => $this->getName(), 'block_order' => Filter::postInteger('block_order'), - )); + ]); $block_id = Database::getInstance()->lastInsertId(); } $this->setBlockSetting($block_id, 'header', Filter::post('header')); @@ -138,17 +138,17 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen $faqbody = $this->getBlockSetting($block_id, 'faqbody'); $block_order = Database::prepare( "SELECT block_order FROM `##block` WHERE block_id = :block_id" - )->execute(array('block_id' => $block_id))->fetchOne(); + )->execute(['block_id' => $block_id])->fetchOne(); $gedcom_id = Database::prepare( "SELECT gedcom_id FROM `##block` WHERE block_id = :block_id" - )->execute(array('block_id' => $block_id))->fetchOne(); + )->execute(['block_id' => $block_id])->fetchOne(); } else { $controller->setPageTitle(/* I18N: FAQ = “Frequently Asked Question” */ I18N::translate('Add an FAQ')); $header = ''; $faqbody = ''; $block_order = Database::prepare( "SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name = :module_name" - )->execute(array('module_name' => $this->getName()))->fetchOne(); + )->execute(['module_name' => $this->getName()])->fetchOne(); $gedcom_id = $WT_TREE->getTreeId(); } $controller->pageHeader(); @@ -246,11 +246,11 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen Database::prepare( "DELETE FROM `##block_setting` WHERE block_id = :block_id" - )->execute(array('block_id' => $block_id)); + )->execute(['block_id' => $block_id]); Database::prepare( "DELETE FROM `##block` WHERE block_id = :block_id" - )->execute(array('block_id' => $block_id)); + )->execute(['block_id' => $block_id]); } /** @@ -261,7 +261,7 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen $block_order = Database::prepare( "SELECT block_order FROM `##block` WHERE block_id = :block_id" - )->execute(array('block_id' => $block_id))->fetchOne(); + )->execute(['block_id' => $block_id])->fetchOne(); $swap_block = Database::prepare( "SELECT block_order, block_id" . @@ -270,24 +270,24 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen " SELECT MAX(block_order) FROM `##block` WHERE block_order < :block_order AND module_name = :module_name_1" . " ) AND module_name = :module_name_2" . " LIMIT 1" - )->execute(array( + )->execute([ 'block_order' => $block_order, 'module_name_1' => $this->getName(), 'module_name_2' => $this->getName(), - ))->fetchOneRow(); + ])->fetchOneRow(); if ($swap_block) { Database::prepare( "UPDATE `##block` SET block_order = :block_order WHERE block_id = :block_id" - )->execute(array( + )->execute([ 'block_order' => $swap_block->block_order, 'block_id' => $block_id, - )); + ]); Database::prepare( "UPDATE `##block` SET block_order = :block_order WHERE block_id = :block_id" - )->execute(array( + )->execute([ 'block_order' => $block_order, 'block_id' => $swap_block->block_id, - )); + ]); } } @@ -299,9 +299,9 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen $block_order = Database::prepare( "SELECT block_order FROM `##block` WHERE block_id = :block_id" - )->execute(array( + )->execute([ 'block_id' => $block_id, - ))->fetchOne(); + ])->fetchOne(); $swap_block = Database::prepare( "SELECT block_order, block_id" . @@ -310,24 +310,24 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen " SELECT MIN(block_order) FROM `##block` WHERE block_order > :block_order AND module_name = :module_name_1" . " ) AND module_name = :module_name_2" . " LIMIT 1" - )->execute(array( + )->execute([ 'block_order' => $block_order, 'module_name_1' => $this->getName(), 'module_name_2' => $this->getName(), - ))->fetchOneRow(); + ])->fetchOneRow(); if ($swap_block) { Database::prepare( "UPDATE `##block` SET block_order = :block_order WHERE block_id = :block_id" - )->execute(array( + )->execute([ 'block_order' => $swap_block->block_order, 'block_id' => $block_id, - )); + ]); Database::prepare( "UPDATE `##block` SET block_order = :block_order WHERE block_id = :block_id" - )->execute(array( + )->execute([ 'block_order' => $block_order, 'block_id' => $swap_block->block_id, - )); + ]); } } @@ -354,11 +354,11 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen " AND bs3.setting_name = 'languages'" . " AND IFNULL(gedcom_id, :tree_id_1) = :tree_id_2" . " ORDER BY block_order" - )->execute(array( + )->execute([ 'module_name' => $this->getName(), 'tree_id_1' => $WT_TREE->getTreeId(), 'tree_id_2' => $WT_TREE->getTreeId(), - ))->fetchAll(); + ])->fetchAll(); echo '<h2 class="center">', I18N::translate('Frequently asked questions'); if (Auth::isManager($WT_TREE)) { @@ -415,23 +415,23 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen " AND bs2.setting_name = 'faqbody'" . " AND IFNULL(gedcom_id, :tree_id_1) = :tree_id_2" . " ORDER BY block_order" - )->execute(array( + )->execute([ 'module_name' => $this->getName(), 'tree_id_1' => $WT_TREE->getTreeId(), 'tree_id_2' => $WT_TREE->getTreeId(), - ))->fetchAll(); + ])->fetchAll(); $min_block_order = Database::prepare( "SELECT MIN(block_order) FROM `##block` WHERE module_name = 'faq' AND (gedcom_id = :tree_id OR gedcom_id IS NULL)" - )->execute(array( + )->execute([ 'tree_id' => $WT_TREE->getTreeId(), - ))->fetchOne(); + ])->fetchOne(); $max_block_order = Database::prepare( "SELECT MAX(block_order) FROM `##block` WHERE module_name = 'faq' AND (gedcom_id = :tree_id OR gedcom_id IS NULL)" - )->execute(array( + )->execute([ 'tree_id' => $WT_TREE->getTreeId(), - ))->fetchOne(); + ])->fetchOne(); ?> <ol class="breadcrumb small"> @@ -526,12 +526,12 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen " JOIN `##block_setting` USING (block_id)" . " WHERE module_name = :module_name AND IFNULL(gedcom_id, :tree_id_1) = :tree_id_2" . " AND setting_name='languages' AND (setting_value LIKE CONCAT('%', :locale, '%') OR setting_value='')" - )->execute(array( + )->execute([ 'module_name' => $this->getName(), 'tree_id_1' => $WT_TREE->getTreeId(), 'tree_id_2' => $WT_TREE->getTreeId(), 'locale' => WT_LOCALE, - ))->fetchAll(); + ])->fetchAll(); if ($faqs) { return new Menu($this->getTitle(), 'module.php?mod=faq&mod_action=show', 'menu-help'); diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php index a486b8ca1d..c903a40441 100644 --- a/app/Module/GoogleMapsModule.php +++ b/app/Module/GoogleMapsModule.php @@ -62,7 +62,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, const SCHEMA_MIGRATION_PREFIX = '\Fisharebest\Webtrees\Module\GoogleMaps\Schema'; /** @var Individual[] of ancestors of root person */ - private $ancestors = array(); + private $ancestors = []; /** @var int Number of nodes in the chart */ private $treesize; @@ -210,7 +210,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, I18N::translate('Pedigree map'), 'module.php?mod=googlemap&mod_action=pedigree_map&rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-pedigree_map', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } @@ -322,12 +322,12 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, </label> <div class="col-sm-9"> <?php - $options = array( + $options = [ 'ROADMAP' => I18N::translate('Map'), 'SATELLITE' => I18N::translate('Satellite'), 'HYBRID' => I18N::translate('Hybrid'), 'TERRAIN' => I18N::translate('Terrain'), - ); + ]; echo FunctionsEdit::selectEditControl('GM_MAP_TYPE', $options, null, $this->getSetting('GM_MAP_TYPE'), 'class="form-control"'); ?> </div> @@ -339,7 +339,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, <?php echo /* I18N: http://en.wikipedia.org/wiki/Google_street_view */ I18N::translate('Google Street View™') ?> </legend> <div class="col-sm-9"> - <?php echo FunctionsEdit::radioButtons('GM_USE_STREETVIEW', array(false => I18N::translate('hide'), true => I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW'), 'class="radio-inline"') ?> + <?php echo FunctionsEdit::radioButtons('GM_USE_STREETVIEW', [false => I18N::translate('hide'), true => I18N::translate('show')], $this->getSetting('GM_USE_STREETVIEW'), 'class="radio-inline"') ?> </div> </fieldset> @@ -453,10 +453,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, </label> <div class="col-sm-9"> <?php - $ph_options = array( + $ph_options = [ 'G_DEFAULT_ICON' => I18N::translate('Standard'), 'G_FLAG' => I18N::translate('Flag'), - ); + ]; echo FunctionsEdit::selectEditControl('GM_PH_MARKER', $ph_options, null, $this->getSetting('GM_PH_MARKER'), 'class="form-control"'); ?> </div> @@ -503,7 +503,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $countrySelected = Filter::get('countrySelected', null, 'Countries'); $stateSelected = Filter::get('stateSelected', null, 'States'); - $country = array(); + $country = []; if (is_dir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/flags')) { $files = glob(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/flags/*.png'); foreach ($files as $file) { @@ -514,7 +514,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, if ($countrySelected == 'Countries') { $flags = $country; } else { - $flags = array(); + $flags = []; if (is_dir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags')) { $files = glob(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/*.png'); foreach ($files as $file) { @@ -523,7 +523,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } } - $flags_s = array(); + $flags_s = []; if ($stateSelected != 'States' && is_dir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/' . $stateSelected)) { $files = glob(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/' . $stateSelected . '/*.png'); foreach ($files as $file) { @@ -564,7 +564,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, </script> <?php } - $countryList = array(); + $countryList = []; foreach ($country as $item) { if (is_dir(WT_MODULES_DIR . 'googlemap/places/' . $item . '/flags')) { @@ -576,7 +576,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } } asort($countryList); - $stateList = array(); + $stateList = []; if ($countrySelected != 'Countries') { $placesDir = scandir(WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/'); @@ -768,11 +768,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $priv = 0; $count = 0; $miscount = 0; - $missing = array(); + $missing = []; - $latlongval = array(); - $lat = array(); - $lon = array(); + $latlongval = []; + $lat = []; + $lon = []; for ($i = 0; $i < ($this->treesize); $i++) { // -- check to see if we have moved to the next generation if ($i + 1 >= pow(2, $curgen)) { @@ -791,8 +791,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $latlongval[$i] = $this->getLatitudeAndLongitudeFromPlaceLocation($person->getBirthPlace()); } if ($latlongval[$i]) { - $lat[$i] = strtr($latlongval[$i]->pl_lati, array('N' => '', 'S' => '-', ',' => '.')); - $lon[$i] = strtr($latlongval[$i]->pl_long, array('N' => '', 'S' => '-', ',' => '.')); + $lat[$i] = strtr($latlongval[$i]->pl_lati, ['N' => '', 'S' => '-', ',' => '.']); + $lon[$i] = strtr($latlongval[$i]->pl_long, ['N' => '', 'S' => '-', ',' => '.']); if ($lat[$i] && $lon[$i]) { $count++; } else { @@ -1134,7 +1134,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, // add the points $curgen = 1; $count = 0; - $colored_line = array( + $colored_line = [ '1' => '#FF0000', '2' => '#0000FF', '3' => '#00FF00', @@ -1143,10 +1143,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, '6' => '#FF00FF', '7' => '#C0C0FF', '8' => '#808000', - ); - $lat = array(); - $lon = array(); - $latlongval = array(); + ]; + $lat = []; + $lon = []; + $latlongval = []; for ($i = 0; $i < $this->treesize; $i++) { // moved up to grab the sex of the individuals $person = $this->ancestors[$i]; @@ -1177,8 +1177,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $latlongval[$i] = $this->getLatitudeAndLongitudeFromPlaceLocation($person->getBirthPlace()); if ($latlongval[$i]) { - $lat[$i] = (double) strtr($latlongval[$i]->pl_lati, array('N' => '', 'S' => '-', ',' => '.')); - $lon[$i] = (double) strtr($latlongval[$i]->pl_long, array('E' => '', 'W' => '-', ',' => '.')); + $lat[$i] = (double) strtr($latlongval[$i]->pl_lati, ['N' => '', 'S' => '-', ',' => '.']); + $lon[$i] = (double) strtr($latlongval[$i]->pl_long, ['E' => '', 'W' => '-', ',' => '.']); if ($lat[$i] || $lon[$i]) { $marker_number = $curgen; $dups = 0; @@ -1345,7 +1345,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, echo '<select name="state" onchange="this.form.submit();" class="form-control">'; echo '<option value="XYZ">', I18N::translate('All'), '</option>'; $places = Database::prepare("SELECT pl_place FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place") - ->execute(array($par_id)) + ->execute([$par_id]) ->fetchOneColumn(); foreach ($places as $place) { echo '<option value="', Filter::escapeHtml($place), '" ', $place == $state ? 'selected' : '', '>', Filter::escapeHtml($place), '</option>'; @@ -1362,9 +1362,9 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, echo '<hr>'; //Select all '2 PLAC ' tags in the file and create array - $place_list = array(); + $place_list = []; $ged_data = Database::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_gedcom LIKE ? AND i_file=?") - ->execute(array("%\n2 PLAC %", $gedcom_id)) + ->execute(["%\n2 PLAC %", $gedcom_id]) ->fetchOneColumn(); foreach ($ged_data as $ged_datum) { preg_match_all('/\n2 PLAC (.+)/', $ged_datum, $matches); @@ -1373,7 +1373,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } } $ged_data = Database::prepare("SELECT f_gedcom FROM `##families` WHERE f_gedcom LIKE ? AND f_file=?") - ->execute(array("%\n2 PLAC %", $gedcom_id)) + ->execute(["%\n2 PLAC %", $gedcom_id]) ->fetchOneColumn(); foreach ($ged_data as $ged_datum) { preg_match_all('/\n2 PLAC (.+)/', $ged_datum, $matches); @@ -1446,7 +1446,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } echo '</tr></thead><tbody>'; $countrows = 0; - $matched = array(); + $matched = []; while ($x < $i) { $placestr = ''; $levels = explode(', ', $place_list[$x]); @@ -1470,9 +1470,9 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $mapstr6 = '\' >'; $mapstr7 = '\')">'; $mapstr8 = '</a>'; - $plac = array(); - $lati = array(); - $long = array(); + $plac = []; + $lati = []; + $long = []; while ($z < $parts) { if ($levels[$z] == '') { $levels[$z] = 'unknown'; // GoogleMap module uses "unknown" while GEDCOM uses , , @@ -1482,7 +1482,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, foreach ($placelist as $key => $placename) { $row = Database::prepare("SELECT pl_id, pl_place, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place") - ->execute(array($z, $id, $placename)) + ->execute([$z, $id, $placename]) ->fetchOneRow(PDO::FETCH_ASSOC); if (!empty($row['pl_id'])) { $row['pl_placerequested'] = $levels[$z]; // keep the actual place name that was requested so we can display that instead of what is in the db @@ -1570,10 +1570,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $statement = Database::prepare( "SELECT COUNT(*) FROM `##placelinks` WHERE pl_gid = :xref AND pl_file = :tree_id" ); - $args = array( + $args = [ 'xref' => $individual->getXref(), 'tree_id' => $individual->getTree()->getTreeId(), - ); + ]; if ($statement->execute($args)->fetchOne()) { return true; @@ -1664,7 +1664,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, * @return string[] */ private function createPossiblePlaceNames($placename, $level) { - $retlist = array(); + $retlist = []; if ($level <= 9) { $retlist = $this->removePrefixAndSuffixFromPlaceName($this->getSetting('GM_PREFIX_' . $level), $this->getSetting('GM_POSTFIX_' . $level), $placename, $retlist); // Remove both $retlist = $this->removePrefixFromPlaceName($this->getSetting('GM_PREFIX_' . $level), $placename, $retlist); // Remove prefix @@ -1696,7 +1696,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, foreach ($placelist as $placename) { $pl_id = Database::prepare( "SELECT pl_id FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place" - )->execute(array($i, $place_id, $placename))->fetchOne(); + )->execute([$i, $place_id, $placename])->fetchOne(); if (!empty($pl_id)) { break; } @@ -1712,7 +1712,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, " FROM `##placelocation`" . " WHERE pl_id = ?" . " ORDER BY pl_place" - )->execute(array($place_id))->fetchOneRow(); + )->execute([$place_id])->fetchOneRow(); } /** @@ -1721,21 +1721,21 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, * @return array */ private function getPlaceData(Fact $fact) { - $result = array(); + $result = []; $has_latitude = preg_match('/\n4 LATI (.+)/', $fact->getGedcom(), $match1); $has_longitude = preg_match('/\n4 LONG (.+)/', $fact->getGedcom(), $match2); // If co-ordinates are stored in the GEDCOM then use them if ($has_latitude && $has_longitude) { - $result = array( + $result = [ 'index' => 'ID' . $match1[1] . $match2[1], - 'mapdata' => array( + 'mapdata' => [ 'class' => 'optionbox', 'place' => $fact->getPlace()->getFullName(), 'tooltip' => $fact->getPlace()->getGedcomName(), - 'lat' => strtr($match1[1], array('N' => '', 'S' => '-', ',' => '.')), - 'lng' => strtr($match2[1], array('E' => '', 'W' => '-', ',' => '.')), + 'lat' => strtr($match1[1], ['N' => '', 'S' => '-', ',' => '.']), + 'lng' => strtr($match2[1], ['E' => '', 'W' => '-', ',' => '.']), 'pl_icon' => '', 'pl_zoom' => '0', 'sv_bearing' => '0', @@ -1744,19 +1744,19 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, 'sv_long' => '0', 'sv_zoom' => '0', 'events' => '', - ), - ); + ], + ]; } else { $place_location = $this->getLatitudeAndLongitudeFromPlaceLocation($fact->getPlace()->getGedcomName()); if ($place_location && $place_location->pl_lati && $place_location->pl_long) { - $result = array( + $result = [ 'index' => 'ID' . $place_location->pl_lati . $place_location->pl_long, - 'mapdata' => array( + 'mapdata' => [ 'class' => 'optionbox', 'place' => $fact->getPlace()->getFullName(), 'tooltip' => $fact->getPlace()->getGedcomName(), - 'lat' => strtr($place_location->pl_lati, array('N' => '', 'S' => '-', ',' => '.')), - 'lng' => strtr($place_location->pl_long, array('E' => '', 'W' => '-', ',' => '.')), + 'lat' => strtr($place_location->pl_lati, ['N' => '', 'S' => '-', ',' => '.']), + 'lng' => strtr($place_location->pl_long, ['E' => '', 'W' => '-', ',' => '.']), 'pl_icon' => $place_location->pl_icon, 'pl_zoom' => $place_location->pl_zoom, 'sv_bearing' => $place_location->sv_bearing, @@ -1765,8 +1765,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, 'sv_long' => $place_location->sv_long, 'sv_zoom' => $place_location->sv_zoom, 'events' => '', - ), - ); + ], + ]; } } @@ -1799,8 +1799,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, // At this point we have an array of valid sorted facts // so now build the data structures needed for the map display - $events = array(); - $unique_places = array(); + $events = []; + $unique_places = []; foreach ($facts as $fact) { $place_data = $this->getPlaceData($fact); @@ -1816,8 +1816,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, if ($parent instanceof Individual && $parent->getXref() !== $indi->getXref()) { // Childs birth $name = '<a href="' . $parent->getHtmlUrl() . '">' . $parent->getFullName() . '</a>'; - $label = strtr($parent->getSex(), array('F' => I18N::translate('Birth of a daughter'), 'M' => I18N::translate('Birth of a son'), 'U' => I18N::translate('Birth of a child'))); - $class = 'person_box' . strtr($parent->getSex(), array('F' => 'F', 'M' => '', 'U' => 'NN')); + $label = strtr($parent->getSex(), ['F' => I18N::translate('Birth of a daughter'), 'M' => I18N::translate('Birth of a son'), 'U' => I18N::translate('Birth of a child')]); + $class = 'person_box' . strtr($parent->getSex(), ['F' => 'F', 'M' => '', 'U' => 'NN']); $evtStr = '<div class="gm-event">' . $label . '<div><strong>' . $name . '</strong></div>' . $fact->getDate()->display(true) . '</div>'; } else { $spouse = $parent instanceof Family ? $parent->getSpouse($indi) : null; @@ -1839,7 +1839,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $unique_places[$index] = $place_data['mapdata']; } $unique_places[$index]['events'] .= $evtStr; - $events[] = array( + $events[] = [ 'class' => $class, 'fact_label' => $label, 'date' => $fact->getDate()->display(true), @@ -1847,7 +1847,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, 'name' => $name, 'place' => '<a href="' . $fact->getPlace()->getURL() . '">' . $fact->getPlace()->getFullName() . '</a>', 'placeid' => $index, - ); + ]; } } @@ -2143,11 +2143,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, foreach ($placelist as $key => $placename) { $pl_id = (int) Database::prepare( "SELECT pl_id FROM `##placelocation` WHERE pl_level = :level AND pl_parent_id = :parent_id AND pl_place LIKE :placename" - )->execute(array( + )->execute([ 'level' => $i, 'parent_id' => $place_id, 'placename' => $placename, - ))->fetchOne(); + ])->fetchOne(); if ($pl_id) { break; } @@ -2182,11 +2182,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, foreach ($placelist as $placename) { $pl_id = (int) Database::prepare( "SELECT p_id FROM `##places` WHERE p_parent_id = :place_id AND p_file = :tree_id AND p_place = :placename" - )->execute(array( + )->execute([ 'place_id' => $place_id, 'tree_id' => $WT_TREE->getTreeId(), 'placename' => $placename, - ))->fetchOne(); + ])->fetchOne(); if ($pl_id) { break; } @@ -2262,7 +2262,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $latlng = Database::prepare("SELECT pl_place, pl_id, pl_lati, pl_long, pl_zoom, sv_long, sv_lati, sv_bearing, sv_elevation, sv_zoom FROM `##placelocation` WHERE pl_id=?") - ->execute(array($levelm)) + ->execute([$levelm]) ->fetch(PDO::FETCH_ASSOC); echo '<table style="margin:auto; border-collapse: collapse;">'; @@ -2305,8 +2305,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, global $pl_lati, $pl_long; if ($level >= 1) { - $pl_lati = strtr($latlng['pl_lati'], array('N' => '', 'S' => '-', ',' => '.')); // WT_placelocation lati - $pl_long = strtr($latlng['pl_long'], array('E' => '', 'W' => '-', ',' => '.')); // WT_placelocation long + $pl_lati = strtr($latlng['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); // WT_placelocation lati + $pl_long = strtr($latlng['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); // WT_placelocation long // Check if Streetview location parameters are stored in database $placeid = $latlng['pl_id']; // Placelocation place id @@ -2419,10 +2419,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, if (Auth::isAdmin()) { echo '<br><a href=\"module.php?mod=googlemap&mod_action=admin_places&parent=', $levelm, '&display=inactive\">', I18N::translate('Geographic data'), '</a>'; } - echo '</div>", icon_url, "', str_replace(array('‎', '‏'), array(WT_UTF8_LRM, WT_UTF8_RLM), addslashes($place2['place'])), '");'; + echo '</div>", icon_url, "', str_replace(['‎', '‏'], [WT_UTF8_LRM, WT_UTF8_RLM], addslashes($place2['place'])), '");'; } else { - $lati = strtr($place2['lati'], array('N' => '', 'S' => '-', ',' => '.')); - $long = strtr($place2['long'], array('E' => '', 'W' => '-', ',' => '.')); + $lati = strtr($place2['lati'], ['N' => '', 'S' => '-', ',' => '.']); + $long = strtr($place2['long'], ['E' => '', 'W' => '-', ',' => '.']); //delete leading zero if ($lati >= 0) { $lati = abs($lati); @@ -2586,7 +2586,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, // show the current place on the map $place = Database::prepare("SELECT pl_id AS place_id, pl_place AS place, pl_lati AS lati, pl_long AS `long`, pl_zoom AS zoom, pl_icon AS icon FROM `##placelocation` WHERE pl_id=?") - ->execute(array($levelm)) + ->execute([$levelm]) ->fetch(PDO::FETCH_ASSOC); if ($place) { @@ -2601,7 +2601,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } // display any sub-places - $placeidlist = array(); + $placeidlist = []; foreach ($place_names as $placename) { $thisloc = $parent; $thisloc[] = $placename; @@ -2646,10 +2646,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, */ private function placeIdToHierarchy($id) { $statement = Database::prepare("SELECT pl_parent_id, pl_place FROM `##placelocation` WHERE pl_id=?"); - $arr = array(); + $arr = []; while ($id != 0) { - $row = $statement->execute(array($id))->fetchOneRow(); - $arr = array($id => $row->pl_place) + $arr; + $row = $statement->execute([$id])->fetchOneRow(); + $arr = [$id => $row->pl_place] + $arr; $id = $row->pl_parent_id; } @@ -2689,10 +2689,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, " FROM `##placelocation`" . " WHERE pl_parent_id = :parent_id" . " ORDER BY pl_place COLLATE :collation" - )->execute(array( + )->execute([ 'parent_id' => $parent_id, 'collation' => I18N::collation(), - ))->fetchAll(); + ])->fetchAll(); } else { $rows = Database::prepare( "SELECT DISTINCT pl_id, pl_place, pl_lati, pl_long, pl_zoom, pl_icon" . @@ -2700,22 +2700,22 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, " INNER JOIN `##places` ON `##placelocation`.pl_place=`##places`.p_place" . " WHERE pl_parent_id = :parent_id" . " ORDER BY pl_place COLLATE :collation" - )->execute(array( + )->execute([ 'parent_id' => $parent_id, 'collation' => I18N::collation(), - ))->fetchAll(); + ])->fetchAll(); } - $placelist = array(); + $placelist = []; foreach ($rows as $row) { - $placelist[] = array( + $placelist[] = [ 'place_id' => $row->pl_id, 'place' => $row->pl_place, 'lati' => $row->pl_lati, 'long' => $row->pl_long, 'zoom' => $row->pl_zoom, 'icon' => $row->pl_icon, - ); + ]; } return $placelist; @@ -2741,7 +2741,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $rows = Database::prepare( "SELECT pl_id, pl_place, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place" - )->execute(array($parent_id))->fetchAll(); + )->execute([$parent_id])->fetchAll(); foreach ($rows as $row) { echo $level, ';', $prefix, $row->pl_place, $suffix, ';', $row->pl_long, ';', $row->pl_lati, ';', $row->pl_zoom, ';', $row->pl_icon, "\r\n"; @@ -2759,7 +2759,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, * @return string[] */ private function findFiles($path) { - $placefiles = array(); + $placefiles = []; try { $di = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS); @@ -2795,14 +2795,14 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, "UPDATE `##placelocation`" . " SET sv_lati = :sv_latitude, sv_long = :sv_longitude, sv_bearing = :sv_bearing, sv_elevation = :sv_elevation, sv_zoom = :sv_zoom" . " WHERE pl_id = :place_id" - )->execute(array( + )->execute([ 'sv_latitude' => (float) Filter::post('sv_latiText'), 'sv_longitude' => (float) Filter::post('sv_longText'), 'sv_bearing' => (float) Filter::post('sv_bearText'), 'sv_elevation' => (float) Filter::post('sv_elevText'), 'sv_zoom' => (float) Filter::post('sv_zoomText'), 'place_id' => $placeid, - )); + ]); // TODO - submit this data via AJAX, so we won't need to redraw the page. header('Location: ' . Filter::post('destination', null, 'index.php')); @@ -2824,9 +2824,9 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); if ((Filter::post('LONG_CONTROL') == '') || (Filter::post('NEW_PLACE_LONG') == '') || (Filter::post('NEW_PLACE_LATI') == '')) { - $statement->execute(array($this->getHighestIndex() + 1, $placeid, $level, Filter::post('NEW_PLACE_NAME'), null, null, Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon'))); + $statement->execute([$this->getHighestIndex() + 1, $placeid, $level, Filter::post('NEW_PLACE_NAME'), null, null, Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon')]); } else { - $statement->execute(array($this->getHighestIndex() + 1, $placeid, $level, Filter::post('NEW_PLACE_NAME'), Filter::post('LONG_CONTROL') . Filter::post('NEW_PLACE_LONG'), Filter::post('LATI_CONTROL') . Filter::post('NEW_PLACE_LATI'), Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon'))); + $statement->execute([$this->getHighestIndex() + 1, $placeid, $level, Filter::post('NEW_PLACE_NAME'), Filter::post('LONG_CONTROL') . Filter::post('NEW_PLACE_LONG'), Filter::post('LATI_CONTROL') . Filter::post('NEW_PLACE_LATI'), Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon')]); } $controller->addInlineJavascript('closePopupAndReloadParent();'); @@ -2839,9 +2839,9 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, Database::prepare("UPDATE `##placelocation` SET pl_place=?, pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?"); if ((Filter::post('LONG_CONTROL') == '') || (Filter::post('NEW_PLACE_LONG') == '') || (Filter::post('NEW_PLACE_LATI') == '')) { - $statement->execute(array(Filter::post('NEW_PLACE_NAME'), null, null, (int) Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon'), $placeid)); + $statement->execute([Filter::post('NEW_PLACE_NAME'), null, null, (int) Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon'), $placeid]); } else { - $statement->execute(array(Filter::post('NEW_PLACE_NAME'), Filter::post('LATI_CONTROL') . Filter::post('NEW_PLACE_LATI'), Filter::post('LONG_CONTROL') . Filter::post('NEW_PLACE_LONG'), Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon'), $placeid)); + $statement->execute([Filter::post('NEW_PLACE_NAME'), Filter::post('LATI_CONTROL') . Filter::post('NEW_PLACE_LATI'), Filter::post('LONG_CONTROL') . Filter::post('NEW_PLACE_LONG'), Filter::post('NEW_ZOOM_FACTOR'), Filter::post('icon'), $placeid]); } $controller->addInlineJavascript('closePopupAndReloadParent();'); @@ -2853,7 +2853,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, // --- find the place in the file $row = Database::prepare("SELECT pl_place, pl_lati, pl_long, pl_icon, pl_parent_id, pl_level, pl_zoom FROM `##placelocation` WHERE pl_id=?") - ->execute(array($placeid)) + ->execute([$placeid]) ->fetchOneRow(); $place_name = $row->pl_place; $place_icon = $row->pl_icon; @@ -2869,8 +2869,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $parent_lati = 0.0; $parent_long = 0.0; if ($row->pl_lati !== null && $row->pl_long !== null) { - $place_lati = (float) (str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati)); - $place_long = (float) (str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long)); + $place_lati = (float) (str_replace(['N', 'S', ','], ['', '-', '.'], $row->pl_lati)); + $place_long = (float) (str_replace(['E', 'W', ','], ['', '-', '.'], $row->pl_long)); } else { $place_lati = 0.0; $place_long = 0.0; @@ -2880,14 +2880,14 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, do { $row = Database::prepare("SELECT pl_lati, pl_long, pl_parent_id, pl_zoom FROM `##placelocation` WHERE pl_id=?") - ->execute(array($parent_id)) + ->execute([$parent_id]) ->fetchOneRow(); if (!$row) { break; } if ($row->pl_lati !== null && $row->pl_long !== null) { - $parent_lati = (float) (str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati)); - $parent_long = (float) (str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long)); + $parent_lati = (float) (str_replace(['N', 'S', ','], ['', '-', '.'], $row->pl_lati)); + $parent_long = (float) (str_replace(['E', 'W', ','], ['', '-', '.'], $row->pl_long)); if ($zoomfactor == 1) { $zoomfactor = $row->pl_zoom; } @@ -2910,11 +2910,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, do { $row = Database::prepare("SELECT pl_lati, pl_long, pl_parent_id, pl_zoom, pl_level FROM `##placelocation` WHERE pl_id=?") - ->execute(array($parent_id)) + ->execute([$parent_id]) ->fetchOneRow(); if ($row->pl_lati !== null && $row->pl_long !== null) { - $parent_lati = strtr($row->pl_lati, array('N' => '', 'S' => '-', ',' => '.')); - $parent_long = strtr($row->pl_long, array('E' => '', 'W' => '-', ',' => '.')); + $parent_lati = strtr($row->pl_lati, ['N' => '', 'S' => '-', ',' => '.']); + $parent_long = strtr($row->pl_long, ['E' => '', 'W' => '-', ',' => '.']); $zoomfactor = min($row->pl_zoom, $GM_MAX_ZOOM); $level = $row->pl_level + 1; } @@ -3053,7 +3053,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, // Define place LatLng arrays <?php - $coordsAsStr = array(); + $coordsAsStr = []; switch (strtoupper($place_name)) { case 'ENGLAND': $coordsAsStr[] = '-4.74361,50.66750|-4.78361,50.59361|-4.91584,50.57722|-5.01750,50.54264|-5.02569,50.47271|-5.04729,50.42750|-5.15208,50.34374|-5.26805,50.27389|-5.43194,50.19326|-5.49584,50.21695|-5.54639,50.20527|-5.71000,50.12916|-5.71681,50.06083|-5.66174,50.03631|-5.58278,50.04777|-5.54166,50.07055|-5.53416,50.11569|-5.47055,50.12499|-5.33361,50.09138|-5.27666,50.05972|-5.25674,50.00514|-5.19306,49.95527|-5.16070,50.00319|-5.06555,50.03750|-5.07090,50.08166|-5.04806,50.17111|-4.95278,50.19333|-4.85750,50.23166|-4.76250,50.31138|-4.67861,50.32583|-4.54334,50.32222|-4.48278,50.32583|-4.42972,50.35139|-4.38000,50.36388|-4.16555,50.37028|-4.11139,50.33027|-4.05708,50.29791|-3.94389,50.31346|-3.87764,50.28139|-3.83653,50.22972|-3.78944,50.21222|-3.70666,50.20972|-3.65195,50.23111|-3.55139,50.43833|-3.49416,50.54639|-3.46181,50.58792|-3.41139,50.61610|-3.24416,50.67444|-3.17347,50.68833|-3.09445,50.69222|-2.97806,50.70638|-2.92750,50.73125|-2.88278,50.73111|-2.82305,50.72027|-2.77139,50.70861|-2.66195,50.67334|-2.56305,50.63222|-2.45861,50.57500|-2.44666,50.62639|-2.39097,50.64166|-2.19722,50.62611|-2.12195,50.60722|-2.05445,50.58569|-1.96437,50.59674|-1.95441,50.66536|-2.06681,50.71430|-1.93416,50.71277|-1.81639,50.72306|-1.68445,50.73888|-1.59278,50.72416|-1.33139,50.79138|-1.11695,50.80694|-1.15889,50.84083|-1.09445,50.84584|-0.92842,50.83966|-0.86584,50.79965|-0.90826,50.77396|-0.78187,50.72722|-0.74611,50.76583|-0.67528,50.78111|-0.57722,50.79527|-0.25500,50.82638|-0.19084,50.82583|-0.13805,50.81833|0.05695,50.78083|0.12334,50.75944|0.22778,50.73944|0.28695,50.76500|0.37195,50.81638|0.43084,50.83111|0.56722,50.84777|0.67889,50.87681|0.71639,50.90500|0.79334,50.93610|0.85666,50.92556|0.97125,50.98111|0.99778,51.01903|1.04555,51.04944|1.10028,51.07361|1.26250,51.10166|1.36889,51.13583|1.41111,51.20111|1.42750,51.33111|1.38556,51.38777|1.19195,51.37861|1.05278,51.36722|0.99916,51.34777|0.90806,51.34069|0.70416,51.37749|0.61972,51.38304|0.55945,51.40596|0.64236,51.44042|0.69750,51.47084|0.59195,51.48777|0.53611,51.48806|0.48916,51.48445|0.45215,51.45562|0.38894,51.44822|0.46500,51.50306|0.65195,51.53680|0.76695,51.52138|0.82084,51.53556|0.87528,51.56110|0.95250,51.60923|0.94695,51.72556|0.90257,51.73465|0.86306,51.71166|0.76140,51.69164|0.70111,51.71847|0.86211,51.77361|0.93236,51.80583|0.98278,51.82527|1.03569,51.77416|1.08834,51.77056|1.13222,51.77694|1.18139,51.78972|1.22361,51.80888|1.26611,51.83916|1.28097,51.88096|1.20834,51.95083|1.16347,52.02361|1.27750,51.98555|1.33125,51.92875|1.39028,51.96999|1.58736,52.08388|1.63000,52.19527|1.68576,52.32630|1.73028,52.41138|1.74945,52.45583|1.74590,52.62021|1.70250,52.71583|1.64528,52.77111|1.50361,52.83749|1.43222,52.87472|1.35250,52.90972|1.28222,52.92750|1.18389,52.93889|0.99472,52.95111|0.94222,52.95083|0.88472,52.96638|0.66722,52.97611|0.54778,52.96618|0.49139,52.93430|0.44431,52.86569|0.42903,52.82403|0.36334,52.78027|0.21778,52.80694|0.16125,52.86250|0.05778,52.88916|0.00211,52.87985|0.03222,52.91722|0.20389,53.02805|0.27666,53.06694|0.33916,53.09236|0.35389,53.18722|0.33958,53.23472|0.23555,53.39944|0.14347,53.47527|0.08528,53.48638|0.02694,53.50972|-0.10084,53.57306|-0.20722,53.63083|-0.26445,53.69083|-0.30166,53.71319|-0.39022,53.70794|-0.51972,53.68527|-0.71653,53.69638|-0.65445,53.72527|-0.60584,53.72972|-0.54916,53.70611|-0.42261,53.71755|-0.35728,53.73056|-0.29389,53.73666|-0.23139,53.72166|-0.10584,53.63166|-0.03472,53.62555|0.04416,53.63916|0.08916,53.62666|0.14945,53.58847|0.12639,53.64527|0.06264,53.70389|-0.12750,53.86388|-0.16916,53.91847|-0.21222,54.00833|-0.20569,54.05153|-0.16111,54.08806|-0.11694,54.13222|-0.20053,54.15171|-0.26250,54.17444|-0.39334,54.27277|-0.42166,54.33222|-0.45750,54.37694|-0.51847,54.44749|-0.56472,54.48000|-0.87584,54.57027|-1.06139,54.61722|-1.16528,54.64972|-1.30445,54.77138|-1.34556,54.87138|-1.41278,54.99944|-1.48292,55.08625|-1.51500,55.14972|-1.56584,55.28722|-1.58097,55.48361|-1.63597,55.58194|-1.69000,55.60556|-1.74695,55.62499|-1.81764,55.63306|-1.97681,55.75416|-2.02166,55.80611|-2.08361,55.78054|-2.22000,55.66499|-2.27916,55.64472|-2.27416,55.57527|-2.21528,55.50583|-2.18278,55.45985|-2.21236,55.42777|-2.46305,55.36111|-2.63055,55.25500|-2.69945,55.17722|-2.96278,55.03889|-3.01500,55.05222|-3.05103,54.97986|-3.13292,54.93139|-3.20861,54.94944|-3.28931,54.93792|-3.39166,54.87639|-3.42916,54.81555|-3.56916,54.64249|-3.61306,54.48861|-3.49305,54.40333|-3.43389,54.34806|-3.41056,54.28014|-3.38055,54.24444|-3.21472,54.09555|-3.15222,54.08194|-2.93097,54.15333|-2.81361,54.22277|-2.81750,54.14277|-2.83361,54.08500|-2.93250,53.95055|-3.05264,53.90764|-3.03708,53.74944|-2.99278,53.73277|-2.89979,53.72499|-2.97729,53.69382|-3.07306,53.59805|-3.10563,53.55993|-3.00678,53.41738|-2.95389,53.36027|-2.85736,53.32083|-2.70493,53.35062|-2.77639,53.29250|-2.89972,53.28916|-2.94250,53.31056|-3.02889,53.38191|-3.07248,53.40936|-3.16695,53.35708|-3.12611,53.32500|-3.08860,53.26001|-3.02000,53.24722|-2.95528,53.21555|-2.91069,53.17014|-2.89389,53.10416|-2.85695,53.03249|-2.77792,52.98514|-2.73109,52.96873|-2.71945,52.91902|-2.79278,52.90207|-2.85069,52.93875|-2.99389,52.95361|-3.08639,52.91611|-3.13014,52.88486|-3.13708,52.79312|-3.06806,52.77027|-3.01111,52.71166|-3.06666,52.63527|-3.11750,52.58666|-3.07089,52.55702|-3.00792,52.56902|-2.98028,52.53083|-3.02736,52.49792|-3.11916,52.49194|-3.19514,52.46722|-3.19611,52.41027|-3.02195,52.34027|-2.95486,52.33117|-2.99750,52.28139|-3.05125,52.23347|-3.07555,52.14804|-3.12222,52.11805|-3.11250,52.06945|-3.08500,52.01930|-3.04528,51.97639|-2.98889,51.92555|-2.91757,51.91569|-2.86639,51.92889|-2.77861,51.88583|-2.65944,51.81806|-2.68334,51.76957|-2.68666,51.71889|-2.66500,51.61500|-2.62916,51.64416|-2.57889,51.67777|-2.46056,51.74666|-2.40389,51.74041|-2.47166,51.72445|-2.55305,51.65722|-2.65334,51.56389|-2.77055,51.48916|-2.85278,51.44472|-2.96000,51.37499|-3.00695,51.30722|-3.01278,51.25632|-3.02834,51.20611|-3.30139,51.18111|-3.39361,51.18138|-3.43729,51.20638|-3.50722,51.22333|-3.57014,51.23027|-3.63222,51.21805|-3.70028,51.23000|-3.79250,51.23916|-3.88389,51.22416|-3.98472,51.21695|-4.11666,51.21222|-4.22805,51.18777|-4.22028,51.11054|-4.23702,51.04659|-4.30361,51.00416|-4.37639,50.99110|-4.42736,51.00958|-4.47445,51.01416|-4.52132,51.01424|-4.54334,50.92694|-4.56139,50.77625|-4.65139,50.71527|-4.74361,50.66750'; @@ -3505,18 +3505,18 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, if ($action == 'ImportGedcom') { echo '<h2>' . I18N::translate('Geographic data') . '</h2>'; - $placelist = array(); + $placelist = []; $j = 0; $gedcom_records = Database::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_file=? UNION ALL SELECT f_gedcom FROM `##families` WHERE f_file=?") - ->execute(array($WT_TREE->getTreeId(), $WT_TREE->getTreeId())) + ->execute([$WT_TREE->getTreeId(), $WT_TREE->getTreeId()]) ->fetchOneColumn(); foreach ($gedcom_records as $gedrec) { $i = 1; $placerec = Functions::getSubRecord(2, '2 PLAC', $gedrec, $i); while (!empty($placerec)) { if (preg_match("/2 PLAC (.+)/", $placerec, $match)) { - $placelist[$j] = array(); + $placelist[$j] = []; $placelist[$j]['place'] = trim($match[1]); if (preg_match("/4 LATI (.*)/", $placerec, $match)) { $placelist[$j]['lati'] = trim($match[1]); @@ -3553,11 +3553,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $prevPlace = ''; $prevLati = ''; $prevLong = ''; - $placelistUniq = array(); + $placelistUniq = []; $j = 0; foreach ($placelist as $k => $place) { if ($place['place'] != $prevPlace) { - $placelistUniq[$j] = array(); + $placelistUniq[$j] = []; $placelistUniq[$j]['place'] = $place['place']; $placelistUniq[$j]['lati'] = $place['lati']; $placelistUniq[$j]['long'] = $place['long']; @@ -3577,7 +3577,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $highestIndex = $this->getHighestIndex(); - $default_zoom_level = array(4, 7, 10, 12); + $default_zoom_level = [4, 7, 10, 12]; foreach ($placelistUniq as $k => $place) { $parent = preg_split('/ *, */', $place['place']); $parent = array_reverse($parent); @@ -3593,14 +3593,14 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } $row = Database::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ?") - ->execute(array($i, $parent_id, $escparent)) + ->execute([$i, $parent_id, $escparent]) ->fetchOneRow(); if ($i < $num_parent - 1) { // Create higher-level places, if necessary if (empty($row)) { $highestIndex++; Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)") - ->execute(array($highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i])); + ->execute([$highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i]]); echo Filter::escapeHtml($escparent), '<br>'; $parent_id = $highestIndex; } else { @@ -3611,12 +3611,12 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, if (empty($row->pl_id)) { $highestIndex++; Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom) VALUES (?, ?, ?, ?, ?, ?, ?)") - ->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i])); + ->execute([$highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i]]); echo Filter::escapeHtml($escparent), '<br>'; } else { if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') { Database::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?") - ->execute(array($place['lati'], $place['long'], $row->pl_id)); + ->execute([$place['lati'], $place['long'], $row->pl_id]); echo Filter::escapeHtml($escparent), '<br>'; } } @@ -3717,7 +3717,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, if ($action === 'ImportFile2') { echo '<h2>' . I18N::translate('Geographic data') . '</h2>'; - $country_names = array(); + $country_names = []; $stats = new Stats($WT_TREE); foreach ($stats->iso3166() as $key => $value) { $country_names[$key] = I18N::translate($key); @@ -3736,7 +3736,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } asort($lines); $highestIndex = $this->getHighestIndex(); - $placelist = array(); + $placelist = []; $j = 0; $maxLevel = 0; foreach ($lines as $p => $placerec) { @@ -3753,7 +3753,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); if (is_numeric($fieldrec[0]) && $fieldrec[0] <= $maxLevel) { - $placelist[$j] = array(); + $placelist[$j] = []; $placelist[$j]['place'] = ''; for ($ii = $fields - 4; $ii > 1; $ii--) { if ($fieldrec[0] > $ii - 2) { @@ -3782,11 +3782,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $prevPlace = ''; $prevLati = ''; $prevLong = ''; - $placelistUniq = array(); + $placelistUniq = []; $j = 0; foreach ($placelist as $k => $place) { if ($place['place'] != $prevPlace) { - $placelistUniq[$j] = array(); + $placelistUniq[$j] = []; $placelistUniq[$j]['place'] = $place['place']; $placelistUniq[$j]['lati'] = $place['lati']; $placelistUniq[$j]['long'] = $place['long']; @@ -3808,7 +3808,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $prevLong = $place['long']; } - $default_zoom_level = array(); + $default_zoom_level = []; $default_zoom_level[0] = 4; $default_zoom_level[1] = 7; $default_zoom_level[2] = 10; @@ -3825,7 +3825,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } $row = Database::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place") - ->execute(array($i, $parent_id, $escparent)) + ->execute([$i, $parent_id, $escparent]) ->fetchOneRow(); if (empty($row)) { // this name does not yet exist: create entry @@ -3840,11 +3840,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } if (($place['lati'] == '0') || ($place['long'] == '0') || (($i + 1) < $num_parent)) { Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?)") - ->execute(array($highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon'])); + ->execute([$highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon']]); } else { //delete leading zero - $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place['lati']); - $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $place['long']); + $pl_lati = str_replace(['N', 'S', ','], ['', '-', '.'], $place['lati']); + $pl_long = str_replace(['E', 'W', ','], ['', '-', '.'], $place['long']); if ($pl_lati >= 0) { $place['lati'] = 'N' . abs($pl_lati); } elseif ($pl_lati < 0) { @@ -3856,7 +3856,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $place['long'] = 'W' . abs($pl_long); } Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)") - ->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon'])); + ->execute([$highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon']]); } $parent_id = $highestIndex; } @@ -3864,16 +3864,16 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $parent_id = $row->pl_id; if (Filter::postBool('overwritedata') && ($i + 1 == count($parent))) { Database::prepare("UPDATE `##placelocation` SET pl_lati = ?, pl_long = ?, pl_zoom = ?, pl_icon = ? WHERE pl_id = ?") - ->execute(array($place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id)); + ->execute([$place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id]); } else { // Update only if existing data is missing if (!$row->pl_long && !$row->pl_lati) { Database::prepare("UPDATE `##placelocation` SET pl_lati = ?, pl_long = ? WHERE pl_id = ?") - ->execute(array($place['lati'], $place['long'], $parent_id)); + ->execute([$place['lati'], $place['long'], $parent_id]); } if (!$row->pl_icon && $place['icon']) { Database::prepare("UPDATE `##placelocation` SET pl_icon = ? WHERE pl_id = ?") - ->execute(array($place['icon'], $parent_id)); + ->execute([$place['icon'], $parent_id]); } } } @@ -3886,12 +3886,12 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, echo '<h2>' . I18N::translate('Geographic data') . '</h2>'; $exists = Database::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?") - ->execute(array($deleteRecord)) + ->execute([$deleteRecord]) ->fetchOne(); if (!$exists) { Database::prepare("DELETE FROM `##placelocation` WHERE pl_id=?") - ->execute(array($deleteRecord)); + ->execute([$deleteRecord]); } else { echo '<table class="facts_table"><tr><td>', I18N::translate('Location not removed: this location contains sub-locations'), '</td></tr></table>'; } @@ -3916,7 +3916,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, function delete_place(placeid) { var answer=confirm('<?php echo I18N::translate('Remove this location?') ?>'); if (answer == true) { - window.location = '<?php echo Functions::getQueryUrl(array('action' => 'DeleteRecord')) ?>&action=DeleteRecord&deleteRecord=' + placeid; + window.location = '<?php echo Functions::getQueryUrl(['action' => 'DeleteRecord']) ?>&action=DeleteRecord&deleteRecord=' + placeid; } } </script> @@ -3995,7 +3995,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, echo '<td class="narrow"><a href="#" onclick="edit_place_location(', $place['place_id'], ');return false;" class="icon-edit" title="', I18N::translate('Edit'), '"></a></td>'; $noRows = Database::prepare("SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id=?") - ->execute(array($place['place_id'])) + ->execute([$place['place_id']]) ->fetchOne(); if ($noRows == 0) { ?> <td><a href="#" onclick="delete_place(<?php echo $place['place_id'] ?>);return false;" class="icon-delete" title="<?php echo I18N::translate('Delete') ?>"></a></td> diff --git a/app/Module/HourglassChartModule.php b/app/Module/HourglassChartModule.php index c817bb5393..1da4d64004 100644 --- a/app/Module/HourglassChartModule.php +++ b/app/Module/HourglassChartModule.php @@ -63,7 +63,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac $this->getTitle(), 'hourglass.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-hourglass', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/HtmlBlockModule.php b/app/Module/HtmlBlockModule.php index e6b870d6ce..7168307211 100644 --- a/app/Module/HtmlBlockModule.php +++ b/app/Module/HtmlBlockModule.php @@ -50,7 +50,7 @@ class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $title = $this->getBlockSetting($block_id, 'title'); @@ -152,7 +152,7 @@ class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface { $this->setBlockSetting($block_id, 'languages', implode(',', $languages)); } - $templates = array( + $templates = [ I18N::translate('Keyword examples') => '#getAllTagsTable#', @@ -259,7 +259,7 @@ class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface { <span style="font-weight: bold;">' . I18N::translate('Most common surnames') . '</span><br> #commonSurnames# </div>', - ); + ]; $title = $this->getBlockSetting($block_id, 'title'); $html = $this->getBlockSetting($block_id, 'html'); diff --git a/app/Module/IndividualFactsTabModule.php b/app/Module/IndividualFactsTabModule.php index 74569b9382..a2bdf51a21 100644 --- a/app/Module/IndividualFactsTabModule.php +++ b/app/Module/IndividualFactsTabModule.php @@ -56,7 +56,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf global $controller; $EXPAND_HISTO_EVENTS = false; - $indifacts = array(); + $indifacts = []; // The individual’s own facts foreach ($controller->record->getFacts() as $fact) { switch ($fact->getTag()) { @@ -195,7 +195,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf private static function spouseFacts(Individual $individual, Individual $spouse) { $SHOW_RELATIVES_EVENTS = $individual->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); - $facts = array(); + $facts = []; if (strstr($SHOW_RELATIVES_EVENTS, '_DEAT_SPOU')) { // Only include events between birth and death $birt_date = $individual->getEstimatedBirthDate(); @@ -231,7 +231,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); - $facts = array(); + $facts = []; // Only include events between birth and death $birt_date = $controller->record->getEstimatedBirthDate(); @@ -364,7 +364,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); - $facts = array(); + $facts = []; // Only include events between birth and death $birt_date = $controller->record->getEstimatedBirthDate(); @@ -462,7 +462,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf private static function historicalFacts(Individual $person) { $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); - $facts = array(); + $facts = []; if ($SHOW_RELATIVES_EVENTS) { // Only include events between birth and death @@ -470,7 +470,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf $deat_date = $person->getEstimatedDeathDate(); if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) { - $histo = array(); + $histo = []; require Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php'; foreach ($histo as $hist) { // Earlier versions of the WIKI encouraged people to use HTML entities, @@ -497,7 +497,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf * @return Fact[] */ private static function associateFacts(Individual $person) { - $facts = array(); + $facts = []; $associates = array_merge( $person->linkedIndividuals('ASSO'), diff --git a/app/Module/IndividualFamiliesReportModule.php b/app/Module/IndividualFamiliesReportModule.php index e7ff87c030..48d7392657 100644 --- a/app/Module/IndividualFamiliesReportModule.php +++ b/app/Module/IndividualFamiliesReportModule.php @@ -58,7 +58,7 @@ class IndividualFamiliesReportModule extends AbstractModule implements ModuleRep $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/IndividualReportModule.php b/app/Module/IndividualReportModule.php index 01ae358fa5..93b511e7e2 100644 --- a/app/Module/IndividualReportModule.php +++ b/app/Module/IndividualReportModule.php @@ -58,7 +58,7 @@ class IndividualReportModule extends AbstractModule implements ModuleReportInter $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/IndividualSidebarModule.php b/app/Module/IndividualSidebarModule.php index e6090d2557..0f43276f41 100644 --- a/app/Module/IndividualSidebarModule.php +++ b/app/Module/IndividualSidebarModule.php @@ -243,12 +243,12 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt " AND i_id = n_id AND i_file = n_file AND i_file = :tree_id" . " ORDER BY n_sort COLLATE :collation" . " LIMIT 50" - )->execute(array( + )->execute([ 'query_1' => $query, 'query_2' => $query, 'tree_id' => $tree->getTreeId(), 'collation' => I18N::collation(), - ))->fetchAll(); + ])->fetchAll(); $out = '<ul>'; foreach ($rows as $row) { diff --git a/app/Module/InteractiveTree/TreeView.php b/app/Module/InteractiveTree/TreeView.php index 5819c60b82..650b453f4f 100644 --- a/app/Module/InteractiveTree/TreeView.php +++ b/app/Module/InteractiveTree/TreeView.php @@ -73,7 +73,7 @@ class TreeView { </div> '; - return array($html, 'var ' . $this->name . 'Handler = new TreeViewHandler("' . $this->name . '");'); + return [$html, 'var ' . $this->name . 'Handler = new TreeViewHandler("' . $this->name . '");']; } /** @@ -87,14 +87,14 @@ class TreeView { global $WT_TREE; $list = explode(';', $list); - $r = array(); + $r = []; foreach ($list as $jsonRequest) { $firstLetter = substr($jsonRequest, 0, 1); $jsonRequest = substr($jsonRequest, 1); switch ($firstLetter) { case 'c': $fidlist = explode(',', $jsonRequest); - $flist = array(); + $flist = []; foreach ($fidlist as $fid) { $flist[] = Family::getInstance($fid, $WT_TREE); } @@ -173,8 +173,8 @@ class TreeView { */ private function drawChildren(array $familyList, $gen = 1, $ajax = false) { $html = ''; - $children2draw = array(); - $f2load = array(); + $children2draw = []; + $f2load = []; foreach ($familyList as $f) { if (empty($f)) { @@ -259,7 +259,7 @@ class TreeView { // Fixing the width for td to the box initial width when the person is the root person fix a rare bug that happen when a person without child and without known parents is the root person : an unwanted white rectangle appear at the right of the person’s boxes, otherwise. $html .= '<td' . ($isRoot ? ' style="width:1px"' : '') . '><div class="tv_box' . ($isRoot ? ' rootPerson' : '') . '" dir="' . I18N::direction() . '" style="text-align: ' . (I18N::direction() === 'rtl' ? 'right' : 'left') . '; direction: ' . I18N::direction() . '" abbr="' . $person->getXref() . '" onclick="' . $this->name . 'Handler.expandBox(this, event);">'; $html .= $this->drawPersonName($person); - $fop = array(); // $fop is fathers of partners + $fop = []; // $fop is fathers of partners if (!is_null($partner)) { $dashed = ''; foreach ($person->getSpouseFamilies() as $family) { @@ -268,9 +268,9 @@ class TreeView { if ($spouse === $partner || $this->all_partners === 'true') { $spouse_parents = $spouse->getPrimaryChildFamily(); if ($spouse_parents && $spouse_parents->getHusband()) { - $fop[] = array($spouse_parents->getHusband(), $spouse_parents); + $fop[] = [$spouse_parents->getHusband(), $spouse_parents]; } elseif ($spouse_parents && $spouse_parents->getWife()) { - $fop[] = array($spouse_parents->getWife(), $spouse_parents); + $fop[] = [$spouse_parents->getWife(), $spouse_parents]; } $html .= $this->drawPersonName($spouse, $dashed); if ($this->all_partners !== 'true') { diff --git a/app/Module/InteractiveTreeModule.php b/app/Module/InteractiveTreeModule.php index 0bb9edd394..d8633dc010 100644 --- a/app/Module/InteractiveTreeModule.php +++ b/app/Module/InteractiveTreeModule.php @@ -82,7 +82,7 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface $this->getTitle(), 'module.php?mod=tree&mod_action=treeview&rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-tree', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/LifespansChartModule.php b/app/Module/LifespansChartModule.php index ead8b0b616..1fe359e9d4 100644 --- a/app/Module/LifespansChartModule.php +++ b/app/Module/LifespansChartModule.php @@ -63,7 +63,7 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac $this->getTitle(), 'lifespan.php', 'menu-chart-lifespan', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/LoggedInUsersModule.php b/app/Module/LoggedInUsersModule.php index d8be57da57..606483698f 100644 --- a/app/Module/LoggedInUsersModule.php +++ b/app/Module/LoggedInUsersModule.php @@ -46,14 +46,14 @@ class LoggedInUsersModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $WT_TREE; $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; $title = $this->getTitle(); $anonymous = 0; - $logged_in = array(); + $logged_in = []; $content = ''; foreach (User::allLoggedIn() as $user) { if (Auth::isAdmin() || $user->getPreference('visibleonline')) { diff --git a/app/Module/LoginBlockModule.php b/app/Module/LoginBlockModule.php index 532d7539f7..11d9160406 100644 --- a/app/Module/LoginBlockModule.php +++ b/app/Module/LoginBlockModule.php @@ -43,7 +43,7 @@ class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $controller; $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; diff --git a/app/Module/MarriageReportModule.php b/app/Module/MarriageReportModule.php index 36ac6b8060..1dcb3c6e3c 100644 --- a/app/Module/MarriageReportModule.php +++ b/app/Module/MarriageReportModule.php @@ -58,7 +58,7 @@ class MarriageReportModule extends AbstractModule implements ModuleReportInterfa $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/MediaTabModule.php b/app/Module/MediaTabModule.php index 0dcdb5d1f2..5d4eac4f5b 100644 --- a/app/Module/MediaTabModule.php +++ b/app/Module/MediaTabModule.php @@ -118,7 +118,7 @@ class MediaTabModule extends AbstractModule implements ModuleTabInterface { } } } - $this->facts = array(); + $this->facts = []; foreach ($facts as $fact) { if (preg_match('/(?:^1|\n\d) OBJE @' . WT_REGEX_XREF . '@/', $fact->getGedcom())) { $this->facts[] = $fact; diff --git a/app/Module/MissingFactsReportModule.php b/app/Module/MissingFactsReportModule.php index 76b485d462..1872f95dbd 100644 --- a/app/Module/MissingFactsReportModule.php +++ b/app/Module/MissingFactsReportModule.php @@ -58,7 +58,7 @@ class MissingFactsReportModule extends AbstractModule implements ModuleReportInt $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/ModuleBlockInterface.php b/app/Module/ModuleBlockInterface.php index 6e05a4b1b7..344b7addae 100644 --- a/app/Module/ModuleBlockInterface.php +++ b/app/Module/ModuleBlockInterface.php @@ -28,7 +28,7 @@ interface ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()); + public function getBlock($block_id, $template = true, $cfg = []); /** * Should this block load asynchronously using AJAX? diff --git a/app/Module/NotesTabModule.php b/app/Module/NotesTabModule.php index 5fb1e9eaf0..c54e8f750a 100644 --- a/app/Module/NotesTabModule.php +++ b/app/Module/NotesTabModule.php @@ -142,7 +142,7 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface { } } } - $this->facts = array(); + $this->facts = []; foreach ($facts as $fact) { if (preg_match('/(?:^1|\n\d) NOTE/', $fact->getGedcom())) { $this->facts[] = $fact; diff --git a/app/Module/OccupationReportModule.php b/app/Module/OccupationReportModule.php index 5e99794039..acfb699a0f 100644 --- a/app/Module/OccupationReportModule.php +++ b/app/Module/OccupationReportModule.php @@ -58,7 +58,7 @@ class OccupationReportModule extends AbstractModule implements ModuleReportInter $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/OnThisDayModule.php b/app/Module/OnThisDayModule.php index 74d7f145fd..91aee87efc 100644 --- a/app/Module/OnThisDayModule.php +++ b/app/Module/OnThisDayModule.php @@ -45,7 +45,7 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $filter = $this->getBlockSetting($block_id, 'filter', '1'); @@ -53,7 +53,7 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface { $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); $block = $this->getBlockSetting($block_id, 'block', '1'); - foreach (array('filter', 'infoStyle', 'sortStyle', 'block') as $name) { + foreach (['filter', 'infoStyle', 'sortStyle', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -141,16 +141,16 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface { echo '<tr><td class="descriptionbox wrap width33">'; echo /* I18N: Label for a configuration option */ I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); + echo FunctionsEdit::selectEditControl('infoStyle', ['list' => I18N::translate('list'), 'table' => I18N::translate('table')], null, $infoStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; echo /* I18N: Label for a configuration option */ I18N::translate('Sort order'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('sortStyle', array( + echo FunctionsEdit::selectEditControl('sortStyle', [ /* I18N: An option in a list-box */ 'alpha' => I18N::translate('sort by name'), /* I18N: An option in a list-box */ 'anniv' => I18N::translate('sort by date'), - ), null, $sortStyle, ''); + ], null, $sortStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; diff --git a/app/Module/PedigreeChartModule.php b/app/Module/PedigreeChartModule.php index a102dad311..b1706d7862 100644 --- a/app/Module/PedigreeChartModule.php +++ b/app/Module/PedigreeChartModule.php @@ -63,7 +63,7 @@ class PedigreeChartModule extends AbstractModule implements ModuleChartInterface $this->getTitle(), 'pedigree.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-pedigree', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/PedigreeReportModule.php b/app/Module/PedigreeReportModule.php index 4e8e8132f1..17a83587f7 100644 --- a/app/Module/PedigreeReportModule.php +++ b/app/Module/PedigreeReportModule.php @@ -58,7 +58,7 @@ class PedigreeReportModule extends AbstractModule implements ModuleReportInterfa $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/RecentChangesModule.php b/app/Module/RecentChangesModule.php index 79d071ac5a..7762631afe 100644 --- a/app/Module/RecentChangesModule.php +++ b/app/Module/RecentChangesModule.php @@ -50,7 +50,7 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface } /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $days = $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); @@ -60,7 +60,7 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface $block = $this->getBlockSetting($block_id, 'block', self::DEFAULT_BLOCK); $hide_empty = $this->getBlockSetting($block_id, 'hide_empty', self::DEFAULT_HIDE_EMPTY); - foreach (array('days', 'infoStyle', 'sortStyle', 'hide_empty', 'show_user', 'block') as $name) { + foreach (['days', 'infoStyle', 'sortStyle', 'hide_empty', 'show_user', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -152,17 +152,17 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); + echo FunctionsEdit::selectEditControl('infoStyle', ['list' => I18N::translate('list'), 'table' => I18N::translate('table')], null, $infoStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Sort order'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('sortStyle', array( + echo FunctionsEdit::selectEditControl('sortStyle', [ 'name' => /* I18N: An option in a list-box */ I18N::translate('sort by name'), 'date_asc' => /* I18N: An option in a list-box */ I18N::translate('sort by date, oldest first'), 'date_desc' => /* I18N: An option in a list-box */ I18N::translate('sort by date, newest first'), - ), null, $sortStyle, ''); + ], null, $sortStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; @@ -200,14 +200,14 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface "SELECT d_gid FROM `##dates`" . " WHERE d_fact='CHAN' AND d_julianday1 >= :jd AND d_file = :tree_id"; - $vars = array( + $vars = [ 'jd' => $jd, 'tree_id' => $tree->getTreeId(), - ); + ]; $xrefs = Database::prepare($sql)->execute($vars)->fetchOneColumn(); - $records = array(); + $records = []; foreach ($xrefs as $xref) { $record = GedcomRecord::getInstance($xref, $tree); if ($record->canShow()) { @@ -230,14 +230,14 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface private function changesList(array $records, $sort, $show_user) { switch ($sort) { case 'name': - uasort($records, array('self', 'sortByNameAndChangeDate')); + uasort($records, ['self', 'sortByNameAndChangeDate']); break; case 'date_asc': - uasort($records, array('self', 'sortByChangeDateAndName')); + uasort($records, ['self', 'sortByChangeDateAndName']); $records = array_reverse($records); break; case 'date_desc': - uasort($records, array('self', 'sortByChangeDateAndName')); + uasort($records, ['self', 'sortByChangeDateAndName']); } $html = ''; diff --git a/app/Module/RelatedIndividualsReportModule.php b/app/Module/RelatedIndividualsReportModule.php index 3cec3bdedd..649de4d700 100644 --- a/app/Module/RelatedIndividualsReportModule.php +++ b/app/Module/RelatedIndividualsReportModule.php @@ -58,7 +58,7 @@ class RelatedIndividualsReportModule extends AbstractModule implements ModuleRep $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), 'menu-report-' . $this->getName(), - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } diff --git a/app/Module/RelationshipsChartModule.php b/app/Module/RelationshipsChartModule.php index 63429718c1..fa40881204 100644 --- a/app/Module/RelationshipsChartModule.php +++ b/app/Module/RelationshipsChartModule.php @@ -83,14 +83,14 @@ class RelationshipsChartModule extends AbstractModule implements ModuleConfigInt I18N::translate('Relationship to me'), 'relationship.php?pid1=' . $gedcomid . '&pid2=' . $individual->getXref() . '&ged=' . $tree->getNameUrl(), 'menu-chart-relationship', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } else { return new Menu( I18N::translate('Relationships'), 'relationship.php?pid1=' . $individual->getXref() . '&ged=' . $tree->getNameUrl(), 'menu-chart-relationship', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } } @@ -130,23 +130,23 @@ class RelationshipsChartModule extends AbstractModule implements ModuleConfigInt * Possible options for the ancestors option */ private function ancestorsOptions() { - return array( + return [ 0 => I18N::translate('Find any relationship'), 1 => I18N::translate('Find relationships via ancestors'), - ); + ]; } /** * Possible options for the recursion option */ private function recursionOptions() { - return array( + return [ 0 => I18N::translate('none'), 1 => I18N::number(1), 2 => I18N::number(2), 3 => I18N::number(3), self::UNLIMITED_RECURSION => I18N::translate('unlimited'), - ); + ]; } /** diff --git a/app/Module/ResearchTaskModule.php b/app/Module/ResearchTaskModule.php index 498b127119..3865eb9451 100644 --- a/app/Module/ResearchTaskModule.php +++ b/app/Module/ResearchTaskModule.php @@ -53,7 +53,7 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $controller, $WT_TREE; $show_other = $this->getBlockSetting($block_id, 'show_other', self::DEFAULT_SHOW_OTHER); @@ -61,7 +61,7 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface $show_future = $this->getBlockSetting($block_id, 'show_future', self::DEFAULT_SHOW_FUTURE); $block = $this->getBlockSetting($block_id, 'block', self::DEFAULT_BLOCK); - foreach (array('show_unassigned', 'show_other', 'show_future', 'block') as $name) { + foreach (['show_unassigned', 'show_other', 'show_future', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -117,12 +117,12 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface $xrefs = Database::prepare( "SELECT DISTINCT d_gid FROM `##dates`" . " WHERE d_file = :tree_id AND d_fact = '_TODO' AND d_julianday1 < :jd" - )->execute(array( + )->execute([ 'tree_id' => $WT_TREE->getTreeId(), 'jd' => $end_jd, - ))->fetchOneColumn(); + ])->fetchOneColumn(); - $facts = array(); + $facts = []; foreach ($xrefs as $xref) { $record = GedcomRecord::getInstance($xref, $WT_TREE); if ($record->canShow()) { diff --git a/app/Module/ReviewChangesModule.php b/app/Module/ReviewChangesModule.php index 5502c20c28..ae9f0a7e1b 100644 --- a/app/Module/ReviewChangesModule.php +++ b/app/Module/ReviewChangesModule.php @@ -51,14 +51,14 @@ class ReviewChangesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $sendmail = $this->getBlockSetting($block_id, 'sendmail', '1'); $days = $this->getBlockSetting($block_id, 'days', '1'); $block = $this->getBlockSetting($block_id, 'block', '1'); - foreach (array('days', 'sendmail', 'block') as $name) { + foreach (['days', 'sendmail', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -121,7 +121,7 @@ class ReviewChangesModule extends AbstractModule implements ModuleBlockInterface " WHERE status='pending'" . " AND gedcom_id=?" . " GROUP BY xref" - )->execute(array($WT_TREE->getTreeId()))->fetchAll(); + )->execute([$WT_TREE->getTreeId()])->fetchAll(); foreach ($changes as $change) { $record = GedcomRecord::getInstance($change->xref, $WT_TREE); if ($record->canShow()) { diff --git a/app/Module/SiteMapModule.php b/app/Module/SiteMapModule.php index b2c00c2318..ae7900d618 100644 --- a/app/Module/SiteMapModule.php +++ b/app/Module/SiteMapModule.php @@ -94,13 +94,13 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { if ($tree->getPreference('include_in_sitemap')) { $n = Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id" - )->execute(array('tree_id' => $tree->getTreeId()))->fetchOne(); + )->execute(['tree_id' => $tree->getTreeId()])->fetchOne(); for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) { $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap-' . $tree->getTreeId() . '-i-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL; } $n = Database::prepare( "SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id" - )->execute(array('tree_id' => $tree->getTreeId()))->fetchOne(); + )->execute(['tree_id' => $tree->getTreeId()])->fetchOne(); if ($n) { for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) { $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap-' . $tree->getTreeId() . '-s-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL; @@ -108,7 +108,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { } $n = Database::prepare( "SELECT COUNT(*) FROM `##other` WHERE o_file = :tree_id AND o_type = 'REPO'" - )->execute(array('tree_id' => $tree->getTreeId()))->fetchOne(); + )->execute(['tree_id' => $tree->getTreeId()])->fetchOne(); if ($n) { for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) { $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap-' . $tree->getTreeId() . '-r-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL; @@ -116,7 +116,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { } $n = Database::prepare( "SELECT COUNT(*) FROM `##other` WHERE o_file = :tree_id AND o_type = 'NOTE'" - )->execute(array('tree_id' => $tree->getTreeId()))->fetchOne(); + )->execute(['tree_id' => $tree->getTreeId()])->fetchOne(); if ($n) { for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) { $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap-' . $tree->getTreeId() . '-n-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL; @@ -124,7 +124,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { } $n = Database::prepare( "SELECT COUNT(*) FROM `##media` WHERE m_file = :tree_id" - )->execute(array('tree_id' => $tree->getTreeId()))->fetchOne(); + )->execute(['tree_id' => $tree->getTreeId()])->fetchOne(); if ($n) { for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) { $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap-' . $tree->getTreeId() . '-m-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL; @@ -158,7 +158,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { $data = $this->getSetting('sitemap-' . $ged_id . '-' . $rec_type . '-' . $volume . '.xml'); } else { $data = '<url><loc>' . WT_BASE_URL . 'index.php?ctype=gedcom&ged=' . $tree->getNameUrl() . '</loc></url>' . PHP_EOL; - $records = array(); + $records = []; switch ($rec_type) { case 'i': $rows = Database::prepare( @@ -167,11 +167,11 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { " WHERE i_file = :tree_id" . " ORDER BY i_id" . " LIMIT :limit OFFSET :offset" - )->execute(array( + )->execute([ 'tree_id' => $ged_id, 'limit' => self::RECORDS_PER_VOLUME, 'offset' => self::RECORDS_PER_VOLUME * $volume, - ))->fetchAll(); + ])->fetchAll(); foreach ($rows as $row) { $records[] = Individual::getInstance($row->xref, $tree, $row->gedcom); } @@ -183,11 +183,11 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { " WHERE s_file = :tree_id" . " ORDER BY s_id" . " LIMIT :limit OFFSET :offset" - )->execute(array( + )->execute([ 'tree_id' => $ged_id, 'limit' => self::RECORDS_PER_VOLUME, 'offset' => self::RECORDS_PER_VOLUME * $volume, - ))->fetchAll(); + ])->fetchAll(); foreach ($rows as $row) { $records[] = Source::getInstance($row->xref, $tree, $row->gedcom); } @@ -199,11 +199,11 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { " WHERE o_file = :tree_id AND o_type = 'REPO'" . " ORDER BY o_id" . " LIMIT :limit OFFSET :offset" - )->execute(array( + )->execute([ 'tree_id' => $ged_id, 'limit' => self::RECORDS_PER_VOLUME, 'offset' => self::RECORDS_PER_VOLUME * $volume, - ))->fetchAll(); + ])->fetchAll(); foreach ($rows as $row) { $records[] = Repository::getInstance($row->xref, $tree, $row->gedcom); } @@ -215,11 +215,11 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { " WHERE o_file = :tree_id AND o_type = 'NOTE'" . " ORDER BY o_id" . " LIMIT :limit OFFSET :offset" - )->execute(array( + )->execute([ 'tree_id' => $ged_id, 'limit' => self::RECORDS_PER_VOLUME, 'offset' => self::RECORDS_PER_VOLUME * $volume, - ))->fetchAll(); + ])->fetchAll(); foreach ($rows as $row) { $records[] = Note::getInstance($row->xref, $tree, $row->gedcom); } @@ -231,11 +231,11 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { " WHERE m_file = :tree_id" . " ORDER BY m_id" . " LIMIT :limit OFFSET :offset" - )->execute(array( + )->execute([ 'tree_id' => $ged_id, 'limit' => self::RECORDS_PER_VOLUME, 'offset' => self::RECORDS_PER_VOLUME * $volume, - ))->fetchAll(); + ])->fetchAll(); foreach ($rows as $row) { $records[] = Media::getInstance($row->xref, $tree, $row->gedcom); } diff --git a/app/Module/SlideShowModule.php b/app/Module/SlideShowModule.php index 9fa39f2373..9465c256c0 100644 --- a/app/Module/SlideShowModule.php +++ b/app/Module/SlideShowModule.php @@ -48,7 +48,7 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $filter = $this->getBlockSetting($block_id, 'filter', 'all'); @@ -62,7 +62,7 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { " WHERE m_file = ?" . " AND m_ext IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '')" . " AND m_type IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '')" - )->execute(array( + )->execute([ $WT_TREE->getTreeId(), $this->getBlockSetting($block_id, 'filter_avi', '0') ? 'avi' : null, $this->getBlockSetting($block_id, 'filter_bmp', '1') ? 'bmp' : null, @@ -94,7 +94,7 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { $this->getBlockSetting($block_id, 'filter_photo', '1') ? 'photo' : null, $this->getBlockSetting($block_id, 'filter_tombstone', '1') ? 'tombstone' : null, $this->getBlockSetting($block_id, 'filter_video', '0') ? 'video' : null, - ))->fetchOneColumn(); + ])->fetchOneColumn(); // Keep looking through the media until a suitable one is found. $random_media = null; @@ -261,10 +261,10 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { echo '<tr><td class="descriptionbox wrap width33">'; echo /* I18N: Label for a configuration option */ I18N::translate('Show only individuals, events, or all'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('filter', array('indi' => I18N::translate('Individuals'), 'event' => I18N::translate('Facts and events'), 'all' => I18N::translate('All')), null, $filter, ''); + echo FunctionsEdit::selectEditControl('filter', ['indi' => I18N::translate('Individuals'), 'event' => I18N::translate('Facts and events'), 'all' => I18N::translate('All')], null, $filter, ''); echo '</td></tr>'; - $filters = array( + $filters = [ 'avi' => $this->getBlockSetting($block_id, 'filter_avi', '0'), 'bmp' => $this->getBlockSetting($block_id, 'filter_bmp', '1'), 'gif' => $this->getBlockSetting($block_id, 'filter_gif', '1'), @@ -294,7 +294,7 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { 'photo' => $this->getBlockSetting($block_id, 'filter_photo', '1'), 'tombstone' => $this->getBlockSetting($block_id, 'filter_tombstone', '1'), 'video' => $this->getBlockSetting($block_id, 'filter_video', '0'), - ); + ]; ?> <tr> diff --git a/app/Module/SourcesTabModule.php b/app/Module/SourcesTabModule.php index c5ea51d2a3..5ec30a3c17 100644 --- a/app/Module/SourcesTabModule.php +++ b/app/Module/SourcesTabModule.php @@ -125,7 +125,7 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface { } } } - $this->facts = array(); + $this->facts = []; foreach ($facts as $fact) { if (preg_match('/(?:^1|\n\d) SOUR/', $fact->getGedcom())) { $this->facts[] = $fact; diff --git a/app/Module/StatisticsChartModule.php b/app/Module/StatisticsChartModule.php index dbe75ffc9e..0c0ed43ed9 100644 --- a/app/Module/StatisticsChartModule.php +++ b/app/Module/StatisticsChartModule.php @@ -63,7 +63,7 @@ class StatisticsChartModule extends AbstractModule implements ModuleChartInterfa $this->getTitle(), 'statistics.php?ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-statistics', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/StoriesModule.php b/app/Module/StoriesModule.php index 731c0f2fdb..1cedd4e3e1 100644 --- a/app/Module/StoriesModule.php +++ b/app/Module/StoriesModule.php @@ -88,11 +88,11 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module " WHERE module_name=?" . " AND xref=?" . " AND gedcom_id=?" - )->execute(array( + )->execute([ $this->getName(), $controller->record->getXref(), $controller->record->getTree()->getTreeId(), - ))->fetchOneColumn(); + ])->fetchOneColumn(); $html = ''; foreach ($block_ids as $block_id) { @@ -132,11 +132,11 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module " WHERE module_name=?" . " AND xref=?" . " AND gedcom_id=?" - )->execute(array( + )->execute([ $this->getName(), $controller->record->getXref(), $controller->record->getTree()->getTreeId(), - ))->fetchOne(); + ])->fetchOne(); return $count_of_stories == 0; } @@ -163,16 +163,16 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module if ($block_id) { Database::prepare( "UPDATE `##block` SET gedcom_id=?, xref=? WHERE block_id=?" - )->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $block_id)); + )->execute([Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $block_id]); } else { Database::prepare( "INSERT INTO `##block` (gedcom_id, xref, module_name, block_order) VALUES (?, ?, ?, ?)" - )->execute(array( + )->execute([ Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $this->getName(), 0, - )); + ]); $block_id = Database::getInstance()->lastInsertId(); } $this->setBlockSetting($block_id, 'title', Filter::post('title')); @@ -190,7 +190,7 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module $story_body = $this->getBlockSetting($block_id, 'story_body'); $xref = Database::prepare( "SELECT xref FROM `##block` WHERE block_id=?" - )->execute(array($block_id))->fetchOne(); + )->execute([$block_id])->fetchOne(); } else { $controller->setPageTitle(I18N::translate('Add a story')); $title = ''; @@ -291,11 +291,11 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module Database::prepare( "DELETE FROM `##block_setting` WHERE block_id=?" - )->execute(array($block_id)); + )->execute([$block_id]); Database::prepare( "DELETE FROM `##block` WHERE block_id=?" - )->execute(array($block_id)); + )->execute([$block_id]); } else { header('Location: ' . WT_BASE_URL); exit; @@ -340,7 +340,7 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref" - )->execute(array($this->getName(), $WT_TREE->getTreeId()))->fetchAll(); + )->execute([$this->getName(), $WT_TREE->getTreeId()])->fetchAll(); ?> <ol class="breadcrumb small"> @@ -449,7 +449,7 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref" - )->execute(array($this->getName(), $WT_TREE->getTreeId()))->fetchAll(); + )->execute([$this->getName(), $WT_TREE->getTreeId()])->fetchAll(); echo '<h2 class="center">', I18N::translate('Stories'), '</h2>'; if (count($stories) > 0) { diff --git a/app/Module/ThemeSelectModule.php b/app/Module/ThemeSelectModule.php index 3535cc372f..2e96d7cfa9 100644 --- a/app/Module/ThemeSelectModule.php +++ b/app/Module/ThemeSelectModule.php @@ -41,7 +41,7 @@ class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; $title = $this->getTitle(); diff --git a/app/Module/TimelineChartModule.php b/app/Module/TimelineChartModule.php index 596260990e..ea0388ce5d 100644 --- a/app/Module/TimelineChartModule.php +++ b/app/Module/TimelineChartModule.php @@ -63,7 +63,7 @@ class TimelineChartModule extends AbstractModule implements ModuleChartInterface $this->getTitle(), 'timeline.php?pids%5B%5D=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-timeline', - array('rel' => 'nofollow') + ['rel' => 'nofollow'] ); } diff --git a/app/Module/TopGivenNamesModule.php b/app/Module/TopGivenNamesModule.php index 5fcf360d17..efd5b58fb1 100644 --- a/app/Module/TopGivenNamesModule.php +++ b/app/Module/TopGivenNamesModule.php @@ -45,13 +45,13 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $num = $this->getBlockSetting($block_id, 'num', '10'); $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); - foreach (array('num', 'infoStyle') as $name) { + foreach (['num', 'infoStyle'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -83,7 +83,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface } else { $padding = 'padding-right: 15px'; } - $params = array(1, $num, 'rcount'); + $params = [1, $num, 'rcount']; // List Female names $totals = $stats->commonGivenFemaleTotals($params); if ($totals) { @@ -96,7 +96,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface } break; case "table": // Style 2: Tabular format. Narrow, 2 or 3 column table, good on right side of page - $params = array(1, $num, 'rcount'); + $params = [1, $num, 'rcount']; $content .= '<table style="margin:auto;"> <tr> <td>' . $stats->commonGivenFemaleTable($params) . '</td> @@ -151,7 +151,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); + echo FunctionsEdit::selectEditControl('infoStyle', ['list' => I18N::translate('list'), 'table' => I18N::translate('table')], null, $infoStyle, ''); echo '</td></tr>'; } } diff --git a/app/Module/TopPageViewsModule.php b/app/Module/TopPageViewsModule.php index 1d36f0289a..a7f7c0ff7d 100644 --- a/app/Module/TopPageViewsModule.php +++ b/app/Module/TopPageViewsModule.php @@ -54,13 +54,13 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $num = $this->getBlockSetting($block_id, 'num', '10'); $count_placement = $this->getBlockSetting($block_id, 'count_placement', 'before'); - foreach (array('count_placement', 'num') as $name) { + foreach (['count_placement', 'num'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -82,10 +82,10 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface " FROM `##hit_counter`" . " WHERE gedcom_id = :tree_id AND page_name IN ('individual.php','family.php','source.php','repo.php','note.php','mediaviewer.php')" . " ORDER BY page_count DESC LIMIT :limit" - )->execute(array( + )->execute([ 'tree_id' => $WT_TREE->getTreeId(), 'limit' => (int) $num, - ))->fetchAssoc(); + ])->fetchAssoc(); $content .= '<table>'; foreach ($top10 as $id => $count) { @@ -164,7 +164,7 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface echo "<tr><td class=\"descriptionbox wrap width33\">"; echo /* I18N: Label for a configuration option */ I18N::translate('Show counts before or after name'); echo "</td><td class=\"optionbox\">"; - echo FunctionsEdit::selectEditControl('count_placement', array('before' => I18N::translate('before'), 'after' => I18N::translate('after')), null, $count_placement, ''); + echo FunctionsEdit::selectEditControl('count_placement', ['before' => I18N::translate('before'), 'after' => I18N::translate('after')], null, $count_placement, ''); echo '</td></tr>'; } } diff --git a/app/Module/TopSurnamesModule.php b/app/Module/TopSurnamesModule.php index 2027f0372a..46e0dc6a16 100644 --- a/app/Module/TopSurnamesModule.php +++ b/app/Module/TopSurnamesModule.php @@ -55,13 +55,13 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $WT_TREE, $ctype; $num = $this->getBlockSetting($block_id, 'num', '10'); $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); - foreach (array('num', 'infoStyle') as $name) { + foreach (['num', 'infoStyle'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -70,7 +70,7 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface { // This next function is a bit out of date, and doesn't cope well with surname variants $top_surnames = FunctionsDb::getTopSurnames($WT_TREE->getTreeId(), 0, $num); - $all_surnames = array(); + $all_surnames = []; $i = 0; foreach (array_keys($top_surnames) as $top_surname) { $all_surnames = array_merge($all_surnames, QueryName::surnames($WT_TREE, $top_surname, '', false, false)); @@ -162,7 +162,7 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface { echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('bullet list'), 'array' => I18N::translate('compact list'), 'table' => I18N::translate('table'), 'tagcloud' => I18N::translate('tag cloud')), null, $infoStyle, ''); + echo FunctionsEdit::selectEditControl('infoStyle', ['list' => I18N::translate('bullet list'), 'array' => I18N::translate('compact list'), 'table' => I18N::translate('table'), 'tagcloud' => I18N::translate('tag cloud')], null, $infoStyle, ''); echo '</td></tr>'; } diff --git a/app/Module/UpcomingAnniversariesModule.php b/app/Module/UpcomingAnniversariesModule.php index 2b6009feb8..dff9a59b15 100644 --- a/app/Module/UpcomingAnniversariesModule.php +++ b/app/Module/UpcomingAnniversariesModule.php @@ -53,7 +53,7 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $days = $this->getBlockSetting($block_id, 'days', '7'); @@ -63,7 +63,7 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); $block = $this->getBlockSetting($block_id, 'block', '1'); - foreach (array('days', 'filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { + foreach (['days', 'filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -165,16 +165,16 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); + echo FunctionsEdit::selectEditControl('infoStyle', ['list' => I18N::translate('list'), 'table' => I18N::translate('table')], null, $infoStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Sort order'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('sortStyle', array( + echo FunctionsEdit::selectEditControl('sortStyle', [ /* I18N: An option in a list-box */ 'alpha' => I18N::translate('sort by name'), /* I18N: An option in a list-box */ 'anniv' => I18N::translate('sort by date'), - ), null, $sortStyle, ''); + ], null, $sortStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; diff --git a/app/Module/UserFavoritesModule.php b/app/Module/UserFavoritesModule.php index aaae91396e..91f34b71d5 100644 --- a/app/Module/UserFavoritesModule.php +++ b/app/Module/UserFavoritesModule.php @@ -66,7 +66,7 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule { Database::prepare( "SELECT SQL_CACHE favorite_id AS id, user_id, gedcom_id, xref AS gid, favorite_type AS type, title AS title, note AS note, url AS url" . " FROM `##favorite` WHERE user_id=? AND gedcom_id=?") - ->execute(array($user_id, $WT_TREE->getTreeId())) + ->execute([$user_id, $WT_TREE->getTreeId()]) ->fetchAll(PDO::FETCH_ASSOC); } @@ -84,7 +84,7 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule { // Process the "add to user favorites" menu item on indi/fam/etc. pages $record = GedcomRecord::getInstance(Filter::post('xref', WT_REGEX_XREF), $WT_TREE); if (Auth::check() && $record->canShowName()) { - self::addFavorite(array( + self::addFavorite([ 'user_id' => Auth::id(), 'gedcom_id' => $record->getTree()->getTreeId(), 'gid' => $record->getXref(), @@ -92,7 +92,7 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule { 'url' => null, 'note' => null, 'title' => null, - )); + ]); FlashMessages::addMessage(/* I18N: %s is the name of an individual, source or other record */ I18N::translate('“%s” has been added to your favorites.', $record->getFullName())); } break; diff --git a/app/Module/UserJournalModule.php b/app/Module/UserJournalModule.php index 0d19b7d3aa..1afe39ecc8 100644 --- a/app/Module/UserJournalModule.php +++ b/app/Module/UserJournalModule.php @@ -65,24 +65,24 @@ class UserJournalModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; switch (Filter::get('action')) { case 'deletenews': $news_id = Filter::getInteger('news_id'); if ($news_id) { - Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute(array($news_id)); + Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute([$news_id]); } break; } $articles = Database::prepare( "SELECT SQL_CACHE news_id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) + :offset AS updated, subject, body FROM `##news` WHERE user_id = :user_id ORDER BY updated DESC" - )->execute(array( + )->execute([ 'offset' => WT_TIMESTAMP_OFFSET, 'user_id' => Auth::id(), - ))->fetchAll(); + ])->fetchAll(); $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; diff --git a/app/Module/UserMessagesModule.php b/app/Module/UserMessagesModule.php index 4fda877ad8..0e457f9817 100644 --- a/app/Module/UserMessagesModule.php +++ b/app/Module/UserMessagesModule.php @@ -50,10 +50,10 @@ class UserMessagesModule extends AbstractModule implements ModuleBlockInterface $stmt = Database::prepare("DELETE FROM `##message` WHERE user_id = :user_id AND message_id = :message_id"); foreach (Filter::postArray('message_id') as $id) { - $stmt->execute(array( + $stmt->execute([ 'message_id' => $id, 'user_id' => Auth::id(), - )); + ]); } } @@ -72,17 +72,17 @@ class UserMessagesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $WT_TREE; $block = $this->getBlockSetting($block_id, 'block', '1'); - foreach (array('block') as $name) { + foreach (['block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } } $messages = Database::prepare("SELECT message_id, sender, subject, body, UNIX_TIMESTAMP(created) AS created FROM `##message` WHERE user_id=? ORDER BY message_id DESC") - ->execute(array(Auth::id())) + ->execute([Auth::id()]) ->fetchAll(); $count = count($messages); diff --git a/app/Module/UserWelcomeModule.php b/app/Module/UserWelcomeModule.php index f97cd0f073..64276f58e7 100644 --- a/app/Module/UserWelcomeModule.php +++ b/app/Module/UserWelcomeModule.php @@ -43,7 +43,7 @@ class UserWelcomeModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $WT_TREE; $id = $this->getName() . $block_id; diff --git a/app/Module/WelcomeBlockModule.php b/app/Module/WelcomeBlockModule.php index 16c32d0ede..2b6cd6825c 100644 --- a/app/Module/WelcomeBlockModule.php +++ b/app/Module/WelcomeBlockModule.php @@ -44,7 +44,7 @@ class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $controller, $WT_TREE; $indi_xref = $controller->getSignificantIndividual()->getXref(); diff --git a/app/Module/YahrzeitModule.php b/app/Module/YahrzeitModule.php index 7edad8b431..025b220b5b 100644 --- a/app/Module/YahrzeitModule.php +++ b/app/Module/YahrzeitModule.php @@ -51,7 +51,7 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { * * @return string */ - public function getBlock($block_id, $template = true, $cfg = array()) { + public function getBlock($block_id, $template = true, $cfg = []) { global $ctype, $controller, $WT_TREE; $days = $this->getBlockSetting($block_id, 'days', '7'); @@ -59,7 +59,7 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { $calendar = $this->getBlockSetting($block_id, 'calendar', 'jewish'); $block = $this->getBlockSetting($block_id, 'block', '1'); - foreach (array('days', 'infoStyle', 'block') as $name) { + foreach (['days', 'infoStyle', 'block'] as $name) { if (array_key_exists($name, $cfg)) { $$name = $cfg[$name]; } @@ -81,7 +81,7 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { // The standard anniversary rules cover most of the Yahrzeit rules, we just // need to handle a few special cases. // Fetch normal anniversaries... - $yahrzeits = array(); + $yahrzeits = []; for ($jd = $startjd - 1; $jd <= $endjd + $days; ++$jd) { foreach (FunctionsDb::getAnniversaryEvents($jd, 'DEAT _YART', $WT_TREE) as $fact) { // Exact hebrew dates only @@ -273,16 +273,16 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); + echo FunctionsEdit::selectEditControl('infoStyle', ['list' => I18N::translate('list'), 'table' => I18N::translate('table')], null, $infoStyle, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; echo I18N::translate('Calendar'); echo '</td><td class="optionbox">'; - echo FunctionsEdit::selectEditControl('calendar', array( + echo FunctionsEdit::selectEditControl('calendar', [ 'jewish' => /* I18N: The Hebrew/Jewish calendar */ I18N::translate('Jewish'), 'gregorian' => /* I18N: The gregorian calendar */ I18N::translate('Gregorian'), - ), null, $calendar, ''); + ], null, $calendar, ''); echo '</td></tr>'; echo '<tr><td class="descriptionbox wrap width33">'; |
