@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | define('WT_LOCALE', I18N::init('en-US')); |
49 | 49 | |
50 | - $step = (int)$request->get('step', '1'); |
|
50 | + $step = (int) $request->get('step', '1'); |
|
51 | 51 | $errors = $this->serverErrors(); |
52 | 52 | $warnings = $this->serverWarnings(); |
53 | 53 | $data = $this->extractParameters($request); |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | private function maxExecutionTime(): int |
366 | 366 | { |
367 | - return (int)ini_get('max_execution_time'); |
|
367 | + return (int) ini_get('max_execution_time'); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $memory_limit = $memory_limit / 1024 / 1024; |
398 | 398 | } |
399 | 399 | |
400 | - return (int)$memory_limit; |
|
400 | + return (int) $memory_limit; |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | 'simplexml' => /* I18N: a program feature */ |
455 | 455 | I18N::translate('reporting'), |
456 | 456 | ]; |
457 | - $settings = [ |
|
457 | + $settings = [ |
|
458 | 458 | 'file_uploads' => /* I18N: a program feature */ |
459 | 459 | I18N::translate('file upload capability'), |
460 | 460 | ]; |
461 | - $warnings = []; |
|
461 | + $warnings = []; |
|
462 | 462 | |
463 | 463 | foreach ($extensions as $extension => $features) { |
464 | 464 | if (!extension_loaded($extension)) { |
@@ -14,17 +14,17 @@ discard block |
||
14 | 14 | <div class="row form-group"> |
15 | 15 | <label for="INDEX_DIRECTORY" class="col-sm-3 col-form-label"> |
16 | 16 | <?= /* I18N: A configuration setting */ |
17 | - I18N::translate('Data folder') ?> |
|
17 | + I18N::translate('Data folder') ?> |
|
18 | 18 | </label> |
19 | 19 | <div class="col-sm-9"> |
20 | 20 | <input type="text" class="form-control" dir="ltr" id="INDEX_DIRECTORY" name="INDEX_DIRECTORY" value="<?= e(Site::getPreference('INDEX_DIRECTORY')) ?>" maxlength="255" placeholder="data/" required> |
21 | 21 | <p class="small text-muted"> |
22 | 22 | <?= /* I18N: Help text for the "Data folder" site configuration setting */ |
23 | - I18N::translate('This folder will be used by webtrees to store media files, GEDCOM files, temporary files, etc. These files may contain private data, and should not be made available over the internet.') ?> |
|
23 | + I18N::translate('This folder will be used by webtrees to store media files, GEDCOM files, temporary files, etc. These files may contain private data, and should not be made available over the internet.') ?> |
|
24 | 24 | </p> |
25 | 25 | <p class="small text-muted"> |
26 | 26 | <?= /* I18N: “Apache” is a software program. */ |
27 | - I18N::translate('To protect this private data, webtrees uses an Apache configuration file (.htaccess) which blocks all access to this folder. If your web-server does not support .htaccess files, and you cannot restrict access to this folder, then you can select another folder, away from your web documents.') ?> |
|
27 | + I18N::translate('To protect this private data, webtrees uses an Apache configuration file (.htaccess) which blocks all access to this folder. If your web-server does not support .htaccess files, and you cannot restrict access to this folder, then you can select another folder, away from your web documents.') ?> |
|
28 | 28 | </p> |
29 | 29 | <p class="small text-muted"> |
30 | 30 | <?= I18N::translate('If you select a different folder, you must also move all files (except config.ini.php, index.php, and .htaccess) from the existing folder to the new folder.') ?> |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | <div class="row form-group"> |
40 | 40 | <label for="MEMORY_LIMIT" class="col-sm-3 col-form-label"> |
41 | 41 | <?= /* I18N: A configuration setting */ |
42 | - I18N::translate('Memory limit') ?> |
|
42 | + I18N::translate('Memory limit') ?> |
|
43 | 43 | </label> |
44 | 44 | <div class="col-sm-9"> |
45 | 45 | <input type="text" class="form-control" id="MEMORY_LIMIT" name="MEMORY_LIMIT" value="<?= e(Site::getPreference('MEMORY_LIMIT')) ?>" pattern="[0-9]+[KMG]" placeholder="<?= get_cfg_var('memory_limit') ?>" maxlength="255"> |
46 | 46 | <p class="small text-muted"> |
47 | 47 | <?= /* I18N: %s is an amount of memory, such as 32MB */ |
48 | - I18N::translate('By default, your server allows scripts to use %s of memory.', get_cfg_var('memory_limit')) ?> |
|
48 | + I18N::translate('By default, your server allows scripts to use %s of memory.', get_cfg_var('memory_limit')) ?> |
|
49 | 49 | <?= I18N::translate('You can request a higher or lower limit, although the server may ignore this request.') ?> |
50 | 50 | <?= I18N::translate('Leave this blank to use the default value.') ?> |
51 | 51 | </p> |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | <div class="row form-group"> |
57 | 57 | <label for="MAX_EXECUTION_TIME" class="col-sm-3 col-form-label"> |
58 | 58 | <?= /* I18N: A configuration setting */ |
59 | - I18N::translate('PHP time limit') ?> |
|
59 | + I18N::translate('PHP time limit') ?> |
|
60 | 60 | </label> |
61 | 61 | <div class="col-sm-9"> |
62 | 62 | <input type="text" class="form-control" id="MAX_EXECUTION_TIME" name="MAX_EXECUTION_TIME" value="<?= e(Site::getPreference('MAX_EXECUTION_TIME')) ?>" pattern="[0-9]*" placeholder="<?= get_cfg_var('max_execution_time') ?>" maxlength="255"> |
63 | 63 | <p class="small text-muted"> |
64 | 64 | <?= I18N::plural( |
65 | - 'By default, your server allows scripts to run for %s second.', |
|
66 | - 'By default, your server allows scripts to run for %s seconds.', |
|
67 | - get_cfg_var('max_execution_time'), I18N::number((float) get_cfg_var('max_execution_time'))); |
|
68 | - ?> |
|
65 | + 'By default, your server allows scripts to run for %s second.', |
|
66 | + 'By default, your server allows scripts to run for %s seconds.', |
|
67 | + get_cfg_var('max_execution_time'), I18N::number((float) get_cfg_var('max_execution_time'))); |
|
68 | + ?> |
|
69 | 69 | <?= I18N::translate('You can request a higher or lower limit, although the server may ignore this request.') ?> |
70 | 70 | <?= I18N::translate('Leave this blank to use the default value.') ?> |
71 | 71 | </p> |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | <div class="row form-group"> |
90 | 90 | <label for="THEME_DIR" class="col-sm-3 col-form-label"> |
91 | 91 | <?= /* I18N: A configuration setting */ |
92 | - I18N::translate('Default theme') ?> |
|
92 | + I18N::translate('Default theme') ?> |
|
93 | 93 | </label> |
94 | 94 | <div class="col-sm-9"> |
95 | 95 | <?= Bootstrap4::select($all_themes, Site::getPreference('THEME_DIR'), ['id' => 'THEME_DIR', 'name' => 'THEME_DIR']) ?> |
96 | 96 | <p class="small text-muted"> |
97 | 97 | <?= /* I18N: Help text for the "Default theme" site configuration setting */ |
98 | - I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?> |
|
98 | + I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?> |
|
99 | 99 | </p> |
100 | 100 | <p class="small text-muted"> |
101 | 101 | <?= I18N::translate('Themes can be selected at three levels: user, family tree, and website. User preferences take priority over family tree preferences, which in turn take priority over the website preferences. Selecting “default theme” at one level will use the theme at the next level.') ?> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | <div class="row"> |
109 | 109 | <legend class="col-form-label col-sm-3"> |
110 | 110 | <?= /* I18N: A configuration setting */ |
111 | - I18N::translate('Allow users to select their own theme') ?> |
|
111 | + I18N::translate('Allow users to select their own theme') ?> |
|
112 | 112 | </legend> |
113 | 113 | <div class="col-sm-9"> |
114 | 114 | <?= Bootstrap4::radioButtons('ALLOW_USER_THEMES', FunctionsEdit::optionsNoYes(), (string) (int) Site::getPreference('ALLOW_USER_THEMES'), true) ?> |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | <div class="row"> |
122 | 122 | <legend class="col-form-label col-sm-3"> |
123 | 123 | <?= /* I18N: A configuration setting */ |
124 | - I18N::translate('Show list of family trees') ?> |
|
124 | + I18N::translate('Show list of family trees') ?> |
|
125 | 125 | </legend> |
126 | 126 | <div class="col-sm-9"> |
127 | 127 | <?= Bootstrap4::radioButtons('ALLOW_CHANGE_GEDCOM', FunctionsEdit::optionsNoYes(), (string) (int) Site::getPreference('ALLOW_CHANGE_GEDCOM'), true) ?> |
128 | 128 | <p class="small text-muted"> |
129 | 129 | <?= /* I18N: Help text for the “Show list of family trees” site configuration setting */ |
130 | - I18N::translate('For websites with more than one family tree, this option will show the list of family trees in the main menu, the search pages, etc.') ?> |
|
130 | + I18N::translate('For websites with more than one family tree, this option will show the list of family trees in the main menu, the search pages, etc.') ?> |
|
131 | 131 | </p> |
132 | 132 | </div> |
133 | 133 | </div> |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function cleanDataAction(Request $request): RedirectResponse |
127 | 127 | { |
128 | - $to_delete = (array)$request->get('to_delete'); |
|
128 | + $to_delete = (array) $request->get('to_delete'); |
|
129 | 129 | $to_delete = array_filter($to_delete); |
130 | 130 | |
131 | 131 | foreach ($to_delete as $path) { |
@@ -250,10 +250,10 @@ discard block |
||
250 | 250 | $search = $request->get('search', []); |
251 | 251 | $search = isset($search['value']) ? $search['value'] : ''; |
252 | 252 | |
253 | - $start = (int)$request->get('start'); |
|
254 | - $length = (int)$request->get('length'); |
|
253 | + $start = (int) $request->get('start'); |
|
254 | + $length = (int) $request->get('length'); |
|
255 | 255 | $order = $request->get('order', []); |
256 | - $draw = (int)$request->get('draw'); |
|
256 | + $draw = (int) $request->get('draw'); |
|
257 | 257 | |
258 | 258 | $sql = |
259 | 259 | "SELECT SQL_CALC_FOUND_ROWS log_id, log_time, log_type, log_message, ip_address, IFNULL(user_name, '<none>') AS user_name, IFNULL(gedcom_name, '<none>') AS gedcom_name" . |
@@ -264,35 +264,35 @@ discard block |
||
264 | 264 | |
265 | 265 | $args = []; |
266 | 266 | if ($search) { |
267 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
267 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
268 | 268 | $args['search'] = $search; |
269 | 269 | } |
270 | 270 | if ($from) { |
271 | - $sql .= " AND log_time >= :from"; |
|
271 | + $sql .= " AND log_time >= :from"; |
|
272 | 272 | $args['from'] = $from; |
273 | 273 | } |
274 | 274 | if ($to) { |
275 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
275 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
276 | 276 | $args['to'] = $to; |
277 | 277 | } |
278 | 278 | if ($type) { |
279 | - $sql .= " AND log_type = :type"; |
|
279 | + $sql .= " AND log_type = :type"; |
|
280 | 280 | $args['type'] = $type; |
281 | 281 | } |
282 | 282 | if ($text) { |
283 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
283 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
284 | 284 | $args['text'] = $text; |
285 | 285 | } |
286 | 286 | if ($ip) { |
287 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
287 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
288 | 288 | $args['ip'] = $ip; |
289 | 289 | } |
290 | 290 | if ($username) { |
291 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
291 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
292 | 292 | $args['user'] = $username; |
293 | 293 | } |
294 | 294 | if ($gedc) { |
295 | - $sql .= " AND gedcom_name = :gedc"; |
|
295 | + $sql .= " AND gedcom_name = :gedc"; |
|
296 | 296 | $args['gedc'] = $gedc; |
297 | 297 | } |
298 | 298 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | if ($length) { |
321 | - $sql .= " LIMIT :limit OFFSET :offset"; |
|
321 | + $sql .= " LIMIT :limit OFFSET :offset"; |
|
322 | 322 | $args['limit'] = $length; |
323 | 323 | $args['offset'] = $start; |
324 | 324 | } |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | // Total filtered/unfiltered rows |
338 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
339 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##log`")->fetchOne(); |
|
338 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
339 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##log`")->fetchOne(); |
|
340 | 340 | |
341 | 341 | return new JsonResponse([ |
342 | 342 | 'draw' => $draw, |
@@ -371,35 +371,35 @@ discard block |
||
371 | 371 | |
372 | 372 | $args = []; |
373 | 373 | if ($search) { |
374 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
374 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
375 | 375 | $args['search'] = $search; |
376 | 376 | } |
377 | 377 | if ($from) { |
378 | - $sql .= " AND log_time >= :from"; |
|
378 | + $sql .= " AND log_time >= :from"; |
|
379 | 379 | $args['from'] = $from; |
380 | 380 | } |
381 | 381 | if ($to) { |
382 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
382 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
383 | 383 | $args['to'] = $to; |
384 | 384 | } |
385 | 385 | if ($type) { |
386 | - $sql .= " AND log_type = :type"; |
|
386 | + $sql .= " AND log_type = :type"; |
|
387 | 387 | $args['type'] = $type; |
388 | 388 | } |
389 | 389 | if ($text) { |
390 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
390 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
391 | 391 | $args['text'] = $text; |
392 | 392 | } |
393 | 393 | if ($ip) { |
394 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
394 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
395 | 395 | $args['ip'] = $ip; |
396 | 396 | } |
397 | 397 | if ($username) { |
398 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
398 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
399 | 399 | $args['user'] = $username; |
400 | 400 | } |
401 | 401 | if ($gedc) { |
402 | - $sql .= " AND gedcom_name = :gedc"; |
|
402 | + $sql .= " AND gedcom_name = :gedc"; |
|
403 | 403 | $args['gedc'] = $gedc; |
404 | 404 | } |
405 | 405 | |
@@ -432,31 +432,31 @@ discard block |
||
432 | 432 | |
433 | 433 | $args = []; |
434 | 434 | if ($from) { |
435 | - $sql .= " AND log_time >= :from"; |
|
435 | + $sql .= " AND log_time >= :from"; |
|
436 | 436 | $args['from'] = $from; |
437 | 437 | } |
438 | 438 | if ($to) { |
439 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
439 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
440 | 440 | $args['to'] = $to; |
441 | 441 | } |
442 | 442 | if ($type) { |
443 | - $sql .= " AND log_type = :type"; |
|
443 | + $sql .= " AND log_type = :type"; |
|
444 | 444 | $args['type'] = $type; |
445 | 445 | } |
446 | 446 | if ($text) { |
447 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
447 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
448 | 448 | $args['text'] = $text; |
449 | 449 | } |
450 | 450 | if ($ip) { |
451 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
451 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
452 | 452 | $args['ip'] = $ip; |
453 | 453 | } |
454 | 454 | if ($username) { |
455 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
455 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
456 | 456 | $args['user'] = $username; |
457 | 457 | } |
458 | 458 | if ($gedc) { |
459 | - $sql .= " AND gedcom_name = :gedc"; |
|
459 | + $sql .= " AND gedcom_name = :gedc"; |
|
460 | 460 | $args['gedc'] = $gedc; |
461 | 461 | } |
462 | 462 | |
@@ -563,10 +563,10 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | Site::setPreference('MEMORY_LIMIT', $request->get('MEMORY_LIMIT')); |
566 | - Site::setPreference('MAX_EXECUTION_TIME', (string)(int)$request->get('MAX_EXECUTION_TIME')); |
|
567 | - Site::setPreference('ALLOW_USER_THEMES', (string)(bool)$request->get('ALLOW_USER_THEMES')); |
|
566 | + Site::setPreference('MAX_EXECUTION_TIME', (string) (int) $request->get('MAX_EXECUTION_TIME')); |
|
567 | + Site::setPreference('ALLOW_USER_THEMES', (string) (bool) $request->get('ALLOW_USER_THEMES')); |
|
568 | 568 | Site::setPreference('THEME_DIR', $request->get('THEME_DIR')); |
569 | - Site::setPreference('ALLOW_CHANGE_GEDCOM', (string)(bool)$request->get('ALLOW_CHANGE_GEDCOM')); |
|
569 | + Site::setPreference('ALLOW_CHANGE_GEDCOM', (string) (bool) $request->get('ALLOW_CHANGE_GEDCOM')); |
|
570 | 570 | Site::setPreference('TIMEZONE', $request->get('TIMEZONE')); |
571 | 571 | |
572 | 572 | FlashMessages::addMessage(I18N::translate('The website preferences have been updated.'), 'success'); |
@@ -601,8 +601,8 @@ discard block |
||
601 | 601 | { |
602 | 602 | Site::setPreference('WELCOME_TEXT_AUTH_MODE', $request->get('WELCOME_TEXT_AUTH_MODE')); |
603 | 603 | Site::setPreference('WELCOME_TEXT_AUTH_MODE_' . WT_LOCALE, $request->get('WELCOME_TEXT_AUTH_MODE_4')); |
604 | - Site::setPreference('USE_REGISTRATION_MODULE', (string)(bool)$request->get('USE_REGISTRATION_MODULE')); |
|
605 | - Site::setPreference('SHOW_REGISTER_CAUTION', (string)(bool)$request->get('SHOW_REGISTER_CAUTION')); |
|
604 | + Site::setPreference('USE_REGISTRATION_MODULE', (string) (bool) $request->get('USE_REGISTRATION_MODULE')); |
|
605 | + Site::setPreference('SHOW_REGISTER_CAUTION', (string) (bool) $request->get('SHOW_REGISTER_CAUTION')); |
|
606 | 606 | |
607 | 607 | FlashMessages::addMessage(I18N::translate('The website preferences have been updated.'), 'success'); |
608 | 608 | $url = route('admin-control-panel'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function edit(Tree $tree, User $user): Response |
49 | 49 | { |
50 | - $allow_user_themes = (bool)Site::getPreference('ALLOW_USER_THEMES'); |
|
50 | + $allow_user_themes = (bool) Site::getPreference('ALLOW_USER_THEMES'); |
|
51 | 51 | $my_individual_record = Individual::getInstance($tree->getUserPreference(Auth::user(), 'gedcomid'), $tree); |
52 | 52 | $contact_methods = FunctionsEdit::optionsContactMethods(); |
53 | 53 | $default_individual = Individual::getInstance($tree->getUserPreference(Auth::user(), 'rootid'), $tree); |
@@ -82,16 +82,16 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function update(Request $request, Tree $tree, User $user): RedirectResponse |
84 | 84 | { |
85 | - $contact_method = (string)$request->get('contact_method'); |
|
86 | - $email = (string)$request->get('email'); |
|
87 | - $language = (string)$request->get('language'); |
|
88 | - $real_name = (string)$request->get('real_name'); |
|
89 | - $password = (string)$request->get('password'); |
|
90 | - $rootid = (string)$request->get('root_id'); |
|
91 | - $theme = (string)$request->get('theme'); |
|
92 | - $time_zone = (string)$request->get('timezone'); |
|
93 | - $user_name = (string)$request->get('user_name'); |
|
94 | - $visible_online = (string)$request->get('visible_online'); |
|
85 | + $contact_method = (string) $request->get('contact_method'); |
|
86 | + $email = (string) $request->get('email'); |
|
87 | + $language = (string) $request->get('language'); |
|
88 | + $real_name = (string) $request->get('real_name'); |
|
89 | + $password = (string) $request->get('password'); |
|
90 | + $rootid = (string) $request->get('root_id'); |
|
91 | + $theme = (string) $request->get('theme'); |
|
92 | + $time_zone = (string) $request->get('timezone'); |
|
93 | + $user_name = (string) $request->get('user_name'); |
|
94 | + $visible_online = (string) $request->get('visible_online'); |
|
95 | 95 | |
96 | 96 | // Change the password |
97 | 97 | if ($password !== '') { |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | public function editRawRecordAction(Request $request, Tree $tree): Response |
291 | 291 | { |
292 | 292 | $xref = $request->get('xref'); |
293 | - $facts = (array)$request->get('fact'); |
|
294 | - $fact_ids = (array)$request->get('fact_id'); |
|
293 | + $facts = (array) $request->get('fact'); |
|
294 | + $fact_ids = (array) $request->get('fact_id'); |
|
295 | 295 | $record = GedcomRecord::getInstance($xref, $tree); |
296 | 296 | |
297 | 297 | $this->checkRecordAccess($record, true); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $record = GedcomRecord::getInstance($xref, $tree); |
396 | 396 | $this->checkRecordAccess($record, true); |
397 | 397 | |
398 | - $keep_chan = (bool)$request->get('keep_chan'); |
|
398 | + $keep_chan = (bool) $request->get('keep_chan'); |
|
399 | 399 | |
400 | 400 | $this->glevels = $request->get('glevels', []); |
401 | 401 | $this->tag = $request->get('tag', []); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | |
415 | 415 | $newged = ''; |
416 | 416 | if (!empty($_POST['NAME'])) { |
417 | - $newged .= "\n1 NAME " . $_POST['NAME']; |
|
417 | + $newged .= "\n1 NAME " . $_POST['NAME']; |
|
418 | 418 | $name_facts = [ |
419 | 419 | 'TYPE', |
420 | 420 | 'NPFX', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $pages = []; |
85 | 85 | |
86 | 86 | // Escape the query for MySQL and PHP, converting spaces to wildcards. |
87 | - $like_query = strtr($query, [ |
|
87 | + $like_query = strtr($query, [ |
|
88 | 88 | '_' => '\\_', |
89 | 89 | '%' => '\\%', |
90 | 90 | ' ' => '%', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function select2Family(Request $request, Tree $tree): JsonResponse |
208 | 208 | { |
209 | - $page = (int)$request->get('page'); |
|
209 | + $page = (int) $request->get('page'); |
|
210 | 210 | $query = $request->get('q'); |
211 | 211 | |
212 | 212 | return new JsonResponse(Select2::familySearch($tree, $page, $query)); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function select2Flag(Request $request): JsonResponse |
221 | 221 | { |
222 | 222 | $page = $request->get('page'); |
223 | - $query = (int)$request->get('q'); |
|
223 | + $query = (int) $request->get('q'); |
|
224 | 224 | |
225 | 225 | return new JsonResponse(Select2::flagSearch($page, $query)); |
226 | 226 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function select2Individual(Request $request, Tree $tree): JsonResponse |
235 | 235 | { |
236 | - $page = (int)$request->get('page'); |
|
236 | + $page = (int) $request->get('page'); |
|
237 | 237 | $query = $request->get('q'); |
238 | 238 | |
239 | 239 | return new JsonResponse(Select2::individualSearch($tree, $page, $query)); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function select2MediaObject(Request $request, Tree $tree): JsonResponse |
249 | 249 | { |
250 | - $page = (int)$request->get('page'); |
|
250 | + $page = (int) $request->get('page'); |
|
251 | 251 | $query = $request->get('q'); |
252 | 252 | |
253 | 253 | return new JsonResponse(Select2::mediaObjectSearch($tree, $page, $query)); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function select2Note(Request $request, Tree $tree): JsonResponse |
263 | 263 | { |
264 | - $page = (int)$request->get('page'); |
|
264 | + $page = (int) $request->get('page'); |
|
265 | 265 | $query = $request->get('q'); |
266 | 266 | |
267 | 267 | return new JsonResponse(Select2::noteSearch($tree, $page, $query)); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | public function select2Place(Request $request, Tree $tree): JsonResponse |
277 | 277 | { |
278 | - $page = (int)$request->get('page'); |
|
278 | + $page = (int) $request->get('page'); |
|
279 | 279 | $query = $request->get('q'); |
280 | 280 | |
281 | 281 | return new JsonResponse(Select2::placeSearch($tree, $page, $query, true)); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function select2Repository(Request $request, Tree $tree): JsonResponse |
291 | 291 | { |
292 | - $page = (int)$request->get('page'); |
|
292 | + $page = (int) $request->get('page'); |
|
293 | 293 | $query = $request->get('q'); |
294 | 294 | |
295 | 295 | return new JsonResponse(Select2::repositorySearch($tree, $page, $query)); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function select2Source(Request $request, Tree $tree): JsonResponse |
305 | 305 | { |
306 | - $page = (int)$request->get('page'); |
|
306 | + $page = (int) $request->get('page'); |
|
307 | 307 | $query = $request->get('q'); |
308 | 308 | |
309 | 309 | return new JsonResponse(Select2::sourceSearch($tree, $page, $query)); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function select2Submitter(Request $request, Tree $tree): JsonResponse |
319 | 319 | { |
320 | - $page = (int)$request->get('page'); |
|
320 | + $page = (int) $request->get('page'); |
|
321 | 321 | $query = $request->get('q'); |
322 | 322 | |
323 | 323 | return new JsonResponse(Select2::submitterSearch($tree, $page, $query)); |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | { |
61 | 61 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
62 | 62 | |
63 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
63 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
64 | 64 | $scale = min($scale, self::SCALE_MAX); |
65 | 65 | $scale = max($scale, self::SCALE_MIN); |
66 | 66 | |
67 | - $xrefs = (array)$request->get('xrefs', []); |
|
67 | + $xrefs = (array) $request->get('xrefs', []); |
|
68 | 68 | $xrefs = array_unique($xrefs); |
69 | 69 | $xrefs = array_filter($xrefs, function (string $xref) use ($tree) { |
70 | 70 | $individual = Individual::getInstance($xref, $tree); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | |
101 | 101 | $zoom_in_url = route('timeline', [ |
102 | 102 | 'ged' => $tree->getName(), |
103 | - 'scale' => min(self::SCALE_MAX, $scale + (int)($scale * 0.2 + 1)), |
|
103 | + 'scale' => min(self::SCALE_MAX, $scale + (int) ($scale * 0.2 + 1)), |
|
104 | 104 | 'xrefs' => $xrefs, |
105 | 105 | ]); |
106 | 106 | |
107 | 107 | $zoom_out_url = route('timeline', [ |
108 | 108 | 'route' => 'timeline', |
109 | 109 | 'ged' => $tree->getName(), |
110 | - 'scale' => max(self::SCALE_MIN, $scale - (int)($scale * 0.2 + 1)), |
|
110 | + 'scale' => max(self::SCALE_MIN, $scale - (int) ($scale * 0.2 + 1)), |
|
111 | 111 | 'xrefs' => $xrefs, |
112 | 112 | ]); |
113 | 113 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | { |
133 | 133 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
134 | 134 | |
135 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
135 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
136 | 136 | $scale = min($scale, self::SCALE_MAX); |
137 | 137 | $scale = max($scale, self::SCALE_MIN); |
138 | 138 | |
139 | - $xrefs = (array)$request->get('xrefs', []); |
|
139 | + $xrefs = (array) $request->get('xrefs', []); |
|
140 | 140 | $xrefs = array_unique($xrefs); |
141 | 141 | |
142 | 142 | /** @var Individual[] $individuals */ |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return $individual !== null && $individual->canShow(); |
149 | 149 | }); |
150 | 150 | |
151 | - $baseyear = (int)date('Y'); |
|
151 | + $baseyear = (int) date('Y'); |
|
152 | 152 | $topyear = 0; |
153 | 153 | $indifacts = []; |
154 | 154 | $birthyears = []; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $topyear = max($topyear, $date->y); |
184 | 184 | |
185 | 185 | if (!$individual->isDead()) { |
186 | - $topyear = max($topyear, (int)date('Y')); |
|
186 | + $topyear = max($topyear, (int) date('Y')); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // do not add the same fact twice (prevents marriages from being added multiple times) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | if ($scale === 0) { |
199 | - $scale = (int)(($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
199 | + $scale = (int) (($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
200 | 200 | if ($scale < 6) { |
201 | 201 | $scale = 6; |
202 | 202 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function reorderMediaAction(Request $request, Tree $tree): Response |
63 | 63 | { |
64 | 64 | $xref = $request->get('xref'); |
65 | - $order = (array)$request->get('order', []); |
|
65 | + $order = (array) $request->get('order', []); |
|
66 | 66 | $individual = Individual::getInstance($xref, $tree); |
67 | 67 | |
68 | 68 | $this->checkIndividualAccess($individual, true); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function reorderNamesAction(Request $request, Tree $tree): Response |
124 | 124 | { |
125 | 125 | $xref = $request->get('xref'); |
126 | - $order = (array)$request->get('order', []); |
|
126 | + $order = (array) $request->get('order', []); |
|
127 | 127 | $individual = Individual::getInstance($xref, $tree); |
128 | 128 | |
129 | 129 | $this->checkIndividualAccess($individual, true); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | public function reorderSpousesAction(Request $request, Tree $tree): Response |
185 | 185 | { |
186 | 186 | $xref = $request->get('xref'); |
187 | - $order = (array)$request->get('order', []); |
|
187 | + $order = (array) $request->get('order', []); |
|
188 | 188 | $individual = Individual::getInstance($xref, $tree); |
189 | 189 | |
190 | 190 | $this->checkIndividualAccess($individual, true); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $gedcom .= $this->addNewFact($tree, $match); |
292 | 292 | } |
293 | 293 | } |
294 | - if ((bool)$request->get('SOUR_INDI')) { |
|
294 | + if ((bool) $request->get('SOUR_INDI')) { |
|
295 | 295 | $gedcom = $this->handleUpdates($gedcom); |
296 | 296 | } else { |
297 | 297 | $gedcom = $this->updateRest($gedcom); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $gedcom .= $this->addNewFact($tree, $match); |
384 | 384 | } |
385 | 385 | } |
386 | - if ((bool)$request->get('SOUR_INDI')) { |
|
386 | + if ((bool) $request->get('SOUR_INDI')) { |
|
387 | 387 | $gedcom = $this->handleUpdates($gedcom); |
388 | 388 | } else { |
389 | 389 | $gedcom = $this->updateRest($gedcom); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | public function addSpouse(Request $request, Tree $tree): Response |
418 | 418 | { |
419 | - $xref = $request->get('xref', ''); |
|
419 | + $xref = $request->get('xref', ''); |
|
420 | 420 | |
421 | 421 | $individual = Individual::getInstance($xref, $tree); |
422 | 422 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $indi_gedcom .= $this->addNewFact($tree, $match); |
475 | 475 | } |
476 | 476 | } |
477 | - if ((bool)$request->get('SOUR_INDI')) { |
|
477 | + if ((bool) $request->get('SOUR_INDI')) { |
|
478 | 478 | $indi_gedcom = $this->handleUpdates($indi_gedcom); |
479 | 479 | } else { |
480 | 480 | $indi_gedcom = $this->updateRest($indi_gedcom); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $fam_gedcom .= $this->addNewFact($tree, $match); |
487 | 487 | } |
488 | 488 | } |
489 | - if ((bool)$request->get('SOUR_FAM')) { |
|
489 | + if ((bool) $request->get('SOUR_FAM')) { |
|
490 | 490 | $fam_gedcom = $this->handleUpdates($fam_gedcom); |
491 | 491 | } else { |
492 | 492 | $fam_gedcom = $this->updateRest($fam_gedcom); |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | $gedrec .= $this->addNewFact($tree, $match); |
561 | 561 | } |
562 | 562 | } |
563 | - if ((BOOL)$request->get('SOUR_INDI')) { |
|
563 | + if ((BOOL) $request->get('SOUR_INDI')) { |
|
564 | 564 | $gedrec = $this->handleUpdates($gedrec); |
565 | 565 | } else { |
566 | 566 | $gedrec = $this->updateRest($gedrec); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $url = $request->get('url', ''); |
100 | 100 | $xref = $request->get('xref', ''); |
101 | - $change_id = (int)$request->get('change_id'); |
|
101 | + $change_id = (int) $request->get('change_id'); |
|
102 | 102 | |
103 | 103 | $changes = Database::prepare( |
104 | 104 | "SELECT change_id, xref, old_gedcom, new_gedcom" . |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $url = $request->get('url', ''); |
206 | 206 | $xref = $request->get('xref', ''); |
207 | - $change_id = (int)$request->get('change_id'); |
|
207 | + $change_id = (int) $request->get('change_id'); |
|
208 | 208 | |
209 | 209 | // Reject a change, and subsequent changes to the same record |
210 | 210 | Database::prepare( |