@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | private function validContacts(Tree $tree): array |
329 | 329 | { |
330 | 330 | $contacts = [ |
331 | - User::find((int)$tree->getPreference('CONTACT_USER_ID')), |
|
332 | - User::find((int)$tree->getPreference('WEBMASTER_USER_ID')), |
|
331 | + User::find((int) $tree->getPreference('CONTACT_USER_ID')), |
|
332 | + User::find((int) $tree->getPreference('WEBMASTER_USER_ID')), |
|
333 | 333 | ]; |
334 | 334 | |
335 | 335 | return array_filter($contacts); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | { |
354 | 354 | // Create a dummy user, so we can send messages from the tree. |
355 | 355 | $from = new User( |
356 | - (object)[ |
|
356 | + (object) [ |
|
357 | 357 | 'user_id' => null, |
358 | 358 | 'user_name' => '', |
359 | 359 | 'real_name' => $tree->getTitle(), |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | // Create a dummy user, so we can reply to visitors. |
365 | 365 | $sender = new User( |
366 | - (object)[ |
|
366 | + (object) [ |
|
367 | 367 | 'user_id' => null, |
368 | 368 | 'user_name' => '', |
369 | 369 | 'real_name' => $sender_name, |
@@ -448,7 +448,7 @@ |
||
448 | 448 | */ |
449 | 449 | public function julianDay(): int |
450 | 450 | { |
451 | - return (int)(($this->minimumJulianDay() + $this->maximumJulianDay()) / 2); |
|
451 | + return (int) (($this->minimumJulianDay() + $this->maximumJulianDay()) / 2); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | /** |
@@ -88,8 +88,7 @@ discard block |
||
88 | 88 | self::$table_prefix = $config['tblpfx']; |
89 | 89 | |
90 | 90 | $dsn = (substr($config['dbhost'], 0, 1) === '/' ? |
91 | - "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" : |
|
92 | - "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
91 | + "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" : "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
93 | 92 | ); |
94 | 93 | |
95 | 94 | // Create the underlying PDO object. |
@@ -222,7 +221,7 @@ discard block |
||
222 | 221 | public static function updateSchema($namespace, $schema_name, $target_version): bool |
223 | 222 | { |
224 | 223 | try { |
225 | - $current_version = (int)Site::getPreference($schema_name); |
|
224 | + $current_version = (int) Site::getPreference($schema_name); |
|
226 | 225 | } catch (PDOException $ex) { |
227 | 226 | DebugBar::addThrowable($ex); |
228 | 227 | |
@@ -239,7 +238,7 @@ discard block |
||
239 | 238 | $migration = new $class(); |
240 | 239 | $migration->upgrade(); |
241 | 240 | $current_version++; |
242 | - Site::setPreference($schema_name, (string)$current_version); |
|
241 | + Site::setPreference($schema_name, (string) $current_version); |
|
243 | 242 | $updates_applied = true; |
244 | 243 | } |
245 | 244 |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $this->pageh = $tmpw; |
146 | 146 | } |
147 | 147 | // Store the pagewidth without margins |
148 | - $this->noMarginWidth = (int)($this->pagew - $this->leftmargin - $this->rightmargin); |
|
148 | + $this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin); |
|
149 | 149 | // If RTL |
150 | 150 | if ($this->rtl) { |
151 | 151 | $this->alignRTL = 'right'; |
@@ -727,14 +727,14 @@ discard block |
||
727 | 727 | public function textWrap($str, $width): string |
728 | 728 | { |
729 | 729 | // Calculate the line width |
730 | - $lw = (int)($width / ($this->getCurrentStyleHeight() / 2)); |
|
730 | + $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2)); |
|
731 | 731 | // Wordwrap each line |
732 | 732 | $lines = explode("\n", $str); |
733 | 733 | // Line Feed counter |
734 | 734 | $lfct = count($lines); |
735 | 735 | $wraptext = ''; |
736 | 736 | foreach ($lines as $line) { |
737 | - $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true); |
|
737 | + $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true); |
|
738 | 738 | $wraptext .= $wtext; |
739 | 739 | // Add a new line as long as it’s not the last line |
740 | 740 | if ($lfct > 1) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | private function getPersonalFacts(Individual $individual): array |
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'], |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | { |
215 | 215 | if ($analytics_id) { |
216 | 216 | // Add extra dimensions (i.e. filtering categories) |
217 | - $dimensions = (object)[ |
|
217 | + $dimensions = (object) [ |
|
218 | 218 | 'dimension1' => $this->tree ? $this->tree->getName() : '-', |
219 | 219 | 'dimension2' => $this->tree ? Auth::accessLevel($this->tree) : '-', |
220 | 220 | ]; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | if ($project_id && $security_id) { |
277 | 277 | return |
278 | 278 | '<script>' . |
279 | - 'var sc_project=' . (int)$project_id . ',sc_invisible=1,sc_security="' . $security_id . |
|
279 | + 'var sc_project=' . (int) $project_id . ',sc_invisible=1,sc_security="' . $security_id . |
|
280 | 280 | '",scJsHost = (("https:"===document.location.protocol)?"https://secure.":"http://www.");' . |
281 | 281 | 'document.write("<sc"+"ript src=\'"+scJsHost+"statcounter.com/counter/counter.js\'></"+"script>");' . |
282 | 282 | '</script>'; |
@@ -1798,7 +1798,7 @@ discard block |
||
1798 | 1798 | public function menuSearchPhonetic(): Menu |
1799 | 1799 | { |
1800 | 1800 | /* I18N: search using “sounds like”, rather than exact spelling */ |
1801 | - return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']); |
|
1801 | + return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex', ]), 'menu-search-soundex', ['rel' => 'nofollow']); |
|
1802 | 1802 | } |
1803 | 1803 | |
1804 | 1804 | /** |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | 100 * $tot_sindi_per, |
477 | 477 | ]); |
478 | 478 | $chl = I18N::translate('Without sources') . ' - ' . I18N::percentage(1 - $tot_sindi_per, 1) . '|' . |
479 | - I18N::translate('With sources') . ' - ' . I18N::percentage($tot_sindi_per, 1); |
|
479 | + I18N::translate('With sources') . ' - ' . I18N::percentage($tot_sindi_per, 1); |
|
480 | 480 | $chart_title = I18N::translate('Individuals with sources'); |
481 | 481 | |
482 | 482 | return '<img src="https://chart.googleapis.com/chart?cht=p3&chd=e:' . $chd . '&chs=' . $size . '&chco=' . $color_from . ',' . $color_to . '&chf=bg,s,ffffff00&chl=' . rawurlencode($chl) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . $chart_title . '" title="' . $chart_title . '">'; |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | I18N::translate('Females') . ' - ' . $per_f . '|' . |
1069 | 1069 | I18N::translate('Males') . ' - ' . $per_m; |
1070 | 1070 | $chart_title = I18N::translate('Males') . ' - ' . $per_m . I18N::$list_separator . |
1071 | - I18N::translate('Females') . ' - ' . $per_f; |
|
1071 | + I18N::translate('Females') . ' - ' . $per_f; |
|
1072 | 1072 | |
1073 | 1073 | return "<img src=\"https://chart.googleapis.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />'; |
1074 | 1074 | } |
@@ -1193,7 +1193,7 @@ discard block |
||
1193 | 1193 | I18N::translate('Living') . ' - ' . $per_l . '|' . |
1194 | 1194 | I18N::translate('Dead') . ' - ' . $per_d . '|'; |
1195 | 1195 | $chart_title = I18N::translate('Living') . ' - ' . $per_l . I18N::$list_separator . |
1196 | - I18N::translate('Dead') . ' - ' . $per_d; |
|
1196 | + I18N::translate('Dead') . ' - ' . $per_d; |
|
1197 | 1197 | |
1198 | 1198 | return "<img src=\"https://chart.googleapis.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_living},{$color_dead}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />'; |
1199 | 1199 | } |
@@ -2216,7 +2216,7 @@ |
||
2216 | 2216 | $centuries = ''; |
2217 | 2217 | $counts = []; |
2218 | 2218 | foreach ($rows as $values) { |
2219 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
2219 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
2220 | 2220 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number((int) $values->total) . '|'; |
2221 | 2221 | } |
2222 | 2222 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $days = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
58 | 58 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_INFO_STYLE); |
59 | 59 | $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT_STYLE); |
60 | - $show_user = (bool)$this->getBlockSetting($block_id, 'show_user', self::DEFAULT_SHOW_USER); |
|
60 | + $show_user = (bool) $this->getBlockSetting($block_id, 'show_user', self::DEFAULT_SHOW_USER); |
|
61 | 61 | |
62 | 62 | extract($cfg, EXTR_OVERWRITE); |
63 | 63 |
@@ -123,49 +123,49 @@ |
||
123 | 123 | |
124 | 124 | <p class="card-text"> |
125 | 125 | <?php |
126 | - // Show file details |
|
127 | - $mediatype = $media_file->type(); |
|
128 | - if ($mediatype) { |
|
129 | - echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($mediatype)); |
|
130 | - } |
|
131 | - echo FunctionsPrintFacts::printFactSources($tree, $media_object->getGedcom(), 1); |
|
132 | - echo FunctionsPrint::printFactNotes($tree, $media_object->getGedcom(), 1); |
|
133 | - if ($media_file->isExternal()) { |
|
134 | - echo GedcomTag::getLabelValue('URL', $media_file->filename()); |
|
135 | - } elseif ($media_file->fileExists()) { |
|
136 | - ?> |
|
126 | + // Show file details |
|
127 | + $mediatype = $media_file->type(); |
|
128 | + if ($mediatype) { |
|
129 | + echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($mediatype)); |
|
130 | + } |
|
131 | + echo FunctionsPrintFacts::printFactSources($tree, $media_object->getGedcom(), 1); |
|
132 | + echo FunctionsPrint::printFactNotes($tree, $media_object->getGedcom(), 1); |
|
133 | + if ($media_file->isExternal()) { |
|
134 | + echo GedcomTag::getLabelValue('URL', $media_file->filename()); |
|
135 | + } elseif ($media_file->fileExists()) { |
|
136 | + ?> |
|
137 | 137 | <button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#details-<?= e($n) ?>" aria-expanded="false" aria-controls="details-<?= e($n) ?>"> |
138 | 138 | <?= I18N::translate('Media file') ?> |
139 | 139 | </button> |
140 | 140 | <div class="collapse" id="details-<?= e($n) ?>"> |
141 | 141 | <?php |
142 | - if (Auth::isEditor($tree)) { |
|
143 | - echo GedcomTag::getLabelValue('FILE', $media_file->filename()); |
|
144 | - } |
|
145 | - echo GedcomTag::getLabelValue('FORM', $media_file->mimeType()); |
|
146 | - foreach ($media_file->attributes() as $tag => $value) { |
|
147 | - echo GedcomTag::getLabelValue($tag, $value); |
|
148 | - } |
|
149 | - ?> |
|
142 | + if (Auth::isEditor($tree)) { |
|
143 | + echo GedcomTag::getLabelValue('FILE', $media_file->filename()); |
|
144 | + } |
|
145 | + echo GedcomTag::getLabelValue('FORM', $media_file->mimeType()); |
|
146 | + foreach ($media_file->attributes() as $tag => $value) { |
|
147 | + echo GedcomTag::getLabelValue($tag, $value); |
|
148 | + } |
|
149 | + ?> |
|
150 | 150 | </div> |
151 | 151 | <?php |
152 | - } else { |
|
153 | - echo '<p class="alert alert-danger">', /* I18N: %s is a filename */ I18N::translate('The file “%s” does not exist.', $media_file->filename()), '</p>'; |
|
154 | - } |
|
155 | - ?> |
|
152 | + } else { |
|
153 | + echo '<p class="alert alert-danger">', /* I18N: %s is a filename */ I18N::translate('The file “%s” does not exist.', $media_file->filename()), '</p>'; |
|
154 | + } |
|
155 | + ?> |
|
156 | 156 | </p> |
157 | 157 | </div> |
158 | 158 | <div class="card-footer"> |
159 | 159 | <?php |
160 | - foreach ($media_object->linkedIndividuals('OBJE') as $individual) { |
|
161 | - echo '<a href="' . e($individual->url()) . '">' . FontAwesome::semanticIcon('individual', I18N::translate('Individual')) . ' ' . $individual->getFullName() . '</a><br>'; |
|
162 | - } |
|
163 | - foreach ($media_object->linkedFamilies('OBJE') as $family) { |
|
164 | - echo '<a href="' . e($family->url()) . '">' . FontAwesome::semanticIcon('family', I18N::translate('Family')) . ' ' . $family->getFullName() . '</a><br>'; |
|
165 | - } |
|
166 | - foreach ($media_object->linkedSources('OBJE') as $source) { |
|
167 | - echo '<a href="' . e($source->url()) . '">' . FontAwesome::semanticIcon('source', I18N::translate('Source')) . ' ' . $source->getFullName() . '</a><br>'; |
|
168 | - } ?> |
|
160 | + foreach ($media_object->linkedIndividuals('OBJE') as $individual) { |
|
161 | + echo '<a href="' . e($individual->url()) . '">' . FontAwesome::semanticIcon('individual', I18N::translate('Individual')) . ' ' . $individual->getFullName() . '</a><br>'; |
|
162 | + } |
|
163 | + foreach ($media_object->linkedFamilies('OBJE') as $family) { |
|
164 | + echo '<a href="' . e($family->url()) . '">' . FontAwesome::semanticIcon('family', I18N::translate('Family')) . ' ' . $family->getFullName() . '</a><br>'; |
|
165 | + } |
|
166 | + foreach ($media_object->linkedSources('OBJE') as $source) { |
|
167 | + echo '<a href="' . e($source->url()) . '">' . FontAwesome::semanticIcon('source', I18N::translate('Source')) . ' ' . $source->getFullName() . '</a><br>'; |
|
168 | + } ?> |
|
169 | 169 | </div> |
170 | 170 | </div> |
171 | 171 | </div> |