@@ -22,15 +22,18 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class RelatedIndividualsReportModule |
24 | 24 | */ |
25 | -class RelatedIndividualsReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class RelatedIndividualsReportModule extends AbstractModule implements ModuleReportInterface |
|
26 | +{ |
|
26 | 27 | /** {@inheritdoc} */ |
27 | - public function getTitle() { |
|
28 | + public function getTitle() |
|
29 | + { |
|
28 | 30 | // This text also appears in the .XML file - update both together |
29 | 31 | return /* I18N: Name of a report */ I18N::translate('Related individuals'); |
30 | 32 | } |
31 | 33 | |
32 | 34 | /** {@inheritdoc} */ |
33 | - public function getDescription() { |
|
35 | + public function getDescription() |
|
36 | + { |
|
34 | 37 | // This text also appears in the .XML file - update both together |
35 | 38 | return /* I18N: Description of the “Related individuals” module */ I18N::translate('A report of the individuals that are closely related to an individual.'); |
36 | 39 | } |
@@ -42,7 +45,8 @@ discard block |
||
42 | 45 | * |
43 | 46 | * @return int |
44 | 47 | */ |
45 | - public function defaultAccessLevel() { |
|
48 | + public function defaultAccessLevel() |
|
49 | + { |
|
46 | 50 | return Auth::PRIV_PRIVATE; |
47 | 51 | } |
48 | 52 | |
@@ -51,7 +55,8 @@ discard block |
||
51 | 55 | * |
52 | 56 | * @return Menu |
53 | 57 | */ |
54 | - public function getReportMenu() { |
|
58 | + public function getReportMenu() |
|
59 | + { |
|
55 | 60 | global $controller, $WT_TREE; |
56 | 61 | |
57 | 62 | return new Menu( |
@@ -33,14 +33,17 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Class CensusAssistantModule |
35 | 35 | */ |
36 | -class CensusAssistantModule extends AbstractModule { |
|
36 | +class CensusAssistantModule extends AbstractModule |
|
37 | +{ |
|
37 | 38 | /** {@inheritdoc} */ |
38 | - public function getTitle() { |
|
39 | + public function getTitle() |
|
40 | + { |
|
39 | 41 | return /* I18N: Name of a module */ I18N::translate('Census assistant'); |
40 | 42 | } |
41 | 43 | |
42 | 44 | /** {@inheritdoc} */ |
43 | - public function getDescription() { |
|
45 | + public function getDescription() |
|
46 | + { |
|
44 | 47 | return /* I18N: Description of the “Census assistant” module */ I18N::translate('An alternative way to enter census transcripts and link them to individuals.'); |
45 | 48 | } |
46 | 49 | |
@@ -50,7 +53,8 @@ discard block |
||
50 | 53 | * |
51 | 54 | * @param string $mod_action |
52 | 55 | */ |
53 | - public function modAction($mod_action) { |
|
56 | + public function modAction($mod_action) |
|
57 | + { |
|
54 | 58 | switch ($mod_action) { |
55 | 59 | case 'census_find': |
56 | 60 | self::censusFind(); |
@@ -69,7 +73,8 @@ discard block |
||
69 | 73 | /** |
70 | 74 | * Find an individual. |
71 | 75 | */ |
72 | - private static function censusFind() { |
|
76 | + private static function censusFind() |
|
77 | + { |
|
73 | 78 | global $WT_TREE; |
74 | 79 | |
75 | 80 | $controller = new SimpleController; |
@@ -126,7 +131,8 @@ discard block |
||
126 | 131 | /** |
127 | 132 | * Find a media object. |
128 | 133 | */ |
129 | - private static function mediaFind() { |
|
134 | + private static function mediaFind() |
|
135 | + { |
|
130 | 136 | global $WT_TREE; |
131 | 137 | |
132 | 138 | $controller = new SimpleController; |
@@ -224,7 +230,8 @@ discard block |
||
224 | 230 | /** |
225 | 231 | * Search for a media object. |
226 | 232 | */ |
227 | - private static function mediaQuery() { |
|
233 | + private static function mediaQuery() |
|
234 | + { |
|
228 | 235 | global $WT_TREE; |
229 | 236 | |
230 | 237 | $iid2 = Filter::get('iid', WT_REGEX_XREF); |
@@ -277,7 +284,8 @@ discard block |
||
277 | 284 | * |
278 | 285 | * @return string |
279 | 286 | */ |
280 | - public static function formatCensusNote(Note $note) { |
|
287 | + public static function formatCensusNote(Note $note) |
|
288 | + { |
|
281 | 289 | global $WT_TREE; |
282 | 290 | |
283 | 291 | if (preg_match('/(.*)((?:\n.*)*)\n\.start_formatted_area\.\n(.+)\n(.+(?:\n.+)*)\n.end_formatted_area\.((?:\n.*)*)/', $note->getNote(), $match)) { |
@@ -363,7 +371,8 @@ discard block |
||
363 | 371 | * |
364 | 372 | * @return string |
365 | 373 | */ |
366 | - public static function censusTableHeader(CensusInterface $census) { |
|
374 | + public static function censusTableHeader(CensusInterface $census) |
|
375 | + { |
|
367 | 376 | $html = ''; |
368 | 377 | foreach ($census->columns() as $column) { |
369 | 378 | $html .= '<th title="' . $column->title() . '">' . $column->abbreviation() . '</th>'; |
@@ -382,7 +391,8 @@ discard block |
||
382 | 391 | * |
383 | 392 | * @return string |
384 | 393 | */ |
385 | - public static function censusTableEmptyRow(CensusInterface $census) { |
|
394 | + public static function censusTableEmptyRow(CensusInterface $census) |
|
395 | + { |
|
386 | 396 | return '<tr><td hidden></td>' . str_repeat('<td><input type="text"></td>', count($census->columns())) . '<td><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>'; |
387 | 397 | } |
388 | 398 | |
@@ -398,7 +408,8 @@ discard block |
||
398 | 408 | * |
399 | 409 | * @return string |
400 | 410 | */ |
401 | - public static function censusTableRow(CensusInterface $census, Individual $individual, Individual $head = null) { |
|
411 | + public static function censusTableRow(CensusInterface $census, Individual $individual, Individual $head = null) |
|
412 | + { |
|
402 | 413 | $html = ''; |
403 | 414 | foreach ($census->columns() as $column) { |
404 | 415 | $html .= '<td><input type="text" value="' . $column->generate($individual, $head) . '"></td>'; |
@@ -416,7 +427,8 @@ discard block |
||
416 | 427 | * |
417 | 428 | * @return string |
418 | 429 | */ |
419 | - public static function censusNavigatorFamily(CensusInterface $census, Family $family, Individual $head) { |
|
430 | + public static function censusNavigatorFamily(CensusInterface $census, Family $family, Individual $head) |
|
431 | + { |
|
420 | 432 | $headImg2 = '<i class="icon-button_head" title="' . I18N::translate('Head of household') . '"></i>'; |
421 | 433 | |
422 | 434 | foreach ($family->getSpouses() as $spouse) { |
@@ -22,9 +22,11 @@ |
||
22 | 22 | /** |
23 | 23 | * Upgrade the database schema from version 2 to version 3. |
24 | 24 | */ |
25 | -class Migration2 implements MigrationInterface { |
|
25 | +class Migration2 implements MigrationInterface |
|
26 | +{ |
|
26 | 27 | /** {@inheritDoc} */ |
27 | - public function upgrade() { |
|
28 | + public function upgrade() |
|
29 | + { |
|
28 | 30 | // Delete any data that might violate the new constraints |
29 | 31 | Database::exec( |
30 | 32 | "DELETE FROM `##news`" . |
@@ -22,9 +22,11 @@ |
||
22 | 22 | /** |
23 | 23 | * Upgrade the database schema from version 1 to version 2. |
24 | 24 | */ |
25 | -class Migration1 implements MigrationInterface { |
|
25 | +class Migration1 implements MigrationInterface |
|
26 | +{ |
|
26 | 27 | /** {@inheritDoc} */ |
27 | - public function upgrade() { |
|
28 | + public function upgrade() |
|
29 | + { |
|
28 | 30 | // Add new columns |
29 | 31 | try { |
30 | 32 | Database::exec( |
@@ -21,9 +21,11 @@ |
||
21 | 21 | /** |
22 | 22 | * Upgrade the database schema from version 0 (empty database) to version 1. |
23 | 23 | */ |
24 | -class Migration0 implements MigrationInterface { |
|
24 | +class Migration0 implements MigrationInterface |
|
25 | +{ |
|
25 | 26 | /** {@inheritDoc} */ |
26 | - public function upgrade() { |
|
27 | + public function upgrade() |
|
28 | + { |
|
27 | 29 | Database::exec( |
28 | 30 | "CREATE TABLE IF NOT EXISTS `##news` (" . |
29 | 31 | " n_id INTEGER AUTO_INCREMENT NOT NULL," . |
@@ -18,7 +18,8 @@ |
||
18 | 18 | /** |
19 | 19 | * Interface ModuleTabInterface - Classes and libraries for module system |
20 | 20 | */ |
21 | -interface ModuleTabInterface { |
|
21 | +interface ModuleTabInterface |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * The user can re-arrange the tab order, but until they do, this |
24 | 25 | * is the order in which tabs are shown. |
@@ -27,13 +27,15 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Class RelativesTabModule |
29 | 29 | */ |
30 | -class RelativesTabModule extends AbstractModule implements ModuleTabInterface { |
|
30 | +class RelativesTabModule extends AbstractModule implements ModuleTabInterface |
|
31 | +{ |
|
31 | 32 | /** |
32 | 33 | * How should this module be labelled on tabs, menus, etc.? |
33 | 34 | * |
34 | 35 | * @return string |
35 | 36 | */ |
36 | - public function getTitle() { |
|
37 | + public function getTitle() |
|
38 | + { |
|
37 | 39 | return /* I18N: Name of a module */ I18N::translate('Families'); |
38 | 40 | } |
39 | 41 | |
@@ -42,7 +44,8 @@ discard block |
||
42 | 44 | * |
43 | 45 | * @return string |
44 | 46 | */ |
45 | - public function getDescription() { |
|
47 | + public function getDescription() |
|
48 | + { |
|
46 | 49 | return /* I18N: Description of the “Families” module */ I18N::translate('A tab showing the close relatives of an individual.'); |
47 | 50 | } |
48 | 51 | |
@@ -52,7 +55,8 @@ discard block |
||
52 | 55 | * |
53 | 56 | * @return int |
54 | 57 | */ |
55 | - public function defaultTabOrder() { |
|
58 | + public function defaultTabOrder() |
|
59 | + { |
|
56 | 60 | return 20; |
57 | 61 | } |
58 | 62 | |
@@ -65,7 +69,8 @@ discard block |
||
65 | 69 | * |
66 | 70 | * @return string |
67 | 71 | */ |
68 | - private static function ageDifference(Date $prev, Date $next, $child_number = 0) { |
|
72 | + private static function ageDifference(Date $prev, Date $next, $child_number = 0) |
|
73 | + { |
|
69 | 74 | if ($prev->isOK() && $next->isOK()) { |
70 | 75 | $days = $next->maximumJulianDay() - $prev->minimumJulianDay(); |
71 | 76 | if ($days < 0) { |
@@ -98,7 +103,8 @@ discard block |
||
98 | 103 | * @param string $type |
99 | 104 | * @param string $label |
100 | 105 | */ |
101 | - private function printFamily(Family $family, $type, $label) { |
|
106 | + private function printFamily(Family $family, $type, $label) |
|
107 | + { |
|
102 | 108 | global $controller; |
103 | 109 | |
104 | 110 | if ($family->getTree()->getPreference('SHOW_PRIVATE_RELATIONSHIPS')) { |
@@ -296,7 +302,8 @@ discard block |
||
296 | 302 | } |
297 | 303 | |
298 | 304 | /** {@inheritdoc} */ |
299 | - public function getTabContent() { |
|
305 | + public function getTabContent() |
|
306 | + { |
|
300 | 307 | global $show_full, $controller; |
301 | 308 | |
302 | 309 | if (isset($show_full)) { |
@@ -415,20 +422,24 @@ discard block |
||
415 | 422 | } |
416 | 423 | |
417 | 424 | /** {@inheritdoc} */ |
418 | - public function hasTabContent() { |
|
425 | + public function hasTabContent() |
|
426 | + { |
|
419 | 427 | return true; |
420 | 428 | } |
421 | 429 | /** {@inheritdoc} */ |
422 | - public function isGrayedOut() { |
|
430 | + public function isGrayedOut() |
|
431 | + { |
|
423 | 432 | return false; |
424 | 433 | } |
425 | 434 | /** {@inheritdoc} */ |
426 | - public function canLoadAjax() { |
|
435 | + public function canLoadAjax() |
|
436 | + { |
|
427 | 437 | return !Auth::isSearchEngine(); // Search engines cannot use AJAX |
428 | 438 | } |
429 | 439 | |
430 | 440 | /** {@inheritdoc} */ |
431 | - public function getPreLoadContent() { |
|
441 | + public function getPreLoadContent() |
|
442 | + { |
|
432 | 443 | return ''; |
433 | 444 | } |
434 | 445 | } |
@@ -26,13 +26,15 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Class TopPageViewsModule |
28 | 28 | */ |
29 | -class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface { |
|
29 | +class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface |
|
30 | +{ |
|
30 | 31 | /** |
31 | 32 | * How should this module be labelled on tabs, menus, etc.? |
32 | 33 | * |
33 | 34 | * @return string |
34 | 35 | */ |
35 | - public function getTitle() { |
|
36 | + public function getTitle() |
|
37 | + { |
|
36 | 38 | return /* I18N: Name of a module */ I18N::translate('Most viewed pages'); |
37 | 39 | } |
38 | 40 | |
@@ -41,7 +43,8 @@ discard block |
||
41 | 43 | * |
42 | 44 | * @return string |
43 | 45 | */ |
44 | - public function getDescription() { |
|
46 | + public function getDescription() |
|
47 | + { |
|
45 | 48 | return /* I18N: Description of the “Most visited pages” module */ I18N::translate('A list of the pages that have been viewed the most number of times.'); |
46 | 49 | } |
47 | 50 | |
@@ -54,7 +57,8 @@ discard block |
||
54 | 57 | * |
55 | 58 | * @return string |
56 | 59 | */ |
57 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
60 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
61 | + { |
|
58 | 62 | global $ctype, $WT_TREE; |
59 | 63 | |
60 | 64 | $num = $this->getBlockSetting($block_id, 'num', '10'); |
@@ -119,7 +123,8 @@ discard block |
||
119 | 123 | * |
120 | 124 | * @return bool |
121 | 125 | */ |
122 | - public function loadAjax() { |
|
126 | + public function loadAjax() |
|
127 | + { |
|
123 | 128 | return true; |
124 | 129 | } |
125 | 130 | |
@@ -128,7 +133,8 @@ discard block |
||
128 | 133 | * |
129 | 134 | * @return bool |
130 | 135 | */ |
131 | - public function isUserBlock() { |
|
136 | + public function isUserBlock() |
|
137 | + { |
|
132 | 138 | return false; |
133 | 139 | } |
134 | 140 | |
@@ -137,7 +143,8 @@ discard block |
||
137 | 143 | * |
138 | 144 | * @return bool |
139 | 145 | */ |
140 | - public function isGedcomBlock() { |
|
146 | + public function isGedcomBlock() |
|
147 | + { |
|
141 | 148 | return true; |
142 | 149 | } |
143 | 150 | |
@@ -146,7 +153,8 @@ discard block |
||
146 | 153 | * |
147 | 154 | * @param int $block_id |
148 | 155 | */ |
149 | - public function configureBlock($block_id) { |
|
156 | + public function configureBlock($block_id) |
|
157 | + { |
|
150 | 158 | if (Filter::postBool('save') && Filter::checkCsrf()) { |
151 | 159 | $this->setBlockSetting($block_id, 'num', Filter::postInteger('num', 1, 10000, 10)); |
152 | 160 | $this->setBlockSetting($block_id, 'count_placement', Filter::post('count_placement', 'before|after', 'before')); |
@@ -21,7 +21,8 @@ |
||
21 | 21 | /** |
22 | 22 | * Interface ModuleChartInterface - Classes and libraries for module system |
23 | 23 | */ |
24 | -interface ModuleChartInterface { |
|
24 | +interface ModuleChartInterface |
|
25 | +{ |
|
25 | 26 | /** |
26 | 27 | * Return a menu item for this chart. |
27 | 28 | * |