@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | <?php if ($record->isPendingDeletion()): ?> |
9 | 9 | <?php if (Auth::isModerator($record->getTree())): ?> |
10 | - <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This family has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
10 | + <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This family has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
11 | 11 | <?php elseif (Auth::isEditor($record->getTree())): ?> |
12 | 12 | <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This family has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
13 | 13 | <?php endif ?> |
14 | 14 | <?php elseif ($record->isPendingAddition()): ?> |
15 | 15 | <?php if (Auth::isModerator($record->getTree())): ?> |
16 | - <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This family has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
16 | + <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This family has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
17 | 17 | <?php elseif (Auth::isEditor($record->getTree())): ?> |
18 | 18 | <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This family has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
19 | 19 | <?php endif ?> |
@@ -26,7 +26,7 @@ |
||
26 | 26 | <button type="submit" class="btn btn-primary"> |
27 | 27 | <?= view('icons/save') ?> |
28 | 28 | <?= /* I18N: A button label. */ |
29 | - I18N::translate('continue') ?> |
|
29 | + I18N::translate('continue') ?> |
|
30 | 30 | </button> |
31 | 31 | |
32 | 32 | <?= I18N::translate('Caution! This may take a long time. Be patient.') ?> |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | </label> |
26 | 26 | <div class="col-sm-9 wt-page-options-value"> |
27 | 27 | <?= |
28 | - Bootstrap4::select( |
|
29 | - FunctionsEdit::numericOptions(range(2, $maxgenerations)), |
|
30 | - $generations, |
|
31 | - ['id' => 'generations', 'name' => 'generations'] |
|
32 | - ) |
|
33 | - ?> |
|
28 | + Bootstrap4::select( |
|
29 | + FunctionsEdit::numericOptions(range(2, $maxgenerations)), |
|
30 | + $generations, |
|
31 | + ['id' => 'generations', 'name' => 'generations'] |
|
32 | + ) |
|
33 | + ?> |
|
34 | 34 | </div> |
35 | 35 | </div> |
36 | 36 | |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | <div class="col-sm-3 wt-page-options-label"></div> |
39 | 39 | <div class="col-sm-9 wt-page-options-value"> |
40 | 40 | <input class="btn btn-primary" type="submit" value="<?= /* I18N: A button label. */ |
41 | - I18N::translate('view') |
|
42 | - ?>"> |
|
41 | + I18N::translate('view') |
|
42 | + ?>"> |
|
43 | 43 | </div> |
44 | 44 | </div> |
45 | 45 | </form> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $note = false; |
61 | 61 | |
62 | 62 | if ($showmap) { |
63 | - $note = true; |
|
63 | + $note = true; |
|
64 | 64 | $content .= view('place-map', [ |
65 | 65 | 'module' => self::MAP_MODULE, |
66 | 66 | 'ref' => $fqpn, |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | switch ($action) { |
73 | 73 | case 'list': |
74 | 74 | $nextaction = ['hierarchy' => I18N::translate('Show place hierarchy')]; |
75 | - $content .= view('place-list', $this->getList($tree)); |
|
75 | + $content .= view('place-list', $this->getList($tree)); |
|
76 | 76 | break; |
77 | 77 | case 'hierarchy': |
78 | 78 | case 'hierarchy-e': |
79 | 79 | $nextaction = ['list' => I18N::translate('Show all places in a list')]; |
80 | 80 | $data = $this->getHierarchy($tree, $place, $parent); |
81 | - $content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data); |
|
81 | + $content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data); |
|
82 | 82 | if (null === $data || $action === 'hierarchy-e') { |
83 | 83 | $content .= view('place-events', $this->getEvents($tree, $place)); |
84 | 84 | } |
@@ -157,7 +157,7 @@ |
||
157 | 157 | */ |
158 | 158 | public function getCount(Tree $tree, $page, $parameter): int |
159 | 159 | { |
160 | - return (int)Database::prepare( |
|
160 | + return (int) Database::prepare( |
|
161 | 161 | "SELECT page_count FROM `##hit_counter` WHERE gedcom_id = :tree_id AND page_name = :page AND page_parameter = :parameter" |
162 | 162 | )->execute([ |
163 | 163 | 'tree_id' => $tree->getTreeId(), |
@@ -9,14 +9,14 @@ |
||
9 | 9 | </a> |
10 | 10 | <?php endif ?> |
11 | 11 | |
12 | -<?php if($value): ?> |
|
12 | +<?php if ($value): ?> |
|
13 | 13 | <span> |
14 | 14 | <?= $value ?> |
15 | 15 | </span> |
16 | 16 | <?php endif ?> |
17 | 17 | |
18 | 18 | <div> |
19 | - <?php if($addtag): ?> |
|
19 | + <?php if ($addtag): ?> |
|
20 | 20 | <?= GedcomTag::getLabel('BIRT') ?>: |
21 | 21 | <?php endif ?> |
22 | 22 | <?= $date ?> |
@@ -9,14 +9,14 @@ |
||
9 | 9 | </a> |
10 | 10 | <?php endif ?> |
11 | 11 | |
12 | -<?php if($value): ?> |
|
12 | +<?php if ($value): ?> |
|
13 | 13 | <span> |
14 | 14 | <?= $value ?> |
15 | 15 | </span> |
16 | 16 | <?php endif ?> |
17 | 17 | |
18 | 18 | <div> |
19 | - <?php if($addtag): ?> |
|
19 | + <?php if ($addtag): ?> |
|
20 | 20 | <?= GedcomTag::getLabel('BIRT') ?>: |
21 | 21 | <?php endif ?> |
22 | 22 | <?= $date ?> |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | private function getPersonalFacts(Individual $individual) |
143 | 143 | { |
144 | - $facts = $individual->getFacts(); |
|
144 | + $facts = $individual->getFacts(); |
|
145 | 145 | foreach ($individual->getSpouseFamilies() as $family) { |
146 | 146 | $facts = array_merge($facts, $family->getFacts()); |
147 | 147 | // Add birth of children from this family to the facts array |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | 'provider' => 'openstreetmap', |
216 | 216 | 'style' => 'mapnik', |
217 | 217 | ]; |
218 | - self::$map_providers = [ |
|
218 | + self::$map_providers = [ |
|
219 | 219 | 'openstreetmap' => [ |
220 | 220 | 'name' => 'OpenStreetMap', |
221 | 221 | 'styles' => ['mapnik' => 'Mapnik'], |
@@ -342,9 +342,11 @@ |
||
342 | 342 | 'fqpn', |
343 | 343 | ]; |
344 | 344 | |
345 | - if ($serverfile !== '') { // first choice is file on server |
|
345 | + if ($serverfile !== '') { |
|
346 | +// first choice is file on server |
|
346 | 347 | $filename = WT_DATA_DIR . 'places/' . $serverfile; |
347 | - } elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { // 2nd choice is local file |
|
348 | + } elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { |
|
349 | +// 2nd choice is local file |
|
348 | 350 | $filename = $_FILES['localfile']['tmp_name']; |
349 | 351 | } |
350 | 352 |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $breadcrumbs[] = I18N::translate('Add'); |
107 | 107 | } else { |
108 | 108 | $breadcrumbs[] = I18N::translate('Edit'); |
109 | - $title .= ' — ' . I18N::translate('Edit'); |
|
109 | + $title .= ' — ' . I18N::translate('Edit'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $this->viewResponse('admin/location-edit', [ |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * @return Response |
240 | 240 | */ |
241 | 241 | public function exportLocations(Request $request): Response { |
242 | - $parent_id = (int)$request->get('parent_id'); |
|
242 | + $parent_id = (int) $request->get('parent_id'); |
|
243 | 243 | $format = $request->get('format'); |
244 | 244 | $maxlevel = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
245 | 245 | $startfqpn = []; |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | return $place; |
270 | 270 | }, $places); |
271 | 271 | |
272 | - $places = array_filter($places, function(array $place) { |
|
272 | + $places = array_filter($places, function (array $place) { |
|
273 | 273 | return $place['pl_long'] !== 0 && $place['pl_lati'] !== 0; |
274 | 274 | }); |
275 | 275 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function importLocations(Request $request): Response |
299 | 299 | { |
300 | - $parent_id = (int) $request->get('parent_id'); |
|
300 | + $parent_id = (int) $request->get('parent_id'); |
|
301 | 301 | |
302 | 302 | $files = array_merge( |
303 | 303 | glob(WT_DATA_DIR . 'places/*.csv'), |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | if (is_file($filename)) { |
353 | - $string = file_get_contents($filename); |
|
353 | + $string = file_get_contents($filename); |
|
354 | 354 | |
355 | 355 | // Check the filetype |
356 | 356 | if (stripos($string, 'FeatureCollection') !== false) { |
@@ -389,10 +389,10 @@ discard block |
||
389 | 389 | |
390 | 390 | $places[] = [ |
391 | 391 | 'pl_level' => $row[0], |
392 | - 'pl_long' => $row[$fields-4], |
|
393 | - 'pl_lati' => $row[$fields-3], |
|
394 | - 'pl_zoom' => $row[$fields-2], |
|
395 | - 'pl_icon' => $row[$fields-1], |
|
392 | + 'pl_long' => $row[$fields - 4], |
|
393 | + 'pl_lati' => $row[$fields - 3], |
|
394 | + 'pl_zoom' => $row[$fields - 2], |
|
395 | + 'pl_icon' => $row[$fields - 1], |
|
396 | 396 | 'fqpn' => $fqdn, |
397 | 397 | ]; |
398 | 398 | } |
@@ -410,10 +410,10 @@ discard block |
||
410 | 410 | usort( |
411 | 411 | $places, |
412 | 412 | function (array $a, array $b) { |
413 | - if ((int)$a['pl_level'] === (int)$b['pl_level']) { |
|
413 | + if ((int) $a['pl_level'] === (int) $b['pl_level']) { |
|
414 | 414 | return I18N::strcasecmp($a['fqpn'], $b['fqpn']); |
415 | 415 | } else { |
416 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
416 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | ); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | "INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" . |
533 | 533 | " VALUES (:id, :parent, :level, :place)" |
534 | 534 | ); |
535 | - $checkRecordQry = Database::prepare( |
|
535 | + $checkRecordQry = Database::prepare( |
|
536 | 536 | "SELECT pl1.pl_id" . |
537 | 537 | " FROM `##placelocation` AS pl1" . |
538 | 538 | " LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" . |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | - FlashMessages::addMessage(I18N::plural('%s location has been imported.', '%s locations have been imported.' , $inserted, I18N::number($inserted)), 'success'); |
|
577 | + FlashMessages::addMessage(I18N::plural('%s location has been imported.', '%s locations have been imported.', $inserted, I18N::number($inserted)), 'success'); |
|
578 | 578 | |
579 | 579 | $url = route('map-data'); |
580 | 580 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | private function buildLevel($parent_id, $placename, &$places) |
671 | 671 | { |
672 | 672 | $level = array_search('', $placename); |
673 | - $rows = (array)Database::prepare( |
|
673 | + $rows = (array) Database::prepare( |
|
674 | 674 | "SELECT pl_level, pl_id, pl_place, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place" |
675 | 675 | ) |
676 | 676 | ->execute([$parent_id]) |