@@ -18,13 +18,15 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * class ReportHtmlFootnote |
20 | 20 | */ |
21 | -class ReportHtmlFootnote extends ReportBaseFootnote { |
|
21 | +class ReportHtmlFootnote extends ReportBaseFootnote |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * HTML Footnotes number renderer |
24 | 25 | * |
25 | 26 | * @param ReportHtml $renderer |
26 | 27 | */ |
27 | - public function render($renderer) { |
|
28 | + public function render($renderer) |
|
29 | + { |
|
28 | 30 | $renderer->setCurrentStyle("footnotenum"); |
29 | 31 | echo "<a href=\"#footnote", $this->num, "\"><sup>"; |
30 | 32 | $renderer->write($renderer->entityRTL . $this->num); |
@@ -37,7 +39,8 @@ discard block |
||
37 | 39 | * |
38 | 40 | * @param ReportHtml $html |
39 | 41 | */ |
40 | - public function renderFootnote($html) { |
|
42 | + public function renderFootnote($html) |
|
43 | + { |
|
41 | 44 | |
42 | 45 | if ($html->getCurrentStyle() != $this->styleName) { |
43 | 46 | $html->setCurrentStyle($this->styleName); |
@@ -61,7 +64,8 @@ discard block |
||
61 | 64 | * |
62 | 65 | * @return int Footnote height in points |
63 | 66 | */ |
64 | - public function getFootnoteHeight($html, $cellWidth = 0) { |
|
67 | + public function getFootnoteHeight($html, $cellWidth = 0) |
|
68 | + { |
|
65 | 69 | if ($html->getCurrentStyle() != $this->styleName) { |
66 | 70 | $html->setCurrentStyle($this->styleName); |
67 | 71 | } |
@@ -84,7 +88,8 @@ discard block |
||
84 | 88 | * |
85 | 89 | * @return array |
86 | 90 | */ |
87 | - public function getWidth($html) { |
|
91 | + public function getWidth($html) |
|
92 | + { |
|
88 | 93 | // Setup the style name |
89 | 94 | $html->setCurrentStyle("footnotenum"); |
90 | 95 |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Class ReportBaseTextbox |
20 | 20 | */ |
21 | -class ReportBaseTextbox extends ReportBaseElement { |
|
21 | +class ReportBaseTextbox extends ReportBaseElement |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * Array of elements in the TextBox |
24 | 25 | * |
@@ -152,7 +153,8 @@ discard block |
||
152 | 153 | * |
153 | 154 | * @param object|string $element |
154 | 155 | */ |
155 | - public function addElement($element) { |
|
156 | + public function addElement($element) |
|
157 | + { |
|
156 | 158 | $this->elements[] = $element; |
157 | 159 | } |
158 | 160 | } |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | * |
23 | 23 | * This class inherits from the TCPDF class and is used to generate the PDF document |
24 | 24 | */ |
25 | -class ReportTcpdf extends TCPDF { |
|
25 | +class ReportTcpdf extends TCPDF |
|
26 | +{ |
|
26 | 27 | /** @var ReportBaseElement[] Array of elements in the header */ |
27 | 28 | public $headerElements = array(); |
28 | 29 | |
@@ -56,7 +57,8 @@ discard block |
||
56 | 57 | /** |
57 | 58 | * PDF Header -PDF |
58 | 59 | */ |
59 | - public function header() { |
|
60 | + public function header() |
|
61 | + { |
|
60 | 62 | foreach ($this->headerElements as $element) { |
61 | 63 | if (is_object($element)) { |
62 | 64 | $element->render($this); |
@@ -80,7 +82,8 @@ discard block |
||
80 | 82 | /** |
81 | 83 | * PDF Body -PDF |
82 | 84 | */ |
83 | - public function body() { |
|
85 | + public function body() |
|
86 | + { |
|
84 | 87 | $this->AddPage(); |
85 | 88 | foreach ($this->bodyElements as $key => $element) { |
86 | 89 | if (is_object($element)) { |
@@ -98,7 +101,8 @@ discard block |
||
98 | 101 | /** |
99 | 102 | * PDF Footnotes -PDF |
100 | 103 | */ |
101 | - public function footnotes() { |
|
104 | + public function footnotes() |
|
105 | + { |
|
102 | 106 | foreach ($this->printedfootnotes as $element) { |
103 | 107 | if (($this->GetY() + $element->getFootnoteHeight($this)) > $this->getPageHeight()) { |
104 | 108 | $this->AddPage(); |
@@ -113,7 +117,8 @@ discard block |
||
113 | 117 | /** |
114 | 118 | * PDF Footer -PDF |
115 | 119 | */ |
116 | - public function footer() { |
|
120 | + public function footer() |
|
121 | + { |
|
117 | 122 | foreach ($this->footerElements as $element) { |
118 | 123 | if (is_object($element)) { |
119 | 124 | $element->render($this); |
@@ -132,7 +137,8 @@ discard block |
||
132 | 137 | * |
133 | 138 | * @return int The number of the Header elements |
134 | 139 | */ |
135 | - public function addHeader($element) { |
|
140 | + public function addHeader($element) |
|
141 | + { |
|
136 | 142 | $this->headerElements[] = $element; |
137 | 143 | |
138 | 144 | return count($this->headerElements) - 1; |
@@ -145,7 +151,8 @@ discard block |
||
145 | 151 | * |
146 | 152 | * @return int The number of the Page Header elements |
147 | 153 | */ |
148 | - public function addPageHeader($element) { |
|
154 | + public function addPageHeader($element) |
|
155 | + { |
|
149 | 156 | $this->pageHeaderElements[] = $element; |
150 | 157 | |
151 | 158 | return count($this->pageHeaderElements) - 1; |
@@ -158,7 +165,8 @@ discard block |
||
158 | 165 | * |
159 | 166 | * @return int The number of the Body elements |
160 | 167 | */ |
161 | - public function addBody($element) { |
|
168 | + public function addBody($element) |
|
169 | + { |
|
162 | 170 | $this->bodyElements[] = $element; |
163 | 171 | |
164 | 172 | return count($this->bodyElements) - 1; |
@@ -171,7 +179,8 @@ discard block |
||
171 | 179 | * |
172 | 180 | * @return int The number of the Footer elements |
173 | 181 | */ |
174 | - public function addFooter($element) { |
|
182 | + public function addFooter($element) |
|
183 | + { |
|
175 | 184 | $this->footerElements[] = $element; |
176 | 185 | |
177 | 186 | return count($this->footerElements) - 1; |
@@ -182,7 +191,8 @@ discard block |
||
182 | 191 | * |
183 | 192 | * @param $index |
184 | 193 | */ |
185 | - public function removeHeader($index) { |
|
194 | + public function removeHeader($index) |
|
195 | + { |
|
186 | 196 | unset($this->headerElements[$index]); |
187 | 197 | } |
188 | 198 | |
@@ -191,7 +201,8 @@ discard block |
||
191 | 201 | * |
192 | 202 | * @param $index |
193 | 203 | */ |
194 | - public function removePageHeader($index) { |
|
204 | + public function removePageHeader($index) |
|
205 | + { |
|
195 | 206 | unset($this->pageHeaderElements[$index]); |
196 | 207 | } |
197 | 208 | |
@@ -200,7 +211,8 @@ discard block |
||
200 | 211 | * |
201 | 212 | * @param $index |
202 | 213 | */ |
203 | - public function removeBody($index) { |
|
214 | + public function removeBody($index) |
|
215 | + { |
|
204 | 216 | unset($this->bodyElements[$index]); |
205 | 217 | } |
206 | 218 | |
@@ -209,14 +221,16 @@ discard block |
||
209 | 221 | * |
210 | 222 | * @param $index |
211 | 223 | */ |
212 | - public function removeFooter($index) { |
|
224 | + public function removeFooter($index) |
|
225 | + { |
|
213 | 226 | unset($this->footerElements[$index]); |
214 | 227 | } |
215 | 228 | |
216 | 229 | /** |
217 | 230 | * Clear the Header -PDF |
218 | 231 | */ |
219 | - public function clearHeader() { |
|
232 | + public function clearHeader() |
|
233 | + { |
|
220 | 234 | unset($this->headerElements); |
221 | 235 | $this->headerElements = array(); |
222 | 236 | } |
@@ -224,7 +238,8 @@ discard block |
||
224 | 238 | /** |
225 | 239 | * Clear the Page Header -PDF |
226 | 240 | */ |
227 | - public function clearPageHeader() { |
|
241 | + public function clearPageHeader() |
|
242 | + { |
|
228 | 243 | unset($this->pageHeaderElements); |
229 | 244 | $this->pageHeaderElements = array(); |
230 | 245 | } |
@@ -234,7 +249,8 @@ discard block |
||
234 | 249 | * |
235 | 250 | * @param $r |
236 | 251 | */ |
237 | - public function setReport($r) { |
|
252 | + public function setReport($r) |
|
253 | + { |
|
238 | 254 | $this->wt_report = $r; |
239 | 255 | } |
240 | 256 | |
@@ -243,7 +259,8 @@ discard block |
||
243 | 259 | * |
244 | 260 | * @return string |
245 | 261 | */ |
246 | - public function getCurrentStyle() { |
|
262 | + public function getCurrentStyle() |
|
263 | + { |
|
247 | 264 | return $this->currentStyle; |
248 | 265 | } |
249 | 266 | |
@@ -252,7 +269,8 @@ discard block |
||
252 | 269 | * |
253 | 270 | * @param string $s Style name |
254 | 271 | */ |
255 | - public function setCurrentStyle($s) { |
|
272 | + public function setCurrentStyle($s) |
|
273 | + { |
|
256 | 274 | $this->currentStyle = $s; |
257 | 275 | $style = $this->wt_report->getStyle($s); |
258 | 276 | $this->SetFont($style['font'], $style['style'], $style['size']); |
@@ -265,7 +283,8 @@ discard block |
||
265 | 283 | * |
266 | 284 | * @return array |
267 | 285 | */ |
268 | - public function getStyle($s) { |
|
286 | + public function getStyle($s) |
|
287 | + { |
|
269 | 288 | if (!isset($this->wt_report->Styles[$s])) { |
270 | 289 | $s = $this->getCurrentStyle(); |
271 | 290 | $this->wt_report->Styles[$s] = $s; |
@@ -282,7 +301,8 @@ discard block |
||
282 | 301 | * |
283 | 302 | * @return float |
284 | 303 | */ |
285 | - public function addMarginX($x) { |
|
304 | + public function addMarginX($x) |
|
305 | + { |
|
286 | 306 | $m = $this->getMargins(); |
287 | 307 | if ($this->getRTL()) { |
288 | 308 | $x += $m['right']; |
@@ -300,7 +320,8 @@ discard block |
||
300 | 320 | * |
301 | 321 | * @return float |
302 | 322 | */ |
303 | - public function getMaxLineWidth() { |
|
323 | + public function getMaxLineWidth() |
|
324 | + { |
|
304 | 325 | $m = $this->getMargins(); |
305 | 326 | if ($this->getRTL()) { |
306 | 327 | return ($this->getRemainingWidth() + $m['right']); |
@@ -314,7 +335,8 @@ discard block |
||
314 | 335 | * |
315 | 336 | * @return int |
316 | 337 | */ |
317 | - public function getFootnotesHeight() { |
|
338 | + public function getFootnotesHeight() |
|
339 | + { |
|
318 | 340 | $h = 0; |
319 | 341 | foreach ($this->printedfootnotes as $element) { |
320 | 342 | $h += $element->getHeight($this); |
@@ -328,7 +350,8 @@ discard block |
||
328 | 350 | * |
329 | 351 | * @return int |
330 | 352 | */ |
331 | - public function getCurrentStyleHeight() { |
|
353 | + public function getCurrentStyleHeight() |
|
354 | + { |
|
332 | 355 | if (empty($this->currentStyle)) { |
333 | 356 | return $this->wt_report->defaultFontSize; |
334 | 357 | } |
@@ -344,7 +367,8 @@ discard block |
||
344 | 367 | * |
345 | 368 | * @return bool false if not numbered befor | object if already numbered |
346 | 369 | */ |
347 | - public function checkFootnote($footnote) { |
|
370 | + public function checkFootnote($footnote) |
|
371 | + { |
|
348 | 372 | $ct = count($this->printedfootnotes); |
349 | 373 | $val = $footnote->getValue(); |
350 | 374 | $i = 0; |
@@ -370,7 +394,8 @@ discard block |
||
370 | 394 | * Used this function instead of AddPage() |
371 | 395 | * This function will make sure that images will not be overwritten |
372 | 396 | */ |
373 | - public function newPage() { |
|
397 | + public function newPage() |
|
398 | + { |
|
374 | 399 | if ($this->lastpicpage > $this->getPage()) { |
375 | 400 | $this->setPage($this->lastpicpage); |
376 | 401 | } |
@@ -384,7 +409,8 @@ discard block |
||
384 | 409 | * |
385 | 410 | * @return bool true in case of page break, false otherwise |
386 | 411 | */ |
387 | - public function checkPageBreakPDF($height) { |
|
412 | + public function checkPageBreakPDF($height) |
|
413 | + { |
|
388 | 414 | return $this->checkPageBreak($height); |
389 | 415 | } |
390 | 416 | |
@@ -393,7 +419,8 @@ discard block |
||
393 | 419 | * |
394 | 420 | * @return float Remaining width |
395 | 421 | */ |
396 | - public function getRemainingWidthPDF() { |
|
422 | + public function getRemainingWidthPDF() |
|
423 | + { |
|
397 | 424 | return $this->getRemainingWidth(); |
398 | 425 | } |
399 | 426 | } |
@@ -36,7 +36,8 @@ discard block |
||
36 | 36 | * this is not the case (e.g. England prior to 1752), we need to use modified |
37 | 37 | * years or the OS/NS notation "4 FEB 1750/51". |
38 | 38 | */ |
39 | -class Date { |
|
39 | +class Date |
|
40 | +{ |
|
40 | 41 | /** @var string Optional qualifier, such as BEF, FROM, ABT */ |
41 | 42 | public $qual1; |
42 | 43 | |
@@ -57,7 +58,8 @@ discard block |
||
57 | 58 | * |
58 | 59 | * @param string $date A date in GEDCOM format |
59 | 60 | */ |
60 | - public function __construct($date) { |
|
61 | + public function __construct($date) |
|
62 | + { |
|
61 | 63 | // Extract any explanatory text |
62 | 64 | if (preg_match('/^(.*) ?[(](.*)[)]/', $date, $match)) { |
63 | 65 | $date = $match[1]; |
@@ -80,7 +82,8 @@ discard block |
||
80 | 82 | * When we copy a date object, we need to create copies of |
81 | 83 | * its child objects. |
82 | 84 | */ |
83 | - public function __clone() { |
|
85 | + public function __clone() |
|
86 | + { |
|
84 | 87 | $this->date1 = clone $this->date1; |
85 | 88 | if (is_object($this->date2)) { |
86 | 89 | $this->date2 = clone $this->date2; |
@@ -98,7 +101,8 @@ discard block |
||
98 | 101 | * |
99 | 102 | * @return CalendarDate |
100 | 103 | */ |
101 | - private function parseDate($date) { |
|
104 | + private function parseDate($date) |
|
105 | + { |
|
102 | 106 | // Valid calendar escape specified? - use it |
103 | 107 | if (preg_match('/^(@#D(?:GREGORIAN|JULIAN|HEBREW|HIJRI|JALALI|FRENCH R|ROMAN)+@) ?(.*)/', $date, $match)) { |
104 | 108 | $cal = $match[1]; |
@@ -193,7 +197,8 @@ discard block |
||
193 | 197 | * |
194 | 198 | * @return string[] |
195 | 199 | */ |
196 | - public static function calendarNames() { |
|
200 | + public static function calendarNames() |
|
201 | + { |
|
197 | 202 | return array( |
198 | 203 | 'gregorian' => /* I18N: The gregorian calendar */ I18N::translate('Gregorian'), |
199 | 204 | 'julian' => /* I18N: The julian calendar */ I18N::translate('Julian'), |
@@ -213,7 +218,8 @@ discard block |
||
213 | 218 | * |
214 | 219 | * @return string |
215 | 220 | */ |
216 | - public function display($url = false, $date_format = null, $convert_calendars = true) { |
|
221 | + public function display($url = false, $date_format = null, $convert_calendars = true) |
|
222 | + { |
|
217 | 223 | global $WT_TREE; |
218 | 224 | |
219 | 225 | $CALENDAR_FORMAT = $WT_TREE->getPreference('CALENDAR_FORMAT'); |
@@ -346,7 +352,8 @@ discard block |
||
346 | 352 | * |
347 | 353 | * @return CalendarDate |
348 | 354 | */ |
349 | - public function minimumDate() { |
|
355 | + public function minimumDate() |
|
356 | + { |
|
350 | 357 | return $this->date1; |
351 | 358 | } |
352 | 359 | |
@@ -357,7 +364,8 @@ discard block |
||
357 | 364 | * |
358 | 365 | * @return CalendarDate |
359 | 366 | */ |
360 | - public function maximumDate() { |
|
367 | + public function maximumDate() |
|
368 | + { |
|
361 | 369 | if (is_null($this->date2)) { |
362 | 370 | return $this->date1; |
363 | 371 | } else { |
@@ -370,7 +378,8 @@ discard block |
||
370 | 378 | * |
371 | 379 | * @return int |
372 | 380 | */ |
373 | - public function minimumJulianDay() { |
|
381 | + public function minimumJulianDay() |
|
382 | + { |
|
374 | 383 | return $this->minimumDate()->minJD; |
375 | 384 | } |
376 | 385 | |
@@ -379,7 +388,8 @@ discard block |
||
379 | 388 | * |
380 | 389 | * @return int |
381 | 390 | */ |
382 | - public function maximumJulianDay() { |
|
391 | + public function maximumJulianDay() |
|
392 | + { |
|
383 | 393 | return $this->maximumDate()->maxJD; |
384 | 394 | } |
385 | 395 | |
@@ -391,7 +401,8 @@ discard block |
||
391 | 401 | * |
392 | 402 | * @return int |
393 | 403 | */ |
394 | - public function julianDay() { |
|
404 | + public function julianDay() |
|
405 | + { |
|
395 | 406 | return (int) (($this->minimumJulianDay() + $this->maximumJulianDay()) / 2); |
396 | 407 | } |
397 | 408 | |
@@ -406,7 +417,8 @@ discard block |
||
406 | 417 | * |
407 | 418 | * @return Date |
408 | 419 | */ |
409 | - public function addYears($years, $qualifier = '') { |
|
420 | + public function addYears($years, $qualifier = '') |
|
421 | + { |
|
410 | 422 | $tmp = clone $this; |
411 | 423 | $tmp->date1->y += $years; |
412 | 424 | $tmp->date1->m = 0; |
@@ -430,7 +442,8 @@ discard block |
||
430 | 442 | * |
431 | 443 | * @return int|string |
432 | 444 | */ |
433 | - public static function getAge(Date $d1, Date $d2 = null, $format = 0) { |
|
445 | + public static function getAge(Date $d1, Date $d2 = null, $format = 0) |
|
446 | + { |
|
434 | 447 | if ($d2) { |
435 | 448 | if ($d2->maximumJulianDay() >= $d1->minimumJulianDay() && $d2->minimumJulianDay() <= $d1->minimumJulianDay()) { |
436 | 449 | // Overlapping dates |
@@ -484,7 +497,8 @@ discard block |
||
484 | 497 | * |
485 | 498 | * @return string |
486 | 499 | */ |
487 | - public static function getAgeGedcom(Date $d1, Date $d2 = null) { |
|
500 | + public static function getAgeGedcom(Date $d1, Date $d2 = null) |
|
501 | + { |
|
488 | 502 | if (is_null($d2)) { |
489 | 503 | return $d1->date1->getAge(true, WT_CLIENT_JD, true); |
490 | 504 | } else { |
@@ -512,7 +526,8 @@ discard block |
||
512 | 526 | * |
513 | 527 | * @return int |
514 | 528 | */ |
515 | - public static function compare(Date $a, Date $b) { |
|
529 | + public static function compare(Date $a, Date $b) |
|
530 | + { |
|
516 | 531 | // Get min/max JD for each date. |
517 | 532 | switch ($a->qual1) { |
518 | 533 | case 'BEF': |
@@ -563,7 +578,8 @@ discard block |
||
563 | 578 | * |
564 | 579 | * @return bool |
565 | 580 | */ |
566 | - public function isOK() { |
|
581 | + public function isOK() |
|
582 | + { |
|
567 | 583 | return $this->minimumJulianDay() && $this->maximumJulianDay(); |
568 | 584 | } |
569 | 585 | |
@@ -575,7 +591,8 @@ discard block |
||
575 | 591 | * |
576 | 592 | * @return int |
577 | 593 | */ |
578 | - public function gregorianYear() { |
|
594 | + public function gregorianYear() |
|
595 | + { |
|
579 | 596 | if ($this->isOK()) { |
580 | 597 | $gregorian_calendar = new GregorianCalendar; |
581 | 598 | list($year) = $gregorian_calendar->jdToYmd($this->julianDay()); |
@@ -26,7 +26,8 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Class Functions - common functions |
28 | 28 | */ |
29 | -class Functions { |
|
29 | +class Functions |
|
30 | +{ |
|
30 | 31 | /** |
31 | 32 | * Check with the webtrees.net server for the latest version of webtrees. |
32 | 33 | * Fetching the remote file can be slow, so check infrequently, and cache the result. |
@@ -36,7 +37,8 @@ discard block |
||
36 | 37 | * |
37 | 38 | * @return null|string |
38 | 39 | */ |
39 | - public static function fetchLatestVersion() { |
|
40 | + public static function fetchLatestVersion() |
|
41 | + { |
|
40 | 42 | $last_update_timestamp = Site::getPreference('LATEST_WT_VERSION_TIMESTAMP'); |
41 | 43 | if ($last_update_timestamp < WT_TIMESTAMP - 24 * 60 * 60) { |
42 | 44 | $row = Database::prepare("SHOW VARIABLES LIKE 'version'")->fetchOneRow(); |
@@ -63,7 +65,8 @@ discard block |
||
63 | 65 | * |
64 | 66 | * @return string |
65 | 67 | */ |
66 | - public static function fileUploadErrorText($error_code) { |
|
68 | + public static function fileUploadErrorText($error_code) |
|
69 | + { |
|
67 | 70 | switch ($error_code) { |
68 | 71 | case UPLOAD_ERR_OK: |
69 | 72 | return I18N::translate('File successfully uploaded'); |
@@ -113,7 +116,8 @@ discard block |
||
113 | 116 | * |
114 | 117 | * @return string the subrecord that was found or an empty string "" if not found. |
115 | 118 | */ |
116 | - public static function getSubRecord($level, $tag, $gedrec, $num = 1) { |
|
119 | + public static function getSubRecord($level, $tag, $gedrec, $num = 1) |
|
120 | + { |
|
117 | 121 | if (empty($gedrec)) { |
118 | 122 | return ''; |
119 | 123 | } |
@@ -154,7 +158,8 @@ discard block |
||
154 | 158 | * |
155 | 159 | * @return string a string with all CONT lines merged |
156 | 160 | */ |
157 | - public static function getCont($nlevel, $nrec) { |
|
161 | + public static function getCont($nlevel, $nrec) |
|
162 | + { |
|
158 | 163 | $text = ''; |
159 | 164 | |
160 | 165 | $subrecords = explode("\n", $nrec); |
@@ -180,7 +185,8 @@ discard block |
||
180 | 185 | * |
181 | 186 | * @param Fact[] $arr |
182 | 187 | */ |
183 | - public static function sortFacts(&$arr) { |
|
188 | + public static function sortFacts(&$arr) |
|
189 | + { |
|
184 | 190 | $dated = array(); |
185 | 191 | $nondated = array(); |
186 | 192 | //-- split the array into dated and non-dated arrays |
@@ -236,7 +242,8 @@ discard block |
||
236 | 242 | * |
237 | 243 | * @return string |
238 | 244 | */ |
239 | - public static function getCloseRelationshipName(Individual $individual1, Individual $individual2) { |
|
245 | + public static function getCloseRelationshipName(Individual $individual1, Individual $individual2) |
|
246 | + { |
|
240 | 247 | if ($individual1 === $individual2) { |
241 | 248 | $label = '<i class="icon-selected"></i> ' . self::reflexivePronoun($individual1); |
242 | 249 | } else { |
@@ -254,7 +261,8 @@ discard block |
||
254 | 261 | * |
255 | 262 | * @return string |
256 | 263 | */ |
257 | - public static function getAssociateRelationshipName(Individual $individual1, Individual $individual2) { |
|
264 | + public static function getAssociateRelationshipName(Individual $individual1, Individual $individual2) |
|
265 | + { |
|
258 | 266 | if ($individual1 === $individual2) { |
259 | 267 | $label = self::reflexivePronoun($individual1); |
260 | 268 | } else { |
@@ -271,7 +279,8 @@ discard block |
||
271 | 279 | * |
272 | 280 | * @return string |
273 | 281 | */ |
274 | - private static function reflexivePronoun(Individual $individual) { |
|
282 | + private static function reflexivePronoun(Individual $individual) |
|
283 | + { |
|
275 | 284 | switch ($individual->getSex()) { |
276 | 285 | case 'M': |
277 | 286 | return /* I18N: reflexive pronoun */ I18N::translate('himself'); |
@@ -291,7 +300,8 @@ discard block |
||
291 | 300 | * |
292 | 301 | * @return array|bool An array of nodes on the relationship path, or false if no path found |
293 | 302 | */ |
294 | - public static function getRelationship(Individual $person1, Individual $person2, $maxlength = 4) { |
|
303 | + public static function getRelationship(Individual $person1, Individual $person2, $maxlength = 4) |
|
304 | + { |
|
295 | 305 | if ($person1 === $person2) { |
296 | 306 | return false; |
297 | 307 | } |
@@ -423,7 +433,8 @@ discard block |
||
423 | 433 | * |
424 | 434 | * @return string |
425 | 435 | */ |
426 | - public static function getRelationshipName($nodes) { |
|
436 | + public static function getRelationshipName($nodes) |
|
437 | + { |
|
427 | 438 | if (!is_array($nodes)) { |
428 | 439 | return ''; |
429 | 440 | } |
@@ -461,7 +472,8 @@ discard block |
||
461 | 472 | * |
462 | 473 | * @return string |
463 | 474 | */ |
464 | - public static function cousinName($n, $sex) { |
|
475 | + public static function cousinName($n, $sex) |
|
476 | + { |
|
465 | 477 | switch ($sex) { |
466 | 478 | case 'M': |
467 | 479 | switch ($n) { |
@@ -597,7 +609,8 @@ discard block |
||
597 | 609 | * |
598 | 610 | * @return string |
599 | 611 | */ |
600 | - public static function cousinName2($n, $sex, $relation) { |
|
612 | + public static function cousinName2($n, $sex, $relation) |
|
613 | + { |
|
601 | 614 | switch ($sex) { |
602 | 615 | case 'M': |
603 | 616 | switch ($n) { |
@@ -659,7 +672,8 @@ discard block |
||
659 | 672 | * |
660 | 673 | * @return string |
661 | 674 | */ |
662 | - public static function getRelationshipNameFromPath($path, Individual $person1 = null, Individual $person2 = null) { |
|
675 | + public static function getRelationshipNameFromPath($path, Individual $person1 = null, Individual $person2 = null) |
|
676 | + { |
|
663 | 677 | if (!preg_match('/^(mot|fat|par|hus|wif|spo|son|dau|chi|bro|sis|sib)*$/', $path)) { |
664 | 678 | // TODO: Update all the “3 RELA ” values in class_person |
665 | 679 | return '<span class="error">' . $path . '</span>'; |
@@ -2176,7 +2190,8 @@ discard block |
||
2176 | 2190 | * |
2177 | 2191 | * @return string |
2178 | 2192 | */ |
2179 | - public static function getQueryUrl($overwrite = null, $separator = '&') { |
|
2193 | + public static function getQueryUrl($overwrite = null, $separator = '&') |
|
2194 | + { |
|
2180 | 2195 | if (empty($_GET)) { |
2181 | 2196 | $get = array(); |
2182 | 2197 | } else { |
@@ -2213,7 +2228,8 @@ discard block |
||
2213 | 2228 | * |
2214 | 2229 | * @return bool |
2215 | 2230 | */ |
2216 | - public static function isFileExternal($file) { |
|
2231 | + public static function isFileExternal($file) |
|
2232 | + { |
|
2217 | 2233 | return strpos($file, '://') !== false; |
2218 | 2234 | } |
2219 | 2235 | } |
@@ -37,7 +37,8 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * Class FunctionsPrintLists - create sortable lists using datatables.net |
39 | 39 | */ |
40 | -class FunctionsPrintLists { |
|
40 | +class FunctionsPrintLists |
|
41 | +{ |
|
41 | 42 | /** |
42 | 43 | * Generate a SURN,GIVN and GIVN,SURN sortable name for an individual. |
43 | 44 | * This allows table data to sort by surname or given names. |
@@ -50,7 +51,8 @@ discard block |
||
50 | 51 | * |
51 | 52 | * @return string[] |
52 | 53 | */ |
53 | - private static function sortableNames(Individual $individual) { |
|
54 | + private static function sortableNames(Individual $individual) |
|
55 | + { |
|
54 | 56 | $names = $individual->getAllNames(); |
55 | 57 | $primary = $individual->getPrimaryName(); |
56 | 58 | |
@@ -73,7 +75,8 @@ discard block |
||
73 | 75 | * |
74 | 76 | * @return string |
75 | 77 | */ |
76 | - public static function individualTable($indiviudals, $option = '') { |
|
78 | + public static function individualTable($indiviudals, $option = '') |
|
79 | + { |
|
77 | 80 | global $controller, $WT_TREE; |
78 | 81 | |
79 | 82 | $table_id = 'table-indi-' . Uuid::uuid4(); // lists requires a unique ID in case there are multiple lists per page |
@@ -516,7 +519,8 @@ discard block |
||
516 | 519 | * |
517 | 520 | * @return string |
518 | 521 | */ |
519 | - public static function familyTable($families) { |
|
522 | + public static function familyTable($families) |
|
523 | + { |
|
520 | 524 | global $WT_TREE, $controller; |
521 | 525 | |
522 | 526 | $table_id = 'table-fam-' . Uuid::uuid4(); // lists requires a unique ID in case there are multiple lists per page |
@@ -985,7 +989,8 @@ discard block |
||
985 | 989 | * |
986 | 990 | * @return string |
987 | 991 | */ |
988 | - public static function sourceTable($sources) { |
|
992 | + public static function sourceTable($sources) |
|
993 | + { |
|
989 | 994 | global $WT_TREE, $controller; |
990 | 995 | |
991 | 996 | // Count the number of linked records. These numbers include private records. |
@@ -1112,7 +1117,8 @@ discard block |
||
1112 | 1117 | * |
1113 | 1118 | * @return string |
1114 | 1119 | */ |
1115 | - public static function noteTable($notes) { |
|
1120 | + public static function noteTable($notes) |
|
1121 | + { |
|
1116 | 1122 | global $WT_TREE, $controller; |
1117 | 1123 | |
1118 | 1124 | // Count the number of linked records. These numbers include private records. |
@@ -1218,7 +1224,8 @@ discard block |
||
1218 | 1224 | * |
1219 | 1225 | * @return string |
1220 | 1226 | */ |
1221 | - public static function repositoryTable($repositories) { |
|
1227 | + public static function repositoryTable($repositories) |
|
1228 | + { |
|
1222 | 1229 | global $WT_TREE, $controller; |
1223 | 1230 | |
1224 | 1231 | // Count the number of linked records. These numbers include private records. |
@@ -1311,7 +1318,8 @@ discard block |
||
1311 | 1318 | * |
1312 | 1319 | * @return string |
1313 | 1320 | */ |
1314 | - public static function mediaTable($media_objects) { |
|
1321 | + public static function mediaTable($media_objects) |
|
1322 | + { |
|
1315 | 1323 | global $WT_TREE, $controller; |
1316 | 1324 | |
1317 | 1325 | $html = ''; |
@@ -1404,7 +1412,8 @@ discard block |
||
1404 | 1412 | * |
1405 | 1413 | * @return string |
1406 | 1414 | */ |
1407 | - public static function surnameTable($surnames, $script, Tree $tree) { |
|
1415 | + public static function surnameTable($surnames, $script, Tree $tree) |
|
1416 | + { |
|
1408 | 1417 | global $controller; |
1409 | 1418 | |
1410 | 1419 | $html = ''; |
@@ -1494,7 +1503,8 @@ discard block |
||
1494 | 1503 | * |
1495 | 1504 | * @return string |
1496 | 1505 | */ |
1497 | - public static function surnameTagCloud($surnames, $script, $totals, Tree $tree) { |
|
1506 | + public static function surnameTagCloud($surnames, $script, $totals, Tree $tree) |
|
1507 | + { |
|
1498 | 1508 | $minimum = PHP_INT_MAX; |
1499 | 1509 | $maximum = 1; |
1500 | 1510 | foreach ($surnames as $surn => $surns) { |
@@ -1537,7 +1547,8 @@ discard block |
||
1537 | 1547 | * |
1538 | 1548 | * @return string |
1539 | 1549 | */ |
1540 | - public static function surnameList($surnames, $style, $totals, $script, Tree $tree) { |
|
1550 | + public static function surnameList($surnames, $style, $totals, $script, Tree $tree) |
|
1551 | + { |
|
1541 | 1552 | $html = array(); |
1542 | 1553 | foreach ($surnames as $surn => $surns) { |
1543 | 1554 | // Each surname links back to the indilist |
@@ -1616,7 +1627,8 @@ discard block |
||
1616 | 1627 | * |
1617 | 1628 | * @return string |
1618 | 1629 | */ |
1619 | - public static function eventsTable($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv') { |
|
1630 | + public static function eventsTable($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv') |
|
1631 | + { |
|
1620 | 1632 | global $controller, $WT_TREE; |
1621 | 1633 | |
1622 | 1634 | $html = ''; |
@@ -1746,7 +1758,8 @@ discard block |
||
1746 | 1758 | * |
1747 | 1759 | * @return string |
1748 | 1760 | */ |
1749 | - public static function eventsList($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv') { |
|
1761 | + public static function eventsList($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv') |
|
1762 | + { |
|
1750 | 1763 | global $WT_TREE; |
1751 | 1764 | |
1752 | 1765 | // Did we have any output? Did we skip anything? |
@@ -1856,7 +1869,8 @@ discard block |
||
1856 | 1869 | * |
1857 | 1870 | * @return string |
1858 | 1871 | */ |
1859 | - public static function chartByAge($data, $title) { |
|
1872 | + public static function chartByAge($data, $title) |
|
1873 | + { |
|
1860 | 1874 | $count = 0; |
1861 | 1875 | $agemax = 0; |
1862 | 1876 | $vmax = 0; |
@@ -1927,7 +1941,8 @@ discard block |
||
1927 | 1941 | * |
1928 | 1942 | * @return string |
1929 | 1943 | */ |
1930 | - public static function chartByDecade($data, $title) { |
|
1944 | + public static function chartByDecade($data, $title) |
|
1945 | + { |
|
1931 | 1946 | $count = 0; |
1932 | 1947 | $vmax = 0; |
1933 | 1948 | foreach ($data as $v) { |
@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Class FunctionsDate - common functions |
23 | 23 | */ |
24 | -class FunctionsDate { |
|
24 | +class FunctionsDate |
|
25 | +{ |
|
25 | 26 | /** |
26 | 27 | * Convert a GEDCOM age string to localized text. |
27 | 28 | * |
@@ -29,7 +30,8 @@ discard block |
||
29 | 30 | * |
30 | 31 | * @return string |
31 | 32 | */ |
32 | - public static function getAgeAtEvent($age_string) { |
|
33 | + public static function getAgeAtEvent($age_string) |
|
34 | + { |
|
33 | 35 | switch (strtoupper($age_string)) { |
34 | 36 | case 'CHILD': |
35 | 37 | return I18N::translate('Child'); |
@@ -68,7 +70,8 @@ discard block |
||
68 | 70 | * |
69 | 71 | * @return string |
70 | 72 | */ |
71 | - public static function formatTimestamp($time) { |
|
73 | + public static function formatTimestamp($time) |
|
74 | + { |
|
72 | 75 | $time_fmt = I18N::timeFormat(); |
73 | 76 | // PHP::date() doesn't do I18N. Do it ourselves.... |
74 | 77 | preg_match_all('/%[^%]/', $time_fmt, $matches); |
@@ -121,7 +124,8 @@ discard block |
||
121 | 124 | * |
122 | 125 | * @return Date |
123 | 126 | */ |
124 | - public static function timestampToGedcomDate($time) { |
|
127 | + public static function timestampToGedcomDate($time) |
|
128 | + { |
|
125 | 129 | return new Date(strtoupper(gmdate('j M Y', $time))); |
126 | 130 | } |
127 | 131 | } |
@@ -38,7 +38,8 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Class FunctionsDb - common functions |
40 | 40 | */ |
41 | -class FunctionsDb { |
|
41 | +class FunctionsDb |
|
42 | +{ |
|
42 | 43 | /** |
43 | 44 | * Fetch all records linked to a record - when deleting an object, we must |
44 | 45 | * also delete all links to it. |
@@ -48,7 +49,8 @@ discard block |
||
48 | 49 | * |
49 | 50 | * @return string[] |
50 | 51 | */ |
51 | - public static function fetchAllLinks($xref, $gedcom_id) { |
|
52 | + public static function fetchAllLinks($xref, $gedcom_id) |
|
53 | + { |
|
52 | 54 | return |
53 | 55 | Database::prepare( |
54 | 56 | "SELECT l_from FROM `##link` WHERE l_file = ? AND l_to = ?" . |
@@ -71,7 +73,8 @@ discard block |
||
71 | 73 | * |
72 | 74 | * @return Source[] array |
73 | 75 | */ |
74 | - public static function getSourceList(Tree $tree) { |
|
76 | + public static function getSourceList(Tree $tree) |
|
77 | + { |
|
75 | 78 | $rows = Database::prepare( |
76 | 79 | "SELECT s_id AS xref, s_gedcom AS gedcom FROM `##sources` WHERE s_file = :tree_id" |
77 | 80 | )->execute(array( |
@@ -95,7 +98,8 @@ discard block |
||
95 | 98 | * |
96 | 99 | * @return Repository[] array |
97 | 100 | */ |
98 | - public static function getRepositoryList(Tree $tree) { |
|
101 | + public static function getRepositoryList(Tree $tree) |
|
102 | + { |
|
99 | 103 | $rows = Database::prepare( |
100 | 104 | "SELECT o_id AS xref, o_gedcom AS gedcom FROM `##other` WHERE o_type = 'REPO' AND o_file = ?" |
101 | 105 | )->execute(array( |
@@ -119,7 +123,8 @@ discard block |
||
119 | 123 | * |
120 | 124 | * @return Note[] array |
121 | 125 | */ |
122 | - public static function getNoteList(Tree $tree) { |
|
126 | + public static function getNoteList(Tree $tree) |
|
127 | + { |
|
123 | 128 | $rows = Database::prepare( |
124 | 129 | "SELECT o_id AS xref, o_gedcom AS gedcom FROM `##other` WHERE o_type = 'NOTE' AND o_file = :tree_id" |
125 | 130 | )->execute(array( |
@@ -144,7 +149,8 @@ discard block |
||
144 | 149 | * |
145 | 150 | * @return Individual[] |
146 | 151 | */ |
147 | - public static function searchIndividuals(array $query, array $trees) { |
|
152 | + public static function searchIndividuals(array $query, array $trees) |
|
153 | + { |
|
148 | 154 | // Convert the query into a regular expression |
149 | 155 | $queryregex = array(); |
150 | 156 | |
@@ -197,7 +203,8 @@ discard block |
||
197 | 203 | * |
198 | 204 | * @return Individual[] |
199 | 205 | */ |
200 | - public static function searchIndividualNames(array $query, array $trees) { |
|
206 | + public static function searchIndividualNames(array $query, array $trees) |
|
207 | + { |
|
201 | 208 | $sql = "SELECT DISTINCT i_id AS xref, i_file AS gedcom_id, i_gedcom AS gedcom, n_full FROM `##individuals` JOIN `##name` ON i_id=n_id AND i_file=n_file WHERE 1"; |
202 | 209 | $args = array(); |
203 | 210 | |
@@ -247,7 +254,8 @@ discard block |
||
247 | 254 | * |
248 | 255 | * @return Individual[] |
249 | 256 | */ |
250 | - public static function searchIndividualsPhonetic($soundex, $lastname, $firstname, $place, array $trees) { |
|
257 | + public static function searchIndividualsPhonetic($soundex, $lastname, $firstname, $place, array $trees) |
|
258 | + { |
|
251 | 259 | switch ($soundex) { |
252 | 260 | case 'Russell': |
253 | 261 | $givn_sdx = Soundex::russell($firstname); |
@@ -358,7 +366,8 @@ discard block |
||
358 | 366 | * |
359 | 367 | * @return Family[] |
360 | 368 | */ |
361 | - public static function searchFamilies(array $query, array $trees) { |
|
369 | + public static function searchFamilies(array $query, array $trees) |
|
370 | + { |
|
362 | 371 | // Convert the query into a regular expression |
363 | 372 | $queryregex = array(); |
364 | 373 | |
@@ -413,7 +422,8 @@ discard block |
||
413 | 422 | * |
414 | 423 | * @return Family[] |
415 | 424 | */ |
416 | - public static function searchFamilyNames(array $query, array $trees) { |
|
425 | + public static function searchFamilyNames(array $query, array $trees) |
|
426 | + { |
|
417 | 427 | // No query => no results |
418 | 428 | if (!$query) { |
419 | 429 | return array(); |
@@ -471,7 +481,8 @@ discard block |
||
471 | 481 | * |
472 | 482 | * @return Source[] |
473 | 483 | */ |
474 | - public static function searchSources($query, $trees) { |
|
484 | + public static function searchSources($query, $trees) |
|
485 | + { |
|
475 | 486 | // Convert the query into a regular expression |
476 | 487 | $queryregex = array(); |
477 | 488 | |
@@ -526,7 +537,8 @@ discard block |
||
526 | 537 | * |
527 | 538 | * @return Note[] |
528 | 539 | */ |
529 | - public static function searchNotes(array $query, array $trees) { |
|
540 | + public static function searchNotes(array $query, array $trees) |
|
541 | + { |
|
530 | 542 | // Convert the query into a regular expression |
531 | 543 | $queryregex = array(); |
532 | 544 | |
@@ -581,7 +593,8 @@ discard block |
||
581 | 593 | * |
582 | 594 | * @return Repository[] |
583 | 595 | */ |
584 | - public static function searchRepositories(array $query, array $trees) { |
|
596 | + public static function searchRepositories(array $query, array $trees) |
|
597 | + { |
|
585 | 598 | // Convert the query into a regular expression |
586 | 599 | $queryregex = array(); |
587 | 600 | |
@@ -635,7 +648,8 @@ discard block |
||
635 | 648 | * |
636 | 649 | * @return string |
637 | 650 | */ |
638 | - public static function findRin($rin) { |
|
651 | + public static function findRin($rin) |
|
652 | + { |
|
639 | 653 | global $WT_TREE; |
640 | 654 | |
641 | 655 | $xref = |
@@ -659,7 +673,8 @@ discard block |
||
659 | 673 | * |
660 | 674 | * @return int[] |
661 | 675 | */ |
662 | - public static function getCommonSurnames($min, Tree $tree) { |
|
676 | + public static function getCommonSurnames($min, Tree $tree) |
|
677 | + { |
|
663 | 678 | return self::getTopSurnames($tree->getTreeId(), $min, 0); |
664 | 679 | } |
665 | 680 | |
@@ -672,7 +687,8 @@ discard block |
||
672 | 687 | * |
673 | 688 | * @return int[] |
674 | 689 | */ |
675 | - public static function getTopSurnames($ged_id, $min, $max) { |
|
690 | + public static function getTopSurnames($ged_id, $min, $max) |
|
691 | + { |
|
676 | 692 | // Use n_surn, rather than n_surname, as it is used to generate URLs for |
677 | 693 | // the indi-list, etc. |
678 | 694 | $max = (int) $max; |
@@ -713,7 +729,8 @@ discard block |
||
713 | 729 | * |
714 | 730 | * @return Fact[] |
715 | 731 | */ |
716 | - public static function getAnniversaryEvents($jd, $facts, Tree $tree) { |
|
732 | + public static function getAnniversaryEvents($jd, $facts, Tree $tree) |
|
733 | + { |
|
717 | 734 | $found_facts = array(); |
718 | 735 | foreach (array( |
719 | 736 | new GregorianDate($jd), |
@@ -890,7 +907,8 @@ discard block |
||
890 | 907 | * |
891 | 908 | * @return Fact[] |
892 | 909 | */ |
893 | - public static function getCalendarEvents($jd1, $jd2, $facts, Tree $tree) { |
|
910 | + public static function getCalendarEvents($jd1, $jd2, $facts, Tree $tree) |
|
911 | + { |
|
894 | 912 | // If no facts specified, get all except these |
895 | 913 | $skipfacts = "CHAN,BAPL,SLGC,SLGS,ENDL,CENS,RESI,NOTE,ADDR,OBJE,SOUR,PAGE,DATA,TEXT"; |
896 | 914 | |
@@ -944,7 +962,8 @@ discard block |
||
944 | 962 | * |
945 | 963 | * @return Fact[] |
946 | 964 | */ |
947 | - public static function getEventsList($jd1, $jd2, $events, Tree $tree) { |
|
965 | + public static function getEventsList($jd1, $jd2, $events, Tree $tree) |
|
966 | + { |
|
948 | 967 | $found_facts = array(); |
949 | 968 | for ($jd = $jd1; $jd <= $jd2; ++$jd) { |
950 | 969 | $found_facts = array_merge($found_facts, self::getAnniversaryEvents($jd, $events, $tree)); |
@@ -961,7 +980,8 @@ discard block |
||
961 | 980 | * |
962 | 981 | * @return bool |
963 | 982 | */ |
964 | - public static function isMediaUsedInOtherTree($file_name, $ged_id) { |
|
983 | + public static function isMediaUsedInOtherTree($file_name, $ged_id) |
|
984 | + { |
|
965 | 985 | return |
966 | 986 | (bool) Database::prepare("SELECT COUNT(*) FROM `##media` WHERE m_filename LIKE ? AND m_file<>?") |
967 | 987 | ->execute(array("%{$file_name}", $ged_id)) |
@@ -975,7 +995,8 @@ discard block |
||
975 | 995 | * |
976 | 996 | * @return string[][] |
977 | 997 | */ |
978 | - public static function getUserBlocks($user_id) { |
|
998 | + public static function getUserBlocks($user_id) |
|
999 | + { |
|
979 | 1000 | global $WT_TREE; |
980 | 1001 | |
981 | 1002 | $blocks = array('main' => array(), 'side' => array()); |
@@ -1004,7 +1025,8 @@ discard block |
||
1004 | 1025 | * |
1005 | 1026 | * @return string[][] |
1006 | 1027 | */ |
1007 | - public static function getTreeBlocks($gedcom_id) { |
|
1028 | + public static function getTreeBlocks($gedcom_id) |
|
1029 | + { |
|
1008 | 1030 | if ($gedcom_id < 0) { |
1009 | 1031 | $access_level = Auth::PRIV_NONE; |
1010 | 1032 | } else { |
@@ -1041,7 +1063,8 @@ discard block |
||
1041 | 1063 | * |
1042 | 1064 | * @return int |
1043 | 1065 | */ |
1044 | - public static function updateFavorites($xref_from, $xref_to, Tree $tree) { |
|
1066 | + public static function updateFavorites($xref_from, $xref_to, Tree $tree) |
|
1067 | + { |
|
1045 | 1068 | return |
1046 | 1069 | Database::prepare("UPDATE `##favorite` SET xref=? WHERE xref=? AND gedcom_id=?") |
1047 | 1070 | ->execute(array($xref_to, $xref_from, $tree->getTreeId())) |
@@ -30,7 +30,8 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * Class FunctionsExport - common functions |
32 | 32 | */ |
33 | -class FunctionsExport { |
|
33 | +class FunctionsExport |
|
34 | +{ |
|
34 | 35 | /** |
35 | 36 | * Tidy up a gedcom record on export, for compatibility/portability. |
36 | 37 | * |
@@ -38,7 +39,8 @@ discard block |
||
38 | 39 | * |
39 | 40 | * @return string |
40 | 41 | */ |
41 | - public static function reformatRecord($rec) { |
|
42 | + public static function reformatRecord($rec) |
|
43 | + { |
|
42 | 44 | global $WT_TREE; |
43 | 45 | |
44 | 46 | $newrec = ''; |
@@ -93,7 +95,8 @@ discard block |
||
93 | 95 | * |
94 | 96 | * @return string |
95 | 97 | */ |
96 | - public static function gedcomHeader(Tree $tree) { |
|
98 | + public static function gedcomHeader(Tree $tree) |
|
99 | + { |
|
97 | 100 | // Default values for a new header |
98 | 101 | $HEAD = "0 HEAD"; |
99 | 102 | $SOUR = "\n1 SOUR " . WT_WEBTREES . "\n2 NAME " . WT_WEBTREES . "\n2 VERS " . WT_VERSION; |
@@ -148,7 +151,8 @@ discard block |
||
148 | 151 | * |
149 | 152 | * @return string |
150 | 153 | */ |
151 | - public static function convertMediaPath($rec, $path) { |
|
154 | + public static function convertMediaPath($rec, $path) |
|
155 | + { |
|
152 | 156 | if ($path && preg_match('/\n1 FILE (.+)/', $rec, $match)) { |
153 | 157 | $old_file_name = $match[1]; |
154 | 158 | // Don’t modify external links |
@@ -181,7 +185,8 @@ discard block |
||
181 | 185 | * 'path': what constant should prefix all media file paths? (eg: media/ or c:\my pictures\my family |
182 | 186 | * 'slashes': what folder separators apply to media file paths? (forward, backward) |
183 | 187 | */ |
184 | - public static function exportGedcom(Tree $tree, $gedout, $exportOptions) { |
|
188 | + public static function exportGedcom(Tree $tree, $gedout, $exportOptions) |
|
189 | + { |
|
185 | 190 | switch ($exportOptions['privatize']) { |
186 | 191 | case 'gedadmin': |
187 | 192 | $access_level = Auth::PRIV_NONE; |