@@ -23,11 +23,13 @@ |
||
23 | 23 | /** |
24 | 24 | * Controller for the shared note page |
25 | 25 | */ |
26 | -class NoteController extends GedcomRecordController { |
|
26 | +class NoteController extends GedcomRecordController |
|
27 | +{ |
|
27 | 28 | /** |
28 | 29 | * get edit menu |
29 | 30 | */ |
30 | - public function getEditMenu() { |
|
31 | + public function getEditMenu() |
|
32 | + { |
|
31 | 33 | if (!$this->record || $this->record->isPendingDeletion()) { |
32 | 34 | return null; |
33 | 35 | } |
@@ -25,7 +25,8 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * Controller for the ancestry chart |
27 | 27 | */ |
28 | -class AncestryController extends ChartController { |
|
28 | +class AncestryController extends ChartController |
|
29 | +{ |
|
29 | 30 | /** @var int Show boxes for cousins */ |
30 | 31 | public $show_cousins; |
31 | 32 | |
@@ -38,7 +39,8 @@ discard block |
||
38 | 39 | /** |
39 | 40 | * Startup activity |
40 | 41 | */ |
41 | - public function __construct() { |
|
42 | + public function __construct() |
|
43 | + { |
|
42 | 44 | global $WT_TREE; |
43 | 45 | |
44 | 46 | parent::__construct(); |
@@ -65,7 +67,8 @@ discard block |
||
65 | 67 | * @param int $sosa child sosa number |
66 | 68 | * @param int $depth the ascendancy depth to show |
67 | 69 | */ |
68 | - public function printChildAscendancy(Individual $individual, $sosa, $depth) { |
|
70 | + public function printChildAscendancy(Individual $individual, $sosa, $depth) |
|
71 | + { |
|
69 | 72 | echo '<li>'; |
70 | 73 | echo '<table><tbody><tr><td>'; |
71 | 74 | if ($sosa === 1) { |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Controller for the fan chart |
24 | 24 | */ |
25 | -class FanchartController extends ChartController { |
|
25 | +class FanchartController extends ChartController |
|
26 | +{ |
|
26 | 27 | /** @var int Style of fanchart */ |
27 | 28 | public $fan_style; |
28 | 29 | |
@@ -35,7 +36,8 @@ discard block |
||
35 | 36 | /** |
36 | 37 | * Create the controller |
37 | 38 | */ |
38 | - public function __construct() { |
|
39 | + public function __construct() |
|
40 | + { |
|
39 | 41 | global $WT_TREE; |
40 | 42 | |
41 | 43 | parent::__construct(); |
@@ -62,7 +64,8 @@ discard block |
||
62 | 64 | * |
63 | 65 | * @return string[] |
64 | 66 | */ |
65 | - public function getFanStyles() { |
|
67 | + public function getFanStyles() |
|
68 | + { |
|
66 | 69 | return array( |
67 | 70 | 2 => /* I18N: layout option for the fan chart */ I18N::translate('half circle'), |
68 | 71 | 3 => /* I18N: layout option for the fan chart */ I18N::translate('three-quarter circle'), |
@@ -78,7 +81,8 @@ discard block |
||
78 | 81 | * |
79 | 82 | * @return string $text output string |
80 | 83 | */ |
81 | - public function splitAlignText($data, $maxlen) { |
|
84 | + public function splitAlignText($data, $maxlen) |
|
85 | + { |
|
82 | 86 | $RTLOrd = array(215, 216, 217, 218, 219); |
83 | 87 | |
84 | 88 | $lines = explode("\n", $data); |
@@ -149,7 +153,8 @@ discard block |
||
149 | 153 | * |
150 | 154 | * @return string |
151 | 155 | */ |
152 | - public function generateFanChart($what) { |
|
156 | + public function generateFanChart($what) |
|
157 | + { |
|
153 | 158 | $treeid = $this->sosaAncestors($this->generations); |
154 | 159 | $fanw = 640 * $this->fan_width / 100; |
155 | 160 | $fandeg = 90 * $this->fan_style; |
@@ -32,7 +32,8 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * Base controller for all GedcomRecord controllers |
34 | 34 | */ |
35 | -class GedcomRecordController extends PageController { |
|
35 | +class GedcomRecordController extends PageController |
|
36 | +{ |
|
36 | 37 | /** |
37 | 38 | * A genealogy record |
38 | 39 | * |
@@ -45,7 +46,8 @@ discard block |
||
45 | 46 | * |
46 | 47 | * @param GedcomRecord|null $record |
47 | 48 | */ |
48 | - public function __construct(GedcomRecord $record = null) { |
|
49 | + public function __construct(GedcomRecord $record = null) |
|
50 | + { |
|
49 | 51 | $this->record = $record; |
50 | 52 | |
51 | 53 | // Automatically fix broken links |
@@ -96,7 +98,8 @@ discard block |
||
96 | 98 | /** |
97 | 99 | * get edit menu |
98 | 100 | */ |
99 | - public function getEditMenu() { |
|
101 | + public function getEditMenu() |
|
102 | + { |
|
100 | 103 | if (!$this->record || $this->record->isPendingDeletion()) { |
101 | 104 | return null; |
102 | 105 | } |
@@ -24,7 +24,8 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Controller for the familybook chart |
26 | 26 | */ |
27 | -class FamilyBookController extends ChartController { |
|
27 | +class FamilyBookController extends ChartController |
|
28 | +{ |
|
28 | 29 | /** @var int Whether to show spouse details */ |
29 | 30 | public $show_spouse; |
30 | 31 | |
@@ -43,7 +44,8 @@ discard block |
||
43 | 44 | /** |
44 | 45 | * Create a family-book controller |
45 | 46 | */ |
46 | - public function __construct() { |
|
47 | + public function __construct() |
|
48 | + { |
|
47 | 49 | global $WT_TREE; |
48 | 50 | |
49 | 51 | parent::__construct(); |
@@ -78,7 +80,8 @@ discard block |
||
78 | 80 | * |
79 | 81 | * @return int |
80 | 82 | */ |
81 | - private function printDescendency(Individual $person = null, $generation) { |
|
83 | + private function printDescendency(Individual $person = null, $generation) |
|
84 | + { |
|
82 | 85 | |
83 | 86 | if ($generation > $this->dgenerations) { |
84 | 87 | return 0; |
@@ -185,7 +188,8 @@ discard block |
||
185 | 188 | * @param Individual $person |
186 | 189 | * @param int $count |
187 | 190 | */ |
188 | - private function printPersonPedigree($person, $count) { |
|
191 | + private function printPersonPedigree($person, $count) |
|
192 | + { |
|
189 | 193 | if ($count >= $this->generations) { |
190 | 194 | return; |
191 | 195 | } |
@@ -316,7 +320,8 @@ discard block |
||
316 | 320 | * |
317 | 321 | * @return int |
318 | 322 | */ |
319 | - private function maxDescendencyGenerations($pid, $depth) { |
|
323 | + private function maxDescendencyGenerations($pid, $depth) |
|
324 | + { |
|
320 | 325 | global $WT_TREE; |
321 | 326 | |
322 | 327 | if ($depth > $this->generations) { |
@@ -350,7 +355,8 @@ discard block |
||
350 | 355 | * Print empty box |
351 | 356 | */ |
352 | 357 | |
353 | - private function printEmptyBox() { |
|
358 | + private function printEmptyBox() |
|
359 | + { |
|
354 | 360 | echo $this->showFull() ? Theme::theme()->individualBoxEmpty() : Theme::theme()->individualBoxSmallEmpty(); |
355 | 361 | } |
356 | 362 | |
@@ -360,7 +366,8 @@ discard block |
||
360 | 366 | * @param Individual $person |
361 | 367 | * @param int $descent_steps |
362 | 368 | */ |
363 | - public function printFamilyBook(Individual $person, $descent_steps) { |
|
369 | + public function printFamilyBook(Individual $person, $descent_steps) |
|
370 | + { |
|
364 | 371 | if ($descent_steps == 0 || !$person->canShowName()) { |
365 | 372 | return; |
366 | 373 | } |
@@ -33,7 +33,8 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Controller for the individual page |
35 | 35 | */ |
36 | -class IndividualController extends GedcomRecordController { |
|
36 | +class IndividualController extends GedcomRecordController |
|
37 | +{ |
|
37 | 38 | /** @var int Count of names */ |
38 | 39 | public $name_count = 0; |
39 | 40 | |
@@ -48,7 +49,8 @@ discard block |
||
48 | 49 | * |
49 | 50 | * @param Individual|null $record |
50 | 51 | */ |
51 | - public function __construct($record) { |
|
52 | + public function __construct($record) |
|
53 | + { |
|
52 | 54 | parent::__construct($record); |
53 | 55 | |
54 | 56 | // If we can display the details, add them to the page header |
@@ -64,7 +66,8 @@ discard block |
||
64 | 66 | * |
65 | 67 | * @return Individual |
66 | 68 | */ |
67 | - public function getSignificantIndividual() { |
|
69 | + public function getSignificantIndividual() |
|
70 | + { |
|
68 | 71 | if ($this->record) { |
69 | 72 | return $this->record; |
70 | 73 | } |
@@ -78,7 +81,8 @@ discard block |
||
78 | 81 | * |
79 | 82 | * @return Family |
80 | 83 | */ |
81 | - public function getSignificantFamily() { |
|
84 | + public function getSignificantFamily() |
|
85 | + { |
|
82 | 86 | if ($this->record) { |
83 | 87 | foreach ($this->record->getChildFamilies() as $family) { |
84 | 88 | return $family; |
@@ -94,7 +98,8 @@ discard block |
||
94 | 98 | /** |
95 | 99 | * Handle AJAX requests - to generate the tab content |
96 | 100 | */ |
97 | - public function ajaxRequest() { |
|
101 | + public function ajaxRequest() |
|
102 | + { |
|
98 | 103 | // Search engines should not make AJAX requests |
99 | 104 | if (Auth::isSearchEngine()) { |
100 | 105 | http_response_code(403); |
@@ -127,7 +132,8 @@ discard block |
||
127 | 132 | * |
128 | 133 | * @param Fact $event the event object |
129 | 134 | */ |
130 | - public function printNameRecord(Fact $event) { |
|
135 | + public function printNameRecord(Fact $event) |
|
136 | + { |
|
131 | 137 | $factrec = $event->getGedcom(); |
132 | 138 | |
133 | 139 | // Create a dummy record, so we can extract the formatted NAME value from the event. |
@@ -219,7 +225,8 @@ discard block |
||
219 | 225 | * |
220 | 226 | * @param Fact $event the Event object |
221 | 227 | */ |
222 | - public function printSexRecord(Fact $event) { |
|
228 | + public function printSexRecord(Fact $event) |
|
229 | + { |
|
223 | 230 | $sex = $event->getValue(); |
224 | 231 | if (empty($sex)) { |
225 | 232 | $sex = 'U'; |
@@ -265,7 +272,8 @@ discard block |
||
265 | 272 | /** |
266 | 273 | * get edit menu |
267 | 274 | */ |
268 | - public function getEditMenu() { |
|
275 | + public function getEditMenu() |
|
276 | + { |
|
269 | 277 | if (!$this->record || $this->record->isPendingDeletion()) { |
270 | 278 | return null; |
271 | 279 | } |
@@ -322,7 +330,8 @@ discard block |
||
322 | 330 | * |
323 | 331 | * @return string returns 'person_box', 'person_boxF', or 'person_boxNN' |
324 | 332 | */ |
325 | - public function getPersonStyle($person) { |
|
333 | + public function getPersonStyle($person) |
|
334 | + { |
|
326 | 335 | switch ($person->getSex()) { |
327 | 336 | case 'M': |
328 | 337 | $class = 'person_box'; |
@@ -349,7 +358,8 @@ discard block |
||
349 | 358 | * |
350 | 359 | * @return string |
351 | 360 | */ |
352 | - public function getSignificantSurname() { |
|
361 | + public function getSignificantSurname() |
|
362 | + { |
|
353 | 363 | if ($this->record) { |
354 | 364 | list($surn) = explode(',', $this->record->getSortName()); |
355 | 365 | |
@@ -364,7 +374,8 @@ discard block |
||
364 | 374 | * |
365 | 375 | * @return string |
366 | 376 | */ |
367 | - public function getSideBarContent() { |
|
377 | + public function getSideBarContent() |
|
378 | + { |
|
368 | 379 | global $controller; |
369 | 380 | |
370 | 381 | $html = ''; |
@@ -408,7 +419,8 @@ discard block |
||
408 | 419 | * |
409 | 420 | * @return string |
410 | 421 | */ |
411 | - public function getSpouseFamilyLabel(Family $family, Individual $individual) { |
|
422 | + public function getSpouseFamilyLabel(Family $family, Individual $individual) |
|
423 | + { |
|
412 | 424 | $spouse = $family->getSpouse($individual); |
413 | 425 | if ($spouse) { |
414 | 426 | return |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Controller for the timeline chart |
31 | 31 | */ |
32 | -class TimelineController extends PageController { |
|
32 | +class TimelineController extends PageController |
|
33 | +{ |
|
33 | 34 | /** @var int Height of the age box */ |
34 | 35 | public $bheight = 30; |
35 | 36 | |
@@ -66,7 +67,8 @@ discard block |
||
66 | 67 | /** |
67 | 68 | * Startup activity |
68 | 69 | */ |
69 | - public function __construct() { |
|
70 | + public function __construct() |
|
71 | + { |
|
70 | 72 | global $WT_TREE; |
71 | 73 | |
72 | 74 | parent::__construct(); |
@@ -149,7 +151,8 @@ discard block |
||
149 | 151 | * |
150 | 152 | * @param Fact $event |
151 | 153 | */ |
152 | - public function printTimeFact(Fact $event) { |
|
154 | + public function printTimeFact(Fact $event) |
|
155 | + { |
|
153 | 156 | global $basexoffset, $baseyoffset, $factcount, $placements; |
154 | 157 | |
155 | 158 | $desc = $event->getValue(); |
@@ -273,7 +276,8 @@ discard block |
||
273 | 276 | * |
274 | 277 | * @return Individual |
275 | 278 | */ |
276 | - public function getSignificantIndividual() { |
|
279 | + public function getSignificantIndividual() |
|
280 | + { |
|
277 | 281 | global $WT_TREE; |
278 | 282 | |
279 | 283 | if ($this->people) { |
@@ -26,7 +26,8 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Controller for the advanced search page |
28 | 28 | */ |
29 | -class AdvancedSearchController extends SearchController { |
|
29 | +class AdvancedSearchController extends SearchController |
|
30 | +{ |
|
30 | 31 | /** @var string[] Fields to search */ |
31 | 32 | public $fields = array(); |
32 | 33 | |
@@ -39,7 +40,8 @@ discard block |
||
39 | 40 | /** |
40 | 41 | * Startup activity |
41 | 42 | */ |
42 | - public function __construct() { |
|
43 | + public function __construct() |
|
44 | + { |
|
43 | 45 | parent::__construct(); |
44 | 46 | |
45 | 47 | $this->setPageTitle(I18N::translate('Advanced search')); |
@@ -84,7 +86,8 @@ discard block |
||
84 | 86 | * |
85 | 87 | * @return string[] |
86 | 88 | */ |
87 | - public function getOtherFields() { |
|
89 | + public function getOtherFields() |
|
90 | + { |
|
88 | 91 | global $WT_TREE; |
89 | 92 | |
90 | 93 | $ofields = array( |
@@ -160,7 +163,8 @@ discard block |
||
160 | 163 | * |
161 | 164 | * @return int |
162 | 165 | */ |
163 | - public static function tagSort($x, $y) { |
|
166 | + public static function tagSort($x, $y) |
|
167 | + { |
|
164 | 168 | list($x1) = explode(':', $x . ':'); |
165 | 169 | list($y1) = explode(':', $y . ':'); |
166 | 170 | $tmp = I18N::strcasecmp(GedcomTag::getLabel($x1), GedcomTag::getLabel($y1)); |
@@ -178,7 +182,8 @@ discard block |
||
178 | 182 | * |
179 | 183 | * @return string |
180 | 184 | */ |
181 | - public function getValue($i) { |
|
185 | + public function getValue($i) |
|
186 | + { |
|
182 | 187 | $val = ''; |
183 | 188 | if (isset($this->values[$i])) { |
184 | 189 | $val = $this->values[$i]; |
@@ -194,7 +199,8 @@ discard block |
||
194 | 199 | * |
195 | 200 | * @return string |
196 | 201 | */ |
197 | - public function getField($i) { |
|
202 | + public function getField($i) |
|
203 | + { |
|
198 | 204 | $val = ''; |
199 | 205 | if (isset($this->fields[$i])) { |
200 | 206 | $val = htmlentities($this->fields[$i]); |
@@ -210,7 +216,8 @@ discard block |
||
210 | 216 | * |
211 | 217 | * @return int |
212 | 218 | */ |
213 | - public function getIndex($field) { |
|
219 | + public function getIndex($field) |
|
220 | + { |
|
214 | 221 | return array_search($field, $this->fields); |
215 | 222 | } |
216 | 223 | |
@@ -221,14 +228,16 @@ discard block |
||
221 | 228 | * |
222 | 229 | * @return string |
223 | 230 | */ |
224 | - public function getLabel($tag) { |
|
231 | + public function getLabel($tag) |
|
232 | + { |
|
225 | 233 | return GedcomTag::getLabel(preg_replace('/:(SDX|BEGINS|EXACT|CONTAINS)$/', '', $tag)); |
226 | 234 | } |
227 | 235 | |
228 | 236 | /** |
229 | 237 | * Set the field order |
230 | 238 | */ |
231 | - private function reorderFields() { |
|
239 | + private function reorderFields() |
|
240 | + { |
|
232 | 241 | $i = 0; |
233 | 242 | $newfields = array(); |
234 | 243 | $newvalues = array(); |
@@ -260,7 +269,8 @@ discard block |
||
260 | 269 | /** |
261 | 270 | * Perform the search |
262 | 271 | */ |
263 | - private function advancedSearch() { |
|
272 | + private function advancedSearch() |
|
273 | + { |
|
264 | 274 | global $WT_TREE; |
265 | 275 | |
266 | 276 | $this->myindilist = array(); |
@@ -656,7 +666,8 @@ discard block |
||
656 | 666 | /** |
657 | 667 | * Display the search results |
658 | 668 | */ |
659 | - public function printResults() { |
|
669 | + public function printResults() |
|
670 | + { |
|
660 | 671 | if ($this->myindilist) { |
661 | 672 | uasort($this->myindilist, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
662 | 673 | echo FunctionsPrintLists::individualTable($this->myindilist); |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Controller for the search page |
36 | 36 | */ |
37 | -class SearchController extends PageController { |
|
37 | +class SearchController extends PageController |
|
38 | +{ |
|
38 | 39 | /** @var string The type of search to perform */ |
39 | 40 | public $action; |
40 | 41 | |
@@ -104,7 +105,8 @@ discard block |
||
104 | 105 | /** |
105 | 106 | * Startup activity |
106 | 107 | */ |
107 | - public function __construct() { |
|
108 | + public function __construct() |
|
109 | + { |
|
108 | 110 | global $WT_TREE; |
109 | 111 | |
110 | 112 | parent::__construct(); |
@@ -216,7 +218,8 @@ discard block |
||
216 | 218 | /** |
217 | 219 | * Gathers results for a general search |
218 | 220 | */ |
219 | - private function generalSearch() { |
|
221 | + private function generalSearch() |
|
222 | + { |
|
220 | 223 | // Split search terms into an array |
221 | 224 | $query_terms = array(); |
222 | 225 | $query = $this->query; |
@@ -301,7 +304,8 @@ discard block |
||
301 | 304 | * |
302 | 305 | * @param Tree $tree |
303 | 306 | */ |
304 | - private function searchAndReplace(Tree $tree) { |
|
307 | + private function searchAndReplace(Tree $tree) |
|
308 | + { |
|
305 | 309 | $this->generalSearch(); |
306 | 310 | |
307 | 311 | //-- don't try to make any changes if nothing was found |
@@ -449,7 +453,8 @@ discard block |
||
449 | 453 | * The names' Soundex SQL table contains all the soundex values twice |
450 | 454 | * The places table contains only one value |
451 | 455 | */ |
452 | - private function soundexSearch() { |
|
456 | + private function soundexSearch() |
|
457 | + { |
|
453 | 458 | if (((!empty($this->lastname)) || (!empty($this->firstname)) || (!empty($this->place))) && $this->search_trees) { |
454 | 459 | $logstring = "Type: Soundex\n"; |
455 | 460 | if (!empty($this->lastname)) { |
@@ -506,7 +511,8 @@ discard block |
||
506 | 511 | /** |
507 | 512 | * Display the search results |
508 | 513 | */ |
509 | - public function printResults() { |
|
514 | + public function printResults() |
|
515 | + { |
|
510 | 516 | if ($this->action !== 'replace' && ($this->query || $this->firstname || $this->lastname || $this->place)) { |
511 | 517 | if ($this->myindilist || $this->myfamlist || $this->mysourcelist || $this->mynotelist) { |
512 | 518 | $this->addInlineJavascript('jQuery("#search-result-tabs").tabs();'); |