@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $args = []; |
170 | 170 | |
171 | 171 | if ($search) { |
172 | - $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))"; |
|
172 | + $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))"; |
|
173 | 173 | $args['search_1'] = $search; |
174 | 174 | $args['search_2'] = $search; |
175 | 175 | $args['search_3'] = $search; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | if ($length) { |
200 | 200 | $user->setPreference('admin_users_page_size', $length); |
201 | - $sql_select .= " LIMIT :limit OFFSET :offset"; |
|
201 | + $sql_select .= " LIMIT :limit OFFSET :offset"; |
|
202 | 202 | $args['limit'] = $length; |
203 | 203 | $args['offset'] = $start; |
204 | 204 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | <br> |
78 | 78 | <br> |
79 | 79 | |
80 | -<table class="table table-bordered table-sm" id="media-table-<?= e($table_id) ?>" data-ajax="<?= e(route('admin-media-data', ['files' => $files, 'media_folder' => $media_folder, 'media_path' => $media_path, 'subfolders' => $subfolders ])) ?>"> |
|
80 | +<table class="table table-bordered table-sm" id="media-table-<?= e($table_id) ?>" data-ajax="<?= e(route('admin-media-data', ['files' => $files, 'media_folder' => $media_folder, 'media_path' => $media_path, 'subfolders' => $subfolders])) ?>"> |
|
81 | 81 | <thead> |
82 | 82 | <tr> |
83 | 83 | <th><?= I18N::translate('Media file') ?></th> |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | " OR descriptive_title LIKE CONCAT('%', :search_2, '%'))" . |
153 | 153 | " AND multimedia_file_refn NOT LIKE 'http://%'" . |
154 | 154 | " AND multimedia_file_refn NOT LIKE 'https://%'"; |
155 | - $ARGS1 = [ |
|
155 | + $ARGS1 = [ |
|
156 | 156 | 'media_path_1' => $media_path, |
157 | 157 | 'media_folder' => $media_folder, |
158 | 158 | 'media_path_2' => Database::escapeLike($media_path), |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | " AND multimedia_file_refn LIKE CONCAT(:media_path_3, '%')" . |
170 | 170 | " AND multimedia_file_refn NOT LIKE 'http://%'" . |
171 | 171 | " AND multimedia_file_refn NOT LIKE 'https://%'"; |
172 | - $ARGS2 = [ |
|
172 | + $ARGS2 = [ |
|
173 | 173 | 'media_folder' => $media_folder, |
174 | 174 | 'media_path_3' => $media_path, |
175 | 175 | ]; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $ARGS2['media_path_4'] = Database::escapeLike($media_path); |
182 | 182 | } |
183 | 183 | |
184 | - $order = $request->get('order', []); |
|
184 | + $order = $request->get('order', []); |
|
185 | 185 | $SELECT1 .= " ORDER BY "; |
186 | 186 | if ($order) { |
187 | 187 | foreach ($order as $key => $value) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | if ($length > 0) { |
208 | - $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
208 | + $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
209 | 209 | $ARGS1['length'] = $length; |
210 | 210 | $ARGS1['start'] = $start; |
211 | 211 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | " JOIN `##media_file` USING (m_id, m_file)" . |
239 | 239 | " WHERE (multimedia_file_refn LIKE 'http://%' OR multimedia_file_refn LIKE 'https://%')" . |
240 | 240 | " AND (multimedia_file_refn LIKE CONCAT('%', :search_1, '%') OR descriptive_title LIKE CONCAT('%', :search_2, '%'))"; |
241 | - $ARGS1 = [ |
|
241 | + $ARGS1 = [ |
|
242 | 242 | 'search_1' => Database::escapeLike($search), |
243 | 243 | 'search_2' => Database::escapeLike($search), |
244 | 244 | ]; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | if ($length > 0) { |
277 | - $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
277 | + $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
278 | 278 | $ARGS1['length'] = $length; |
279 | 279 | $ARGS1['start'] = $start; |
280 | 280 | } |
@@ -193,7 +193,7 @@ |
||
193 | 193 | |
194 | 194 | // Username already exists |
195 | 195 | if (User::findByUserName($username) !== null) { |
196 | - throw new Exception(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.'.$username)); |
|
196 | + throw new Exception(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.' . $username)); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | // Email already exists |
@@ -975,8 +975,8 @@ |
||
975 | 975 | // For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable |
976 | 976 | // e.g. "gregorian_and_jewish" |
977 | 977 | $tree->setPreference('CALENDAR_FORMAT', implode('_and_', array_unique([ |
978 | - $request->get('CALENDAR_FORMAT0', 'none'), |
|
979 | - $request->get('CALENDAR_FORMAT1', 'none'), |
|
978 | + $request->get('CALENDAR_FORMAT0', 'none'), |
|
979 | + $request->get('CALENDAR_FORMAT1', 'none'), |
|
980 | 980 | ]))); |
981 | 981 | $tree->setPreference('CHART_BOX_TAGS', implode(',', $request->get('CHART_BOX_TAGS', []))); |
982 | 982 | $tree->setPreference('CONTACT_USER_ID', $request->get('CONTACT_USER_ID')); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | <select name="tree_name" class="form-control" id="import-server-file"> |
47 | 47 | <option value=""></option> |
48 | 48 | <?php foreach ($gedcom_files as $gedcom_file): ?> |
49 | - <option value="<?= e($gedcom_file) ?>" <?= $gedcom_file === $default_gedcom_file? 'selected' : '' ?>> |
|
49 | + <option value="<?= e($gedcom_file) ?>" <?= $gedcom_file === $default_gedcom_file ? 'selected' : '' ?>> |
|
50 | 50 | <?= e($gedcom_file) ?> |
51 | 51 | </option> |
52 | 52 | <?php endforeach ?> |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $color = self::LINE_COLORS[log($id, 2) % $color_count]; |
298 | 298 | $icon['color'] = $color; //make icon color the same as the line |
299 | 299 | $sosa_points[$id] = $event->getLatLonJSArray(); |
300 | - $sosa_parent = (int)floor($id / 2); |
|
300 | + $sosa_parent = (int) floor($id / 2); |
|
301 | 301 | if (array_key_exists($sosa_parent, $sosa_points)) { |
302 | 302 | // Would like to use a GeometryCollection to hold LineStrings |
303 | 303 | // rather than generate polylines but the MarkerCluster library |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | 'modules/openstreetmap/event-sidebar', |
330 | 330 | $event->shortSummary($mapType, $id) |
331 | 331 | ), |
332 | - 'zoom' => (int)$event->getZoom(), |
|
332 | + 'zoom' => (int) $event->getZoom(), |
|
333 | 333 | ], |
334 | 334 | ]; |
335 | 335 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | 'stats' => $placeStats, |
400 | 400 | ] |
401 | 401 | ), |
402 | - 'zoom' => (int)($location->getZoom() ?? 2), |
|
402 | + 'zoom' => (int) ($location->getZoom() ?? 2), |
|
403 | 403 | ], |
404 | 404 | ]; |
405 | 405 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $xref = $request->get('reference'); |
452 | 452 | $tree = $request->attributes->get('tree'); |
453 | 453 | $individual = Individual::getInstance($xref, $tree); |
454 | - $generations = (int)$request->get( |
|
454 | + $generations = (int) $request->get( |
|
455 | 455 | 'generations', |
456 | 456 | $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS') |
457 | 457 | ); |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | function ($item) { |
501 | 501 | return preg_replace('/[^a-z\d]/i', '', strtolower($item)); |
502 | 502 | }, |
503 | - (array)$provider->styles |
|
503 | + (array) $provider->styles |
|
504 | 504 | ); |
505 | 505 | |
506 | - $key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name)); |
|
506 | + $key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name)); |
|
507 | 507 | |
508 | 508 | self::$map_providers[$key] = [ |
509 | - 'name' => (string)$provider->name, |
|
510 | - 'styles' => array_combine($style_keys, (array)$provider->styles), |
|
509 | + 'name' => (string) $provider->name, |
|
510 | + 'styles' => array_combine($style_keys, (array) $provider->styles), |
|
511 | 511 | ]; |
512 | 512 | } |
513 | 513 | } catch (\Exception $ex) { |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | 'provider' => 'openstreetmap', |
517 | 517 | 'style' => 'mapnik', |
518 | 518 | ]; |
519 | - self::$map_providers = [ |
|
519 | + self::$map_providers = [ |
|
520 | 520 | 'openstreetmap' => [ |
521 | 521 | 'name' => 'OpenStreetMap', |
522 | 522 | 'styles' => ['mapnik' => 'Mapnik'], |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $maxgenerations = $tree->getPreference('MAX_PEDIGREE_GENERATIONS'); |
570 | 570 | $generations = $request->get('generations', $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS')); |
571 | 571 | |
572 | - return (object)[ |
|
572 | + return (object) [ |
|
573 | 573 | 'name' => 'modules/openstreetmap/pedigreemap', |
574 | 574 | 'data' => [ |
575 | 575 | 'assets' => $this->assets(), |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | * @return object |
633 | 633 | */ |
634 | 634 | public function getAdminConfigAction(Request $request) { |
635 | - return (object)[ |
|
635 | + return (object) [ |
|
636 | 636 | 'name' => 'modules/openstreetmap/admin-config', |
637 | 637 | 'data' => [ |
638 | 638 | 'title' => I18N::translate('Open Street Maps (Configuration)'), |
@@ -688,8 +688,8 @@ discard block |
||
688 | 688 | * @throws \Exception |
689 | 689 | */ |
690 | 690 | public function getAdminPlacesAction(Request $request) { |
691 | - $parent_id = (int)$request->get('parent_id', 0); |
|
692 | - $inactive = (bool)$request->get('inactive'); |
|
691 | + $parent_id = (int) $request->get('parent_id', 0); |
|
692 | + $inactive = (bool) $request->get('inactive'); |
|
693 | 693 | $hierarchy = $this->gethierarchy($parent_id); |
694 | 694 | $title = I18N::translate('Open Street Maps (Geographic data)'); |
695 | 695 | $breadcrumbs = [ |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | } |
713 | 713 | $breadcrumbs[] = array_pop($breadcrumbs); |
714 | 714 | |
715 | - return (object)[ |
|
715 | + return (object) [ |
|
716 | 716 | 'name' => 'modules/openstreetmap/admin-places', |
717 | 717 | 'data' => [ |
718 | 718 | 'title' => $title, |
@@ -733,9 +733,9 @@ discard block |
||
733 | 733 | * @throws \Exception |
734 | 734 | */ |
735 | 735 | public function getAdminPlaceEditAction(Request $request) { |
736 | - $parent_id = (int)$request->get('parent_id', 0); |
|
737 | - $place_id = (int)$request->get('place_id'); |
|
738 | - $inactive = (int)$request->get('inactive'); |
|
736 | + $parent_id = (int) $request->get('parent_id', 0); |
|
737 | + $place_id = (int) $request->get('place_id'); |
|
738 | + $inactive = (int) $request->get('inactive'); |
|
739 | 739 | $hierarchy = $this->gethierarchy($place_id); |
740 | 740 | $fqpn = empty($hierarchy) ? '' : $hierarchy[0]->fqpn; |
741 | 741 | $location = new Location($fqpn); |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | } |
772 | 772 | $breadcrumbs[] = $place_id === 0 ? I18N::translate('Add') : I18N::translate('Edit'); |
773 | 773 | |
774 | - return (object)[ |
|
774 | + return (object) [ |
|
775 | 775 | 'name' => 'modules/openstreetmap/admin-place-edit', |
776 | 776 | 'data' => [ |
777 | 777 | 'module' => $this->getName(), |
@@ -797,9 +797,9 @@ discard block |
||
797 | 797 | */ |
798 | 798 | public function postAdminSaveAction(Request $request): RedirectResponse { |
799 | 799 | if (Filter::checkCsrf()) { |
800 | - $parent_id = (int)$request->get('parent_id'); |
|
801 | - $place_id = (int)$request->get('place_id'); |
|
802 | - $inactive = (int)$request->get('inactive'); |
|
800 | + $parent_id = (int) $request->get('parent_id'); |
|
801 | + $place_id = (int) $request->get('place_id'); |
|
802 | + $inactive = (int) $request->get('inactive'); |
|
803 | 803 | $lat = round($request->get('new_place_lati'), 5); // 5 decimal places (locate to within about 1 metre) |
804 | 804 | $lat = ($lat < 0 ? 'S' : 'N') . abs($lat); |
805 | 805 | $lng = round($request->get('new_place_long'), 5); |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | VALUES (:id, :parent, :level, :place, :lng, :lat, :zoom, :icon)" |
819 | 819 | )->execute( |
820 | 820 | [ |
821 | - 'id' => (int)Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(), |
|
821 | + 'id' => (int) Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(), |
|
822 | 822 | 'parent' => $parent_id, |
823 | 823 | 'level' => $level, |
824 | 824 | 'place' => $request->get('new_place_name'), |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | 'place' => $request->get('new_place_name'), |
838 | 838 | 'lat' => $request->get('lati_control') . $lat, |
839 | 839 | 'lng' => $request->get('long_control') . $lng, |
840 | - 'zoom' => (int)$request->get('new_zoom_factor'), |
|
840 | + 'zoom' => (int) $request->get('new_zoom_factor'), |
|
841 | 841 | 'icon' => $icon, |
842 | 842 | ] |
843 | 843 | ); |
@@ -870,9 +870,9 @@ discard block |
||
870 | 870 | */ |
871 | 871 | public function postAdminDeleteRecordAction(Request $request): RedirectResponse { |
872 | 872 | if (Filter::checkCsrf()) { |
873 | - $place_id = (int)$request->get('place_id'); |
|
874 | - $parent_id = (int)$request->get('parent_id'); |
|
875 | - $inactive = (int)$request->get('inactive'); |
|
873 | + $place_id = (int) $request->get('place_id'); |
|
874 | + $parent_id = (int) $request->get('parent_id'); |
|
875 | + $inactive = (int) $request->get('inactive'); |
|
876 | 876 | |
877 | 877 | try { |
878 | 878 | Database::prepare( |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | ); |
892 | 892 | } |
893 | 893 | // If after deleting there are no more places at this level then go up a level |
894 | - $children = (int)Database::prepare( |
|
894 | + $children = (int) Database::prepare( |
|
895 | 895 | "SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id = :parent_id" |
896 | 896 | ) |
897 | 897 | ->execute(['parent_id' => $parent_id]) |
@@ -924,9 +924,9 @@ discard block |
||
924 | 924 | * @throws \Exception |
925 | 925 | */ |
926 | 926 | public function getAdminExportAction(Request $request): RedirectResponse { |
927 | - $parent_id = (int)$request->get('parent_id'); |
|
927 | + $parent_id = (int) $request->get('parent_id'); |
|
928 | 928 | $format = $request->get('format', 'csv'); |
929 | - $maxlevel = (int)Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
|
929 | + $maxlevel = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
|
930 | 930 | $startfqpn = []; |
931 | 931 | $hierarchy = $this->gethierarchy($parent_id); |
932 | 932 | $geojson = []; |
@@ -978,8 +978,8 @@ discard block |
||
978 | 978 | ) |
979 | 979 | ) |
980 | 980 | ); |
981 | - $long = (float)strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); |
|
982 | - $lati = (float)strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); |
|
981 | + $long = (float) strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); |
|
982 | + $lati = (float) strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); |
|
983 | 983 | |
984 | 984 | $geojson['features'][] = [ |
985 | 985 | 'type' => 'Feature', |
@@ -1015,8 +1015,8 @@ discard block |
||
1015 | 1015 | * @return object |
1016 | 1016 | */ |
1017 | 1017 | public function getAdminImportFormAction(Request $request) { |
1018 | - $parent_id = (int)$request->get('parent_id'); |
|
1019 | - $inactive = (int)$request->get('inactive'); |
|
1018 | + $parent_id = (int) $request->get('parent_id'); |
|
1019 | + $inactive = (int) $request->get('inactive'); |
|
1020 | 1020 | $breadcrumbs = [ |
1021 | 1021 | route('admin-control-panel') => I18N::translate('Control panel'), |
1022 | 1022 | route('admin-modules') => I18N::translate('Module administration'), |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | ) => $this->getTitle() . ' (' . I18N::translate('Geographic data') . ')', |
1032 | 1032 | I18N::translate('Import file'), |
1033 | 1033 | ]; |
1034 | - $files = $this->findFiles(WT_MODULES_DIR . $this->getName() . '/extra', ['csv', 'geojson', 'json']); |
|
1034 | + $files = $this->findFiles(WT_MODULES_DIR . $this->getName() . '/extra', ['csv', 'geojson', 'json']); |
|
1035 | 1035 | uasort( |
1036 | 1036 | $files, |
1037 | 1037 | function ($a, $b) { |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | } |
1043 | 1043 | ); |
1044 | 1044 | |
1045 | - return (object)[ |
|
1045 | + return (object) [ |
|
1046 | 1046 | 'name' => 'modules/openstreetmap/admin-import-form', |
1047 | 1047 | 'data' => [ |
1048 | 1048 | 'title' => I18N::translate('Import geographic data'), |
@@ -1106,8 +1106,8 @@ discard block |
||
1106 | 1106 | $row = explode($delimiter, $input_array[0]); |
1107 | 1107 | $fields = count($row); |
1108 | 1108 | if ($fields >= 6 && |
1109 | - (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
1110 | - (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
1109 | + (bool) preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
1110 | + (bool) preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
1111 | 1111 | $filetype = 'csv'; |
1112 | 1112 | } |
1113 | 1113 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | } |
1148 | 1148 | ); |
1149 | 1149 | // convert separate place fields into a comma separated placename |
1150 | - $row[] = implode( |
|
1150 | + $row[] = implode( |
|
1151 | 1151 | Place::GEDCOM_SEPARATOR, |
1152 | 1152 | array_filter( |
1153 | 1153 | array_reverse( |
@@ -1163,7 +1163,7 @@ discard block |
||
1163 | 1163 | } |
1164 | 1164 | |
1165 | 1165 | if ($filetype !== '?') { |
1166 | - if ((bool)$request->get('cleardatabase')) { |
|
1166 | + if ((bool) $request->get('cleardatabase')) { |
|
1167 | 1167 | Database::exec("TRUNCATE TABLE `##placelocation`"); |
1168 | 1168 | } |
1169 | 1169 | //process places |
@@ -1174,10 +1174,10 @@ discard block |
||
1174 | 1174 | usort( |
1175 | 1175 | $places, |
1176 | 1176 | function (array $a, array $b) { |
1177 | - if ((int)$a['pl_level'] === (int)$b['pl_level']) { |
|
1177 | + if ((int) $a['pl_level'] === (int) $b['pl_level']) { |
|
1178 | 1178 | return I18N::strcasecmp($a['fqpn'], $b['fqpn']); |
1179 | 1179 | } else { |
1180 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
1180 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
1181 | 1181 | } |
1182 | 1182 | } |
1183 | 1183 | ); |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | )) { |
1198 | 1198 | |
1199 | 1199 | // overwrite |
1200 | - $location->update((object)$place); |
|
1200 | + $location->update((object) $place); |
|
1201 | 1201 | $updated++; |
1202 | 1202 | } elseif (!$valid && $options !== 'update') { |
1203 | 1203 | //add |
@@ -1267,7 +1267,7 @@ discard block |
||
1267 | 1267 | */ |
1268 | 1268 | public function postAdminImportPlacesAction(Request $request): RedirectResponse { |
1269 | 1269 | $gedcomName = $request->get('ged'); |
1270 | - $inactive = (int)$request->get('inactive'); |
|
1270 | + $inactive = (int) $request->get('inactive'); |
|
1271 | 1271 | $tree = Tree::findByName($gedcomName); |
1272 | 1272 | |
1273 | 1273 | // Get all the places from the places table ... |
@@ -1323,7 +1323,7 @@ discard block |
||
1323 | 1323 | "INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" . |
1324 | 1324 | " VALUES (:id, :parent, :level, :place)" |
1325 | 1325 | ); |
1326 | - $checkRecordQry = Database::prepare( |
|
1326 | + $checkRecordQry = Database::prepare( |
|
1327 | 1327 | "SELECT pl1.pl_id" . |
1328 | 1328 | " FROM `##placelocation` AS pl1" . |
1329 | 1329 | " LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" . |
@@ -1486,18 +1486,18 @@ discard block |
||
1486 | 1486 | |
1487 | 1487 | if ($row['inactive']) { |
1488 | 1488 | $badge = 'danger'; |
1489 | - } elseif ((int)$children->no_coord > 0) { |
|
1489 | + } elseif ((int) $children->no_coord > 0) { |
|
1490 | 1490 | $badge = 'warning'; |
1491 | - } elseif ((int)$children->child_count > 0) { |
|
1491 | + } elseif ((int) $children->child_count > 0) { |
|
1492 | 1492 | $badge = 'info'; |
1493 | 1493 | } else { |
1494 | 1494 | $badge = 'secondary'; |
1495 | 1495 | } |
1496 | 1496 | |
1497 | - $list[] = (object)array_merge( |
|
1497 | + $list[] = (object) array_merge( |
|
1498 | 1498 | $row, |
1499 | 1499 | [ |
1500 | - 'child_count' => (int)$children->child_count, |
|
1500 | + 'child_count' => (int) $children->child_count, |
|
1501 | 1501 | 'badge' => $badge, |
1502 | 1502 | ] |
1503 | 1503 | ); |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | $row = $statement->execute(['id' => $id])->fetchOneRow(); |
1520 | 1520 | $fqpn[] = $row->pl_place; |
1521 | 1521 | $row->fqpn = implode(Place::GEDCOM_SEPARATOR, $fqpn); |
1522 | - $id = (int)$row->pl_parent_id; |
|
1522 | + $id = (int) $row->pl_parent_id; |
|
1523 | 1523 | $arr[] = $row; |
1524 | 1524 | } |
1525 | 1525 | |
@@ -1534,7 +1534,7 @@ discard block |
||
1534 | 1534 | */ |
1535 | 1535 | private function buildLevel($parent_id, $placename, &$places) { |
1536 | 1536 | $level = array_search('', $placename); |
1537 | - $rows = (array)Database::prepare( |
|
1537 | + $rows = (array) Database::prepare( |
|
1538 | 1538 | "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" |
1539 | 1539 | ) |
1540 | 1540 | ->execute([$parent_id]) |
@@ -1604,7 +1604,7 @@ |
||
1604 | 1604 | $height = (int) $attrs['height']; |
1605 | 1605 | } |
1606 | 1606 | |
1607 | - $person = Individual::getInstance($id, $this->tree); |
|
1607 | + $person = Individual::getInstance($id, $this->tree); |
|
1608 | 1608 | $media_file = $person->findHighlightedMediaFile(); |
1609 | 1609 | |
1610 | 1610 | if ($media_file !== null && $media_file->fileExists()) { |
@@ -255,35 +255,35 @@ discard block |
||
255 | 255 | |
256 | 256 | $args = []; |
257 | 257 | if ($search) { |
258 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
258 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
259 | 259 | $args['search'] = $search; |
260 | 260 | } |
261 | 261 | if ($from) { |
262 | - $sql .= " AND log_time >= :from"; |
|
262 | + $sql .= " AND log_time >= :from"; |
|
263 | 263 | $args['from'] = $from; |
264 | 264 | } |
265 | 265 | if ($to) { |
266 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
266 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
267 | 267 | $args['to'] = $to; |
268 | 268 | } |
269 | 269 | if ($type) { |
270 | - $sql .= " AND log_type = :type"; |
|
270 | + $sql .= " AND log_type = :type"; |
|
271 | 271 | $args['type'] = $type; |
272 | 272 | } |
273 | 273 | if ($text) { |
274 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
274 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
275 | 275 | $args['text'] = $text; |
276 | 276 | } |
277 | 277 | if ($ip) { |
278 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
278 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
279 | 279 | $args['ip'] = $ip; |
280 | 280 | } |
281 | 281 | if ($username) { |
282 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
282 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
283 | 283 | $args['user'] = $username; |
284 | 284 | } |
285 | 285 | if ($gedc) { |
286 | - $sql .= " AND gedcom_name = :gedc"; |
|
286 | + $sql .= " AND gedcom_name = :gedc"; |
|
287 | 287 | $args['gedc'] = $gedc; |
288 | 288 | } |
289 | 289 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | if ($length) { |
312 | - $sql .= " LIMIT :limit OFFSET :offset"; |
|
312 | + $sql .= " LIMIT :limit OFFSET :offset"; |
|
313 | 313 | $args['limit'] = $length; |
314 | 314 | $args['offset'] = $start; |
315 | 315 | } |
@@ -361,35 +361,35 @@ discard block |
||
361 | 361 | |
362 | 362 | $args = []; |
363 | 363 | if ($search) { |
364 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
364 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
365 | 365 | $args['search'] = $search; |
366 | 366 | } |
367 | 367 | if ($from) { |
368 | - $sql .= " AND log_time >= :from"; |
|
368 | + $sql .= " AND log_time >= :from"; |
|
369 | 369 | $args['from'] = $from; |
370 | 370 | } |
371 | 371 | if ($to) { |
372 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
372 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
373 | 373 | $args['to'] = $to; |
374 | 374 | } |
375 | 375 | if ($type) { |
376 | - $sql .= " AND log_type = :type"; |
|
376 | + $sql .= " AND log_type = :type"; |
|
377 | 377 | $args['type'] = $type; |
378 | 378 | } |
379 | 379 | if ($text) { |
380 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
380 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
381 | 381 | $args['text'] = $text; |
382 | 382 | } |
383 | 383 | if ($ip) { |
384 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
384 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
385 | 385 | $args['ip'] = $ip; |
386 | 386 | } |
387 | 387 | if ($username) { |
388 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
388 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
389 | 389 | $args['user'] = $username; |
390 | 390 | } |
391 | 391 | if ($gedc) { |
392 | - $sql .= " AND gedcom_name = :gedc"; |
|
392 | + $sql .= " AND gedcom_name = :gedc"; |
|
393 | 393 | $args['gedc'] = $gedc; |
394 | 394 | } |
395 | 395 | |
@@ -421,37 +421,37 @@ discard block |
||
421 | 421 | |
422 | 422 | $args = []; |
423 | 423 | if ($from) { |
424 | - $sql .= " AND log_time >= :from"; |
|
424 | + $sql .= " AND log_time >= :from"; |
|
425 | 425 | $args['from'] = $from; |
426 | 426 | } |
427 | 427 | if ($to) { |
428 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
428 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
429 | 429 | $args['to'] = $to; |
430 | 430 | } |
431 | 431 | if ($type) { |
432 | - $sql .= " AND log_type = :type"; |
|
432 | + $sql .= " AND log_type = :type"; |
|
433 | 433 | $args['type'] = $type; |
434 | 434 | } |
435 | 435 | if ($text) { |
436 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
436 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
437 | 437 | $args['text'] = $text; |
438 | 438 | } |
439 | 439 | if ($ip) { |
440 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
440 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
441 | 441 | $args['ip'] = $ip; |
442 | 442 | } |
443 | 443 | if ($username) { |
444 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
444 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
445 | 445 | $args['user'] = $username; |
446 | 446 | } |
447 | 447 | if ($gedc) { |
448 | - $sql .= " AND gedcom_name = :gedc"; |
|
448 | + $sql .= " AND gedcom_name = :gedc"; |
|
449 | 449 | $args['gedc'] = $gedc; |
450 | 450 | } |
451 | 451 | |
452 | 452 | $sql .= " ORDER BY log_id"; |
453 | 453 | |
454 | - $rows = Database::prepare($sql )->execute($args)->fetchAll(); |
|
454 | + $rows = Database::prepare($sql)->execute($args)->fetchAll(); |
|
455 | 455 | |
456 | 456 | $data = ''; |
457 | 457 |