@@ -29,10 +29,10 @@ |
||
| 29 | 29 | // Check for updates |
| 30 | 30 | $latest_version_txt = Functions::fetchLatestVersion(); |
| 31 | 31 | if (preg_match('/^[0-9.]+\|[0-9.]+\|/', $latest_version_txt)) { |
| 32 | - list($latest_version, , $download_url) = explode('|', $latest_version_txt); |
|
| 32 | + list($latest_version,, $download_url) = explode('|', $latest_version_txt); |
|
| 33 | 33 | } else { |
| 34 | 34 | // Cannot determine the latest version |
| 35 | - list($latest_version, , $download_url) = explode('|', '||'); |
|
| 35 | + list($latest_version,, $download_url) = explode('|', '||'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $latest_version_html = '<span dir="ltr">' . $latest_version . '</span>'; |
@@ -118,18 +118,18 @@ discard block |
||
| 118 | 118 | foreach (Module::getInstalledModules('disabled') as $module) { |
| 119 | 119 | if (!in_array($module->getName(), Module::getCoreModuleNames())) { |
| 120 | 120 | switch ($modules_action) { |
| 121 | - case 'disable': |
|
| 122 | - Database::prepare( |
|
| 123 | - "UPDATE `##module` SET status = 'disabled' WHERE module_name = ?" |
|
| 124 | - )->execute([$module->getName()]); |
|
| 125 | - break; |
|
| 126 | - case 'ignore': |
|
| 127 | - echo '<br>', I18N::translate('Custom module'), ' — ', WT_MODULES_DIR, $module->getName(), ' — ', $module->getTitle(), $icon_success; |
|
| 128 | - break; |
|
| 129 | - default: |
|
| 130 | - echo '<br>', I18N::translate('Custom module'), ' — ', WT_MODULES_DIR, $module->getName(), ' — ', $module->getTitle(), $icon_failure; |
|
| 131 | - $custom_modules = true; |
|
| 132 | - break; |
|
| 121 | + case 'disable': |
|
| 122 | + Database::prepare( |
|
| 123 | + "UPDATE `##module` SET status = 'disabled' WHERE module_name = ?" |
|
| 124 | + )->execute([$module->getName()]); |
|
| 125 | + break; |
|
| 126 | + case 'ignore': |
|
| 127 | + echo '<br>', I18N::translate('Custom module'), ' — ', WT_MODULES_DIR, $module->getName(), ' — ', $module->getTitle(), $icon_success; |
|
| 128 | + break; |
|
| 129 | + default: |
|
| 130 | + echo '<br>', I18N::translate('Custom module'), ' — ', WT_MODULES_DIR, $module->getName(), ' — ', $module->getTitle(), $icon_failure; |
|
| 131 | + $custom_modules = true; |
|
| 132 | + break; |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -158,40 +158,40 @@ discard block |
||
| 158 | 158 | $custom_themes = false; |
| 159 | 159 | foreach (Theme::themeNames() as $theme_id => $theme_name) { |
| 160 | 160 | switch ($theme_id) { |
| 161 | - case 'clouds': |
|
| 162 | - case 'colors': |
|
| 163 | - case 'fab': |
|
| 164 | - case 'minimal': |
|
| 165 | - case 'webtrees': |
|
| 166 | - case 'xenea': |
|
| 167 | - break; |
|
| 168 | - default: |
|
| 169 | - $theme_used = Database::prepare( |
|
| 170 | - "SELECT EXISTS (SELECT 1 FROM `##site_setting` WHERE setting_name='THEME_DIR' AND setting_value=?)" . |
|
| 171 | - " OR EXISTS (SELECT 1 FROM `##gedcom_setting` WHERE setting_name='THEME_DIR' AND setting_value=?)" . |
|
| 172 | - " OR EXISTS (SELECT 1 FROM `##user_setting` WHERE setting_name='theme' AND setting_value=?)" |
|
| 173 | - )->execute([$theme_id, $theme_id, $theme_id])->fetchOne(); |
|
| 174 | - if ($theme_used) { |
|
| 175 | - switch ($themes_action) { |
|
| 176 | - case 'disable': |
|
| 177 | - Database::prepare( |
|
| 178 | - "DELETE FROM `##site_setting` WHERE setting_name = 'THEME_DIR' AND setting_value = ?" |
|
| 179 | - )->execute([$theme_id]); |
|
| 180 | - Database::prepare( |
|
| 181 | - "DELETE FROM `##gedcom_setting` WHERE setting_name = 'THEME_DIR' AND setting_value = ?" |
|
| 182 | - )->execute([$theme_id]); |
|
| 183 | - Database::prepare( |
|
| 184 | - "DELETE FROM `##user_setting` WHERE setting_name = 'theme' AND setting_value = ?" |
|
| 185 | - )->execute([$theme_id]); |
|
| 186 | - break; |
|
| 187 | - case 'ignore': |
|
| 188 | - echo '<br>', I18N::translate('Custom theme'), ' — ', $theme_id, ' — ', $theme_name, $icon_success; |
|
| 189 | - break; |
|
| 190 | - default: |
|
| 191 | - echo '<br>', I18N::translate('Custom theme'), ' — ', $theme_id, ' — ', $theme_name, $icon_failure; |
|
| 192 | - $custom_themes = true; |
|
| 193 | - break; |
|
| 194 | - } |
|
| 161 | + case 'clouds': |
|
| 162 | + case 'colors': |
|
| 163 | + case 'fab': |
|
| 164 | + case 'minimal': |
|
| 165 | + case 'webtrees': |
|
| 166 | + case 'xenea': |
|
| 167 | + break; |
|
| 168 | + default: |
|
| 169 | + $theme_used = Database::prepare( |
|
| 170 | + "SELECT EXISTS (SELECT 1 FROM `##site_setting` WHERE setting_name='THEME_DIR' AND setting_value=?)" . |
|
| 171 | + " OR EXISTS (SELECT 1 FROM `##gedcom_setting` WHERE setting_name='THEME_DIR' AND setting_value=?)" . |
|
| 172 | + " OR EXISTS (SELECT 1 FROM `##user_setting` WHERE setting_name='theme' AND setting_value=?)" |
|
| 173 | + )->execute([$theme_id, $theme_id, $theme_id])->fetchOne(); |
|
| 174 | + if ($theme_used) { |
|
| 175 | + switch ($themes_action) { |
|
| 176 | + case 'disable': |
|
| 177 | + Database::prepare( |
|
| 178 | + "DELETE FROM `##site_setting` WHERE setting_name = 'THEME_DIR' AND setting_value = ?" |
|
| 179 | + )->execute([$theme_id]); |
|
| 180 | + Database::prepare( |
|
| 181 | + "DELETE FROM `##gedcom_setting` WHERE setting_name = 'THEME_DIR' AND setting_value = ?" |
|
| 182 | + )->execute([$theme_id]); |
|
| 183 | + Database::prepare( |
|
| 184 | + "DELETE FROM `##user_setting` WHERE setting_name = 'theme' AND setting_value = ?" |
|
| 185 | + )->execute([$theme_id]); |
|
| 186 | + break; |
|
| 187 | + case 'ignore': |
|
| 188 | + echo '<br>', I18N::translate('Custom theme'), ' — ', $theme_id, ' — ', $theme_name, $icon_success; |
|
| 189 | + break; |
|
| 190 | + default: |
|
| 191 | + echo '<br>', I18N::translate('Custom theme'), ' — ', $theme_id, ' — ', $theme_name, $icon_failure; |
|
| 192 | + $custom_themes = true; |
|
| 193 | + break; |
|
| 194 | + } |
|
| 195 | 195 | } |
| 196 | 196 | break; |
| 197 | 197 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | switch ($action) { |
| 49 | 49 | case 'delete': |
| 50 | - Database::prepare("DELETE FROM `##news` WHERE news_id = :news_id")->execute(['news_id' => $news_id,]); |
|
| 50 | + Database::prepare("DELETE FROM `##news` WHERE news_id = :news_id")->execute(['news_id' => $news_id, ]); |
|
| 51 | 51 | |
| 52 | 52 | header('Location: index.php?ctype=' . $ctype . '&ged=' . $controller->tree()->getNameUrl()); |
| 53 | 53 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | // Caution - $media_dir may contain relative paths: ../../ |
| 69 | 69 | $source_dir = new Filesystem(new Local(WT_DATA_DIR . $media_dir)); |
| 70 | 70 | $cache_dir = new Filesystem(new Local(WT_DATA_DIR . 'thumbnail-cache/' . md5($media_dir))); |
| 71 | - $assets_dir = new Filesystem(new Local( 'assets')); |
|
| 71 | + $assets_dir = new Filesystem(new Local('assets')); |
|
| 72 | 72 | |
| 73 | 73 | $server = ServerFactory::create([ |
| 74 | 74 | 'driver' => $driver, |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function getTabs() { |
| 98 | 98 | $active_tabs = Module::getActiveTabs($this->record->getTree()); |
| 99 | 99 | |
| 100 | - return array_filter($active_tabs, function(ModuleTabInterface $tab) { |
|
| 100 | + return array_filter($active_tabs, function (ModuleTabInterface $tab) { |
|
| 101 | 101 | return $tab->hasTabContent(); |
| 102 | 102 | }); |
| 103 | 103 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | if ($individual->canEdit() && !$fact->isPendingDeletion()) { |
| 250 | - $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $individual->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . $individual->getTree()->getNameHtml() ]); |
|
| 250 | + $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $individual->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . $individual->getTree()->getNameHtml()]); |
|
| 251 | 251 | } else { |
| 252 | 252 | $edit_links = ''; |
| 253 | 253 | } |
@@ -166,23 +166,23 @@ discard block |
||
| 166 | 166 | $name = str_replace('/', '', $name); |
| 167 | 167 | $name = preg_replace('/(\S*)\*/', '<span class="starredname">\\1</span>', $name); |
| 168 | 168 | switch ($tag) { |
| 169 | - case 'TYPE': |
|
| 170 | - echo GedcomCodeName::getValue($name, $this->record); |
|
| 171 | - break; |
|
| 172 | - case 'SURN': |
|
| 173 | - // The SURN field is not necessarily the surname. |
|
| 174 | - // Where it is not a substring of the real surname, show it after the real surname. |
|
| 175 | - $surname = Html::escape($dummy->getAllNames()[0]['surname']); |
|
| 176 | - $surns = preg_replace('/, */', ' ', $nmatch[$i][2]); |
|
| 177 | - if (strpos($dummy->getAllNames()[0]['surname'], $surns) !== false) { |
|
| 178 | - echo '<span dir="auto">' . $surname . '</span>'; |
|
| 179 | - } else { |
|
| 180 | - echo I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $surname . '</span>', '<span dir="auto">' . $name . '</span>'); |
|
| 181 | - } |
|
| 182 | - break; |
|
| 183 | - default: |
|
| 184 | - echo '<span dir="auto">' . $name . '</span>'; |
|
| 185 | - break; |
|
| 169 | + case 'TYPE': |
|
| 170 | + echo GedcomCodeName::getValue($name, $this->record); |
|
| 171 | + break; |
|
| 172 | + case 'SURN': |
|
| 173 | + // The SURN field is not necessarily the surname. |
|
| 174 | + // Where it is not a substring of the real surname, show it after the real surname. |
|
| 175 | + $surname = Html::escape($dummy->getAllNames()[0]['surname']); |
|
| 176 | + $surns = preg_replace('/, */', ' ', $nmatch[$i][2]); |
|
| 177 | + if (strpos($dummy->getAllNames()[0]['surname'], $surns) !== false) { |
|
| 178 | + echo '<span dir="auto">' . $surname . '</span>'; |
|
| 179 | + } else { |
|
| 180 | + echo I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $surname . '</span>', '<span dir="auto">' . $name . '</span>'); |
|
| 181 | + } |
|
| 182 | + break; |
|
| 183 | + default: |
|
| 184 | + echo '<span dir="auto">' . $name . '</span>'; |
|
| 185 | + break; |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | echo '</dd>'; |
@@ -228,15 +228,15 @@ discard block |
||
| 228 | 228 | $individual = $fact->getParent(); |
| 229 | 229 | |
| 230 | 230 | switch ($fact->getValue()) { |
| 231 | - case 'M': |
|
| 232 | - $sex = I18N::translate('Male'); |
|
| 233 | - break; |
|
| 234 | - case 'F': |
|
| 235 | - $sex = I18N::translate('Female'); |
|
| 236 | - break; |
|
| 237 | - default: |
|
| 238 | - $sex = I18N::translateContext('unknown gender', 'Unknown'); |
|
| 239 | - break; |
|
| 231 | + case 'M': |
|
| 232 | + $sex = I18N::translate('Male'); |
|
| 233 | + break; |
|
| 234 | + case 'F': |
|
| 235 | + $sex = I18N::translate('Female'); |
|
| 236 | + break; |
|
| 237 | + default: |
|
| 238 | + $sex = I18N::translateContext('unknown gender', 'Unknown'); |
|
| 239 | + break; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $container_class = 'card'; |
@@ -296,15 +296,15 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | public function getPersonStyle($person) { |
| 298 | 298 | switch ($person->getSex()) { |
| 299 | - case 'M': |
|
| 300 | - $class = 'person_box'; |
|
| 301 | - break; |
|
| 302 | - case 'F': |
|
| 303 | - $class = 'person_boxF'; |
|
| 304 | - break; |
|
| 305 | - default: |
|
| 306 | - $class = 'person_boxNN'; |
|
| 307 | - break; |
|
| 299 | + case 'M': |
|
| 300 | + $class = 'person_box'; |
|
| 301 | + break; |
|
| 302 | + case 'F': |
|
| 303 | + $class = 'person_boxF'; |
|
| 304 | + break; |
|
| 305 | + default: |
|
| 306 | + $class = 'person_boxNN'; |
|
| 307 | + break; |
|
| 308 | 308 | } |
| 309 | 309 | if ($person->isPendingDeletion()) { |
| 310 | 310 | $class .= ' old'; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $controller->restrictAccess(!in_array($to, ['all', 'never_logged', 'last_6mo']) || Auth::isAdmin()); |
| 96 | 96 | $controller->pageHeader(); |
| 97 | 97 | |
| 98 | -$to_names = implode(I18N::$list_separator, array_map(function(User $user) { |
|
| 98 | +$to_names = implode(I18N::$list_separator, array_map(function (User $user) { |
|
| 99 | 99 | return $user->getRealName(); |
| 100 | 100 | }, recipients($to))); |
| 101 | 101 | |
@@ -184,11 +184,11 @@ discard block |
||
| 184 | 184 | if ($to === 'all') { |
| 185 | 185 | $recipients = User::all(); |
| 186 | 186 | } elseif ($to === 'last_6mo') { |
| 187 | - $recipients = array_filter(User::all(), function(User $user) { |
|
| 187 | + $recipients = array_filter(User::all(), function (User $user) { |
|
| 188 | 188 | return $user->getPreference('sessiontime') > 0 && WT_TIMESTAMP - $user->getPreference('sessiontime') > 60 * 60 * 24 * 30 * 6; |
| 189 | 189 | }); |
| 190 | 190 | } elseif ($to === 'never_logged') { |
| 191 | - $recipients = array_filter(User::all(), function(User $user) { |
|
| 191 | + $recipients = array_filter(User::all(), function (User $user) { |
|
| 192 | 192 | return $user->getPreference('verified_by_admin') && $user->getPreference('reg_timestamp') > $user->getPreference('sessiontime'); |
| 193 | 193 | }); |
| 194 | 194 | } else { |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | * @return string |
| 63 | 63 | */ |
| 64 | 64 | public static function getFilenameForView($view_name) { |
| 65 | - $view_file = $view_name . '.php'; |
|
| 65 | + $view_file = $view_name . '.php'; |
|
| 66 | 66 | //$theme_view = WT_THEMES_DIR . Theme::theme()->themeId() . '/resources/views/' . $view_file; |
| 67 | 67 | |
| 68 | 68 | //if (file_exists($theme_view)) { |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | * You should have received a copy of the GNU General Public License |
| 14 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 | */ |
| 16 | -declare(strict_types=1); |
|
| 16 | +declare(strict_types = 1); |
|
| 17 | 17 | |
| 18 | 18 | namespace Fisharebest\Webtrees; |
| 19 | 19 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | * You should have received a copy of the GNU General Public License |
| 14 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 | */ |
| 16 | -declare(strict_types=1); |
|
| 16 | +declare(strict_types = 1); |
|
| 17 | 17 | |
| 18 | 18 | namespace Fisharebest\Webtrees; |
| 19 | 19 | |
@@ -78,8 +78,7 @@ |
||
| 78 | 78 | // Create the underlying PDO object |
| 79 | 79 | self::$pdo = new PDO( |
| 80 | 80 | (substr($config['dbhost'], 0, 1) === '/' ? |
| 81 | - "mysql:unix_socket={$config['dbhost']};dbname={$config['dbname']}" : |
|
| 82 | - "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
| 81 | + "mysql:unix_socket={$config['dbhost']};dbname={$config['dbname']}" : "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
| 83 | 82 | ), |
| 84 | 83 | $config['dbuser'], $config['dbpass'], |
| 85 | 84 | [ |