@@ -25,7 +25,8 @@ |
||
25 | 25 | /** |
26 | 26 | * Specification for a theme. |
27 | 27 | */ |
28 | -interface ThemeInterface { |
|
28 | +interface ThemeInterface |
|
29 | +{ |
|
29 | 30 | /** |
30 | 31 | * Where are our CSS, JS and other assets? |
31 | 32 | * |
@@ -20,13 +20,15 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * The Minimal theme. |
22 | 22 | */ |
23 | -class MinimalTheme extends AbstractTheme implements ThemeInterface { |
|
23 | +class MinimalTheme extends AbstractTheme implements ThemeInterface |
|
24 | +{ |
|
24 | 25 | /** |
25 | 26 | * Where are our CSS, JS and other assets? |
26 | 27 | * |
27 | 28 | * @return string A relative path, such as "themes/foo/" |
28 | 29 | */ |
29 | - public function assetUrl() { |
|
30 | + public function assetUrl() |
|
31 | + { |
|
30 | 32 | return 'themes/minimal/css-1.7.8/'; |
31 | 33 | } |
32 | 34 | |
@@ -37,7 +39,8 @@ discard block |
||
37 | 39 | * |
38 | 40 | * @return string |
39 | 41 | */ |
40 | - protected function flashMessageContainer(\stdClass $message) { |
|
42 | + protected function flashMessageContainer(\stdClass $message) |
|
43 | + { |
|
41 | 44 | // This theme uses jQueryUI markup. |
42 | 45 | switch ($message->status) { |
43 | 46 | case 'danger': |
@@ -52,7 +55,8 @@ discard block |
||
52 | 55 | * |
53 | 56 | * @return string |
54 | 57 | */ |
55 | - protected function formQuickSearchFields() { |
|
58 | + protected function formQuickSearchFields() |
|
59 | + { |
|
56 | 60 | return |
57 | 61 | '<input type="search" name="query" size="20" placeholder="' . I18N::translate('Search') . '">'; |
58 | 62 | } |
@@ -62,7 +66,8 @@ discard block |
||
62 | 66 | * |
63 | 67 | * @return string |
64 | 68 | */ |
65 | - protected function formatSecondaryMenu() { |
|
69 | + protected function formatSecondaryMenu() |
|
70 | + { |
|
66 | 71 | return |
67 | 72 | '<ul class="secondary-menu">' . |
68 | 73 | implode('', $this->secondaryMenu()) . |
@@ -77,7 +82,8 @@ discard block |
||
77 | 82 | * |
78 | 83 | * @return string |
79 | 84 | */ |
80 | - protected function headerContent() { |
|
85 | + protected function headerContent() |
|
86 | + { |
|
81 | 87 | return |
82 | 88 | //$this->accessibilityLinks() . |
83 | 89 | $this->formatTreeTitle() . |
@@ -89,7 +95,8 @@ discard block |
||
89 | 95 | * |
90 | 96 | * @return string |
91 | 97 | */ |
92 | - protected function logoPoweredBy() { |
|
98 | + protected function logoPoweredBy() |
|
99 | + { |
|
93 | 100 | return '<a href="' . WT_WEBTREES_URL . '" class="powered-by-webtrees" title="' . WT_WEBTREES_URL . '">' . WT_WEBTREES . '</a>'; |
94 | 101 | } |
95 | 102 | |
@@ -98,7 +105,8 @@ discard block |
||
98 | 105 | * |
99 | 106 | * @return string |
100 | 107 | */ |
101 | - public function hookFooterExtraJavascript() { |
|
108 | + public function hookFooterExtraJavascript() |
|
109 | + { |
|
102 | 110 | return |
103 | 111 | '<script src="' . WT_JQUERY_COLORBOX_URL . '"></script>' . |
104 | 112 | '<script src="' . WT_JQUERY_WHEELZOOM_URL . '"></script>' . |
@@ -122,7 +130,8 @@ discard block |
||
122 | 130 | * |
123 | 131 | * @return string|int|float |
124 | 132 | */ |
125 | - public function parameter($parameter_name) { |
|
133 | + public function parameter($parameter_name) |
|
134 | + { |
|
126 | 135 | $parameters = array( |
127 | 136 | 'chart-background-f' => 'dddddd', |
128 | 137 | 'chart-background-m' => 'cccccc', |
@@ -142,7 +151,8 @@ discard block |
||
142 | 151 | * |
143 | 152 | * @return string[] |
144 | 153 | */ |
145 | - protected function stylesheets() { |
|
154 | + protected function stylesheets() |
|
155 | + { |
|
146 | 156 | return array( |
147 | 157 | 'themes/minimal/jquery-ui-1.11.2/jquery-ui.css', |
148 | 158 | $this->assetUrl() . 'style.css', |
@@ -154,7 +164,8 @@ discard block |
||
154 | 164 | * |
155 | 165 | * @return string |
156 | 166 | */ |
157 | - public function themeId() { |
|
167 | + public function themeId() |
|
168 | + { |
|
158 | 169 | return 'minimal'; |
159 | 170 | } |
160 | 171 | |
@@ -163,7 +174,8 @@ discard block |
||
163 | 174 | * |
164 | 175 | * @return string |
165 | 176 | */ |
166 | - public function themeName() { |
|
177 | + public function themeName() |
|
178 | + { |
|
167 | 179 | return /* I18N: Name of a theme. */ I18N::translate('minimal'); |
168 | 180 | } |
169 | 181 | } |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * A GEDCOM media (OBJE) object. |
24 | 24 | */ |
25 | -class Media extends GedcomRecord { |
|
25 | +class Media extends GedcomRecord |
|
26 | +{ |
|
26 | 27 | const RECORD_TYPE = 'OBJE'; |
27 | 28 | const URL_PREFIX = 'mediaviewer.php?mid='; |
28 | 29 | |
@@ -41,7 +42,8 @@ discard block |
||
41 | 42 | * empty string for records with pending deletions |
42 | 43 | * @param Tree $tree |
43 | 44 | */ |
44 | - public function __construct($xref, $gedcom, $pending, $tree) { |
|
45 | + public function __construct($xref, $gedcom, $pending, $tree) |
|
46 | + { |
|
45 | 47 | parent::__construct($xref, $gedcom, $pending, $tree); |
46 | 48 | |
47 | 49 | if (preg_match('/\n1 FILE (.+)/', $gedcom . $pending, $match)) { |
@@ -59,7 +61,8 @@ discard block |
||
59 | 61 | * |
60 | 62 | * @return bool |
61 | 63 | */ |
62 | - protected function canShowByType($access_level) { |
|
64 | + protected function canShowByType($access_level) |
|
65 | + { |
|
63 | 66 | // Hide media objects if they are attached to private records |
64 | 67 | $linked_ids = Database::prepare( |
65 | 68 | "SELECT l_from FROM `##link` WHERE l_to = ? AND l_file = ?" |
@@ -85,7 +88,8 @@ discard block |
||
85 | 88 | * |
86 | 89 | * @return null|string |
87 | 90 | */ |
88 | - protected static function fetchGedcomRecord($xref, $tree_id) { |
|
91 | + protected static function fetchGedcomRecord($xref, $tree_id) |
|
92 | + { |
|
89 | 93 | return Database::prepare( |
90 | 94 | "SELECT m_gedcom FROM `##media` WHERE m_id = :xref AND m_file = :tree_id" |
91 | 95 | )->execute(array( |
@@ -99,7 +103,8 @@ discard block |
||
99 | 103 | * |
100 | 104 | * @return null|string |
101 | 105 | */ |
102 | - public function getNote() { |
|
106 | + public function getNote() |
|
107 | + { |
|
103 | 108 | $note = $this->getFirstFact('NOTE'); |
104 | 109 | if ($note) { |
105 | 110 | $text = $note->getValue(); |
@@ -118,7 +123,8 @@ discard block |
||
118 | 123 | * |
119 | 124 | * @return string |
120 | 125 | */ |
121 | - public function getFilename() { |
|
126 | + public function getFilename() |
|
127 | + { |
|
122 | 128 | return $this->file; |
123 | 129 | } |
124 | 130 | |
@@ -127,7 +133,8 @@ discard block |
||
127 | 133 | * |
128 | 134 | * @return string |
129 | 135 | */ |
130 | - public function getTitle() { |
|
136 | + public function getTitle() |
|
137 | + { |
|
131 | 138 | return $this->title; |
132 | 139 | } |
133 | 140 | |
@@ -139,7 +146,8 @@ discard block |
||
139 | 146 | * |
140 | 147 | * @return string |
141 | 148 | */ |
142 | - public function getServerFilename($which = 'main') { |
|
149 | + public function getServerFilename($which = 'main') |
|
150 | + { |
|
143 | 151 | $MEDIA_DIRECTORY = $this->tree->getPreference('MEDIA_DIRECTORY'); |
144 | 152 | $THUMBNAIL_WIDTH = $this->tree->getPreference('THUMBNAIL_WIDTH'); |
145 | 153 | |
@@ -249,7 +257,8 @@ discard block |
||
249 | 257 | * |
250 | 258 | * @return bool |
251 | 259 | */ |
252 | - public function fileExists($which = 'main') { |
|
260 | + public function fileExists($which = 'main') |
|
261 | + { |
|
253 | 262 | return file_exists($this->getServerFilename($which)); |
254 | 263 | } |
255 | 264 | |
@@ -258,7 +267,8 @@ discard block |
||
258 | 267 | * |
259 | 268 | * @return bool |
260 | 269 | */ |
261 | - public function isExternal() { |
|
270 | + public function isExternal() |
|
271 | + { |
|
262 | 272 | return strpos($this->file, '://') !== false; |
263 | 273 | } |
264 | 274 | |
@@ -269,7 +279,8 @@ discard block |
||
269 | 279 | * |
270 | 280 | * @return string |
271 | 281 | */ |
272 | - public function getFilesize($which = 'main') { |
|
282 | + public function getFilesize($which = 'main') |
|
283 | + { |
|
273 | 284 | $size = $this->getFilesizeraw($which); |
274 | 285 | // Round up to the nearest KB. |
275 | 286 | $size = (int) (($size + 1023) / 1024); |
@@ -284,7 +295,8 @@ discard block |
||
284 | 295 | * |
285 | 296 | * @return int |
286 | 297 | */ |
287 | - public function getFilesizeraw($which = 'main') { |
|
298 | + public function getFilesizeraw($which = 'main') |
|
299 | + { |
|
288 | 300 | try { |
289 | 301 | return filesize($this->getServerFilename($which)); |
290 | 302 | } catch (\ErrorException $ex) { |
@@ -299,7 +311,8 @@ discard block |
||
299 | 311 | * |
300 | 312 | * @return int |
301 | 313 | */ |
302 | - public function getFiletime($which = 'main') { |
|
314 | + public function getFiletime($which = 'main') |
|
315 | + { |
|
303 | 316 | try { |
304 | 317 | return filemtime($this->getServerFilename($which)); |
305 | 318 | } catch (\ErrorException $ex) { |
@@ -314,7 +327,8 @@ discard block |
||
314 | 327 | * |
315 | 328 | * @return string |
316 | 329 | */ |
317 | - public function getEtag($which = 'main') { |
|
330 | + public function getEtag($which = 'main') |
|
331 | + { |
|
318 | 332 | if ($this->isExternal()) { |
319 | 333 | // etag not really defined for external media |
320 | 334 | |
@@ -331,7 +345,8 @@ discard block |
||
331 | 345 | * |
332 | 346 | * @return string |
333 | 347 | */ |
334 | - public function getMediaType() { |
|
348 | + public function getMediaType() |
|
349 | + { |
|
335 | 350 | if (preg_match('/\n\d TYPE (.+)/', $this->gedcom, $match)) { |
336 | 351 | return strtolower($match[1]); |
337 | 352 | } else { |
@@ -344,7 +359,8 @@ discard block |
||
344 | 359 | * |
345 | 360 | * @return string |
346 | 361 | */ |
347 | - public function isPrimary() { |
|
362 | + public function isPrimary() |
|
363 | + { |
|
348 | 364 | if (preg_match('/\n\d _PRIM ([YN])/', $this->getGedcom(), $match)) { |
349 | 365 | return $match[1]; |
350 | 366 | } else { |
@@ -361,7 +377,8 @@ discard block |
||
361 | 377 | * |
362 | 378 | * @return array |
363 | 379 | */ |
364 | - public function getImageAttributes($which = 'main', $addWidth = 0, $addHeight = 0) { |
|
380 | + public function getImageAttributes($which = 'main', $addWidth = 0, $addHeight = 0) |
|
381 | + { |
|
365 | 382 | $THUMBNAIL_WIDTH = $this->tree->getPreference('THUMBNAIL_WIDTH'); |
366 | 383 | |
367 | 384 | $var = $which . 'imagesize'; |
@@ -456,7 +473,8 @@ discard block |
||
456 | 473 | * |
457 | 474 | * @return string |
458 | 475 | */ |
459 | - public function getHtmlUrlDirect($which = 'main', $download = false) { |
|
476 | + public function getHtmlUrlDirect($which = 'main', $download = false) |
|
477 | + { |
|
460 | 478 | // “cb” is “cache buster”, so clients will make new request if anything significant about the user or the file changes |
461 | 479 | // The extension is there so that image viewers (e.g. colorbox) can do something sensible |
462 | 480 | $thumbstr = ($which == 'thumb') ? '&thumb=1' : ''; |
@@ -473,7 +491,8 @@ discard block |
||
473 | 491 | * |
474 | 492 | * @return string |
475 | 493 | */ |
476 | - public function extension() { |
|
494 | + public function extension() |
|
495 | + { |
|
477 | 496 | if (preg_match('/\.([a-zA-Z0-9]+)$/', $this->file, $match)) { |
478 | 497 | return strtolower($match[1]); |
479 | 498 | } else { |
@@ -487,7 +506,8 @@ discard block |
||
487 | 506 | * |
488 | 507 | * @return string |
489 | 508 | */ |
490 | - public function mimeType() { |
|
509 | + public function mimeType() |
|
510 | + { |
|
491 | 511 | // Themes contain icon definitions for some/all of these mime-types |
492 | 512 | switch ($this->extension()) { |
493 | 513 | case 'bmp': |
@@ -546,7 +566,8 @@ discard block |
||
546 | 566 | * |
547 | 567 | * @return string |
548 | 568 | */ |
549 | - public function displayImage() { |
|
569 | + public function displayImage() |
|
570 | + { |
|
550 | 571 | // Default image for external, missing or corrupt images. |
551 | 572 | $image = |
552 | 573 | '<i' . |
@@ -588,7 +609,8 @@ discard block |
||
588 | 609 | * |
589 | 610 | * @return string |
590 | 611 | */ |
591 | - public function getFallBackName() { |
|
612 | + public function getFallBackName() |
|
613 | + { |
|
592 | 614 | if ($this->canShow()) { |
593 | 615 | return basename($this->file); |
594 | 616 | } else { |
@@ -599,7 +621,8 @@ discard block |
||
599 | 621 | /** |
600 | 622 | * Extract names from the GEDCOM record. |
601 | 623 | */ |
602 | - public function extractNames() { |
|
624 | + public function extractNames() |
|
625 | + { |
|
603 | 626 | // Earlier gedcom versions had level 1 titles |
604 | 627 | // Later gedcom versions had level 2 titles |
605 | 628 | $this->extractNamesFromFacts(2, 'TITL', $this->getFacts('FILE')); |
@@ -612,7 +635,8 @@ discard block |
||
612 | 635 | * |
613 | 636 | * @return string |
614 | 637 | */ |
615 | - public function formatListDetails() { |
|
638 | + public function formatListDetails() |
|
639 | + { |
|
616 | 640 | ob_start(); |
617 | 641 | FunctionsPrintFacts::printMediaLinks('1 OBJE @' . $this->getXref() . '@', 1); |
618 | 642 |
@@ -19,7 +19,8 @@ discard block |
||
19 | 19 | * Application configuration data. Data here has no GUI to edit it, |
20 | 20 | * although most of it can be altered to customise local installations. |
21 | 21 | */ |
22 | -class Config { |
|
22 | +class Config |
|
23 | +{ |
|
23 | 24 | /** Font used to watermark images */ |
24 | 25 | const FONT_DEJAVU_SANS_TTF = 'packages/dejavu-fonts-ttf-2.35/ttf/DejaVuSans.ttf'; |
25 | 26 | |
@@ -28,7 +29,8 @@ discard block |
||
28 | 29 | * |
29 | 30 | * @return string[] |
30 | 31 | */ |
31 | - public static function namePrefixes() { |
|
32 | + public static function namePrefixes() |
|
33 | + { |
|
32 | 34 | return array( |
33 | 35 | 'Adm', 'Amb', 'Brig', 'Can', 'Capt', 'Chan', 'Chapln', 'Cmdr', 'Col', 'Cpl', |
34 | 36 | 'Cpt', 'Dr', 'Gen', 'Gov', 'Hon', 'Lady', 'Lt', 'Mr', 'Mrs', 'Ms', 'Msgr', |
@@ -42,7 +44,8 @@ discard block |
||
42 | 44 | * |
43 | 45 | * @return string[] |
44 | 46 | */ |
45 | - public static function fileFormats() { |
|
47 | + public static function fileFormats() |
|
48 | + { |
|
46 | 49 | return array( |
47 | 50 | 'avi', 'bmp', 'gif', 'jpeg', 'mp3', 'ole', 'pcx', 'png', 'tiff', 'wav', |
48 | 51 | ); |
@@ -53,7 +56,8 @@ discard block |
||
53 | 56 | * |
54 | 57 | * return string[] |
55 | 58 | */ |
56 | - public static function emptyFacts() { |
|
59 | + public static function emptyFacts() |
|
60 | + { |
|
57 | 61 | return array( |
58 | 62 | 'ADOP', 'ANUL', 'BAPL', 'BAPM', 'BARM', 'BASM', 'BIRT', 'BLES', 'BURI', |
59 | 63 | 'CENS', 'CHAN', 'CHR', 'CHRA', 'CONF', 'CONL', 'CREM', 'DATA', 'DEAT', |
@@ -69,7 +73,8 @@ discard block |
||
69 | 73 | * |
70 | 74 | * @return string[] |
71 | 75 | */ |
72 | - public static function nonPlaceFacts() { |
|
76 | + public static function nonPlaceFacts() |
|
77 | + { |
|
73 | 78 | return array( |
74 | 79 | 'ENDL', 'NCHI', 'REFN', 'SLGC', 'SLGS', |
75 | 80 | ); |
@@ -80,7 +85,8 @@ discard block |
||
80 | 85 | * |
81 | 86 | * @return string[] |
82 | 87 | */ |
83 | - public static function nonDateFacts() { |
|
88 | + public static function nonDateFacts() |
|
89 | + { |
|
84 | 90 | return array( |
85 | 91 | 'ABBR', 'ADDR', 'AFN', 'ALIA', 'AUTH', 'CHIL', 'EMAIL', 'FAX', 'FILE', |
86 | 92 | 'HUSB', 'NAME', 'NCHI', 'NOTE', 'OBJE', 'PHON', 'PUBL', 'REFN', 'REPO', |
@@ -93,7 +99,8 @@ discard block |
||
93 | 99 | * |
94 | 100 | * @return string[] |
95 | 101 | */ |
96 | - public static function dateAndTime() { |
|
102 | + public static function dateAndTime() |
|
103 | + { |
|
97 | 104 | return array( |
98 | 105 | 'BIRT', 'DEAT', |
99 | 106 | ); |
@@ -105,7 +112,8 @@ discard block |
||
105 | 112 | * |
106 | 113 | * @return string[][] |
107 | 114 | */ |
108 | - public static function levelTwoTags() { |
|
115 | + public static function levelTwoTags() |
|
116 | + { |
|
109 | 117 | return array( |
110 | 118 | '_HEB' => array( |
111 | 119 | 'NAME', 'TITL', |
@@ -203,7 +211,8 @@ discard block |
||
203 | 211 | * |
204 | 212 | * @return string[] |
205 | 213 | */ |
206 | - public static function standardNameFacts() { |
|
214 | + public static function standardNameFacts() |
|
215 | + { |
|
207 | 216 | return array( |
208 | 217 | 'NAME', 'NPFX', 'GIVN', 'SPFX', 'SURN', 'NSFX', |
209 | 218 | ); |
@@ -215,7 +224,8 @@ discard block |
||
215 | 224 | * |
216 | 225 | * @return string[] |
217 | 226 | */ |
218 | - public static function twoAssociates() { |
|
227 | + public static function twoAssociates() |
|
228 | + { |
|
219 | 229 | return array( |
220 | 230 | 'CHR', 'BAPM', 'MARR', |
221 | 231 | ); |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * File manipulation utilities. |
20 | 20 | */ |
21 | -class File { |
|
21 | +class File |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * Fetch a remote file |
24 | 25 | * Note that fopen() and file_get_contents() are often unvailable, as they |
@@ -32,7 +33,8 @@ discard block |
||
32 | 33 | * |
33 | 34 | * @return null|string |
34 | 35 | */ |
35 | - public static function fetchUrl($url, $stream = null) { |
|
36 | + public static function fetchUrl($url, $stream = null) |
|
37 | + { |
|
36 | 38 | $host = parse_url($url, PHP_URL_HOST); |
37 | 39 | $port = parse_url($url, PHP_URL_PORT); |
38 | 40 | $path = parse_url($url, PHP_URL_PATH); |
@@ -90,7 +92,8 @@ discard block |
||
90 | 92 | * |
91 | 93 | * @return bool Was the file deleted |
92 | 94 | */ |
93 | - public static function delete($path) { |
|
95 | + public static function delete($path) |
|
96 | + { |
|
94 | 97 | if (is_dir($path)) { |
95 | 98 | $dir = opendir($path); |
96 | 99 | while ($dir !== false && (($file = readdir($dir)) !== false)) { |
@@ -122,7 +125,8 @@ discard block |
||
122 | 125 | * |
123 | 126 | * @return bool Does the folder now exist |
124 | 127 | */ |
125 | - public static function mkdir($path) { |
|
128 | + public static function mkdir($path) |
|
129 | + { |
|
126 | 130 | if (is_dir($path)) { |
127 | 131 | return true; |
128 | 132 | } else { |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * A GEDCOM source (SOUR) object. |
20 | 20 | */ |
21 | -class Source extends GedcomRecord { |
|
21 | +class Source extends GedcomRecord |
|
22 | +{ |
|
22 | 23 | const RECORD_TYPE = 'SOUR'; |
23 | 24 | const URL_PREFIX = 'source.php?sid='; |
24 | 25 | |
@@ -29,7 +30,8 @@ discard block |
||
29 | 30 | * |
30 | 31 | * @return bool |
31 | 32 | */ |
32 | - protected function canShowByType($access_level) { |
|
33 | + protected function canShowByType($access_level) |
|
34 | + { |
|
33 | 35 | // Hide sources if they are attached to private repositories ... |
34 | 36 | preg_match_all('/\n1 REPO @(.+)@/', $this->gedcom, $matches); |
35 | 37 | foreach ($matches[1] as $match) { |
@@ -50,7 +52,8 @@ discard block |
||
50 | 52 | * |
51 | 53 | * @return string |
52 | 54 | */ |
53 | - protected function createPrivateGedcomRecord($access_level) { |
|
55 | + protected function createPrivateGedcomRecord($access_level) |
|
56 | + { |
|
54 | 57 | return '0 @' . $this->xref . "@ SOUR\n1 TITL " . I18N::translate('Private'); |
55 | 58 | } |
56 | 59 | |
@@ -62,7 +65,8 @@ discard block |
||
62 | 65 | * |
63 | 66 | * @return null|string |
64 | 67 | */ |
65 | - protected static function fetchGedcomRecord($xref, $tree_id) { |
|
68 | + protected static function fetchGedcomRecord($xref, $tree_id) |
|
69 | + { |
|
66 | 70 | return Database::prepare( |
67 | 71 | "SELECT s_gedcom FROM `##sources` WHERE s_id = :xref AND s_file = :tree_id" |
68 | 72 | )->execute(array( |
@@ -74,7 +78,8 @@ discard block |
||
74 | 78 | /** |
75 | 79 | * Extract names from the GEDCOM record. |
76 | 80 | */ |
77 | - public function extractNames() { |
|
81 | + public function extractNames() |
|
82 | + { |
|
78 | 83 | parent::extractNamesFromFacts(1, 'TITL', $this->getFacts('TITL')); |
79 | 84 | } |
80 | 85 | } |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * A GEDCOM place (PLAC) object. |
20 | 20 | */ |
21 | -class Place { |
|
21 | +class Place |
|
22 | +{ |
|
22 | 23 | const GEDCOM_SEPARATOR = ', '; |
23 | 24 | |
24 | 25 | /** @var string[] e.g. array('Westminster', 'London', 'England') */ |
@@ -33,7 +34,8 @@ discard block |
||
33 | 34 | * @param string $gedcom_place |
34 | 35 | * @param Tree $tree |
35 | 36 | */ |
36 | - public function __construct($gedcom_place, Tree $tree) { |
|
37 | + public function __construct($gedcom_place, Tree $tree) |
|
38 | + { |
|
37 | 39 | if ($gedcom_place) { |
38 | 40 | $this->gedcom_place = explode(self::GEDCOM_SEPARATOR, $gedcom_place); |
39 | 41 | } else { |
@@ -48,7 +50,8 @@ discard block |
||
48 | 50 | * |
49 | 51 | * @return int |
50 | 52 | */ |
51 | - public function getPlaceId() { |
|
53 | + public function getPlaceId() |
|
54 | + { |
|
52 | 55 | $place_id = 0; |
53 | 56 | foreach (array_reverse($this->gedcom_place) as $place) { |
54 | 57 | $place_id = Database::prepare( |
@@ -68,7 +71,8 @@ discard block |
||
68 | 71 | * |
69 | 72 | * @return Place |
70 | 73 | */ |
71 | - public function getParentPlace() { |
|
74 | + public function getParentPlace() |
|
75 | + { |
|
72 | 76 | return new self(implode(self::GEDCOM_SEPARATOR, array_slice($this->gedcom_place, 1)), $this->tree); |
73 | 77 | } |
74 | 78 | |
@@ -77,7 +81,8 @@ discard block |
||
77 | 81 | * |
78 | 82 | * @return Place[] |
79 | 83 | */ |
80 | - public function getChildPlaces() { |
|
84 | + public function getChildPlaces() |
|
85 | + { |
|
81 | 86 | $children = array(); |
82 | 87 | if ($this->getPlaceId()) { |
83 | 88 | $parent_text = self::GEDCOM_SEPARATOR . $this->getGedcomName(); |
@@ -106,7 +111,8 @@ discard block |
||
106 | 111 | * |
107 | 112 | * @return string |
108 | 113 | */ |
109 | - public function getURL() { |
|
114 | + public function getURL() |
|
115 | + { |
|
110 | 116 | if (Auth::isSearchEngine()) { |
111 | 117 | return '#'; |
112 | 118 | } else { |
@@ -126,7 +132,8 @@ discard block |
||
126 | 132 | * |
127 | 133 | * @return string |
128 | 134 | */ |
129 | - public function getGedcomName() { |
|
135 | + public function getGedcomName() |
|
136 | + { |
|
130 | 137 | return implode(self::GEDCOM_SEPARATOR, $this->gedcom_place); |
131 | 138 | } |
132 | 139 | |
@@ -135,7 +142,8 @@ discard block |
||
135 | 142 | * |
136 | 143 | * @return string |
137 | 144 | */ |
138 | - public function getPlaceName() { |
|
145 | + public function getPlaceName() |
|
146 | + { |
|
139 | 147 | $place = reset($this->gedcom_place); |
140 | 148 | |
141 | 149 | return $place ? '<span dir="auto">' . Filter::escapeHtml($place) . '</span>' : I18N::translate('unknown'); |
@@ -146,7 +154,8 @@ discard block |
||
146 | 154 | * |
147 | 155 | * @return bool |
148 | 156 | */ |
149 | - public function isEmpty() { |
|
157 | + public function isEmpty() |
|
158 | + { |
|
150 | 159 | return empty($this->gedcom_place); |
151 | 160 | } |
152 | 161 | |
@@ -155,7 +164,8 @@ discard block |
||
155 | 164 | * |
156 | 165 | * @return string |
157 | 166 | */ |
158 | - public function getFullName() { |
|
167 | + public function getFullName() |
|
168 | + { |
|
159 | 169 | if (true) { |
160 | 170 | // If a place hierarchy is a single entity |
161 | 171 | return '<span dir="auto">' . Filter::escapeHtml(implode(I18N::$list_separator, $this->gedcom_place)) . '</span>'; |
@@ -175,7 +185,8 @@ discard block |
||
175 | 185 | * |
176 | 186 | * @return string |
177 | 187 | */ |
178 | - public function getShortName() { |
|
188 | + public function getShortName() |
|
189 | + { |
|
179 | 190 | $SHOW_PEDIGREE_PLACES = $this->tree->getPreference('SHOW_PEDIGREE_PLACES'); |
180 | 191 | |
181 | 192 | if ($SHOW_PEDIGREE_PLACES >= count($this->gedcom_place)) { |
@@ -200,7 +211,8 @@ discard block |
||
200 | 211 | * |
201 | 212 | * @return string |
202 | 213 | */ |
203 | - public function getReverseName() { |
|
214 | + public function getReverseName() |
|
215 | + { |
|
204 | 216 | $tmp = array(); |
205 | 217 | foreach (array_reverse($this->gedcom_place) as $place) { |
206 | 218 | $tmp[] = '<span dir="auto">' . Filter::escapeHtml($place) . '</span>'; |
@@ -216,7 +228,8 @@ discard block |
||
216 | 228 | * |
217 | 229 | * @return string[] |
218 | 230 | */ |
219 | - public static function allPlaces(Tree $tree) { |
|
231 | + public static function allPlaces(Tree $tree) |
|
232 | + { |
|
220 | 233 | $places = array(); |
221 | 234 | $rows = |
222 | 235 | Database::prepare( |
@@ -252,7 +265,8 @@ discard block |
||
252 | 265 | * |
253 | 266 | * @return Place[] |
254 | 267 | */ |
255 | - public static function findPlaces($filter, Tree $tree) { |
|
268 | + public static function findPlaces($filter, Tree $tree) |
|
269 | + { |
|
256 | 270 | $places = array(); |
257 | 271 | $rows = |
258 | 272 | Database::prepare( |
@@ -20,7 +20,8 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * A GEDCOM fact or event object. |
22 | 22 | */ |
23 | -class Fact { |
|
23 | +class Fact |
|
24 | +{ |
|
24 | 25 | /** @var string Unique identifier for this fact (currently implemented as a hash of the raw data). */ |
25 | 26 | private $fact_id; |
26 | 27 | |
@@ -59,7 +60,8 @@ discard block |
||
59 | 60 | * |
60 | 61 | * @throws \InvalidArgumentException |
61 | 62 | */ |
62 | - public function __construct($gedcom, GedcomRecord $parent, $fact_id) { |
|
63 | + public function __construct($gedcom, GedcomRecord $parent, $fact_id) |
|
64 | + { |
|
63 | 65 | if (preg_match('/^1 (' . WT_REGEX_TAG . ')/', $gedcom, $match)) { |
64 | 66 | $this->gedcom = $gedcom; |
65 | 67 | $this->parent = $parent; |
@@ -76,7 +78,8 @@ discard block |
||
76 | 78 | * |
77 | 79 | * @return string|null |
78 | 80 | */ |
79 | - public function getValue() { |
|
81 | + public function getValue() |
|
82 | + { |
|
80 | 83 | if (preg_match('/^1 (?:' . $this->tag . ') ?(.*(?:(?:\n2 CONT ?.*)*))/', $this->gedcom, $match)) { |
81 | 84 | return preg_replace("/\n2 CONT ?/", "\n", $match[1]); |
82 | 85 | } else { |
@@ -89,7 +92,8 @@ discard block |
||
89 | 92 | * |
90 | 93 | * @return Individual|Family|Source|Repository|Media|Note|null |
91 | 94 | */ |
92 | - public function getTarget() { |
|
95 | + public function getTarget() |
|
96 | + { |
|
93 | 97 | $xref = trim($this->getValue(), '@'); |
94 | 98 | switch ($this->tag) { |
95 | 99 | case 'FAMC': |
@@ -119,7 +123,8 @@ discard block |
||
119 | 123 | * |
120 | 124 | * @return string|null |
121 | 125 | */ |
122 | - public function getAttribute($tag) { |
|
126 | + public function getAttribute($tag) |
|
127 | + { |
|
123 | 128 | if (preg_match('/\n2 (?:' . $tag . ') ?(.*(?:(?:\n3 CONT ?.*)*)*)/', $this->gedcom, $match)) { |
124 | 129 | return preg_replace("/\n3 CONT ?/", "\n", $match[1]); |
125 | 130 | } else { |
@@ -134,7 +139,8 @@ discard block |
||
134 | 139 | * |
135 | 140 | * @return bool |
136 | 141 | */ |
137 | - public function canShow($access_level = null) { |
|
142 | + public function canShow($access_level = null) |
|
143 | + { |
|
138 | 144 | if ($access_level === null) { |
139 | 145 | $access_level = Auth::accessLevel($this->getParent()->getTree()); |
140 | 146 | } |
@@ -170,7 +176,8 @@ discard block |
||
170 | 176 | * |
171 | 177 | * @return bool |
172 | 178 | */ |
173 | - public function canEdit() { |
|
179 | + public function canEdit() |
|
180 | + { |
|
174 | 181 | // Managers can edit anything |
175 | 182 | // Members cannot edit RESN, CHAN and locked records |
176 | 183 | return |
@@ -185,7 +192,8 @@ discard block |
||
185 | 192 | * |
186 | 193 | * @return Place |
187 | 194 | */ |
188 | - public function getPlace() { |
|
195 | + public function getPlace() |
|
196 | + { |
|
189 | 197 | if ($this->place === null) { |
190 | 198 | $this->place = new Place($this->getAttribute('PLAC'), $this->getParent()->getTree()); |
191 | 199 | } |
@@ -200,7 +208,8 @@ discard block |
||
200 | 208 | * |
201 | 209 | * @return Date |
202 | 210 | */ |
203 | - public function getDate() { |
|
211 | + public function getDate() |
|
212 | + { |
|
204 | 213 | if ($this->date === null) { |
205 | 214 | $this->date = new Date($this->getAttribute('DATE')); |
206 | 215 | } |
@@ -213,7 +222,8 @@ discard block |
||
213 | 222 | * |
214 | 223 | * @return string |
215 | 224 | */ |
216 | - public function getGedcom() { |
|
225 | + public function getGedcom() |
|
226 | + { |
|
217 | 227 | return $this->gedcom; |
218 | 228 | } |
219 | 229 | |
@@ -222,7 +232,8 @@ discard block |
||
222 | 232 | * |
223 | 233 | * @return string |
224 | 234 | */ |
225 | - public function getFactId() { |
|
235 | + public function getFactId() |
|
236 | + { |
|
226 | 237 | return $this->fact_id; |
227 | 238 | } |
228 | 239 | |
@@ -232,7 +243,8 @@ discard block |
||
232 | 243 | * |
233 | 244 | * @return string |
234 | 245 | */ |
235 | - public function getTag() { |
|
246 | + public function getTag() |
|
247 | + { |
|
236 | 248 | return $this->tag; |
237 | 249 | } |
238 | 250 | |
@@ -241,7 +253,8 @@ discard block |
||
241 | 253 | * |
242 | 254 | * @param string $tag |
243 | 255 | */ |
244 | - public function setTag($tag) { |
|
256 | + public function setTag($tag) |
|
257 | + { |
|
245 | 258 | $this->tag = $tag; |
246 | 259 | } |
247 | 260 | |
@@ -251,7 +264,8 @@ discard block |
||
251 | 264 | * |
252 | 265 | * @return Individual|Family|Source|Repository|Media|Note|GedcomRecord |
253 | 266 | */ |
254 | - public function getParent() { |
|
267 | + public function getParent() |
|
268 | + { |
|
255 | 269 | return $this->parent; |
256 | 270 | } |
257 | 271 | |
@@ -260,7 +274,8 @@ discard block |
||
260 | 274 | * |
261 | 275 | * @return string |
262 | 276 | */ |
263 | - public function getLabel() { |
|
277 | + public function getLabel() |
|
278 | + { |
|
264 | 279 | switch ($this->tag) { |
265 | 280 | case 'EVEN': |
266 | 281 | case 'FACT': |
@@ -277,7 +292,8 @@ discard block |
||
277 | 292 | /** |
278 | 293 | * This is a newly deleted fact, pending approval. |
279 | 294 | */ |
280 | - public function setPendingDeletion() { |
|
295 | + public function setPendingDeletion() |
|
296 | + { |
|
281 | 297 | $this->pending_deletion = true; |
282 | 298 | $this->pending_addition = false; |
283 | 299 | } |
@@ -287,14 +303,16 @@ discard block |
||
287 | 303 | * |
288 | 304 | * @return bool |
289 | 305 | */ |
290 | - public function isPendingDeletion() { |
|
306 | + public function isPendingDeletion() |
|
307 | + { |
|
291 | 308 | return $this->pending_deletion; |
292 | 309 | } |
293 | 310 | |
294 | 311 | /** |
295 | 312 | * This is a newly added fact, pending approval. |
296 | 313 | */ |
297 | - public function setPendingAddition() { |
|
314 | + public function setPendingAddition() |
|
315 | + { |
|
298 | 316 | $this->pending_addition = true; |
299 | 317 | $this->pending_deletion = false; |
300 | 318 | } |
@@ -304,7 +322,8 @@ discard block |
||
304 | 322 | * |
305 | 323 | * @return bool |
306 | 324 | */ |
307 | - public function isPendingAddition() { |
|
325 | + public function isPendingAddition() |
|
326 | + { |
|
308 | 327 | return $this->pending_addition; |
309 | 328 | } |
310 | 329 | |
@@ -313,7 +332,8 @@ discard block |
||
313 | 332 | * |
314 | 333 | * @return string[] |
315 | 334 | */ |
316 | - public function getCitations() { |
|
335 | + public function getCitations() |
|
336 | + { |
|
317 | 337 | preg_match_all('/\n(2 SOUR @(' . WT_REGEX_XREF . ')@(?:\n[3-9] .*)*)/', $this->getGedcom(), $matches, PREG_SET_ORDER); |
318 | 338 | $citations = array(); |
319 | 339 | foreach ($matches as $match) { |
@@ -331,7 +351,8 @@ discard block |
||
331 | 351 | * |
332 | 352 | * @return string[]|Note[] |
333 | 353 | */ |
334 | - public function getNotes() { |
|
354 | + public function getNotes() |
|
355 | + { |
|
335 | 356 | $notes = array(); |
336 | 357 | preg_match_all('/\n2 NOTE ?(.*(?:\n3.*)*)/', $this->getGedcom(), $matches); |
337 | 358 | foreach ($matches[1] as $match) { |
@@ -356,7 +377,8 @@ discard block |
||
356 | 377 | * |
357 | 378 | * @return Media[] |
358 | 379 | */ |
359 | - public function getMedia() { |
|
380 | + public function getMedia() |
|
381 | + { |
|
360 | 382 | $media = array(); |
361 | 383 | preg_match_all('/\n2 OBJE @(' . WT_REGEX_XREF . ')@/', $this->getGedcom(), $matches); |
362 | 384 | foreach ($matches[1] as $match) { |
@@ -374,7 +396,8 @@ discard block |
||
374 | 396 | * |
375 | 397 | * @return string |
376 | 398 | */ |
377 | - public function summary() { |
|
399 | + public function summary() |
|
400 | + { |
|
378 | 401 | $attributes = array(); |
379 | 402 | $target = $this->getTarget(); |
380 | 403 | if ($target) { |
@@ -422,7 +445,8 @@ discard block |
||
422 | 445 | * |
423 | 446 | * @return int |
424 | 447 | */ |
425 | - public static function compareDate(Fact $a, Fact $b) { |
|
448 | + public static function compareDate(Fact $a, Fact $b) |
|
449 | + { |
|
426 | 450 | if ($a->getDate()->isOK() && $b->getDate()->isOK()) { |
427 | 451 | // If both events have dates, compare by date |
428 | 452 | $ret = Date::compare($a->getDate(), $b->getDate()); |
@@ -452,7 +476,8 @@ discard block |
||
452 | 476 | * |
453 | 477 | * @return int |
454 | 478 | */ |
455 | - public static function compareType(Fact $a, Fact $b) { |
|
479 | + public static function compareType(Fact $a, Fact $b) |
|
480 | + { |
|
456 | 481 | global $factsort; |
457 | 482 | |
458 | 483 | if (empty($factsort)) { |
@@ -579,7 +604,8 @@ discard block |
||
579 | 604 | * |
580 | 605 | * @return string |
581 | 606 | */ |
582 | - public function __toString() { |
|
607 | + public function __toString() |
|
608 | + { |
|
583 | 609 | return $this->fact_id . '@' . $this->parent->getXref(); |
584 | 610 | } |
585 | 611 | } |
@@ -33,7 +33,8 @@ discard block |
||
33 | 33 | * These are primarily used for embedded keywords on HTML blocks, but |
34 | 34 | * are also used elsewhere in the code. |
35 | 35 | */ |
36 | -class Stats { |
|
36 | +class Stats |
|
37 | +{ |
|
37 | 38 | /** @var Tree Generate statistics for a specified tree. */ |
38 | 39 | private $tree; |
39 | 40 | |
@@ -50,7 +51,8 @@ discard block |
||
50 | 51 | * |
51 | 52 | * @param Tree $tree Generate statistics for this tree |
52 | 53 | */ |
53 | - public function __construct(Tree $tree) { |
|
54 | + public function __construct(Tree $tree) |
|
55 | + { |
|
54 | 56 | $this->tree = $tree; |
55 | 57 | } |
56 | 58 | |
@@ -59,7 +61,8 @@ discard block |
||
59 | 61 | * |
60 | 62 | * @return string |
61 | 63 | */ |
62 | - public function getAllTagsTable() { |
|
64 | + public function getAllTagsTable() |
|
65 | + { |
|
63 | 66 | $examples = array(); |
64 | 67 | foreach (get_class_methods($this) as $method) { |
65 | 68 | $reflection = new \ReflectionMethod($this, $method); |
@@ -97,7 +100,8 @@ discard block |
||
97 | 100 | * |
98 | 101 | * @return string |
99 | 102 | */ |
100 | - public function getAllTagsText() { |
|
103 | + public function getAllTagsText() |
|
104 | + { |
|
101 | 105 | $examples = array(); |
102 | 106 | foreach (get_class_methods($this) as $method) { |
103 | 107 | $reflection = new \ReflectionMethod($this, $method); |
@@ -117,7 +121,8 @@ discard block |
||
117 | 121 | * |
118 | 122 | * @return string[][] |
119 | 123 | */ |
120 | - private function getTags($text) { |
|
124 | + private function getTags($text) |
|
125 | + { |
|
121 | 126 | static $funcs; |
122 | 127 | |
123 | 128 | // Retrive all class methods |
@@ -160,7 +165,8 @@ discard block |
||
160 | 165 | * |
161 | 166 | * @return string |
162 | 167 | */ |
163 | - public function embedTags($text) { |
|
168 | + public function embedTags($text) |
|
169 | + { |
|
164 | 170 | if (strpos($text, '#') !== false) { |
165 | 171 | list($new_tags, $new_values) = $this->getTags($text); |
166 | 172 | $text = str_replace($new_tags, $new_values, $text); |
@@ -174,7 +180,8 @@ discard block |
||
174 | 180 | * |
175 | 181 | * @return string |
176 | 182 | */ |
177 | - public function gedcomFilename() { |
|
183 | + public function gedcomFilename() |
|
184 | + { |
|
178 | 185 | return $this->tree->getName(); |
179 | 186 | } |
180 | 187 | |
@@ -183,7 +190,8 @@ discard block |
||
183 | 190 | * |
184 | 191 | * @return int |
185 | 192 | */ |
186 | - public function gedcomId() { |
|
193 | + public function gedcomId() |
|
194 | + { |
|
187 | 195 | return $this->tree->getTreeId(); |
188 | 196 | } |
189 | 197 | |
@@ -192,7 +200,8 @@ discard block |
||
192 | 200 | * |
193 | 201 | * @return string |
194 | 202 | */ |
195 | - public function gedcomTitle() { |
|
203 | + public function gedcomTitle() |
|
204 | + { |
|
196 | 205 | return $this->tree->getTitleHtml(); |
197 | 206 | } |
198 | 207 | |
@@ -201,7 +210,8 @@ discard block |
||
201 | 210 | * |
202 | 211 | * @return string[] |
203 | 212 | */ |
204 | - private function gedcomHead() { |
|
213 | + private function gedcomHead() |
|
214 | + { |
|
205 | 215 | $title = ''; |
206 | 216 | $version = ''; |
207 | 217 | $source = ''; |
@@ -222,7 +232,8 @@ discard block |
||
222 | 232 | * |
223 | 233 | * @return string |
224 | 234 | */ |
225 | - public function gedcomCreatedSoftware() { |
|
235 | + public function gedcomCreatedSoftware() |
|
236 | + { |
|
226 | 237 | $head = $this->gedcomHead(); |
227 | 238 | |
228 | 239 | return $head[0]; |
@@ -233,7 +244,8 @@ discard block |
||
233 | 244 | * |
234 | 245 | * @return string |
235 | 246 | */ |
236 | - public function gedcomCreatedVersion() { |
|
247 | + public function gedcomCreatedVersion() |
|
248 | + { |
|
237 | 249 | $head = $this->gedcomHead(); |
238 | 250 | // fix broken version string in Family Tree Maker |
239 | 251 | if (strstr($head[1], 'Family Tree Maker ')) { |
@@ -254,7 +266,8 @@ discard block |
||
254 | 266 | * |
255 | 267 | * @return string |
256 | 268 | */ |
257 | - public function gedcomDate() { |
|
269 | + public function gedcomDate() |
|
270 | + { |
|
258 | 271 | $head = GedcomRecord::getInstance('HEAD', $this->tree); |
259 | 272 | $fact = $head->getFirstFact('DATE'); |
260 | 273 | if ($fact) { |
@@ -271,7 +284,8 @@ discard block |
||
271 | 284 | * |
272 | 285 | * @return string |
273 | 286 | */ |
274 | - public function gedcomUpdated() { |
|
287 | + public function gedcomUpdated() |
|
288 | + { |
|
275 | 289 | $row = Database::prepare( |
276 | 290 | "SELECT d_year, d_month, d_day FROM `##dates` WHERE d_julianday1 = (SELECT MAX(d_julianday1) FROM `##dates` WHERE d_file =? AND d_fact='CHAN') LIMIT 1" |
277 | 291 | )->execute(array($this->tree->getTreeId()))->fetchOneRow(); |
@@ -289,7 +303,8 @@ discard block |
||
289 | 303 | * |
290 | 304 | * @return string |
291 | 305 | */ |
292 | - public function gedcomRootId() { |
|
306 | + public function gedcomRootId() |
|
307 | + { |
|
293 | 308 | return $this->tree->getPreference('PEDIGREE_ROOT_ID'); |
294 | 309 | } |
295 | 310 | |
@@ -301,7 +316,8 @@ discard block |
||
301 | 316 | * |
302 | 317 | * @return string |
303 | 318 | */ |
304 | - private function getPercentage($total, $type) { |
|
319 | + private function getPercentage($total, $type) |
|
320 | + { |
|
305 | 321 | switch ($type) { |
306 | 322 | case 'individual': |
307 | 323 | $type = $this->totalIndividualsQuery(); |
@@ -332,7 +348,8 @@ discard block |
||
332 | 348 | * |
333 | 349 | * @return string |
334 | 350 | */ |
335 | - public function totalRecords() { |
|
351 | + public function totalRecords() |
|
352 | + { |
|
336 | 353 | return I18N::number($this->totalIndividualsQuery() + $this->totalFamiliesQuery() + $this->totalSourcesQuery()); |
337 | 354 | } |
338 | 355 | |
@@ -341,7 +358,8 @@ discard block |
||
341 | 358 | * |
342 | 359 | * @return int |
343 | 360 | */ |
344 | - private function totalIndividualsQuery() { |
|
361 | + private function totalIndividualsQuery() |
|
362 | + { |
|
345 | 363 | return (int) Database::prepare( |
346 | 364 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id" |
347 | 365 | )->execute(array( |
@@ -354,7 +372,8 @@ discard block |
||
354 | 372 | * |
355 | 373 | * @return string |
356 | 374 | */ |
357 | - public function totalIndividuals() { |
|
375 | + public function totalIndividuals() |
|
376 | + { |
|
358 | 377 | return I18N::number($this->totalIndividualsQuery()); |
359 | 378 | } |
360 | 379 | |
@@ -363,7 +382,8 @@ discard block |
||
363 | 382 | * |
364 | 383 | * @return int |
365 | 384 | */ |
366 | - private function totalIndisWithSourcesQuery() { |
|
385 | + private function totalIndisWithSourcesQuery() |
|
386 | + { |
|
367 | 387 | return (int) Database::prepare( |
368 | 388 | "SELECT COUNT(DISTINCT i_id)" . |
369 | 389 | " FROM `##individuals` JOIN `##link` ON i_id = l_from AND i_file = l_file" . |
@@ -378,7 +398,8 @@ discard block |
||
378 | 398 | * |
379 | 399 | * @return string |
380 | 400 | */ |
381 | - public function totalIndisWithSources() { |
|
401 | + public function totalIndisWithSources() |
|
402 | + { |
|
382 | 403 | return I18N::number($this->totalIndisWithSourcesQuery()); |
383 | 404 | } |
384 | 405 | |
@@ -389,7 +410,8 @@ discard block |
||
389 | 410 | * |
390 | 411 | * @return string |
391 | 412 | */ |
392 | - public function chartIndisWithSources($params = array()) { |
|
413 | + public function chartIndisWithSources($params = array()) |
|
414 | + { |
|
393 | 415 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
394 | 416 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
395 | 417 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -430,7 +452,8 @@ discard block |
||
430 | 452 | * |
431 | 453 | * @return string |
432 | 454 | */ |
433 | - public function totalIndividualsPercentage() { |
|
455 | + public function totalIndividualsPercentage() |
|
456 | + { |
|
434 | 457 | return $this->getPercentage($this->totalIndividualsQuery(), 'all'); |
435 | 458 | } |
436 | 459 | |
@@ -439,7 +462,8 @@ discard block |
||
439 | 462 | * |
440 | 463 | * @return int |
441 | 464 | */ |
442 | - private function totalFamiliesQuery() { |
|
465 | + private function totalFamiliesQuery() |
|
466 | + { |
|
443 | 467 | return (int) Database::prepare( |
444 | 468 | "SELECT COUNT(*) FROM `##families` WHERE f_file = :tree_id" |
445 | 469 | )->execute(array( |
@@ -452,7 +476,8 @@ discard block |
||
452 | 476 | * |
453 | 477 | * @return string |
454 | 478 | */ |
455 | - public function totalFamilies() { |
|
479 | + public function totalFamilies() |
|
480 | + { |
|
456 | 481 | return I18N::number($this->totalFamiliesQuery()); |
457 | 482 | } |
458 | 483 | |
@@ -461,7 +486,8 @@ discard block |
||
461 | 486 | * |
462 | 487 | * @return int |
463 | 488 | */ |
464 | - private function totalFamsWithSourcesQuery() { |
|
489 | + private function totalFamsWithSourcesQuery() |
|
490 | + { |
|
465 | 491 | return (int) Database::prepare( |
466 | 492 | "SELECT COUNT(DISTINCT f_id)" . |
467 | 493 | " FROM `##families` JOIN `##link` ON f_id = l_from AND f_file = l_file" . |
@@ -476,7 +502,8 @@ discard block |
||
476 | 502 | * |
477 | 503 | * @return string |
478 | 504 | */ |
479 | - public function totalFamsWithSources() { |
|
505 | + public function totalFamsWithSources() |
|
506 | + { |
|
480 | 507 | return I18N::number($this->totalFamsWithSourcesQuery()); |
481 | 508 | } |
482 | 509 | |
@@ -487,7 +514,8 @@ discard block |
||
487 | 514 | * |
488 | 515 | * @return string |
489 | 516 | */ |
490 | - public function chartFamsWithSources($params = array()) { |
|
517 | + public function chartFamsWithSources($params = array()) |
|
518 | + { |
|
491 | 519 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
492 | 520 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
493 | 521 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -528,7 +556,8 @@ discard block |
||
528 | 556 | * |
529 | 557 | * @return string |
530 | 558 | */ |
531 | - public function totalFamiliesPercentage() { |
|
559 | + public function totalFamiliesPercentage() |
|
560 | + { |
|
532 | 561 | return $this->getPercentage($this->totalFamiliesQuery(), 'all'); |
533 | 562 | } |
534 | 563 | |
@@ -537,7 +566,8 @@ discard block |
||
537 | 566 | * |
538 | 567 | * @return int |
539 | 568 | */ |
540 | - private function totalSourcesQuery() { |
|
569 | + private function totalSourcesQuery() |
|
570 | + { |
|
541 | 571 | return (int) Database::prepare( |
542 | 572 | "SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id" |
543 | 573 | )->execute(array( |
@@ -550,7 +580,8 @@ discard block |
||
550 | 580 | * |
551 | 581 | * @return string |
552 | 582 | */ |
553 | - public function totalSources() { |
|
583 | + public function totalSources() |
|
584 | + { |
|
554 | 585 | return I18N::number($this->totalSourcesQuery()); |
555 | 586 | } |
556 | 587 | |
@@ -559,7 +590,8 @@ discard block |
||
559 | 590 | * |
560 | 591 | * @return string |
561 | 592 | */ |
562 | - public function totalSourcesPercentage() { |
|
593 | + public function totalSourcesPercentage() |
|
594 | + { |
|
563 | 595 | return $this->getPercentage($this->totalSourcesQuery(), 'all'); |
564 | 596 | } |
565 | 597 | |
@@ -568,7 +600,8 @@ discard block |
||
568 | 600 | * |
569 | 601 | * @return int |
570 | 602 | */ |
571 | - private function totalNotesQuery() { |
|
603 | + private function totalNotesQuery() |
|
604 | + { |
|
572 | 605 | return (int) Database::prepare( |
573 | 606 | "SELECT COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file = :tree_id" |
574 | 607 | )->execute(array( |
@@ -581,7 +614,8 @@ discard block |
||
581 | 614 | * |
582 | 615 | * @return string |
583 | 616 | */ |
584 | - public function totalNotes() { |
|
617 | + public function totalNotes() |
|
618 | + { |
|
585 | 619 | return I18N::number($this->totalNotesQuery()); |
586 | 620 | } |
587 | 621 | |
@@ -590,7 +624,8 @@ discard block |
||
590 | 624 | * |
591 | 625 | * @return string |
592 | 626 | */ |
593 | - public function totalNotesPercentage() { |
|
627 | + public function totalNotesPercentage() |
|
628 | + { |
|
594 | 629 | return $this->getPercentage($this->totalNotesQuery(), 'all'); |
595 | 630 | } |
596 | 631 | |
@@ -599,7 +634,8 @@ discard block |
||
599 | 634 | * |
600 | 635 | * @return int |
601 | 636 | */ |
602 | - private function totalRepositoriesQuery() { |
|
637 | + private function totalRepositoriesQuery() |
|
638 | + { |
|
603 | 639 | return (int) Database::prepare( |
604 | 640 | "SELECT COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file = :tree_id" |
605 | 641 | )->execute(array( |
@@ -612,7 +648,8 @@ discard block |
||
612 | 648 | * |
613 | 649 | * @return string |
614 | 650 | */ |
615 | - public function totalRepositories() { |
|
651 | + public function totalRepositories() |
|
652 | + { |
|
616 | 653 | return I18N::number($this->totalRepositoriesQuery()); |
617 | 654 | } |
618 | 655 | |
@@ -621,7 +658,8 @@ discard block |
||
621 | 658 | * |
622 | 659 | * @return string |
623 | 660 | */ |
624 | - public function totalRepositoriesPercentage() { |
|
661 | + public function totalRepositoriesPercentage() |
|
662 | + { |
|
625 | 663 | return $this->getPercentage($this->totalRepositoriesQuery(), 'all'); |
626 | 664 | } |
627 | 665 | |
@@ -632,7 +670,8 @@ discard block |
||
632 | 670 | * |
633 | 671 | * @return string |
634 | 672 | */ |
635 | - public function totalSurnames($params = array()) { |
|
673 | + public function totalSurnames($params = array()) |
|
674 | + { |
|
636 | 675 | if ($params) { |
637 | 676 | $opt = 'IN (' . implode(',', array_fill(0, count($params), '?')) . ')'; |
638 | 677 | $distinct = ''; |
@@ -661,7 +700,8 @@ discard block |
||
661 | 700 | * |
662 | 701 | * @return string |
663 | 702 | */ |
664 | - public function totalGivennames($params = array()) { |
|
703 | + public function totalGivennames($params = array()) |
|
704 | + { |
|
665 | 705 | if ($params) { |
666 | 706 | $qs = implode(',', array_fill(0, count($params), '?')); |
667 | 707 | $params[] = $this->tree->getTreeId(); |
@@ -686,7 +726,8 @@ discard block |
||
686 | 726 | * |
687 | 727 | * @return string |
688 | 728 | */ |
689 | - public function totalEvents($params = array()) { |
|
729 | + public function totalEvents($params = array()) |
|
730 | + { |
|
690 | 731 | $sql = "SELECT COUNT(*) AS tot FROM `##dates` WHERE d_file=?"; |
691 | 732 | $vars = array($this->tree->getTreeId()); |
692 | 733 | |
@@ -716,7 +757,8 @@ discard block |
||
716 | 757 | * |
717 | 758 | * @return string |
718 | 759 | */ |
719 | - public function totalEventsBirth() { |
|
760 | + public function totalEventsBirth() |
|
761 | + { |
|
720 | 762 | return $this->totalEvents(explode('|', WT_EVENTS_BIRT)); |
721 | 763 | } |
722 | 764 | |
@@ -725,7 +767,8 @@ discard block |
||
725 | 767 | * |
726 | 768 | * @return string |
727 | 769 | */ |
728 | - public function totalBirths() { |
|
770 | + public function totalBirths() |
|
771 | + { |
|
729 | 772 | return $this->totalEvents(array('BIRT')); |
730 | 773 | } |
731 | 774 | |
@@ -734,7 +777,8 @@ discard block |
||
734 | 777 | * |
735 | 778 | * @return string |
736 | 779 | */ |
737 | - public function totalEventsDeath() { |
|
780 | + public function totalEventsDeath() |
|
781 | + { |
|
738 | 782 | return $this->totalEvents(explode('|', WT_EVENTS_DEAT)); |
739 | 783 | } |
740 | 784 | |
@@ -743,7 +787,8 @@ discard block |
||
743 | 787 | * |
744 | 788 | * @return string |
745 | 789 | */ |
746 | - public function totalDeaths() { |
|
790 | + public function totalDeaths() |
|
791 | + { |
|
747 | 792 | return $this->totalEvents(array('DEAT')); |
748 | 793 | } |
749 | 794 | |
@@ -752,7 +797,8 @@ discard block |
||
752 | 797 | * |
753 | 798 | * @return string |
754 | 799 | */ |
755 | - public function totalEventsMarriage() { |
|
800 | + public function totalEventsMarriage() |
|
801 | + { |
|
756 | 802 | return $this->totalEvents(explode('|', WT_EVENTS_MARR)); |
757 | 803 | } |
758 | 804 | |
@@ -761,7 +807,8 @@ discard block |
||
761 | 807 | * |
762 | 808 | * @return string |
763 | 809 | */ |
764 | - public function totalMarriages() { |
|
810 | + public function totalMarriages() |
|
811 | + { |
|
765 | 812 | return $this->totalEvents(array('MARR')); |
766 | 813 | } |
767 | 814 | |
@@ -770,7 +817,8 @@ discard block |
||
770 | 817 | * |
771 | 818 | * @return string |
772 | 819 | */ |
773 | - public function totalEventsDivorce() { |
|
820 | + public function totalEventsDivorce() |
|
821 | + { |
|
774 | 822 | return $this->totalEvents(explode('|', WT_EVENTS_DIV)); |
775 | 823 | } |
776 | 824 | |
@@ -779,7 +827,8 @@ discard block |
||
779 | 827 | * |
780 | 828 | * @return string |
781 | 829 | */ |
782 | - public function totalDivorces() { |
|
830 | + public function totalDivorces() |
|
831 | + { |
|
783 | 832 | return $this->totalEvents(array('DIV')); |
784 | 833 | } |
785 | 834 | |
@@ -788,7 +837,8 @@ discard block |
||
788 | 837 | * |
789 | 838 | * @return string |
790 | 839 | */ |
791 | - public function totalEventsOther() { |
|
840 | + public function totalEventsOther() |
|
841 | + { |
|
792 | 842 | $facts = array_merge(explode('|', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT)); |
793 | 843 | $no_facts = array(); |
794 | 844 | foreach ($facts as $fact) { |
@@ -804,7 +854,8 @@ discard block |
||
804 | 854 | * |
805 | 855 | * @return int |
806 | 856 | */ |
807 | - private function totalSexMalesQuery() { |
|
857 | + private function totalSexMalesQuery() |
|
858 | + { |
|
808 | 859 | return (int) Database::prepare( |
809 | 860 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'M'" |
810 | 861 | )->execute(array( |
@@ -817,7 +868,8 @@ discard block |
||
817 | 868 | * |
818 | 869 | * @return string |
819 | 870 | */ |
820 | - public function totalSexMales() { |
|
871 | + public function totalSexMales() |
|
872 | + { |
|
821 | 873 | return I18N::number($this->totalSexMalesQuery()); |
822 | 874 | } |
823 | 875 | |
@@ -826,7 +878,8 @@ discard block |
||
826 | 878 | * |
827 | 879 | * @return string |
828 | 880 | */ |
829 | - public function totalSexMalesPercentage() { |
|
881 | + public function totalSexMalesPercentage() |
|
882 | + { |
|
830 | 883 | return $this->getPercentage($this->totalSexMalesQuery(), 'individual'); |
831 | 884 | } |
832 | 885 | |
@@ -835,7 +888,8 @@ discard block |
||
835 | 888 | * |
836 | 889 | * @return int |
837 | 890 | */ |
838 | - private function totalSexFemalesQuery() { |
|
891 | + private function totalSexFemalesQuery() |
|
892 | + { |
|
839 | 893 | return (int) Database::prepare( |
840 | 894 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'F'" |
841 | 895 | )->execute(array( |
@@ -848,7 +902,8 @@ discard block |
||
848 | 902 | * |
849 | 903 | * @return string |
850 | 904 | */ |
851 | - public function totalSexFemales() { |
|
905 | + public function totalSexFemales() |
|
906 | + { |
|
852 | 907 | return I18N::number($this->totalSexFemalesQuery()); |
853 | 908 | } |
854 | 909 | |
@@ -857,7 +912,8 @@ discard block |
||
857 | 912 | * |
858 | 913 | * @return string |
859 | 914 | */ |
860 | - public function totalSexFemalesPercentage() { |
|
915 | + public function totalSexFemalesPercentage() |
|
916 | + { |
|
861 | 917 | return $this->getPercentage($this->totalSexFemalesQuery(), 'individual'); |
862 | 918 | } |
863 | 919 | |
@@ -866,7 +922,8 @@ discard block |
||
866 | 922 | * |
867 | 923 | * @return int |
868 | 924 | */ |
869 | - private function totalSexUnknownQuery() { |
|
925 | + private function totalSexUnknownQuery() |
|
926 | + { |
|
870 | 927 | return (int) Database::prepare( |
871 | 928 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'U'" |
872 | 929 | )->execute(array( |
@@ -879,7 +936,8 @@ discard block |
||
879 | 936 | * |
880 | 937 | * @return string |
881 | 938 | */ |
882 | - public function totalSexUnknown() { |
|
939 | + public function totalSexUnknown() |
|
940 | + { |
|
883 | 941 | return I18N::number($this->totalSexUnknownQuery()); |
884 | 942 | } |
885 | 943 | |
@@ -888,7 +946,8 @@ discard block |
||
888 | 946 | * |
889 | 947 | * @return string |
890 | 948 | */ |
891 | - public function totalSexUnknownPercentage() { |
|
949 | + public function totalSexUnknownPercentage() |
|
950 | + { |
|
892 | 951 | return $this->getPercentage($this->totalSexUnknownQuery(), 'individual'); |
893 | 952 | } |
894 | 953 | |
@@ -899,7 +958,8 @@ discard block |
||
899 | 958 | * |
900 | 959 | * @return string |
901 | 960 | */ |
902 | - public function chartSex($params = array()) { |
|
961 | + public function chartSex($params = array()) |
|
962 | + { |
|
903 | 963 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
904 | 964 | $WT_STATS_S_CHART_Y = Theme::theme()->parameter('stats-small-chart-y'); |
905 | 965 | |
@@ -969,7 +1029,8 @@ discard block |
||
969 | 1029 | * |
970 | 1030 | * @return int |
971 | 1031 | */ |
972 | - private function totalLivingQuery() { |
|
1032 | + private function totalLivingQuery() |
|
1033 | + { |
|
973 | 1034 | return (int) Database::prepare( |
974 | 1035 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'" |
975 | 1036 | )->execute(array( |
@@ -982,7 +1043,8 @@ discard block |
||
982 | 1043 | * |
983 | 1044 | * @return string |
984 | 1045 | */ |
985 | - public function totalLiving() { |
|
1046 | + public function totalLiving() |
|
1047 | + { |
|
986 | 1048 | return I18N::number($this->totalLivingQuery()); |
987 | 1049 | } |
988 | 1050 | |
@@ -991,7 +1053,8 @@ discard block |
||
991 | 1053 | * |
992 | 1054 | * @return string |
993 | 1055 | */ |
994 | - public function totalLivingPercentage() { |
|
1056 | + public function totalLivingPercentage() |
|
1057 | + { |
|
995 | 1058 | return $this->getPercentage($this->totalLivingQuery(), 'individual'); |
996 | 1059 | } |
997 | 1060 | |
@@ -1000,7 +1063,8 @@ discard block |
||
1000 | 1063 | * |
1001 | 1064 | * @return int |
1002 | 1065 | */ |
1003 | - private function totalDeceasedQuery() { |
|
1066 | + private function totalDeceasedQuery() |
|
1067 | + { |
|
1004 | 1068 | return (int) Database::prepare( |
1005 | 1069 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'" |
1006 | 1070 | )->execute(array( |
@@ -1013,7 +1077,8 @@ discard block |
||
1013 | 1077 | * |
1014 | 1078 | * @return string |
1015 | 1079 | */ |
1016 | - public function totalDeceased() { |
|
1080 | + public function totalDeceased() |
|
1081 | + { |
|
1017 | 1082 | return I18N::number($this->totalDeceasedQuery()); |
1018 | 1083 | } |
1019 | 1084 | |
@@ -1022,7 +1087,8 @@ discard block |
||
1022 | 1087 | * |
1023 | 1088 | * @return string |
1024 | 1089 | */ |
1025 | - public function totalDeceasedPercentage() { |
|
1090 | + public function totalDeceasedPercentage() |
|
1091 | + { |
|
1026 | 1092 | return $this->getPercentage($this->totalDeceasedQuery(), 'individual'); |
1027 | 1093 | } |
1028 | 1094 | |
@@ -1033,7 +1099,8 @@ discard block |
||
1033 | 1099 | * |
1034 | 1100 | * @return string |
1035 | 1101 | */ |
1036 | - public function chartMortality($params = array()) { |
|
1102 | + public function chartMortality($params = array()) |
|
1103 | + { |
|
1037 | 1104 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
1038 | 1105 | $WT_STATS_S_CHART_Y = Theme::theme()->parameter('stats-small-chart-y'); |
1039 | 1106 | |
@@ -1081,7 +1148,8 @@ discard block |
||
1081 | 1148 | * |
1082 | 1149 | * @return string |
1083 | 1150 | */ |
1084 | - public function totalUsers($params = array()) { |
|
1151 | + public function totalUsers($params = array()) |
|
1152 | + { |
|
1085 | 1153 | if (isset($params[0])) { |
1086 | 1154 | $total = count(User::all()) + (int) $params[0]; |
1087 | 1155 | } else { |
@@ -1096,7 +1164,8 @@ discard block |
||
1096 | 1164 | * |
1097 | 1165 | * @return string |
1098 | 1166 | */ |
1099 | - public function totalAdmins() { |
|
1167 | + public function totalAdmins() |
|
1168 | + { |
|
1100 | 1169 | return I18N::number(count(User::allAdmins())); |
1101 | 1170 | } |
1102 | 1171 | |
@@ -1105,7 +1174,8 @@ discard block |
||
1105 | 1174 | * |
1106 | 1175 | * @return string |
1107 | 1176 | */ |
1108 | - public function totalNonAdmins() { |
|
1177 | + public function totalNonAdmins() |
|
1178 | + { |
|
1109 | 1179 | return I18N::number(count(User::all()) - count(User::allAdmins())); |
1110 | 1180 | } |
1111 | 1181 | |
@@ -1116,7 +1186,8 @@ discard block |
||
1116 | 1186 | * |
1117 | 1187 | * @return int |
1118 | 1188 | */ |
1119 | - private function totalMediaType($type = 'all') { |
|
1189 | + private function totalMediaType($type = 'all') |
|
1190 | + { |
|
1120 | 1191 | if (!in_array($type, $this->_media_types) && $type != 'all' && $type != 'unknown') { |
1121 | 1192 | return 0; |
1122 | 1193 | } |
@@ -1146,7 +1217,8 @@ discard block |
||
1146 | 1217 | * |
1147 | 1218 | * @return string |
1148 | 1219 | */ |
1149 | - public function totalMedia() { |
|
1220 | + public function totalMedia() |
|
1221 | + { |
|
1150 | 1222 | return I18N::number($this->totalMediaType('all')); |
1151 | 1223 | } |
1152 | 1224 | |
@@ -1155,7 +1227,8 @@ discard block |
||
1155 | 1227 | * |
1156 | 1228 | * @return string |
1157 | 1229 | */ |
1158 | - public function totalMediaAudio() { |
|
1230 | + public function totalMediaAudio() |
|
1231 | + { |
|
1159 | 1232 | return I18N::number($this->totalMediaType('audio')); |
1160 | 1233 | } |
1161 | 1234 | |
@@ -1164,7 +1237,8 @@ discard block |
||
1164 | 1237 | * |
1165 | 1238 | * @return string |
1166 | 1239 | */ |
1167 | - public function totalMediaBook() { |
|
1240 | + public function totalMediaBook() |
|
1241 | + { |
|
1168 | 1242 | return I18N::number($this->totalMediaType('book')); |
1169 | 1243 | } |
1170 | 1244 | |
@@ -1173,7 +1247,8 @@ discard block |
||
1173 | 1247 | * |
1174 | 1248 | * @return string |
1175 | 1249 | */ |
1176 | - public function totalMediaCard() { |
|
1250 | + public function totalMediaCard() |
|
1251 | + { |
|
1177 | 1252 | return I18N::number($this->totalMediaType('card')); |
1178 | 1253 | } |
1179 | 1254 | |
@@ -1182,7 +1257,8 @@ discard block |
||
1182 | 1257 | * |
1183 | 1258 | * @return string |
1184 | 1259 | */ |
1185 | - public function totalMediaCertificate() { |
|
1260 | + public function totalMediaCertificate() |
|
1261 | + { |
|
1186 | 1262 | return I18N::number($this->totalMediaType('certificate')); |
1187 | 1263 | } |
1188 | 1264 | |
@@ -1191,7 +1267,8 @@ discard block |
||
1191 | 1267 | * |
1192 | 1268 | * @return string |
1193 | 1269 | */ |
1194 | - public function totalMediaCoatOfArms() { |
|
1270 | + public function totalMediaCoatOfArms() |
|
1271 | + { |
|
1195 | 1272 | return I18N::number($this->totalMediaType('coat')); |
1196 | 1273 | } |
1197 | 1274 | |
@@ -1200,7 +1277,8 @@ discard block |
||
1200 | 1277 | * |
1201 | 1278 | * @return string |
1202 | 1279 | */ |
1203 | - public function totalMediaDocument() { |
|
1280 | + public function totalMediaDocument() |
|
1281 | + { |
|
1204 | 1282 | return I18N::number($this->totalMediaType('document')); |
1205 | 1283 | } |
1206 | 1284 | |
@@ -1209,7 +1287,8 @@ discard block |
||
1209 | 1287 | * |
1210 | 1288 | * @return string |
1211 | 1289 | */ |
1212 | - public function totalMediaElectronic() { |
|
1290 | + public function totalMediaElectronic() |
|
1291 | + { |
|
1213 | 1292 | return I18N::number($this->totalMediaType('electronic')); |
1214 | 1293 | } |
1215 | 1294 | |
@@ -1218,7 +1297,8 @@ discard block |
||
1218 | 1297 | * |
1219 | 1298 | * @return string |
1220 | 1299 | */ |
1221 | - public function totalMediaMagazine() { |
|
1300 | + public function totalMediaMagazine() |
|
1301 | + { |
|
1222 | 1302 | return I18N::number($this->totalMediaType('magazine')); |
1223 | 1303 | } |
1224 | 1304 | |
@@ -1227,7 +1307,8 @@ discard block |
||
1227 | 1307 | * |
1228 | 1308 | * @return string |
1229 | 1309 | */ |
1230 | - public function totalMediaManuscript() { |
|
1310 | + public function totalMediaManuscript() |
|
1311 | + { |
|
1231 | 1312 | return I18N::number($this->totalMediaType('manuscript')); |
1232 | 1313 | } |
1233 | 1314 | |
@@ -1236,7 +1317,8 @@ discard block |
||
1236 | 1317 | * |
1237 | 1318 | * @return string |
1238 | 1319 | */ |
1239 | - public function totalMediaMap() { |
|
1320 | + public function totalMediaMap() |
|
1321 | + { |
|
1240 | 1322 | return I18N::number($this->totalMediaType('map')); |
1241 | 1323 | } |
1242 | 1324 | |
@@ -1245,7 +1327,8 @@ discard block |
||
1245 | 1327 | * |
1246 | 1328 | * @return string |
1247 | 1329 | */ |
1248 | - public function totalMediaFiche() { |
|
1330 | + public function totalMediaFiche() |
|
1331 | + { |
|
1249 | 1332 | return I18N::number($this->totalMediaType('fiche')); |
1250 | 1333 | } |
1251 | 1334 | |
@@ -1254,7 +1337,8 @@ discard block |
||
1254 | 1337 | * |
1255 | 1338 | * @return string |
1256 | 1339 | */ |
1257 | - public function totalMediaFilm() { |
|
1340 | + public function totalMediaFilm() |
|
1341 | + { |
|
1258 | 1342 | return I18N::number($this->totalMediaType('film')); |
1259 | 1343 | } |
1260 | 1344 | |
@@ -1263,7 +1347,8 @@ discard block |
||
1263 | 1347 | * |
1264 | 1348 | * @return string |
1265 | 1349 | */ |
1266 | - public function totalMediaNewspaper() { |
|
1350 | + public function totalMediaNewspaper() |
|
1351 | + { |
|
1267 | 1352 | return I18N::number($this->totalMediaType('newspaper')); |
1268 | 1353 | } |
1269 | 1354 | |
@@ -1272,7 +1357,8 @@ discard block |
||
1272 | 1357 | * |
1273 | 1358 | * @return string |
1274 | 1359 | */ |
1275 | - public function totalMediaPainting() { |
|
1360 | + public function totalMediaPainting() |
|
1361 | + { |
|
1276 | 1362 | return I18N::number($this->totalMediaType('painting')); |
1277 | 1363 | } |
1278 | 1364 | |
@@ -1281,7 +1367,8 @@ discard block |
||
1281 | 1367 | * |
1282 | 1368 | * @return string |
1283 | 1369 | */ |
1284 | - public function totalMediaPhoto() { |
|
1370 | + public function totalMediaPhoto() |
|
1371 | + { |
|
1285 | 1372 | return I18N::number($this->totalMediaType('photo')); |
1286 | 1373 | } |
1287 | 1374 | |
@@ -1290,7 +1377,8 @@ discard block |
||
1290 | 1377 | * |
1291 | 1378 | * @return string |
1292 | 1379 | */ |
1293 | - public function totalMediaTombstone() { |
|
1380 | + public function totalMediaTombstone() |
|
1381 | + { |
|
1294 | 1382 | return I18N::number($this->totalMediaType('tombstone')); |
1295 | 1383 | } |
1296 | 1384 | |
@@ -1299,7 +1387,8 @@ discard block |
||
1299 | 1387 | * |
1300 | 1388 | * @return string |
1301 | 1389 | */ |
1302 | - public function totalMediaVideo() { |
|
1390 | + public function totalMediaVideo() |
|
1391 | + { |
|
1303 | 1392 | return I18N::number($this->totalMediaType('video')); |
1304 | 1393 | } |
1305 | 1394 | |
@@ -1308,7 +1397,8 @@ discard block |
||
1308 | 1397 | * |
1309 | 1398 | * @return string |
1310 | 1399 | */ |
1311 | - public function totalMediaOther() { |
|
1400 | + public function totalMediaOther() |
|
1401 | + { |
|
1312 | 1402 | return I18N::number($this->totalMediaType('other')); |
1313 | 1403 | } |
1314 | 1404 | |
@@ -1317,7 +1407,8 @@ discard block |
||
1317 | 1407 | * |
1318 | 1408 | * @return string |
1319 | 1409 | */ |
1320 | - public function totalMediaUnknown() { |
|
1410 | + public function totalMediaUnknown() |
|
1411 | + { |
|
1321 | 1412 | return I18N::number($this->totalMediaType('unknown')); |
1322 | 1413 | } |
1323 | 1414 | |
@@ -1328,7 +1419,8 @@ discard block |
||
1328 | 1419 | * |
1329 | 1420 | * @return string |
1330 | 1421 | */ |
1331 | - public function chartMedia($params = array()) { |
|
1422 | + public function chartMedia($params = array()) |
|
1423 | + { |
|
1332 | 1424 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
1333 | 1425 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
1334 | 1426 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -1414,7 +1506,8 @@ discard block |
||
1414 | 1506 | * |
1415 | 1507 | * @return string |
1416 | 1508 | */ |
1417 | - private function mortalityQuery($type = 'full', $life_dir = 'ASC', $birth_death = 'BIRT') { |
|
1509 | + private function mortalityQuery($type = 'full', $life_dir = 'ASC', $birth_death = 'BIRT') |
|
1510 | + { |
|
1418 | 1511 | if ($birth_death == 'MARR') { |
1419 | 1512 | $query_field = "'MARR'"; |
1420 | 1513 | } elseif ($birth_death == 'DIV') { |
@@ -1482,7 +1575,8 @@ discard block |
||
1482 | 1575 | * |
1483 | 1576 | * @return int[]|string[][] |
1484 | 1577 | */ |
1485 | - public function statsPlaces($what = 'ALL', $fact = '', $parent = 0, $country = false) { |
|
1578 | + public function statsPlaces($what = 'ALL', $fact = '', $parent = 0, $country = false) |
|
1579 | + { |
|
1486 | 1580 | if ($fact) { |
1487 | 1581 | if ($what == 'INDI') { |
1488 | 1582 | $rows = Database::prepare( |
@@ -1570,7 +1664,8 @@ discard block |
||
1570 | 1664 | * |
1571 | 1665 | * @return int |
1572 | 1666 | */ |
1573 | - private function totalPlacesQuery() { |
|
1667 | + private function totalPlacesQuery() |
|
1668 | + { |
|
1574 | 1669 | return |
1575 | 1670 | (int) Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?") |
1576 | 1671 | ->execute(array($this->tree->getTreeId())) |
@@ -1582,7 +1677,8 @@ discard block |
||
1582 | 1677 | * |
1583 | 1678 | * @return string |
1584 | 1679 | */ |
1585 | - public function totalPlaces() { |
|
1680 | + public function totalPlaces() |
|
1681 | + { |
|
1586 | 1682 | return I18N::number($this->totalPlacesQuery()); |
1587 | 1683 | } |
1588 | 1684 | |
@@ -1593,7 +1689,8 @@ discard block |
||
1593 | 1689 | * |
1594 | 1690 | * @return string |
1595 | 1691 | */ |
1596 | - public function chartDistribution($params = array()) { |
|
1692 | + public function chartDistribution($params = array()) |
|
1693 | + { |
|
1597 | 1694 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
1598 | 1695 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
1599 | 1696 | $WT_STATS_CHART_COLOR3 = Theme::theme()->parameter('distribution-chart-low-values'); |
@@ -1747,7 +1844,8 @@ discard block |
||
1747 | 1844 | * |
1748 | 1845 | * @return string |
1749 | 1846 | */ |
1750 | - public function commonCountriesList() { |
|
1847 | + public function commonCountriesList() |
|
1848 | + { |
|
1751 | 1849 | $countries = $this->statsPlaces(); |
1752 | 1850 | if (empty($countries)) { |
1753 | 1851 | return ''; |
@@ -1799,7 +1897,8 @@ discard block |
||
1799 | 1897 | * |
1800 | 1898 | * @return string |
1801 | 1899 | */ |
1802 | - public function commonBirthPlacesList() { |
|
1900 | + public function commonBirthPlacesList() |
|
1901 | + { |
|
1803 | 1902 | $places = $this->statsPlaces('INDI', 'BIRT'); |
1804 | 1903 | $top10 = array(); |
1805 | 1904 | $i = 1; |
@@ -1822,7 +1921,8 @@ discard block |
||
1822 | 1921 | * |
1823 | 1922 | * @return string |
1824 | 1923 | */ |
1825 | - public function commonDeathPlacesList() { |
|
1924 | + public function commonDeathPlacesList() |
|
1925 | + { |
|
1826 | 1926 | $places = $this->statsPlaces('INDI', 'DEAT'); |
1827 | 1927 | $top10 = array(); |
1828 | 1928 | $i = 1; |
@@ -1845,7 +1945,8 @@ discard block |
||
1845 | 1945 | * |
1846 | 1946 | * @return string |
1847 | 1947 | */ |
1848 | - public function commonMarriagePlacesList() { |
|
1948 | + public function commonMarriagePlacesList() |
|
1949 | + { |
|
1849 | 1950 | $places = $this->statsPlaces('FAM', 'MARR'); |
1850 | 1951 | $top10 = array(); |
1851 | 1952 | $i = 1; |
@@ -1874,7 +1975,8 @@ discard block |
||
1874 | 1975 | * |
1875 | 1976 | * @return array|string |
1876 | 1977 | */ |
1877 | - public function statsBirthQuery($simple = true, $sex = false, $year1 = -1, $year2 = -1, $params = array()) { |
|
1978 | + public function statsBirthQuery($simple = true, $sex = false, $year1 = -1, $year2 = -1, $params = array()) |
|
1979 | + { |
|
1878 | 1980 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
1879 | 1981 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
1880 | 1982 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -1967,7 +2069,8 @@ discard block |
||
1967 | 2069 | * |
1968 | 2070 | * @return array|string |
1969 | 2071 | */ |
1970 | - public function statsDeathQuery($simple = true, $sex = false, $year1 = -1, $year2 = -1, $params = array()) { |
|
2072 | + public function statsDeathQuery($simple = true, $sex = false, $year1 = -1, $year2 = -1, $params = array()) |
|
2073 | + { |
|
1971 | 2074 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
1972 | 2075 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
1973 | 2076 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -2054,7 +2157,8 @@ discard block |
||
2054 | 2157 | * |
2055 | 2158 | * @return string |
2056 | 2159 | */ |
2057 | - public function firstBirth() { |
|
2160 | + public function firstBirth() |
|
2161 | + { |
|
2058 | 2162 | return $this->mortalityQuery('full', 'ASC', 'BIRT'); |
2059 | 2163 | } |
2060 | 2164 | |
@@ -2063,7 +2167,8 @@ discard block |
||
2063 | 2167 | * |
2064 | 2168 | * @return string |
2065 | 2169 | */ |
2066 | - public function firstBirthYear() { |
|
2170 | + public function firstBirthYear() |
|
2171 | + { |
|
2067 | 2172 | return $this->mortalityQuery('year', 'ASC', 'BIRT'); |
2068 | 2173 | } |
2069 | 2174 | |
@@ -2072,7 +2177,8 @@ discard block |
||
2072 | 2177 | * |
2073 | 2178 | * @return string |
2074 | 2179 | */ |
2075 | - public function firstBirthName() { |
|
2180 | + public function firstBirthName() |
|
2181 | + { |
|
2076 | 2182 | return $this->mortalityQuery('name', 'ASC', 'BIRT'); |
2077 | 2183 | } |
2078 | 2184 | |
@@ -2081,7 +2187,8 @@ discard block |
||
2081 | 2187 | * |
2082 | 2188 | * @return string |
2083 | 2189 | */ |
2084 | - public function firstBirthPlace() { |
|
2190 | + public function firstBirthPlace() |
|
2191 | + { |
|
2085 | 2192 | return $this->mortalityQuery('place', 'ASC', 'BIRT'); |
2086 | 2193 | } |
2087 | 2194 | |
@@ -2090,7 +2197,8 @@ discard block |
||
2090 | 2197 | * |
2091 | 2198 | * @return string |
2092 | 2199 | */ |
2093 | - public function lastBirth() { |
|
2200 | + public function lastBirth() |
|
2201 | + { |
|
2094 | 2202 | return $this->mortalityQuery('full', 'DESC', 'BIRT'); |
2095 | 2203 | } |
2096 | 2204 | |
@@ -2099,7 +2207,8 @@ discard block |
||
2099 | 2207 | * |
2100 | 2208 | * @return string |
2101 | 2209 | */ |
2102 | - public function lastBirthYear() { |
|
2210 | + public function lastBirthYear() |
|
2211 | + { |
|
2103 | 2212 | return $this->mortalityQuery('year', 'DESC', 'BIRT'); |
2104 | 2213 | } |
2105 | 2214 | |
@@ -2108,7 +2217,8 @@ discard block |
||
2108 | 2217 | * |
2109 | 2218 | * @return string |
2110 | 2219 | */ |
2111 | - public function lastBirthName() { |
|
2220 | + public function lastBirthName() |
|
2221 | + { |
|
2112 | 2222 | return $this->mortalityQuery('name', 'DESC', 'BIRT'); |
2113 | 2223 | } |
2114 | 2224 | |
@@ -2117,7 +2227,8 @@ discard block |
||
2117 | 2227 | * |
2118 | 2228 | * @return string |
2119 | 2229 | */ |
2120 | - public function lastBirthPlace() { |
|
2230 | + public function lastBirthPlace() |
|
2231 | + { |
|
2121 | 2232 | return $this->mortalityQuery('place', 'DESC', 'BIRT'); |
2122 | 2233 | } |
2123 | 2234 | |
@@ -2128,7 +2239,8 @@ discard block |
||
2128 | 2239 | * |
2129 | 2240 | * @return string |
2130 | 2241 | */ |
2131 | - public function statsBirth($params = array()) { |
|
2242 | + public function statsBirth($params = array()) |
|
2243 | + { |
|
2132 | 2244 | return $this->statsBirthQuery(true, false, -1, -1, $params); |
2133 | 2245 | } |
2134 | 2246 | |
@@ -2137,7 +2249,8 @@ discard block |
||
2137 | 2249 | * |
2138 | 2250 | * @return string |
2139 | 2251 | */ |
2140 | - public function firstDeath() { |
|
2252 | + public function firstDeath() |
|
2253 | + { |
|
2141 | 2254 | return $this->mortalityQuery('full', 'ASC', 'DEAT'); |
2142 | 2255 | } |
2143 | 2256 | |
@@ -2146,7 +2259,8 @@ discard block |
||
2146 | 2259 | * |
2147 | 2260 | * @return string |
2148 | 2261 | */ |
2149 | - public function firstDeathYear() { |
|
2262 | + public function firstDeathYear() |
|
2263 | + { |
|
2150 | 2264 | return $this->mortalityQuery('year', 'ASC', 'DEAT'); |
2151 | 2265 | } |
2152 | 2266 | |
@@ -2155,7 +2269,8 @@ discard block |
||
2155 | 2269 | * |
2156 | 2270 | * @return string |
2157 | 2271 | */ |
2158 | - public function firstDeathName() { |
|
2272 | + public function firstDeathName() |
|
2273 | + { |
|
2159 | 2274 | return $this->mortalityQuery('name', 'ASC', 'DEAT'); |
2160 | 2275 | } |
2161 | 2276 | |
@@ -2164,7 +2279,8 @@ discard block |
||
2164 | 2279 | * |
2165 | 2280 | * @return string |
2166 | 2281 | */ |
2167 | - public function firstDeathPlace() { |
|
2282 | + public function firstDeathPlace() |
|
2283 | + { |
|
2168 | 2284 | return $this->mortalityQuery('place', 'ASC', 'DEAT'); |
2169 | 2285 | } |
2170 | 2286 | |
@@ -2173,7 +2289,8 @@ discard block |
||
2173 | 2289 | * |
2174 | 2290 | * @return string |
2175 | 2291 | */ |
2176 | - public function lastDeath() { |
|
2292 | + public function lastDeath() |
|
2293 | + { |
|
2177 | 2294 | return $this->mortalityQuery('full', 'DESC', 'DEAT'); |
2178 | 2295 | } |
2179 | 2296 | |
@@ -2182,7 +2299,8 @@ discard block |
||
2182 | 2299 | * |
2183 | 2300 | * @return string |
2184 | 2301 | */ |
2185 | - public function lastDeathYear() { |
|
2302 | + public function lastDeathYear() |
|
2303 | + { |
|
2186 | 2304 | return $this->mortalityQuery('year', 'DESC', 'DEAT'); |
2187 | 2305 | } |
2188 | 2306 | |
@@ -2191,7 +2309,8 @@ discard block |
||
2191 | 2309 | * |
2192 | 2310 | * @return string |
2193 | 2311 | */ |
2194 | - public function lastDeathName() { |
|
2312 | + public function lastDeathName() |
|
2313 | + { |
|
2195 | 2314 | return $this->mortalityQuery('name', 'DESC', 'DEAT'); |
2196 | 2315 | } |
2197 | 2316 | |
@@ -2200,7 +2319,8 @@ discard block |
||
2200 | 2319 | * |
2201 | 2320 | * @return string |
2202 | 2321 | */ |
2203 | - public function lastDeathPlace() { |
|
2322 | + public function lastDeathPlace() |
|
2323 | + { |
|
2204 | 2324 | return $this->mortalityQuery('place', 'DESC', 'DEAT'); |
2205 | 2325 | } |
2206 | 2326 | |
@@ -2211,7 +2331,8 @@ discard block |
||
2211 | 2331 | * |
2212 | 2332 | * @return string |
2213 | 2333 | */ |
2214 | - public function statsDeath($params = array()) { |
|
2334 | + public function statsDeath($params = array()) |
|
2335 | + { |
|
2215 | 2336 | return $this->statsDeathQuery(true, false, -1, -1, $params); |
2216 | 2337 | } |
2217 | 2338 | |
@@ -2223,7 +2344,8 @@ discard block |
||
2223 | 2344 | * |
2224 | 2345 | * @return string |
2225 | 2346 | */ |
2226 | - private function longlifeQuery($type = 'full', $sex = 'F') { |
|
2347 | + private function longlifeQuery($type = 'full', $sex = 'F') |
|
2348 | + { |
|
2227 | 2349 | $sex_search = ' 1=1'; |
2228 | 2350 | if ($sex == 'F') { |
2229 | 2351 | $sex_search = " i_sex='F'"; |
@@ -2287,7 +2409,8 @@ discard block |
||
2287 | 2409 | * |
2288 | 2410 | * @return string |
2289 | 2411 | */ |
2290 | - private function topTenOldestQuery($type = 'list', $sex = 'BOTH', $params = array()) { |
|
2412 | + private function topTenOldestQuery($type = 'list', $sex = 'BOTH', $params = array()) |
|
2413 | + { |
|
2291 | 2414 | if ($sex === 'F') { |
2292 | 2415 | $sex_search = " AND i_sex='F' "; |
2293 | 2416 | } elseif ($sex === 'M') { |
@@ -2370,7 +2493,8 @@ discard block |
||
2370 | 2493 | * |
2371 | 2494 | * @return string |
2372 | 2495 | */ |
2373 | - private function topTenOldestAliveQuery($type = 'list', $sex = 'BOTH', $params = array()) { |
|
2496 | + private function topTenOldestAliveQuery($type = 'list', $sex = 'BOTH', $params = array()) |
|
2497 | + { |
|
2374 | 2498 | if (!Auth::isMember($this->tree)) { |
2375 | 2499 | return I18N::translate('This information is private and cannot be shown.'); |
2376 | 2500 | } |
@@ -2446,7 +2570,8 @@ discard block |
||
2446 | 2570 | * |
2447 | 2571 | * @return string |
2448 | 2572 | */ |
2449 | - private function averageLifespanQuery($sex = 'BOTH', $show_years = false) { |
|
2573 | + private function averageLifespanQuery($sex = 'BOTH', $show_years = false) |
|
2574 | + { |
|
2450 | 2575 | if ($sex === 'F') { |
2451 | 2576 | $sex_search = " AND i_sex='F' "; |
2452 | 2577 | } elseif ($sex === 'M') { |
@@ -2505,7 +2630,8 @@ discard block |
||
2505 | 2630 | * |
2506 | 2631 | * @return array|string |
2507 | 2632 | */ |
2508 | - public function statsAgeQuery($simple = true, $related = 'BIRT', $sex = 'BOTH', $year1 = -1, $year2 = -1, $params = array()) { |
|
2633 | + public function statsAgeQuery($simple = true, $related = 'BIRT', $sex = 'BOTH', $year1 = -1, $year2 = -1, $params = array()) |
|
2634 | + { |
|
2509 | 2635 | if ($simple) { |
2510 | 2636 | if (isset($params[0]) && $params[0] != '') { |
2511 | 2637 | $size = strtolower($params[0]); |
@@ -2646,7 +2772,8 @@ discard block |
||
2646 | 2772 | * |
2647 | 2773 | * @return string |
2648 | 2774 | */ |
2649 | - public function statsAge($params = array()) { |
|
2775 | + public function statsAge($params = array()) |
|
2776 | + { |
|
2650 | 2777 | return $this->statsAgeQuery(true, 'BIRT', 'BOTH', -1, -1, $params); |
2651 | 2778 | } |
2652 | 2779 | |
@@ -2655,7 +2782,8 @@ discard block |
||
2655 | 2782 | * |
2656 | 2783 | * @return string |
2657 | 2784 | */ |
2658 | - public function longestLife() { |
|
2785 | + public function longestLife() |
|
2786 | + { |
|
2659 | 2787 | return $this->longlifeQuery('full', 'BOTH'); |
2660 | 2788 | } |
2661 | 2789 | |
@@ -2664,7 +2792,8 @@ discard block |
||
2664 | 2792 | * |
2665 | 2793 | * @return string |
2666 | 2794 | */ |
2667 | - public function longestLifeAge() { |
|
2795 | + public function longestLifeAge() |
|
2796 | + { |
|
2668 | 2797 | return $this->longlifeQuery('age', 'BOTH'); |
2669 | 2798 | } |
2670 | 2799 | |
@@ -2673,7 +2802,8 @@ discard block |
||
2673 | 2802 | * |
2674 | 2803 | * @return string |
2675 | 2804 | */ |
2676 | - public function longestLifeName() { |
|
2805 | + public function longestLifeName() |
|
2806 | + { |
|
2677 | 2807 | return $this->longlifeQuery('name', 'BOTH'); |
2678 | 2808 | } |
2679 | 2809 | |
@@ -2684,7 +2814,8 @@ discard block |
||
2684 | 2814 | * |
2685 | 2815 | * @return string |
2686 | 2816 | */ |
2687 | - public function topTenOldest($params = array()) { |
|
2817 | + public function topTenOldest($params = array()) |
|
2818 | + { |
|
2688 | 2819 | return $this->topTenOldestQuery('nolist', 'BOTH', $params); |
2689 | 2820 | } |
2690 | 2821 | |
@@ -2695,7 +2826,8 @@ discard block |
||
2695 | 2826 | * |
2696 | 2827 | * @return string |
2697 | 2828 | */ |
2698 | - public function topTenOldestList($params = array()) { |
|
2829 | + public function topTenOldestList($params = array()) |
|
2830 | + { |
|
2699 | 2831 | return $this->topTenOldestQuery('list', 'BOTH', $params); |
2700 | 2832 | } |
2701 | 2833 | |
@@ -2706,7 +2838,8 @@ discard block |
||
2706 | 2838 | * |
2707 | 2839 | * @return string |
2708 | 2840 | */ |
2709 | - public function topTenOldestAlive($params = array()) { |
|
2841 | + public function topTenOldestAlive($params = array()) |
|
2842 | + { |
|
2710 | 2843 | return $this->topTenOldestAliveQuery('nolist', 'BOTH', $params); |
2711 | 2844 | } |
2712 | 2845 | |
@@ -2717,7 +2850,8 @@ discard block |
||
2717 | 2850 | * |
2718 | 2851 | * @return string |
2719 | 2852 | */ |
2720 | - public function topTenOldestListAlive($params = array()) { |
|
2853 | + public function topTenOldestListAlive($params = array()) |
|
2854 | + { |
|
2721 | 2855 | return $this->topTenOldestAliveQuery('list', 'BOTH', $params); |
2722 | 2856 | } |
2723 | 2857 | |
@@ -2728,7 +2862,8 @@ discard block |
||
2728 | 2862 | * |
2729 | 2863 | * @return string |
2730 | 2864 | */ |
2731 | - public function averageLifespan($show_years = false) { |
|
2865 | + public function averageLifespan($show_years = false) |
|
2866 | + { |
|
2732 | 2867 | return $this->averageLifespanQuery('BOTH', $show_years); |
2733 | 2868 | } |
2734 | 2869 | |
@@ -2737,7 +2872,8 @@ discard block |
||
2737 | 2872 | * |
2738 | 2873 | * @return string |
2739 | 2874 | */ |
2740 | - public function longestLifeFemale() { |
|
2875 | + public function longestLifeFemale() |
|
2876 | + { |
|
2741 | 2877 | return $this->longlifeQuery('full', 'F'); |
2742 | 2878 | } |
2743 | 2879 | |
@@ -2746,7 +2882,8 @@ discard block |
||
2746 | 2882 | * |
2747 | 2883 | * @return string |
2748 | 2884 | */ |
2749 | - public function longestLifeFemaleAge() { |
|
2885 | + public function longestLifeFemaleAge() |
|
2886 | + { |
|
2750 | 2887 | return $this->longlifeQuery('age', 'F'); |
2751 | 2888 | } |
2752 | 2889 | |
@@ -2755,7 +2892,8 @@ discard block |
||
2755 | 2892 | * |
2756 | 2893 | * @return string |
2757 | 2894 | */ |
2758 | - public function longestLifeFemaleName() { |
|
2895 | + public function longestLifeFemaleName() |
|
2896 | + { |
|
2759 | 2897 | return $this->longlifeQuery('name', 'F'); |
2760 | 2898 | } |
2761 | 2899 | |
@@ -2766,7 +2904,8 @@ discard block |
||
2766 | 2904 | * |
2767 | 2905 | * @return string |
2768 | 2906 | */ |
2769 | - public function topTenOldestFemale($params = array()) { |
|
2907 | + public function topTenOldestFemale($params = array()) |
|
2908 | + { |
|
2770 | 2909 | return $this->topTenOldestQuery('nolist', 'F', $params); |
2771 | 2910 | } |
2772 | 2911 | |
@@ -2777,7 +2916,8 @@ discard block |
||
2777 | 2916 | * |
2778 | 2917 | * @return string |
2779 | 2918 | */ |
2780 | - public function topTenOldestFemaleList($params = array()) { |
|
2919 | + public function topTenOldestFemaleList($params = array()) |
|
2920 | + { |
|
2781 | 2921 | return $this->topTenOldestQuery('list', 'F', $params); |
2782 | 2922 | } |
2783 | 2923 | |
@@ -2788,7 +2928,8 @@ discard block |
||
2788 | 2928 | * |
2789 | 2929 | * @return string |
2790 | 2930 | */ |
2791 | - public function topTenOldestFemaleAlive($params = array()) { |
|
2931 | + public function topTenOldestFemaleAlive($params = array()) |
|
2932 | + { |
|
2792 | 2933 | return $this->topTenOldestAliveQuery('nolist', 'F', $params); |
2793 | 2934 | } |
2794 | 2935 | |
@@ -2799,7 +2940,8 @@ discard block |
||
2799 | 2940 | * |
2800 | 2941 | * @return string |
2801 | 2942 | */ |
2802 | - public function topTenOldestFemaleListAlive($params = array()) { |
|
2943 | + public function topTenOldestFemaleListAlive($params = array()) |
|
2944 | + { |
|
2803 | 2945 | return $this->topTenOldestAliveQuery('list', 'F', $params); |
2804 | 2946 | } |
2805 | 2947 | |
@@ -2810,7 +2952,8 @@ discard block |
||
2810 | 2952 | * |
2811 | 2953 | * @return string |
2812 | 2954 | */ |
2813 | - public function averageLifespanFemale($show_years = false) { |
|
2955 | + public function averageLifespanFemale($show_years = false) |
|
2956 | + { |
|
2814 | 2957 | return $this->averageLifespanQuery('F', $show_years); |
2815 | 2958 | } |
2816 | 2959 | |
@@ -2819,7 +2962,8 @@ discard block |
||
2819 | 2962 | * |
2820 | 2963 | * @return string |
2821 | 2964 | */ |
2822 | - public function longestLifeMale() { |
|
2965 | + public function longestLifeMale() |
|
2966 | + { |
|
2823 | 2967 | return $this->longlifeQuery('full', 'M'); |
2824 | 2968 | } |
2825 | 2969 | |
@@ -2828,7 +2972,8 @@ discard block |
||
2828 | 2972 | * |
2829 | 2973 | * @return string |
2830 | 2974 | */ |
2831 | - public function longestLifeMaleAge() { |
|
2975 | + public function longestLifeMaleAge() |
|
2976 | + { |
|
2832 | 2977 | return $this->longlifeQuery('age', 'M'); |
2833 | 2978 | } |
2834 | 2979 | |
@@ -2837,7 +2982,8 @@ discard block |
||
2837 | 2982 | * |
2838 | 2983 | * @return string |
2839 | 2984 | */ |
2840 | - public function longestLifeMaleName() { |
|
2985 | + public function longestLifeMaleName() |
|
2986 | + { |
|
2841 | 2987 | return $this->longlifeQuery('name', 'M'); |
2842 | 2988 | } |
2843 | 2989 | |
@@ -2848,7 +2994,8 @@ discard block |
||
2848 | 2994 | * |
2849 | 2995 | * @return string |
2850 | 2996 | */ |
2851 | - public function topTenOldestMale($params = array()) { |
|
2997 | + public function topTenOldestMale($params = array()) |
|
2998 | + { |
|
2852 | 2999 | return $this->topTenOldestQuery('nolist', 'M', $params); |
2853 | 3000 | } |
2854 | 3001 | |
@@ -2859,7 +3006,8 @@ discard block |
||
2859 | 3006 | * |
2860 | 3007 | * @return string |
2861 | 3008 | */ |
2862 | - public function topTenOldestMaleList($params = array()) { |
|
3009 | + public function topTenOldestMaleList($params = array()) |
|
3010 | + { |
|
2863 | 3011 | return $this->topTenOldestQuery('list', 'M', $params); |
2864 | 3012 | } |
2865 | 3013 | |
@@ -2870,7 +3018,8 @@ discard block |
||
2870 | 3018 | * |
2871 | 3019 | * @return string |
2872 | 3020 | */ |
2873 | - public function topTenOldestMaleAlive($params = array()) { |
|
3021 | + public function topTenOldestMaleAlive($params = array()) |
|
3022 | + { |
|
2874 | 3023 | return $this->topTenOldestAliveQuery('nolist', 'M', $params); |
2875 | 3024 | } |
2876 | 3025 | |
@@ -2881,7 +3030,8 @@ discard block |
||
2881 | 3030 | * |
2882 | 3031 | * @return string |
2883 | 3032 | */ |
2884 | - public function topTenOldestMaleListAlive($params = array()) { |
|
3033 | + public function topTenOldestMaleListAlive($params = array()) |
|
3034 | + { |
|
2885 | 3035 | return $this->topTenOldestAliveQuery('list', 'M', $params); |
2886 | 3036 | } |
2887 | 3037 | |
@@ -2892,7 +3042,8 @@ discard block |
||
2892 | 3042 | * |
2893 | 3043 | * @return string |
2894 | 3044 | */ |
2895 | - public function averageLifespanMale($show_years = false) { |
|
3045 | + public function averageLifespanMale($show_years = false) |
|
3046 | + { |
|
2896 | 3047 | return $this->averageLifespanQuery('M', $show_years); |
2897 | 3048 | } |
2898 | 3049 | |
@@ -2905,7 +3056,8 @@ discard block |
||
2905 | 3056 | * |
2906 | 3057 | * @return string |
2907 | 3058 | */ |
2908 | - private function eventQuery($type, $direction, $facts) { |
|
3059 | + private function eventQuery($type, $direction, $facts) |
|
3060 | + { |
|
2909 | 3061 | $eventTypes = array( |
2910 | 3062 | 'BIRT' => I18N::translate('birth'), |
2911 | 3063 | 'DEAT' => I18N::translate('death'), |
@@ -2982,7 +3134,8 @@ discard block |
||
2982 | 3134 | * |
2983 | 3135 | * @return string |
2984 | 3136 | */ |
2985 | - public function firstEvent() { |
|
3137 | + public function firstEvent() |
|
3138 | + { |
|
2986 | 3139 | return $this->eventQuery('full', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
2987 | 3140 | } |
2988 | 3141 | |
@@ -2991,7 +3144,8 @@ discard block |
||
2991 | 3144 | * |
2992 | 3145 | * @return string |
2993 | 3146 | */ |
2994 | - public function firstEventYear() { |
|
3147 | + public function firstEventYear() |
|
3148 | + { |
|
2995 | 3149 | return $this->eventQuery('year', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
2996 | 3150 | } |
2997 | 3151 | |
@@ -3000,7 +3154,8 @@ discard block |
||
3000 | 3154 | * |
3001 | 3155 | * @return string |
3002 | 3156 | */ |
3003 | - public function firstEventType() { |
|
3157 | + public function firstEventType() |
|
3158 | + { |
|
3004 | 3159 | return $this->eventQuery('type', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3005 | 3160 | } |
3006 | 3161 | |
@@ -3009,7 +3164,8 @@ discard block |
||
3009 | 3164 | * |
3010 | 3165 | * @return string |
3011 | 3166 | */ |
3012 | - public function firstEventName() { |
|
3167 | + public function firstEventName() |
|
3168 | + { |
|
3013 | 3169 | return $this->eventQuery('name', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3014 | 3170 | } |
3015 | 3171 | |
@@ -3018,7 +3174,8 @@ discard block |
||
3018 | 3174 | * |
3019 | 3175 | * @return string |
3020 | 3176 | */ |
3021 | - public function firstEventPlace() { |
|
3177 | + public function firstEventPlace() |
|
3178 | + { |
|
3022 | 3179 | return $this->eventQuery('place', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3023 | 3180 | } |
3024 | 3181 | |
@@ -3027,7 +3184,8 @@ discard block |
||
3027 | 3184 | * |
3028 | 3185 | * @return string |
3029 | 3186 | */ |
3030 | - public function lastEvent() { |
|
3187 | + public function lastEvent() |
|
3188 | + { |
|
3031 | 3189 | return $this->eventQuery('full', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3032 | 3190 | } |
3033 | 3191 | |
@@ -3036,7 +3194,8 @@ discard block |
||
3036 | 3194 | * |
3037 | 3195 | * @return string |
3038 | 3196 | */ |
3039 | - public function lastEventYear() { |
|
3197 | + public function lastEventYear() |
|
3198 | + { |
|
3040 | 3199 | return $this->eventQuery('year', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3041 | 3200 | } |
3042 | 3201 | |
@@ -3045,7 +3204,8 @@ discard block |
||
3045 | 3204 | * |
3046 | 3205 | * @return string |
3047 | 3206 | */ |
3048 | - public function lastEventType() { |
|
3207 | + public function lastEventType() |
|
3208 | + { |
|
3049 | 3209 | return $this->eventQuery('type', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3050 | 3210 | } |
3051 | 3211 | |
@@ -3054,7 +3214,8 @@ discard block |
||
3054 | 3214 | * |
3055 | 3215 | * @return string |
3056 | 3216 | */ |
3057 | - public function lastEventName() { |
|
3217 | + public function lastEventName() |
|
3218 | + { |
|
3058 | 3219 | return $this->eventQuery('name', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3059 | 3220 | } |
3060 | 3221 | |
@@ -3063,7 +3224,8 @@ discard block |
||
3063 | 3224 | * |
3064 | 3225 | * @return string |
3065 | 3226 | */ |
3066 | - public function lastEventPlace() { |
|
3227 | + public function lastEventPlace() |
|
3228 | + { |
|
3067 | 3229 | return $this->eventQuery('place', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); |
3068 | 3230 | } |
3069 | 3231 | |
@@ -3077,7 +3239,8 @@ discard block |
||
3077 | 3239 | * |
3078 | 3240 | * @return string |
3079 | 3241 | */ |
3080 | - private function marriageQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false) { |
|
3242 | + private function marriageQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false) |
|
3243 | + { |
|
3081 | 3244 | if ($sex == 'F') { |
3082 | 3245 | $sex_field = 'f_wife'; |
3083 | 3246 | } else { |
@@ -3156,7 +3319,8 @@ discard block |
||
3156 | 3319 | * |
3157 | 3320 | * @return string |
3158 | 3321 | */ |
3159 | - private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = array()) { |
|
3322 | + private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = array()) |
|
3323 | + { |
|
3160 | 3324 | if (isset($params[0])) { |
3161 | 3325 | $total = (int) $params[0]; |
3162 | 3326 | } else { |
@@ -3291,7 +3455,8 @@ discard block |
||
3291 | 3455 | * |
3292 | 3456 | * @return string |
3293 | 3457 | */ |
3294 | - private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = array()) { |
|
3458 | + private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = array()) |
|
3459 | + { |
|
3295 | 3460 | if (isset($params[0])) { |
3296 | 3461 | $total = (int) $params[0]; |
3297 | 3462 | } else { |
@@ -3376,7 +3541,8 @@ discard block |
||
3376 | 3541 | * |
3377 | 3542 | * @return string |
3378 | 3543 | */ |
3379 | - private function parentsQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false) { |
|
3544 | + private function parentsQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false) |
|
3545 | + { |
|
3380 | 3546 | if ($sex == 'F') { |
3381 | 3547 | $sex_field = 'WIFE'; |
3382 | 3548 | } else { |
@@ -3456,7 +3622,8 @@ discard block |
||
3456 | 3622 | * |
3457 | 3623 | * @return string|array |
3458 | 3624 | */ |
3459 | - public function statsMarrQuery($simple = true, $first = false, $year1 = -1, $year2 = -1, $params = array()) { |
|
3625 | + public function statsMarrQuery($simple = true, $first = false, $year1 = -1, $year2 = -1, $params = array()) |
|
3626 | + { |
|
3460 | 3627 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
3461 | 3628 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
3462 | 3629 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -3554,7 +3721,8 @@ discard block |
||
3554 | 3721 | * |
3555 | 3722 | * @return string|array |
3556 | 3723 | */ |
3557 | - private function statsDivQuery($simple = true, $first = false, $year1 = -1, $year2 = -1, $params = array()) { |
|
3724 | + private function statsDivQuery($simple = true, $first = false, $year1 = -1, $year2 = -1, $params = array()) |
|
3725 | + { |
|
3558 | 3726 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
3559 | 3727 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
3560 | 3728 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -3645,7 +3813,8 @@ discard block |
||
3645 | 3813 | * |
3646 | 3814 | * @return string |
3647 | 3815 | */ |
3648 | - public function firstMarriage() { |
|
3816 | + public function firstMarriage() |
|
3817 | + { |
|
3649 | 3818 | return $this->mortalityQuery('full', 'ASC', 'MARR'); |
3650 | 3819 | } |
3651 | 3820 | |
@@ -3654,7 +3823,8 @@ discard block |
||
3654 | 3823 | * |
3655 | 3824 | * @return string |
3656 | 3825 | */ |
3657 | - public function firstMarriageYear() { |
|
3826 | + public function firstMarriageYear() |
|
3827 | + { |
|
3658 | 3828 | return $this->mortalityQuery('year', 'ASC', 'MARR'); |
3659 | 3829 | } |
3660 | 3830 | |
@@ -3663,7 +3833,8 @@ discard block |
||
3663 | 3833 | * |
3664 | 3834 | * @return string |
3665 | 3835 | */ |
3666 | - public function firstMarriageName() { |
|
3836 | + public function firstMarriageName() |
|
3837 | + { |
|
3667 | 3838 | return $this->mortalityQuery('name', 'ASC', 'MARR'); |
3668 | 3839 | } |
3669 | 3840 | |
@@ -3672,7 +3843,8 @@ discard block |
||
3672 | 3843 | * |
3673 | 3844 | * @return string |
3674 | 3845 | */ |
3675 | - public function firstMarriagePlace() { |
|
3846 | + public function firstMarriagePlace() |
|
3847 | + { |
|
3676 | 3848 | return $this->mortalityQuery('place', 'ASC', 'MARR'); |
3677 | 3849 | } |
3678 | 3850 | |
@@ -3681,7 +3853,8 @@ discard block |
||
3681 | 3853 | * |
3682 | 3854 | * @return string |
3683 | 3855 | */ |
3684 | - public function lastMarriage() { |
|
3856 | + public function lastMarriage() |
|
3857 | + { |
|
3685 | 3858 | return $this->mortalityQuery('full', 'DESC', 'MARR'); |
3686 | 3859 | } |
3687 | 3860 | |
@@ -3690,7 +3863,8 @@ discard block |
||
3690 | 3863 | * |
3691 | 3864 | * @return string |
3692 | 3865 | */ |
3693 | - public function lastMarriageYear() { |
|
3866 | + public function lastMarriageYear() |
|
3867 | + { |
|
3694 | 3868 | return $this->mortalityQuery('year', 'DESC', 'MARR'); |
3695 | 3869 | } |
3696 | 3870 | |
@@ -3699,7 +3873,8 @@ discard block |
||
3699 | 3873 | * |
3700 | 3874 | * @return string |
3701 | 3875 | */ |
3702 | - public function lastMarriageName() { |
|
3876 | + public function lastMarriageName() |
|
3877 | + { |
|
3703 | 3878 | return $this->mortalityQuery('name', 'DESC', 'MARR'); |
3704 | 3879 | } |
3705 | 3880 | |
@@ -3708,7 +3883,8 @@ discard block |
||
3708 | 3883 | * |
3709 | 3884 | * @return string |
3710 | 3885 | */ |
3711 | - public function lastMarriagePlace() { |
|
3886 | + public function lastMarriagePlace() |
|
3887 | + { |
|
3712 | 3888 | return $this->mortalityQuery('place', 'DESC', 'MARR'); |
3713 | 3889 | } |
3714 | 3890 | |
@@ -3719,7 +3895,8 @@ discard block |
||
3719 | 3895 | * |
3720 | 3896 | * @return string |
3721 | 3897 | */ |
3722 | - public function statsMarr($params = array()) { |
|
3898 | + public function statsMarr($params = array()) |
|
3899 | + { |
|
3723 | 3900 | return $this->statsMarrQuery(true, false, -1, -1, $params); |
3724 | 3901 | } |
3725 | 3902 | |
@@ -3728,7 +3905,8 @@ discard block |
||
3728 | 3905 | * |
3729 | 3906 | * @return string |
3730 | 3907 | */ |
3731 | - public function firstDivorce() { |
|
3908 | + public function firstDivorce() |
|
3909 | + { |
|
3732 | 3910 | return $this->mortalityQuery('full', 'ASC', 'DIV'); |
3733 | 3911 | } |
3734 | 3912 | |
@@ -3737,7 +3915,8 @@ discard block |
||
3737 | 3915 | * |
3738 | 3916 | * @return string |
3739 | 3917 | */ |
3740 | - public function firstDivorceYear() { |
|
3918 | + public function firstDivorceYear() |
|
3919 | + { |
|
3741 | 3920 | return $this->mortalityQuery('year', 'ASC', 'DIV'); |
3742 | 3921 | } |
3743 | 3922 | |
@@ -3746,7 +3925,8 @@ discard block |
||
3746 | 3925 | * |
3747 | 3926 | * @return string |
3748 | 3927 | */ |
3749 | - public function firstDivorceName() { |
|
3928 | + public function firstDivorceName() |
|
3929 | + { |
|
3750 | 3930 | return $this->mortalityQuery('name', 'ASC', 'DIV'); |
3751 | 3931 | } |
3752 | 3932 | |
@@ -3755,7 +3935,8 @@ discard block |
||
3755 | 3935 | * |
3756 | 3936 | * @return string |
3757 | 3937 | */ |
3758 | - public function firstDivorcePlace() { |
|
3938 | + public function firstDivorcePlace() |
|
3939 | + { |
|
3759 | 3940 | return $this->mortalityQuery('place', 'ASC', 'DIV'); |
3760 | 3941 | } |
3761 | 3942 | |
@@ -3764,7 +3945,8 @@ discard block |
||
3764 | 3945 | * |
3765 | 3946 | * @return string |
3766 | 3947 | */ |
3767 | - public function lastDivorce() { |
|
3948 | + public function lastDivorce() |
|
3949 | + { |
|
3768 | 3950 | return $this->mortalityQuery('full', 'DESC', 'DIV'); |
3769 | 3951 | } |
3770 | 3952 | |
@@ -3773,7 +3955,8 @@ discard block |
||
3773 | 3955 | * |
3774 | 3956 | * @return string |
3775 | 3957 | */ |
3776 | - public function lastDivorceYear() { |
|
3958 | + public function lastDivorceYear() |
|
3959 | + { |
|
3777 | 3960 | return $this->mortalityQuery('year', 'DESC', 'DIV'); |
3778 | 3961 | } |
3779 | 3962 | |
@@ -3782,7 +3965,8 @@ discard block |
||
3782 | 3965 | * |
3783 | 3966 | * @return string |
3784 | 3967 | */ |
3785 | - public function lastDivorceName() { |
|
3968 | + public function lastDivorceName() |
|
3969 | + { |
|
3786 | 3970 | return $this->mortalityQuery('name', 'DESC', 'DIV'); |
3787 | 3971 | } |
3788 | 3972 | |
@@ -3791,7 +3975,8 @@ discard block |
||
3791 | 3975 | * |
3792 | 3976 | * @return string |
3793 | 3977 | */ |
3794 | - public function lastDivorcePlace() { |
|
3978 | + public function lastDivorcePlace() |
|
3979 | + { |
|
3795 | 3980 | return $this->mortalityQuery('place', 'DESC', 'DIV'); |
3796 | 3981 | } |
3797 | 3982 | |
@@ -3802,7 +3987,8 @@ discard block |
||
3802 | 3987 | * |
3803 | 3988 | * @return string |
3804 | 3989 | */ |
3805 | - public function statsDiv($params = array()) { |
|
3990 | + public function statsDiv($params = array()) |
|
3991 | + { |
|
3806 | 3992 | return $this->statsDivQuery(true, false, -1, -1, $params); |
3807 | 3993 | } |
3808 | 3994 | |
@@ -3817,7 +4003,8 @@ discard block |
||
3817 | 4003 | * |
3818 | 4004 | * @return array|string |
3819 | 4005 | */ |
3820 | - public function statsMarrAgeQuery($simple = true, $sex = 'M', $year1 = -1, $year2 = -1, $params = array()) { |
|
4006 | + public function statsMarrAgeQuery($simple = true, $sex = 'M', $year1 = -1, $year2 = -1, $params = array()) |
|
4007 | + { |
|
3821 | 4008 | if ($simple) { |
3822 | 4009 | if (isset($params[0]) && $params[0] != '') { |
3823 | 4010 | $size = strtolower($params[0]); |
@@ -3983,7 +4170,8 @@ discard block |
||
3983 | 4170 | * |
3984 | 4171 | * @return string |
3985 | 4172 | */ |
3986 | - public function youngestMarriageFemale() { |
|
4173 | + public function youngestMarriageFemale() |
|
4174 | + { |
|
3987 | 4175 | return $this->marriageQuery('full', 'ASC', 'F', false); |
3988 | 4176 | } |
3989 | 4177 | |
@@ -3992,7 +4180,8 @@ discard block |
||
3992 | 4180 | * |
3993 | 4181 | * @return string |
3994 | 4182 | */ |
3995 | - public function youngestMarriageFemaleName() { |
|
4183 | + public function youngestMarriageFemaleName() |
|
4184 | + { |
|
3996 | 4185 | return $this->marriageQuery('name', 'ASC', 'F', false); |
3997 | 4186 | } |
3998 | 4187 | |
@@ -4003,7 +4192,8 @@ discard block |
||
4003 | 4192 | * |
4004 | 4193 | * @return string |
4005 | 4194 | */ |
4006 | - public function youngestMarriageFemaleAge($show_years = false) { |
|
4195 | + public function youngestMarriageFemaleAge($show_years = false) |
|
4196 | + { |
|
4007 | 4197 | return $this->marriageQuery('age', 'ASC', 'F', $show_years); |
4008 | 4198 | } |
4009 | 4199 | |
@@ -4012,7 +4202,8 @@ discard block |
||
4012 | 4202 | * |
4013 | 4203 | * @return string |
4014 | 4204 | */ |
4015 | - public function oldestMarriageFemale() { |
|
4205 | + public function oldestMarriageFemale() |
|
4206 | + { |
|
4016 | 4207 | return $this->marriageQuery('full', 'DESC', 'F', false); |
4017 | 4208 | } |
4018 | 4209 | |
@@ -4021,7 +4212,8 @@ discard block |
||
4021 | 4212 | * |
4022 | 4213 | * @return string |
4023 | 4214 | */ |
4024 | - public function oldestMarriageFemaleName() { |
|
4215 | + public function oldestMarriageFemaleName() |
|
4216 | + { |
|
4025 | 4217 | return $this->marriageQuery('name', 'DESC', 'F', false); |
4026 | 4218 | } |
4027 | 4219 | |
@@ -4032,7 +4224,8 @@ discard block |
||
4032 | 4224 | * |
4033 | 4225 | * @return string |
4034 | 4226 | */ |
4035 | - public function oldestMarriageFemaleAge($show_years = false) { |
|
4227 | + public function oldestMarriageFemaleAge($show_years = false) |
|
4228 | + { |
|
4036 | 4229 | return $this->marriageQuery('age', 'DESC', 'F', $show_years); |
4037 | 4230 | } |
4038 | 4231 | |
@@ -4041,7 +4234,8 @@ discard block |
||
4041 | 4234 | * |
4042 | 4235 | * @return string |
4043 | 4236 | */ |
4044 | - public function youngestMarriageMale() { |
|
4237 | + public function youngestMarriageMale() |
|
4238 | + { |
|
4045 | 4239 | return $this->marriageQuery('full', 'ASC', 'M', false); |
4046 | 4240 | } |
4047 | 4241 | |
@@ -4050,7 +4244,8 @@ discard block |
||
4050 | 4244 | * |
4051 | 4245 | * @return string |
4052 | 4246 | */ |
4053 | - public function youngestMarriageMaleName() { |
|
4247 | + public function youngestMarriageMaleName() |
|
4248 | + { |
|
4054 | 4249 | return $this->marriageQuery('name', 'ASC', 'M', false); |
4055 | 4250 | } |
4056 | 4251 | |
@@ -4061,7 +4256,8 @@ discard block |
||
4061 | 4256 | * |
4062 | 4257 | * @return string |
4063 | 4258 | */ |
4064 | - public function youngestMarriageMaleAge($show_years = false) { |
|
4259 | + public function youngestMarriageMaleAge($show_years = false) |
|
4260 | + { |
|
4065 | 4261 | return $this->marriageQuery('age', 'ASC', 'M', $show_years); |
4066 | 4262 | } |
4067 | 4263 | |
@@ -4070,7 +4266,8 @@ discard block |
||
4070 | 4266 | * |
4071 | 4267 | * @return string |
4072 | 4268 | */ |
4073 | - public function oldestMarriageMale() { |
|
4269 | + public function oldestMarriageMale() |
|
4270 | + { |
|
4074 | 4271 | return $this->marriageQuery('full', 'DESC', 'M', false); |
4075 | 4272 | } |
4076 | 4273 | |
@@ -4079,7 +4276,8 @@ discard block |
||
4079 | 4276 | * |
4080 | 4277 | * @return string |
4081 | 4278 | */ |
4082 | - public function oldestMarriageMaleName() { |
|
4279 | + public function oldestMarriageMaleName() |
|
4280 | + { |
|
4083 | 4281 | return $this->marriageQuery('name', 'DESC', 'M', false); |
4084 | 4282 | } |
4085 | 4283 | |
@@ -4090,7 +4288,8 @@ discard block |
||
4090 | 4288 | * |
4091 | 4289 | * @return string |
4092 | 4290 | */ |
4093 | - public function oldestMarriageMaleAge($show_years = false) { |
|
4291 | + public function oldestMarriageMaleAge($show_years = false) |
|
4292 | + { |
|
4094 | 4293 | return $this->marriageQuery('age', 'DESC', 'M', $show_years); |
4095 | 4294 | } |
4096 | 4295 | |
@@ -4101,7 +4300,8 @@ discard block |
||
4101 | 4300 | * |
4102 | 4301 | * @return string |
4103 | 4302 | */ |
4104 | - public function statsMarrAge($params = array()) { |
|
4303 | + public function statsMarrAge($params = array()) |
|
4304 | + { |
|
4105 | 4305 | return $this->statsMarrAgeQuery(true, 'BOTH', -1, -1, $params); |
4106 | 4306 | } |
4107 | 4307 | |
@@ -4112,7 +4312,8 @@ discard block |
||
4112 | 4312 | * |
4113 | 4313 | * @return string |
4114 | 4314 | */ |
4115 | - public function ageBetweenSpousesMF($params = array()) { |
|
4315 | + public function ageBetweenSpousesMF($params = array()) |
|
4316 | + { |
|
4116 | 4317 | return $this->ageBetweenSpousesQuery('nolist', 'DESC', $params); |
4117 | 4318 | } |
4118 | 4319 | |
@@ -4123,7 +4324,8 @@ discard block |
||
4123 | 4324 | * |
4124 | 4325 | * @return string |
4125 | 4326 | */ |
4126 | - public function ageBetweenSpousesMFList($params = array()) { |
|
4327 | + public function ageBetweenSpousesMFList($params = array()) |
|
4328 | + { |
|
4127 | 4329 | return $this->ageBetweenSpousesQuery('list', 'DESC', $params); |
4128 | 4330 | } |
4129 | 4331 | |
@@ -4134,7 +4336,8 @@ discard block |
||
4134 | 4336 | * |
4135 | 4337 | * @return string |
4136 | 4338 | */ |
4137 | - public function ageBetweenSpousesFM($params = array()) { |
|
4339 | + public function ageBetweenSpousesFM($params = array()) |
|
4340 | + { |
|
4138 | 4341 | return $this->ageBetweenSpousesQuery('nolist', 'ASC', $params); |
4139 | 4342 | } |
4140 | 4343 | |
@@ -4145,7 +4348,8 @@ discard block |
||
4145 | 4348 | * |
4146 | 4349 | * @return string |
4147 | 4350 | */ |
4148 | - public function ageBetweenSpousesFMList($params = array()) { |
|
4351 | + public function ageBetweenSpousesFMList($params = array()) |
|
4352 | + { |
|
4149 | 4353 | return $this->ageBetweenSpousesQuery('list', 'ASC', $params); |
4150 | 4354 | } |
4151 | 4355 | |
@@ -4154,7 +4358,8 @@ discard block |
||
4154 | 4358 | * |
4155 | 4359 | * @return string |
4156 | 4360 | */ |
4157 | - public function topAgeOfMarriageFamily() { |
|
4361 | + public function topAgeOfMarriageFamily() |
|
4362 | + { |
|
4158 | 4363 | return $this->ageOfMarriageQuery('name', 'DESC', array('1')); |
4159 | 4364 | } |
4160 | 4365 | |
@@ -4163,7 +4368,8 @@ discard block |
||
4163 | 4368 | * |
4164 | 4369 | * @return string |
4165 | 4370 | */ |
4166 | - public function topAgeOfMarriage() { |
|
4371 | + public function topAgeOfMarriage() |
|
4372 | + { |
|
4167 | 4373 | return $this->ageOfMarriageQuery('age', 'DESC', array('1')); |
4168 | 4374 | } |
4169 | 4375 | |
@@ -4174,7 +4380,8 @@ discard block |
||
4174 | 4380 | * |
4175 | 4381 | * @return string |
4176 | 4382 | */ |
4177 | - public function topAgeOfMarriageFamilies($params = array()) { |
|
4383 | + public function topAgeOfMarriageFamilies($params = array()) |
|
4384 | + { |
|
4178 | 4385 | return $this->ageOfMarriageQuery('nolist', 'DESC', $params); |
4179 | 4386 | } |
4180 | 4387 | |
@@ -4185,7 +4392,8 @@ discard block |
||
4185 | 4392 | * |
4186 | 4393 | * @return string |
4187 | 4394 | */ |
4188 | - public function topAgeOfMarriageFamiliesList($params = array()) { |
|
4395 | + public function topAgeOfMarriageFamiliesList($params = array()) |
|
4396 | + { |
|
4189 | 4397 | return $this->ageOfMarriageQuery('list', 'DESC', $params); |
4190 | 4398 | } |
4191 | 4399 | |
@@ -4194,7 +4402,8 @@ discard block |
||
4194 | 4402 | * |
4195 | 4403 | * @return string |
4196 | 4404 | */ |
4197 | - public function minAgeOfMarriageFamily() { |
|
4405 | + public function minAgeOfMarriageFamily() |
|
4406 | + { |
|
4198 | 4407 | return $this->ageOfMarriageQuery('name', 'ASC', array('1')); |
4199 | 4408 | } |
4200 | 4409 | |
@@ -4203,7 +4412,8 @@ discard block |
||
4203 | 4412 | * |
4204 | 4413 | * @return string |
4205 | 4414 | */ |
4206 | - public function minAgeOfMarriage() { |
|
4415 | + public function minAgeOfMarriage() |
|
4416 | + { |
|
4207 | 4417 | return $this->ageOfMarriageQuery('age', 'ASC', array('1')); |
4208 | 4418 | } |
4209 | 4419 | |
@@ -4214,7 +4424,8 @@ discard block |
||
4214 | 4424 | * |
4215 | 4425 | * @return string |
4216 | 4426 | */ |
4217 | - public function minAgeOfMarriageFamilies($params = array()) { |
|
4427 | + public function minAgeOfMarriageFamilies($params = array()) |
|
4428 | + { |
|
4218 | 4429 | return $this->ageOfMarriageQuery('nolist', 'ASC', $params); |
4219 | 4430 | } |
4220 | 4431 | |
@@ -4225,7 +4436,8 @@ discard block |
||
4225 | 4436 | * |
4226 | 4437 | * @return string |
4227 | 4438 | */ |
4228 | - public function minAgeOfMarriageFamiliesList($params = array()) { |
|
4439 | + public function minAgeOfMarriageFamiliesList($params = array()) |
|
4440 | + { |
|
4229 | 4441 | return $this->ageOfMarriageQuery('list', 'ASC', $params); |
4230 | 4442 | } |
4231 | 4443 | |
@@ -4234,7 +4446,8 @@ discard block |
||
4234 | 4446 | * |
4235 | 4447 | * @return string |
4236 | 4448 | */ |
4237 | - public function youngestMother() { |
|
4449 | + public function youngestMother() |
|
4450 | + { |
|
4238 | 4451 | return $this->parentsQuery('full', 'ASC', 'F'); |
4239 | 4452 | } |
4240 | 4453 | |
@@ -4243,7 +4456,8 @@ discard block |
||
4243 | 4456 | * |
4244 | 4457 | * @return string |
4245 | 4458 | */ |
4246 | - public function youngestMotherName() { |
|
4459 | + public function youngestMotherName() |
|
4460 | + { |
|
4247 | 4461 | return $this->parentsQuery('name', 'ASC', 'F'); |
4248 | 4462 | } |
4249 | 4463 | |
@@ -4254,7 +4468,8 @@ discard block |
||
4254 | 4468 | * |
4255 | 4469 | * @return string |
4256 | 4470 | */ |
4257 | - public function youngestMotherAge($show_years = false) { |
|
4471 | + public function youngestMotherAge($show_years = false) |
|
4472 | + { |
|
4258 | 4473 | return $this->parentsQuery('age', 'ASC', 'F', $show_years); |
4259 | 4474 | } |
4260 | 4475 | |
@@ -4263,7 +4478,8 @@ discard block |
||
4263 | 4478 | * |
4264 | 4479 | * @return string |
4265 | 4480 | */ |
4266 | - public function oldestMother() { |
|
4481 | + public function oldestMother() |
|
4482 | + { |
|
4267 | 4483 | return $this->parentsQuery('full', 'DESC', 'F'); |
4268 | 4484 | } |
4269 | 4485 | |
@@ -4272,7 +4488,8 @@ discard block |
||
4272 | 4488 | * |
4273 | 4489 | * @return string |
4274 | 4490 | */ |
4275 | - public function oldestMotherName() { |
|
4491 | + public function oldestMotherName() |
|
4492 | + { |
|
4276 | 4493 | return $this->parentsQuery('name', 'DESC', 'F'); |
4277 | 4494 | } |
4278 | 4495 | |
@@ -4283,7 +4500,8 @@ discard block |
||
4283 | 4500 | * |
4284 | 4501 | * @return string |
4285 | 4502 | */ |
4286 | - public function oldestMotherAge($show_years = false) { |
|
4503 | + public function oldestMotherAge($show_years = false) |
|
4504 | + { |
|
4287 | 4505 | return $this->parentsQuery('age', 'DESC', 'F', $show_years); |
4288 | 4506 | } |
4289 | 4507 | |
@@ -4292,7 +4510,8 @@ discard block |
||
4292 | 4510 | * |
4293 | 4511 | * @return string |
4294 | 4512 | */ |
4295 | - public function youngestFather() { |
|
4513 | + public function youngestFather() |
|
4514 | + { |
|
4296 | 4515 | return $this->parentsQuery('full', 'ASC', 'M'); |
4297 | 4516 | } |
4298 | 4517 | |
@@ -4301,7 +4520,8 @@ discard block |
||
4301 | 4520 | * |
4302 | 4521 | * @return string |
4303 | 4522 | */ |
4304 | - public function youngestFatherName() { |
|
4523 | + public function youngestFatherName() |
|
4524 | + { |
|
4305 | 4525 | return $this->parentsQuery('name', 'ASC', 'M'); |
4306 | 4526 | } |
4307 | 4527 | |
@@ -4312,7 +4532,8 @@ discard block |
||
4312 | 4532 | * |
4313 | 4533 | * @return string |
4314 | 4534 | */ |
4315 | - public function youngestFatherAge($show_years = false) { |
|
4535 | + public function youngestFatherAge($show_years = false) |
|
4536 | + { |
|
4316 | 4537 | return $this->parentsQuery('age', 'ASC', 'M', $show_years); |
4317 | 4538 | } |
4318 | 4539 | |
@@ -4321,7 +4542,8 @@ discard block |
||
4321 | 4542 | * |
4322 | 4543 | * @return string |
4323 | 4544 | */ |
4324 | - public function oldestFather() { |
|
4545 | + public function oldestFather() |
|
4546 | + { |
|
4325 | 4547 | return $this->parentsQuery('full', 'DESC', 'M'); |
4326 | 4548 | } |
4327 | 4549 | |
@@ -4330,7 +4552,8 @@ discard block |
||
4330 | 4552 | * |
4331 | 4553 | * @return string |
4332 | 4554 | */ |
4333 | - public function oldestFatherName() { |
|
4555 | + public function oldestFatherName() |
|
4556 | + { |
|
4334 | 4557 | return $this->parentsQuery('name', 'DESC', 'M'); |
4335 | 4558 | } |
4336 | 4559 | |
@@ -4341,7 +4564,8 @@ discard block |
||
4341 | 4564 | * |
4342 | 4565 | * @return string |
4343 | 4566 | */ |
4344 | - public function oldestFatherAge($show_years = false) { |
|
4567 | + public function oldestFatherAge($show_years = false) |
|
4568 | + { |
|
4345 | 4569 | return $this->parentsQuery('age', 'DESC', 'M', $show_years); |
4346 | 4570 | } |
4347 | 4571 | |
@@ -4350,7 +4574,8 @@ discard block |
||
4350 | 4574 | * |
4351 | 4575 | * @return string |
4352 | 4576 | */ |
4353 | - public function totalMarriedMales() { |
|
4577 | + public function totalMarriedMales() |
|
4578 | + { |
|
4354 | 4579 | $n = Database::prepare("SELECT COUNT(DISTINCT f_husb) FROM `##families` WHERE f_file=? AND f_gedcom LIKE '%\\n1 MARR%'") |
4355 | 4580 | ->execute(array($this->tree->getTreeId())) |
4356 | 4581 | ->fetchOne(); |
@@ -4363,7 +4588,8 @@ discard block |
||
4363 | 4588 | * |
4364 | 4589 | * @return string |
4365 | 4590 | */ |
4366 | - public function totalMarriedFemales() { |
|
4591 | + public function totalMarriedFemales() |
|
4592 | + { |
|
4367 | 4593 | $n = Database::prepare("SELECT COUNT(DISTINCT f_wife) FROM `##families` WHERE f_file=? AND f_gedcom LIKE '%\\n1 MARR%'") |
4368 | 4594 | ->execute(array($this->tree->getTreeId())) |
4369 | 4595 | ->fetchOne(); |
@@ -4378,7 +4604,8 @@ discard block |
||
4378 | 4604 | * |
4379 | 4605 | * @return string |
4380 | 4606 | */ |
4381 | - private function familyQuery($type = 'full') { |
|
4607 | + private function familyQuery($type = 'full') |
|
4608 | + { |
|
4382 | 4609 | $rows = $this->runSql( |
4383 | 4610 | " SELECT f_numchil AS tot, f_id AS id" . |
4384 | 4611 | " FROM `##families`" . |
@@ -4424,7 +4651,8 @@ discard block |
||
4424 | 4651 | * |
4425 | 4652 | * @return string |
4426 | 4653 | */ |
4427 | - private function topTenFamilyQuery($type = 'list', $params = array()) { |
|
4654 | + private function topTenFamilyQuery($type = 'list', $params = array()) |
|
4655 | + { |
|
4428 | 4656 | if (isset($params[0])) { |
4429 | 4657 | $total = (int) $params[0]; |
4430 | 4658 | } else { |
@@ -4482,7 +4710,8 @@ discard block |
||
4482 | 4710 | * |
4483 | 4711 | * @return string |
4484 | 4712 | */ |
4485 | - private function ageBetweenSiblingsQuery($type = 'list', $params = array()) { |
|
4713 | + private function ageBetweenSiblingsQuery($type = 'list', $params = array()) |
|
4714 | + { |
|
4486 | 4715 | if (isset($params[0])) { |
4487 | 4716 | $total = (int) $params[0]; |
4488 | 4717 | } else { |
@@ -4611,7 +4840,8 @@ discard block |
||
4611 | 4840 | * |
4612 | 4841 | * @return string|string[][] |
4613 | 4842 | */ |
4614 | - public function monthFirstChildQuery($simple = true, $sex = false, $year1 = -1, $year2 = -1, $params = array()) { |
|
4843 | + public function monthFirstChildQuery($simple = true, $sex = false, $year1 = -1, $year2 = -1, $params = array()) |
|
4844 | + { |
|
4615 | 4845 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
4616 | 4846 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
4617 | 4847 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -4743,7 +4973,8 @@ discard block |
||
4743 | 4973 | * |
4744 | 4974 | * @return string |
4745 | 4975 | */ |
4746 | - public function largestFamily() { |
|
4976 | + public function largestFamily() |
|
4977 | + { |
|
4747 | 4978 | return $this->familyQuery('full'); |
4748 | 4979 | } |
4749 | 4980 | |
@@ -4752,7 +4983,8 @@ discard block |
||
4752 | 4983 | * |
4753 | 4984 | * @return string |
4754 | 4985 | */ |
4755 | - public function largestFamilySize() { |
|
4986 | + public function largestFamilySize() |
|
4987 | + { |
|
4756 | 4988 | return $this->familyQuery('size'); |
4757 | 4989 | } |
4758 | 4990 | |
@@ -4761,7 +4993,8 @@ discard block |
||
4761 | 4993 | * |
4762 | 4994 | * @return string |
4763 | 4995 | */ |
4764 | - public function largestFamilyName() { |
|
4996 | + public function largestFamilyName() |
|
4997 | + { |
|
4765 | 4998 | return $this->familyQuery('name'); |
4766 | 4999 | } |
4767 | 5000 | |
@@ -4772,7 +5005,8 @@ discard block |
||
4772 | 5005 | * |
4773 | 5006 | * @return string |
4774 | 5007 | */ |
4775 | - public function topTenLargestFamily($params = array()) { |
|
5008 | + public function topTenLargestFamily($params = array()) |
|
5009 | + { |
|
4776 | 5010 | return $this->topTenFamilyQuery('nolist', $params); |
4777 | 5011 | } |
4778 | 5012 | |
@@ -4783,7 +5017,8 @@ discard block |
||
4783 | 5017 | * |
4784 | 5018 | * @return string |
4785 | 5019 | */ |
4786 | - public function topTenLargestFamilyList($params = array()) { |
|
5020 | + public function topTenLargestFamilyList($params = array()) |
|
5021 | + { |
|
4787 | 5022 | return $this->topTenFamilyQuery('list', $params); |
4788 | 5023 | } |
4789 | 5024 | |
@@ -4794,7 +5029,8 @@ discard block |
||
4794 | 5029 | * |
4795 | 5030 | * @return string |
4796 | 5031 | */ |
4797 | - public function chartLargestFamilies($params = array()) { |
|
5032 | + public function chartLargestFamilies($params = array()) |
|
5033 | + { |
|
4798 | 5034 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
4799 | 5035 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
4800 | 5036 | $WT_STATS_L_CHART_X = Theme::theme()->parameter('stats-large-chart-x'); |
@@ -4860,7 +5096,8 @@ discard block |
||
4860 | 5096 | * |
4861 | 5097 | * @return string |
4862 | 5098 | */ |
4863 | - public function totalChildren() { |
|
5099 | + public function totalChildren() |
|
5100 | + { |
|
4864 | 5101 | $rows = $this->runSql("SELECT SUM(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->getTreeId()}"); |
4865 | 5102 | |
4866 | 5103 | return I18N::number($rows[0]['tot']); |
@@ -4871,7 +5108,8 @@ discard block |
||
4871 | 5108 | * |
4872 | 5109 | * @return string |
4873 | 5110 | */ |
4874 | - public function averageChildren() { |
|
5111 | + public function averageChildren() |
|
5112 | + { |
|
4875 | 5113 | $rows = $this->runSql("SELECT AVG(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->getTreeId()}"); |
4876 | 5114 | |
4877 | 5115 | return I18N::number($rows[0]['tot'], 2); |
@@ -4888,7 +5126,8 @@ discard block |
||
4888 | 5126 | * |
4889 | 5127 | * @return string|string[][] |
4890 | 5128 | */ |
4891 | - public function statsChildrenQuery($simple = true, $sex = 'BOTH', $year1 = -1, $year2 = -1, $params = array()) { |
|
5129 | + public function statsChildrenQuery($simple = true, $sex = 'BOTH', $year1 = -1, $year2 = -1, $params = array()) |
|
5130 | + { |
|
4892 | 5131 | if ($simple) { |
4893 | 5132 | if (isset($params[0]) && $params[0] != '') { |
4894 | 5133 | $size = strtolower($params[0]); |
@@ -4994,7 +5233,8 @@ discard block |
||
4994 | 5233 | * |
4995 | 5234 | * @return string |
4996 | 5235 | */ |
4997 | - public function statsChildren($params = array()) { |
|
5236 | + public function statsChildren($params = array()) |
|
5237 | + { |
|
4998 | 5238 | return $this->statsChildrenQuery(true, 'BOTH', -1, -1, $params); |
4999 | 5239 | } |
5000 | 5240 | |
@@ -5005,7 +5245,8 @@ discard block |
||
5005 | 5245 | * |
5006 | 5246 | * @return string |
5007 | 5247 | */ |
5008 | - public function topAgeBetweenSiblingsName($params = array()) { |
|
5248 | + public function topAgeBetweenSiblingsName($params = array()) |
|
5249 | + { |
|
5009 | 5250 | return $this->ageBetweenSiblingsQuery('name', $params); |
5010 | 5251 | } |
5011 | 5252 | |
@@ -5016,7 +5257,8 @@ discard block |
||
5016 | 5257 | * |
5017 | 5258 | * @return string |
5018 | 5259 | */ |
5019 | - public function topAgeBetweenSiblings($params = array()) { |
|
5260 | + public function topAgeBetweenSiblings($params = array()) |
|
5261 | + { |
|
5020 | 5262 | return $this->ageBetweenSiblingsQuery('age', $params); |
5021 | 5263 | } |
5022 | 5264 | |
@@ -5027,7 +5269,8 @@ discard block |
||
5027 | 5269 | * |
5028 | 5270 | * @return string |
5029 | 5271 | */ |
5030 | - public function topAgeBetweenSiblingsFullName($params = array()) { |
|
5272 | + public function topAgeBetweenSiblingsFullName($params = array()) |
|
5273 | + { |
|
5031 | 5274 | return $this->ageBetweenSiblingsQuery('nolist', $params); |
5032 | 5275 | } |
5033 | 5276 | |
@@ -5038,7 +5281,8 @@ discard block |
||
5038 | 5281 | * |
5039 | 5282 | * @return string |
5040 | 5283 | */ |
5041 | - public function topAgeBetweenSiblingsList($params = array()) { |
|
5284 | + public function topAgeBetweenSiblingsList($params = array()) |
|
5285 | + { |
|
5042 | 5286 | return $this->ageBetweenSiblingsQuery('list', $params); |
5043 | 5287 | } |
5044 | 5288 | |
@@ -5047,7 +5291,8 @@ discard block |
||
5047 | 5291 | * |
5048 | 5292 | * @return string |
5049 | 5293 | */ |
5050 | - private function noChildrenFamiliesQuery() { |
|
5294 | + private function noChildrenFamiliesQuery() |
|
5295 | + { |
|
5051 | 5296 | $rows = $this->runSql( |
5052 | 5297 | " SELECT COUNT(*) AS tot" . |
5053 | 5298 | " FROM `##families`" . |
@@ -5061,7 +5306,8 @@ discard block |
||
5061 | 5306 | * |
5062 | 5307 | * @return string |
5063 | 5308 | */ |
5064 | - public function noChildrenFamilies() { |
|
5309 | + public function noChildrenFamilies() |
|
5310 | + { |
|
5065 | 5311 | return I18N::number($this->noChildrenFamiliesQuery()); |
5066 | 5312 | } |
5067 | 5313 | |
@@ -5072,7 +5318,8 @@ discard block |
||
5072 | 5318 | * |
5073 | 5319 | * @return string |
5074 | 5320 | */ |
5075 | - public function noChildrenFamiliesList($params = array()) { |
|
5321 | + public function noChildrenFamiliesList($params = array()) |
|
5322 | + { |
|
5076 | 5323 | if (isset($params[0]) && $params[0] != '') { |
5077 | 5324 | $type = strtolower($params[0]); |
5078 | 5325 | } else { |
@@ -5118,7 +5365,8 @@ discard block |
||
5118 | 5365 | * |
5119 | 5366 | * @return string |
5120 | 5367 | */ |
5121 | - public function chartNoChildrenFamilies($params = array()) { |
|
5368 | + public function chartNoChildrenFamilies($params = array()) |
|
5369 | + { |
|
5122 | 5370 | if (isset($params[0]) && $params[0] != '') { |
5123 | 5371 | $size = strtolower($params[0]); |
5124 | 5372 | } else { |
@@ -5217,7 +5465,8 @@ discard block |
||
5217 | 5465 | * |
5218 | 5466 | * @return string |
5219 | 5467 | */ |
5220 | - private function topTenGrandFamilyQuery($type = 'list', $params = array()) { |
|
5468 | + private function topTenGrandFamilyQuery($type = 'list', $params = array()) |
|
5469 | + { |
|
5221 | 5470 | if (isset($params[0])) { |
5222 | 5471 | $total = (int) $params[0]; |
5223 | 5472 | } else { |
@@ -5281,7 +5530,8 @@ discard block |
||
5281 | 5530 | * |
5282 | 5531 | * @return string |
5283 | 5532 | */ |
5284 | - public function topTenLargestGrandFamily($params = array()) { |
|
5533 | + public function topTenLargestGrandFamily($params = array()) |
|
5534 | + { |
|
5285 | 5535 | return $this->topTenGrandFamilyQuery('nolist', $params); |
5286 | 5536 | } |
5287 | 5537 | |
@@ -5292,7 +5542,8 @@ discard block |
||
5292 | 5542 | * |
5293 | 5543 | * @return string |
5294 | 5544 | */ |
5295 | - public function topTenLargestGrandFamilyList($params = array()) { |
|
5545 | + public function topTenLargestGrandFamilyList($params = array()) |
|
5546 | + { |
|
5296 | 5547 | return $this->topTenGrandFamilyQuery('list', $params); |
5297 | 5548 | } |
5298 | 5549 | |
@@ -5305,7 +5556,8 @@ discard block |
||
5305 | 5556 | * |
5306 | 5557 | * @return string |
5307 | 5558 | */ |
5308 | - private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = array()) { |
|
5559 | + private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = array()) |
|
5560 | + { |
|
5309 | 5561 | $threshold = empty($params[0]) ? 10 : (int) $params[0]; |
5310 | 5562 | $number_of_surnames = empty($params[1]) ? 10 : (int) $params[1]; |
5311 | 5563 | $sorting = empty($params[2]) ? 'alpha' : $params[2]; |
@@ -5342,7 +5594,8 @@ discard block |
||
5342 | 5594 | * |
5343 | 5595 | * @return string |
5344 | 5596 | */ |
5345 | - public function getCommonSurname() { |
|
5597 | + public function getCommonSurname() |
|
5598 | + { |
|
5346 | 5599 | $surnames = array_keys(FunctionsDb::getTopSurnames($this->tree->getTreeId(), 1, 1)); |
5347 | 5600 | |
5348 | 5601 | return array_shift($surnames); |
@@ -5355,7 +5608,8 @@ discard block |
||
5355 | 5608 | * |
5356 | 5609 | * @return string |
5357 | 5610 | */ |
5358 | - public function commonSurnames($params = array('', '', 'alpha')) { |
|
5611 | + public function commonSurnames($params = array('', '', 'alpha')) |
|
5612 | + { |
|
5359 | 5613 | return $this->commonSurnamesQuery('nolist', false, $params); |
5360 | 5614 | } |
5361 | 5615 | |
@@ -5366,7 +5620,8 @@ discard block |
||
5366 | 5620 | * |
5367 | 5621 | * @return string |
5368 | 5622 | */ |
5369 | - public function commonSurnamesTotals($params = array('', '', 'rcount')) { |
|
5623 | + public function commonSurnamesTotals($params = array('', '', 'rcount')) |
|
5624 | + { |
|
5370 | 5625 | return $this->commonSurnamesQuery('nolist', true, $params); |
5371 | 5626 | } |
5372 | 5627 | |
@@ -5377,7 +5632,8 @@ discard block |
||
5377 | 5632 | * |
5378 | 5633 | * @return string |
5379 | 5634 | */ |
5380 | - public function commonSurnamesList($params = array('', '', 'alpha')) { |
|
5635 | + public function commonSurnamesList($params = array('', '', 'alpha')) |
|
5636 | + { |
|
5381 | 5637 | return $this->commonSurnamesQuery('list', false, $params); |
5382 | 5638 | } |
5383 | 5639 | |
@@ -5388,7 +5644,8 @@ discard block |
||
5388 | 5644 | * |
5389 | 5645 | * @return string |
5390 | 5646 | */ |
5391 | - public function commonSurnamesListTotals($params = array('', '', 'rcount')) { |
|
5647 | + public function commonSurnamesListTotals($params = array('', '', 'rcount')) |
|
5648 | + { |
|
5392 | 5649 | return $this->commonSurnamesQuery('list', true, $params); |
5393 | 5650 | } |
5394 | 5651 | |
@@ -5399,7 +5656,8 @@ discard block |
||
5399 | 5656 | * |
5400 | 5657 | * @return string |
5401 | 5658 | */ |
5402 | - public function chartCommonSurnames($params = array()) { |
|
5659 | + public function chartCommonSurnames($params = array()) |
|
5660 | + { |
|
5403 | 5661 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
5404 | 5662 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
5405 | 5663 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -5468,7 +5726,8 @@ discard block |
||
5468 | 5726 | * |
5469 | 5727 | * @return string |
5470 | 5728 | */ |
5471 | - private function commonGivenQuery($sex = 'B', $type = 'list', $show_tot = false, $params = array()) { |
|
5729 | + private function commonGivenQuery($sex = 'B', $type = 'list', $show_tot = false, $params = array()) |
|
5730 | + { |
|
5472 | 5731 | if (isset($params[0]) && $params[0] != '' && $params[0] >= 0) { |
5473 | 5732 | $threshold = (int) $params[0]; |
5474 | 5733 | } else { |
@@ -5596,7 +5855,8 @@ discard block |
||
5596 | 5855 | * |
5597 | 5856 | * @return string |
5598 | 5857 | */ |
5599 | - public function commonGiven($params = array(1, 10, 'alpha')) { |
|
5858 | + public function commonGiven($params = array(1, 10, 'alpha')) |
|
5859 | + { |
|
5600 | 5860 | return $this->commonGivenQuery('B', 'nolist', false, $params); |
5601 | 5861 | } |
5602 | 5862 | |
@@ -5607,7 +5867,8 @@ discard block |
||
5607 | 5867 | * |
5608 | 5868 | * @return string |
5609 | 5869 | */ |
5610 | - public function commonGivenTotals($params = array(1, 10, 'rcount')) { |
|
5870 | + public function commonGivenTotals($params = array(1, 10, 'rcount')) |
|
5871 | + { |
|
5611 | 5872 | return $this->commonGivenQuery('B', 'nolist', true, $params); |
5612 | 5873 | } |
5613 | 5874 | |
@@ -5618,7 +5879,8 @@ discard block |
||
5618 | 5879 | * |
5619 | 5880 | * @return string |
5620 | 5881 | */ |
5621 | - public function commonGivenList($params = array(1, 10, 'alpha')) { |
|
5882 | + public function commonGivenList($params = array(1, 10, 'alpha')) |
|
5883 | + { |
|
5622 | 5884 | return $this->commonGivenQuery('B', 'list', false, $params); |
5623 | 5885 | } |
5624 | 5886 | |
@@ -5629,7 +5891,8 @@ discard block |
||
5629 | 5891 | * |
5630 | 5892 | * @return string |
5631 | 5893 | */ |
5632 | - public function commonGivenListTotals($params = array(1, 10, 'rcount')) { |
|
5894 | + public function commonGivenListTotals($params = array(1, 10, 'rcount')) |
|
5895 | + { |
|
5633 | 5896 | return $this->commonGivenQuery('B', 'list', true, $params); |
5634 | 5897 | } |
5635 | 5898 | |
@@ -5640,7 +5903,8 @@ discard block |
||
5640 | 5903 | * |
5641 | 5904 | * @return string |
5642 | 5905 | */ |
5643 | - public function commonGivenTable($params = array(1, 10, 'rcount')) { |
|
5906 | + public function commonGivenTable($params = array(1, 10, 'rcount')) |
|
5907 | + { |
|
5644 | 5908 | return $this->commonGivenQuery('B', 'table', false, $params); |
5645 | 5909 | } |
5646 | 5910 | |
@@ -5651,7 +5915,8 @@ discard block |
||
5651 | 5915 | * |
5652 | 5916 | * @return string |
5653 | 5917 | */ |
5654 | - public function commonGivenFemale($params = array(1, 10, 'alpha')) { |
|
5918 | + public function commonGivenFemale($params = array(1, 10, 'alpha')) |
|
5919 | + { |
|
5655 | 5920 | return $this->commonGivenQuery('F', 'nolist', false, $params); |
5656 | 5921 | } |
5657 | 5922 | |
@@ -5662,7 +5927,8 @@ discard block |
||
5662 | 5927 | * |
5663 | 5928 | * @return string |
5664 | 5929 | */ |
5665 | - public function commonGivenFemaleTotals($params = array(1, 10, 'rcount')) { |
|
5930 | + public function commonGivenFemaleTotals($params = array(1, 10, 'rcount')) |
|
5931 | + { |
|
5666 | 5932 | return $this->commonGivenQuery('F', 'nolist', true, $params); |
5667 | 5933 | } |
5668 | 5934 | |
@@ -5673,7 +5939,8 @@ discard block |
||
5673 | 5939 | * |
5674 | 5940 | * @return string |
5675 | 5941 | */ |
5676 | - public function commonGivenFemaleList($params = array(1, 10, 'alpha')) { |
|
5942 | + public function commonGivenFemaleList($params = array(1, 10, 'alpha')) |
|
5943 | + { |
|
5677 | 5944 | return $this->commonGivenQuery('F', 'list', false, $params); |
5678 | 5945 | } |
5679 | 5946 | |
@@ -5684,7 +5951,8 @@ discard block |
||
5684 | 5951 | * |
5685 | 5952 | * @return string |
5686 | 5953 | */ |
5687 | - public function commonGivenFemaleListTotals($params = array(1, 10, 'rcount')) { |
|
5954 | + public function commonGivenFemaleListTotals($params = array(1, 10, 'rcount')) |
|
5955 | + { |
|
5688 | 5956 | return $this->commonGivenQuery('F', 'list', true, $params); |
5689 | 5957 | } |
5690 | 5958 | |
@@ -5695,7 +5963,8 @@ discard block |
||
5695 | 5963 | * |
5696 | 5964 | * @return string |
5697 | 5965 | */ |
5698 | - public function commonGivenFemaleTable($params = array(1, 10, 'rcount')) { |
|
5966 | + public function commonGivenFemaleTable($params = array(1, 10, 'rcount')) |
|
5967 | + { |
|
5699 | 5968 | return $this->commonGivenQuery('F', 'table', false, $params); |
5700 | 5969 | } |
5701 | 5970 | |
@@ -5706,7 +5975,8 @@ discard block |
||
5706 | 5975 | * |
5707 | 5976 | * @return string |
5708 | 5977 | */ |
5709 | - public function commonGivenMale($params = array(1, 10, 'alpha')) { |
|
5978 | + public function commonGivenMale($params = array(1, 10, 'alpha')) |
|
5979 | + { |
|
5710 | 5980 | return $this->commonGivenQuery('M', 'nolist', false, $params); |
5711 | 5981 | } |
5712 | 5982 | |
@@ -5717,7 +5987,8 @@ discard block |
||
5717 | 5987 | * |
5718 | 5988 | * @return string |
5719 | 5989 | */ |
5720 | - public function commonGivenMaleTotals($params = array(1, 10, 'rcount')) { |
|
5990 | + public function commonGivenMaleTotals($params = array(1, 10, 'rcount')) |
|
5991 | + { |
|
5721 | 5992 | return $this->commonGivenQuery('M', 'nolist', true, $params); |
5722 | 5993 | } |
5723 | 5994 | |
@@ -5728,7 +5999,8 @@ discard block |
||
5728 | 5999 | * |
5729 | 6000 | * @return string |
5730 | 6001 | */ |
5731 | - public function commonGivenMaleList($params = array(1, 10, 'alpha')) { |
|
6002 | + public function commonGivenMaleList($params = array(1, 10, 'alpha')) |
|
6003 | + { |
|
5732 | 6004 | return $this->commonGivenQuery('M', 'list', false, $params); |
5733 | 6005 | } |
5734 | 6006 | |
@@ -5739,7 +6011,8 @@ discard block |
||
5739 | 6011 | * |
5740 | 6012 | * @return string |
5741 | 6013 | */ |
5742 | - public function commonGivenMaleListTotals($params = array(1, 10, 'rcount')) { |
|
6014 | + public function commonGivenMaleListTotals($params = array(1, 10, 'rcount')) |
|
6015 | + { |
|
5743 | 6016 | return $this->commonGivenQuery('M', 'list', true, $params); |
5744 | 6017 | } |
5745 | 6018 | |
@@ -5750,7 +6023,8 @@ discard block |
||
5750 | 6023 | * |
5751 | 6024 | * @return string |
5752 | 6025 | */ |
5753 | - public function commonGivenMaleTable($params = array(1, 10, 'rcount')) { |
|
6026 | + public function commonGivenMaleTable($params = array(1, 10, 'rcount')) |
|
6027 | + { |
|
5754 | 6028 | return $this->commonGivenQuery('M', 'table', false, $params); |
5755 | 6029 | } |
5756 | 6030 | |
@@ -5761,7 +6035,8 @@ discard block |
||
5761 | 6035 | * |
5762 | 6036 | * @return string |
5763 | 6037 | */ |
5764 | - public function commonGivenUnknown($params = array(1, 10, 'alpha')) { |
|
6038 | + public function commonGivenUnknown($params = array(1, 10, 'alpha')) |
|
6039 | + { |
|
5765 | 6040 | return $this->commonGivenQuery('U', 'nolist', false, $params); |
5766 | 6041 | } |
5767 | 6042 | |
@@ -5772,7 +6047,8 @@ discard block |
||
5772 | 6047 | * |
5773 | 6048 | * @return string |
5774 | 6049 | */ |
5775 | - public function commonGivenUnknownTotals($params = array(1, 10, 'rcount')) { |
|
6050 | + public function commonGivenUnknownTotals($params = array(1, 10, 'rcount')) |
|
6051 | + { |
|
5776 | 6052 | return $this->commonGivenQuery('U', 'nolist', true, $params); |
5777 | 6053 | } |
5778 | 6054 | |
@@ -5783,7 +6059,8 @@ discard block |
||
5783 | 6059 | * |
5784 | 6060 | * @return string |
5785 | 6061 | */ |
5786 | - public function commonGivenUnknownList($params = array(1, 10, 'alpha')) { |
|
6062 | + public function commonGivenUnknownList($params = array(1, 10, 'alpha')) |
|
6063 | + { |
|
5787 | 6064 | return $this->commonGivenQuery('U', 'list', false, $params); |
5788 | 6065 | } |
5789 | 6066 | |
@@ -5794,7 +6071,8 @@ discard block |
||
5794 | 6071 | * |
5795 | 6072 | * @return string |
5796 | 6073 | */ |
5797 | - public function commonGivenUnknownListTotals($params = array(1, 10, 'rcount')) { |
|
6074 | + public function commonGivenUnknownListTotals($params = array(1, 10, 'rcount')) |
|
6075 | + { |
|
5798 | 6076 | return $this->commonGivenQuery('U', 'list', true, $params); |
5799 | 6077 | } |
5800 | 6078 | |
@@ -5805,7 +6083,8 @@ discard block |
||
5805 | 6083 | * |
5806 | 6084 | * @return string |
5807 | 6085 | */ |
5808 | - public function commonGivenUnknownTable($params = array(1, 10, 'rcount')) { |
|
6086 | + public function commonGivenUnknownTable($params = array(1, 10, 'rcount')) |
|
6087 | + { |
|
5809 | 6088 | return $this->commonGivenQuery('U', 'table', false, $params); |
5810 | 6089 | } |
5811 | 6090 | |
@@ -5816,7 +6095,8 @@ discard block |
||
5816 | 6095 | * |
5817 | 6096 | * @return string |
5818 | 6097 | */ |
5819 | - public function chartCommonGiven($params = array()) { |
|
6098 | + public function chartCommonGiven($params = array()) |
|
6099 | + { |
|
5820 | 6100 | $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); |
5821 | 6101 | $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); |
5822 | 6102 | $WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x'); |
@@ -5884,7 +6164,8 @@ discard block |
||
5884 | 6164 | * |
5885 | 6165 | * @return string |
5886 | 6166 | */ |
5887 | - private function usersLoggedInQuery($type = 'nolist') { |
|
6167 | + private function usersLoggedInQuery($type = 'nolist') |
|
6168 | + { |
|
5888 | 6169 | $content = ''; |
5889 | 6170 | // List active users |
5890 | 6171 | $NumAnonymous = 0; |
@@ -5951,7 +6232,8 @@ discard block |
||
5951 | 6232 | * |
5952 | 6233 | * @return int |
5953 | 6234 | */ |
5954 | - private function usersLoggedInTotalQuery($type = 'all') { |
|
6235 | + private function usersLoggedInTotalQuery($type = 'all') |
|
6236 | + { |
|
5955 | 6237 | $anon = 0; |
5956 | 6238 | $visible = 0; |
5957 | 6239 | foreach (User::allLoggedIn() as $user) { |
@@ -5975,7 +6257,8 @@ discard block |
||
5975 | 6257 | * |
5976 | 6258 | * @return string |
5977 | 6259 | */ |
5978 | - public function usersLoggedIn() { |
|
6260 | + public function usersLoggedIn() |
|
6261 | + { |
|
5979 | 6262 | return $this->usersLoggedInQuery('nolist'); |
5980 | 6263 | } |
5981 | 6264 | |
@@ -5984,7 +6267,8 @@ discard block |
||
5984 | 6267 | * |
5985 | 6268 | * @return string |
5986 | 6269 | */ |
5987 | - public function usersLoggedInList() { |
|
6270 | + public function usersLoggedInList() |
|
6271 | + { |
|
5988 | 6272 | return $this->usersLoggedInQuery('list'); |
5989 | 6273 | } |
5990 | 6274 | |
@@ -5993,7 +6277,8 @@ discard block |
||
5993 | 6277 | * |
5994 | 6278 | * @return int |
5995 | 6279 | */ |
5996 | - public function usersLoggedInTotal() { |
|
6280 | + public function usersLoggedInTotal() |
|
6281 | + { |
|
5997 | 6282 | return $this->usersLoggedInTotalQuery('all'); |
5998 | 6283 | } |
5999 | 6284 | |
@@ -6002,7 +6287,8 @@ discard block |
||
6002 | 6287 | * |
6003 | 6288 | * @return int |
6004 | 6289 | */ |
6005 | - public function usersLoggedInTotalAnon() { |
|
6290 | + public function usersLoggedInTotalAnon() |
|
6291 | + { |
|
6006 | 6292 | return $this->usersLoggedInTotalQuery('anon'); |
6007 | 6293 | } |
6008 | 6294 | |
@@ -6011,7 +6297,8 @@ discard block |
||
6011 | 6297 | * |
6012 | 6298 | * @return int |
6013 | 6299 | */ |
6014 | - public function usersLoggedInTotalVisible() { |
|
6300 | + public function usersLoggedInTotalVisible() |
|
6301 | + { |
|
6015 | 6302 | return $this->usersLoggedInTotalQuery('visible'); |
6016 | 6303 | } |
6017 | 6304 | |
@@ -6020,7 +6307,8 @@ discard block |
||
6020 | 6307 | * |
6021 | 6308 | * @return null|string |
6022 | 6309 | */ |
6023 | - public function userId() { |
|
6310 | + public function userId() |
|
6311 | + { |
|
6024 | 6312 | return Auth::id(); |
6025 | 6313 | } |
6026 | 6314 | |
@@ -6031,7 +6319,8 @@ discard block |
||
6031 | 6319 | * |
6032 | 6320 | * @return string |
6033 | 6321 | */ |
6034 | - public function userName($params = array()) { |
|
6322 | + public function userName($params = array()) |
|
6323 | + { |
|
6035 | 6324 | if (Auth::check()) { |
6036 | 6325 | return Filter::escapeHtml(Auth::user()->getUserName()); |
6037 | 6326 | } elseif (isset($params[0]) && $params[0] != '') { |
@@ -6047,7 +6336,8 @@ discard block |
||
6047 | 6336 | * |
6048 | 6337 | * @return string |
6049 | 6338 | */ |
6050 | - public function userFullName() { |
|
6339 | + public function userFullName() |
|
6340 | + { |
|
6051 | 6341 | return Auth::check() ? Auth::user()->getRealNameHtml() : ''; |
6052 | 6342 | } |
6053 | 6343 | |
@@ -6059,7 +6349,8 @@ discard block |
||
6059 | 6349 | * |
6060 | 6350 | * @return string |
6061 | 6351 | */ |
6062 | - private function getLatestUserData($type = 'userid', $params = array()) { |
|
6352 | + private function getLatestUserData($type = 'userid', $params = array()) |
|
6353 | + { |
|
6063 | 6354 | static $user_id = null; |
6064 | 6355 | |
6065 | 6356 | if ($user_id === null) { |
@@ -6113,7 +6404,8 @@ discard block |
||
6113 | 6404 | * |
6114 | 6405 | * @return string |
6115 | 6406 | */ |
6116 | - public function latestUserId() { |
|
6407 | + public function latestUserId() |
|
6408 | + { |
|
6117 | 6409 | return $this->getLatestUserData('userid'); |
6118 | 6410 | } |
6119 | 6411 | |
@@ -6122,7 +6414,8 @@ discard block |
||
6122 | 6414 | * |
6123 | 6415 | * @return string |
6124 | 6416 | */ |
6125 | - public function latestUserName() { |
|
6417 | + public function latestUserName() |
|
6418 | + { |
|
6126 | 6419 | return $this->getLatestUserData('username'); |
6127 | 6420 | } |
6128 | 6421 | |
@@ -6131,7 +6424,8 @@ discard block |
||
6131 | 6424 | * |
6132 | 6425 | * @return string |
6133 | 6426 | */ |
6134 | - public function latestUserFullName() { |
|
6427 | + public function latestUserFullName() |
|
6428 | + { |
|
6135 | 6429 | return $this->getLatestUserData('fullname'); |
6136 | 6430 | } |
6137 | 6431 | |
@@ -6142,7 +6436,8 @@ discard block |
||
6142 | 6436 | * |
6143 | 6437 | * @return string |
6144 | 6438 | */ |
6145 | - public function latestUserRegDate($params = array()) { |
|
6439 | + public function latestUserRegDate($params = array()) |
|
6440 | + { |
|
6146 | 6441 | return $this->getLatestUserData('regdate', $params); |
6147 | 6442 | } |
6148 | 6443 | |
@@ -6153,7 +6448,8 @@ discard block |
||
6153 | 6448 | * |
6154 | 6449 | * @return string |
6155 | 6450 | */ |
6156 | - public function latestUserRegTime($params = array()) { |
|
6451 | + public function latestUserRegTime($params = array()) |
|
6452 | + { |
|
6157 | 6453 | return $this->getLatestUserData('regtime', $params); |
6158 | 6454 | } |
6159 | 6455 | |
@@ -6164,7 +6460,8 @@ discard block |
||
6164 | 6460 | * |
6165 | 6461 | * @return string |
6166 | 6462 | */ |
6167 | - public function latestUserLoggedin($params = array()) { |
|
6463 | + public function latestUserLoggedin($params = array()) |
|
6464 | + { |
|
6168 | 6465 | return $this->getLatestUserData('loggedin', $params); |
6169 | 6466 | } |
6170 | 6467 | |
@@ -6173,7 +6470,8 @@ discard block |
||
6173 | 6470 | * |
6174 | 6471 | * @return string |
6175 | 6472 | */ |
6176 | - public function contactWebmaster() { |
|
6473 | + public function contactWebmaster() |
|
6474 | + { |
|
6177 | 6475 | $user_id = $this->tree->getPreference('WEBMASTER_USER_ID'); |
6178 | 6476 | $user = User::find($user_id); |
6179 | 6477 | if ($user) { |
@@ -6188,7 +6486,8 @@ discard block |
||
6188 | 6486 | * |
6189 | 6487 | * @return string |
6190 | 6488 | */ |
6191 | - public function contactGedcom() { |
|
6489 | + public function contactGedcom() |
|
6490 | + { |
|
6192 | 6491 | $user_id = $this->tree->getPreference('CONTACT_USER_ID'); |
6193 | 6492 | $user = User::find($user_id); |
6194 | 6493 | if ($user) { |
@@ -6203,7 +6502,8 @@ discard block |
||
6203 | 6502 | * |
6204 | 6503 | * @return string |
6205 | 6504 | */ |
6206 | - public function serverDate() { |
|
6505 | + public function serverDate() |
|
6506 | + { |
|
6207 | 6507 | return FunctionsDate::timestampToGedcomDate(WT_TIMESTAMP)->display(); |
6208 | 6508 | } |
6209 | 6509 | |
@@ -6212,7 +6512,8 @@ discard block |
||
6212 | 6512 | * |
6213 | 6513 | * @return string |
6214 | 6514 | */ |
6215 | - public function serverTime() { |
|
6515 | + public function serverTime() |
|
6516 | + { |
|
6216 | 6517 | return date('g:i a'); |
6217 | 6518 | } |
6218 | 6519 | |
@@ -6221,7 +6522,8 @@ discard block |
||
6221 | 6522 | * |
6222 | 6523 | * @return string |
6223 | 6524 | */ |
6224 | - public function serverTime24() { |
|
6525 | + public function serverTime24() |
|
6526 | + { |
|
6225 | 6527 | return date('G:i'); |
6226 | 6528 | } |
6227 | 6529 | |
@@ -6230,7 +6532,8 @@ discard block |
||
6230 | 6532 | * |
6231 | 6533 | * @return string |
6232 | 6534 | */ |
6233 | - public function serverTimezone() { |
|
6535 | + public function serverTimezone() |
|
6536 | + { |
|
6234 | 6537 | return date('T'); |
6235 | 6538 | } |
6236 | 6539 | |
@@ -6239,7 +6542,8 @@ discard block |
||
6239 | 6542 | * |
6240 | 6543 | * @return string |
6241 | 6544 | */ |
6242 | - public function browserDate() { |
|
6545 | + public function browserDate() |
|
6546 | + { |
|
6243 | 6547 | return FunctionsDate::timestampToGedcomDate(WT_TIMESTAMP + WT_TIMESTAMP_OFFSET)->display(); |
6244 | 6548 | } |
6245 | 6549 | |
@@ -6248,7 +6552,8 @@ discard block |
||
6248 | 6552 | * |
6249 | 6553 | * @return string |
6250 | 6554 | */ |
6251 | - public function browserTime() { |
|
6555 | + public function browserTime() |
|
6556 | + { |
|
6252 | 6557 | return date(str_replace('%', '', I18N::timeFormat()), WT_TIMESTAMP + WT_TIMESTAMP_OFFSET); |
6253 | 6558 | } |
6254 | 6559 | |
@@ -6257,7 +6562,8 @@ discard block |
||
6257 | 6562 | * |
6258 | 6563 | * @return string |
6259 | 6564 | */ |
6260 | - public function browserTimezone() { |
|
6565 | + public function browserTimezone() |
|
6566 | + { |
|
6261 | 6567 | return date('T', WT_TIMESTAMP + WT_TIMESTAMP_OFFSET); |
6262 | 6568 | } |
6263 | 6569 | |
@@ -6266,7 +6572,8 @@ discard block |
||
6266 | 6572 | * |
6267 | 6573 | * @return string |
6268 | 6574 | */ |
6269 | - public function webtreesVersion() { |
|
6575 | + public function webtreesVersion() |
|
6576 | + { |
|
6270 | 6577 | return WT_VERSION; |
6271 | 6578 | } |
6272 | 6579 | |
@@ -6278,7 +6585,8 @@ discard block |
||
6278 | 6585 | * |
6279 | 6586 | * @return string |
6280 | 6587 | */ |
6281 | - private function hitCountQuery($page_name, $params) { |
|
6588 | + private function hitCountQuery($page_name, $params) |
|
6589 | + { |
|
6282 | 6590 | if (is_array($params) && isset($params[0]) && $params[0] != '') { |
6283 | 6591 | $page_parameter = $params[0]; |
6284 | 6592 | } else { |
@@ -6307,7 +6615,8 @@ discard block |
||
6307 | 6615 | * |
6308 | 6616 | * @return string |
6309 | 6617 | */ |
6310 | - public function hitCount($params = array()) { |
|
6618 | + public function hitCount($params = array()) |
|
6619 | + { |
|
6311 | 6620 | return $this->hitCountQuery(null, $params); |
6312 | 6621 | } |
6313 | 6622 | |
@@ -6318,7 +6627,8 @@ discard block |
||
6318 | 6627 | * |
6319 | 6628 | * @return string |
6320 | 6629 | */ |
6321 | - public function hitCountUser($params = array()) { |
|
6630 | + public function hitCountUser($params = array()) |
|
6631 | + { |
|
6322 | 6632 | return $this->hitCountQuery('index.php', $params); |
6323 | 6633 | } |
6324 | 6634 | |
@@ -6329,7 +6639,8 @@ discard block |
||
6329 | 6639 | * |
6330 | 6640 | * @return string |
6331 | 6641 | */ |
6332 | - public function hitCountIndi($params = array()) { |
|
6642 | + public function hitCountIndi($params = array()) |
|
6643 | + { |
|
6333 | 6644 | return $this->hitCountQuery('individual.php', $params); |
6334 | 6645 | } |
6335 | 6646 | |
@@ -6340,7 +6651,8 @@ discard block |
||
6340 | 6651 | * |
6341 | 6652 | * @return string |
6342 | 6653 | */ |
6343 | - public function hitCountFam($params = array()) { |
|
6654 | + public function hitCountFam($params = array()) |
|
6655 | + { |
|
6344 | 6656 | return $this->hitCountQuery('family.php', $params); |
6345 | 6657 | } |
6346 | 6658 | |
@@ -6351,7 +6663,8 @@ discard block |
||
6351 | 6663 | * |
6352 | 6664 | * @return string |
6353 | 6665 | */ |
6354 | - public function hitCountSour($params = array()) { |
|
6666 | + public function hitCountSour($params = array()) |
|
6667 | + { |
|
6355 | 6668 | return $this->hitCountQuery('source.php', $params); |
6356 | 6669 | } |
6357 | 6670 | |
@@ -6362,7 +6675,8 @@ discard block |
||
6362 | 6675 | * |
6363 | 6676 | * @return string |
6364 | 6677 | */ |
6365 | - public function hitCountRepo($params = array()) { |
|
6678 | + public function hitCountRepo($params = array()) |
|
6679 | + { |
|
6366 | 6680 | return $this->hitCountQuery('repo.php', $params); |
6367 | 6681 | } |
6368 | 6682 | |
@@ -6373,7 +6687,8 @@ discard block |
||
6373 | 6687 | * |
6374 | 6688 | * @return string |
6375 | 6689 | */ |
6376 | - public function hitCountNote($params = array()) { |
|
6690 | + public function hitCountNote($params = array()) |
|
6691 | + { |
|
6377 | 6692 | return $this->hitCountQuery('note.php', $params); |
6378 | 6693 | } |
6379 | 6694 | |
@@ -6384,7 +6699,8 @@ discard block |
||
6384 | 6699 | * |
6385 | 6700 | * @return string |
6386 | 6701 | */ |
6387 | - public function hitCountObje($params = array()) { |
|
6702 | + public function hitCountObje($params = array()) |
|
6703 | + { |
|
6388 | 6704 | return $this->hitCountQuery('mediaviewer.php', $params); |
6389 | 6705 | } |
6390 | 6706 | |
@@ -6397,7 +6713,8 @@ discard block |
||
6397 | 6713 | * |
6398 | 6714 | * @return string |
6399 | 6715 | */ |
6400 | - private function arrayToExtendedEncoding($a) { |
|
6716 | + private function arrayToExtendedEncoding($a) |
|
6717 | + { |
|
6401 | 6718 | $xencoding = WT_GOOGLE_CHART_ENCODING; |
6402 | 6719 | |
6403 | 6720 | $encoding = ''; |
@@ -6421,7 +6738,8 @@ discard block |
||
6421 | 6738 | * |
6422 | 6739 | * @return int |
6423 | 6740 | */ |
6424 | - private function nameTotalSort($a, $b) { |
|
6741 | + private function nameTotalSort($a, $b) |
|
6742 | + { |
|
6425 | 6743 | return $a['match'] - $b['match']; |
6426 | 6744 | } |
6427 | 6745 | |
@@ -6433,7 +6751,8 @@ discard block |
||
6433 | 6751 | * |
6434 | 6752 | * @return int |
6435 | 6753 | */ |
6436 | - private function nameTotalReverseSort($a, $b) { |
|
6754 | + private function nameTotalReverseSort($a, $b) |
|
6755 | + { |
|
6437 | 6756 | return $b['match'] - $a['match']; |
6438 | 6757 | } |
6439 | 6758 | |
@@ -6444,7 +6763,8 @@ discard block |
||
6444 | 6763 | * |
6445 | 6764 | * @return string[][] |
6446 | 6765 | */ |
6447 | - private function runSql($sql) { |
|
6766 | + private function runSql($sql) |
|
6767 | + { |
|
6448 | 6768 | static $cache = array(); |
6449 | 6769 | |
6450 | 6770 | $id = md5($sql); |
@@ -6462,7 +6782,8 @@ discard block |
||
6462 | 6782 | * |
6463 | 6783 | * @return string |
6464 | 6784 | */ |
6465 | - public function gedcomFavorites() { |
|
6785 | + public function gedcomFavorites() |
|
6786 | + { |
|
6466 | 6787 | if (Module::getModuleByName('gedcom_favorites')) { |
6467 | 6788 | $block = new FamilyTreeFavoritesModule(WT_MODULES_DIR . 'gedcom_favorites'); |
6468 | 6789 | |
@@ -6477,7 +6798,8 @@ discard block |
||
6477 | 6798 | * |
6478 | 6799 | * @return string |
6479 | 6800 | */ |
6480 | - public function userFavorites() { |
|
6801 | + public function userFavorites() |
|
6802 | + { |
|
6481 | 6803 | if (Auth::check() && Module::getModuleByName('user_favorites')) { |
6482 | 6804 | $block = new UserFavoritesModule(WT_MODULES_DIR . 'gedcom_favorites'); |
6483 | 6805 | |
@@ -6492,7 +6814,8 @@ discard block |
||
6492 | 6814 | * |
6493 | 6815 | * @return int |
6494 | 6816 | */ |
6495 | - public function totalGedcomFavorites() { |
|
6817 | + public function totalGedcomFavorites() |
|
6818 | + { |
|
6496 | 6819 | if (Module::getModuleByName('gedcom_favorites')) { |
6497 | 6820 | return count(FamilyTreeFavoritesModule::getFavorites($this->tree->getTreeId())); |
6498 | 6821 | } else { |
@@ -6505,7 +6828,8 @@ discard block |
||
6505 | 6828 | * |
6506 | 6829 | * @return int |
6507 | 6830 | */ |
6508 | - public function totalUserFavorites() { |
|
6831 | + public function totalUserFavorites() |
|
6832 | + { |
|
6509 | 6833 | if (Module::getModuleByName('user_favorites')) { |
6510 | 6834 | return count(UserFavoritesModule::getFavorites(Auth::id())); |
6511 | 6835 | } else { |
@@ -6522,7 +6846,8 @@ discard block |
||
6522 | 6846 | * |
6523 | 6847 | * @return string |
6524 | 6848 | */ |
6525 | - public function callBlock($params = array()) { |
|
6849 | + public function callBlock($params = array()) |
|
6850 | + { |
|
6526 | 6851 | global $ctype; |
6527 | 6852 | |
6528 | 6853 | if (isset($params[0]) && $params[0] != '') { |
@@ -6562,7 +6887,8 @@ discard block |
||
6562 | 6887 | * |
6563 | 6888 | * @return string |
6564 | 6889 | */ |
6565 | - public function totalUserMessages() { |
|
6890 | + public function totalUserMessages() |
|
6891 | + { |
|
6566 | 6892 | $total = (int) Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?") |
6567 | 6893 | ->execute(array(Auth::id())) |
6568 | 6894 | ->fetchOne(); |
@@ -6575,7 +6901,8 @@ discard block |
||
6575 | 6901 | * |
6576 | 6902 | * @return string |
6577 | 6903 | */ |
6578 | - public function totalUserJournal() { |
|
6904 | + public function totalUserJournal() |
|
6905 | + { |
|
6579 | 6906 | try { |
6580 | 6907 | $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") |
6581 | 6908 | ->execute(array(Auth::id())) |
@@ -6593,7 +6920,8 @@ discard block |
||
6593 | 6920 | * |
6594 | 6921 | * @return string |
6595 | 6922 | */ |
6596 | - public function totalGedcomNews() { |
|
6923 | + public function totalGedcomNews() |
|
6924 | + { |
|
6597 | 6925 | try { |
6598 | 6926 | $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") |
6599 | 6927 | ->execute(array($this->tree->getTreeId())) |
@@ -6613,7 +6941,8 @@ discard block |
||
6613 | 6941 | * |
6614 | 6942 | * @return string[] |
6615 | 6943 | */ |
6616 | - public function iso3166() { |
|
6944 | + public function iso3166() |
|
6945 | + { |
|
6617 | 6946 | return array( |
6618 | 6947 | 'ABW' => 'AW', 'AFG' => 'AF', 'AGO' => 'AO', 'AIA' => 'AI', 'ALA' => 'AX', 'ALB' => 'AL', |
6619 | 6948 | 'AND' => 'AD', 'ARE' => 'AE', 'ARG' => 'AR', 'ARM' => 'AM', 'ASM' => 'AS', |
@@ -6665,7 +6994,8 @@ discard block |
||
6665 | 6994 | * |
6666 | 6995 | * @return string[] |
6667 | 6996 | */ |
6668 | - public function getAllCountries() { |
|
6997 | + public function getAllCountries() |
|
6998 | + { |
|
6669 | 6999 | return array( |
6670 | 7000 | '???' => /* I18N: Name of a country or state */ I18N::translate('Unknown'), |
6671 | 7001 | 'ABW' => /* I18N: Name of a country or state */ I18N::translate('Aruba'), |
@@ -6934,7 +7264,8 @@ discard block |
||
6934 | 7264 | * |
6935 | 7265 | * @return string |
6936 | 7266 | */ |
6937 | - private function centuryName($century) { |
|
7267 | + private function centuryName($century) |
|
7268 | + { |
|
6938 | 7269 | if ($century < 0) { |
6939 | 7270 | return str_replace(-$century, self::centuryName(-$century), /* I18N: BCE=Before the Common Era, for Julian years < 0. See http://en.wikipedia.org/wiki/Common_Era */ |
6940 | 7271 | I18N::translate('%s BCE', I18N::number(-$century))); |