@@ -28,17 +28,20 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * Class FamilyTreeStatisticsModule |
30 | 30 | */ |
31 | -class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockInterface { |
|
31 | +class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockInterface |
|
32 | +{ |
|
32 | 33 | /** Show this number of surnames by default */ |
33 | 34 | const DEFAULT_NUMBER_OF_SURNAMES = 10; |
34 | 35 | |
35 | 36 | /** {@inheritdoc} */ |
36 | - public function getTitle() { |
|
37 | + public function getTitle() |
|
38 | + { |
|
37 | 39 | return /* I18N: Name of a module */ I18N::translate('Statistics'); |
38 | 40 | } |
39 | 41 | |
40 | 42 | /** {@inheritdoc} */ |
41 | - public function getDescription() { |
|
43 | + public function getDescription() |
|
44 | + { |
|
42 | 45 | return /* I18N: Description of “Statistics” module */ I18N::translate('The size of the family tree, earliest and latest events, common names, etc.'); |
43 | 46 | } |
44 | 47 | |
@@ -51,7 +54,8 @@ discard block |
||
51 | 54 | * |
52 | 55 | * @return string |
53 | 56 | */ |
54 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
57 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
58 | + { |
|
55 | 59 | global $WT_TREE, $ctype; |
56 | 60 | |
57 | 61 | $show_last_update = $this->getBlockSetting($block_id, 'show_last_update', '1'); |
@@ -226,17 +230,20 @@ discard block |
||
226 | 230 | } |
227 | 231 | |
228 | 232 | /** {@inheritdoc} */ |
229 | - public function loadAjax() { |
|
233 | + public function loadAjax() |
|
234 | + { |
|
230 | 235 | return true; |
231 | 236 | } |
232 | 237 | |
233 | 238 | /** {@inheritdoc} */ |
234 | - public function isUserBlock() { |
|
239 | + public function isUserBlock() |
|
240 | + { |
|
235 | 241 | return true; |
236 | 242 | } |
237 | 243 | |
238 | 244 | /** {@inheritdoc} */ |
239 | - public function isGedcomBlock() { |
|
245 | + public function isGedcomBlock() |
|
246 | + { |
|
240 | 247 | return true; |
241 | 248 | } |
242 | 249 | |
@@ -245,7 +252,8 @@ discard block |
||
245 | 252 | * |
246 | 253 | * @param int $block_id |
247 | 254 | */ |
248 | - public function configureBlock($block_id) { |
|
255 | + public function configureBlock($block_id) |
|
256 | + { |
|
249 | 257 | if (Filter::postBool('save') && Filter::checkCsrf()) { |
250 | 258 | $this->setBlockSetting($block_id, 'show_last_update', Filter::postBool('show_last_update')); |
251 | 259 | $this->setBlockSetting($block_id, 'show_common_surnames', Filter::postBool('show_common_surnames')); |
@@ -26,39 +26,46 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Class MediaTabModule |
28 | 28 | */ |
29 | -class MediaTabModule extends AbstractModule implements ModuleTabInterface { |
|
29 | +class MediaTabModule extends AbstractModule implements ModuleTabInterface |
|
30 | +{ |
|
30 | 31 | /** @var Fact[] A list of facts with media objects. */ |
31 | 32 | private $facts; |
32 | 33 | |
33 | 34 | /** {@inheritdoc} */ |
34 | - public function getTitle() { |
|
35 | + public function getTitle() |
|
36 | + { |
|
35 | 37 | return /* I18N: Name of a module */ I18N::translate('Media'); |
36 | 38 | } |
37 | 39 | |
38 | 40 | /** {@inheritdoc} */ |
39 | - public function getDescription() { |
|
41 | + public function getDescription() |
|
42 | + { |
|
40 | 43 | return /* I18N: Description of the “Media” module */ I18N::translate('A tab showing the media objects linked to an individual.'); |
41 | 44 | } |
42 | 45 | |
43 | 46 | /** {@inheritdoc} */ |
44 | - public function defaultTabOrder() { |
|
47 | + public function defaultTabOrder() |
|
48 | + { |
|
45 | 49 | return 50; |
46 | 50 | } |
47 | 51 | |
48 | 52 | /** {@inheritdoc} */ |
49 | - public function hasTabContent() { |
|
53 | + public function hasTabContent() |
|
54 | + { |
|
50 | 55 | global $WT_TREE; |
51 | 56 | |
52 | 57 | return Auth::isEditor($WT_TREE) || $this->getFactsWithMedia(); |
53 | 58 | } |
54 | 59 | |
55 | 60 | /** {@inheritdoc} */ |
56 | - public function isGrayedOut() { |
|
61 | + public function isGrayedOut() |
|
62 | + { |
|
57 | 63 | return !$this->getFactsWithMedia(); |
58 | 64 | } |
59 | 65 | |
60 | 66 | /** {@inheritdoc} */ |
61 | - public function getTabContent() { |
|
67 | + public function getTabContent() |
|
68 | + { |
|
62 | 69 | global $WT_TREE, $controller; |
63 | 70 | |
64 | 71 | ob_start(); |
@@ -106,7 +113,8 @@ discard block |
||
106 | 113 | * |
107 | 114 | * @return Fact[] |
108 | 115 | */ |
109 | - private function getFactsWithMedia() { |
|
116 | + private function getFactsWithMedia() |
|
117 | + { |
|
110 | 118 | global $controller; |
111 | 119 | |
112 | 120 | if ($this->facts === null) { |
@@ -131,12 +139,14 @@ discard block |
||
131 | 139 | } |
132 | 140 | |
133 | 141 | /** {@inheritdoc} */ |
134 | - public function canLoadAjax() { |
|
142 | + public function canLoadAjax() |
|
143 | + { |
|
135 | 144 | return !Auth::isSearchEngine(); // Search engines cannot use AJAX |
136 | 145 | } |
137 | 146 | |
138 | 147 | /** {@inheritdoc} */ |
139 | - public function getPreLoadContent() { |
|
148 | + public function getPreLoadContent() |
|
149 | + { |
|
140 | 150 | return ''; |
141 | 151 | } |
142 | 152 | } |
@@ -21,14 +21,17 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Class ThemeSelectModule |
23 | 23 | */ |
24 | -class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface { |
|
24 | +class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface |
|
25 | +{ |
|
25 | 26 | /** {@inheritdoc} */ |
26 | - public function getTitle() { |
|
27 | + public function getTitle() |
|
28 | + { |
|
27 | 29 | return /* I18N: Name of a module */ I18N::translate('Theme change'); |
28 | 30 | } |
29 | 31 | |
30 | 32 | /** {@inheritdoc} */ |
31 | - public function getDescription() { |
|
33 | + public function getDescription() |
|
34 | + { |
|
32 | 35 | return /* I18N: Description of the “Theme change” module */ I18N::translate('An alternative way to select a new theme.'); |
33 | 36 | } |
34 | 37 | |
@@ -41,7 +44,8 @@ discard block |
||
41 | 44 | * |
42 | 45 | * @return string |
43 | 46 | */ |
44 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
47 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
48 | + { |
|
45 | 49 | $id = $this->getName() . $block_id; |
46 | 50 | $class = $this->getName() . '_block'; |
47 | 51 | $title = $this->getTitle(); |
@@ -61,17 +65,20 @@ discard block |
||
61 | 65 | } |
62 | 66 | |
63 | 67 | /** {@inheritdoc} */ |
64 | - public function loadAjax() { |
|
68 | + public function loadAjax() |
|
69 | + { |
|
65 | 70 | return false; |
66 | 71 | } |
67 | 72 | |
68 | 73 | /** {@inheritdoc} */ |
69 | - public function isUserBlock() { |
|
74 | + public function isUserBlock() |
|
75 | + { |
|
70 | 76 | return true; |
71 | 77 | } |
72 | 78 | |
73 | 79 | /** {@inheritdoc} */ |
74 | - public function isGedcomBlock() { |
|
80 | + public function isGedcomBlock() |
|
81 | + { |
|
75 | 82 | return true; |
76 | 83 | } |
77 | 84 | |
@@ -80,6 +87,7 @@ discard block |
||
80 | 87 | * |
81 | 88 | * @param int $block_id |
82 | 89 | */ |
83 | - public function configureBlock($block_id) { |
|
90 | + public function configureBlock($block_id) |
|
91 | + { |
|
84 | 92 | } |
85 | 93 | } |
@@ -18,7 +18,8 @@ |
||
18 | 18 | /** |
19 | 19 | * Interface ModuleBlockInterface - Classes and libraries for module system |
20 | 20 | */ |
21 | -interface ModuleBlockInterface { |
|
21 | +interface ModuleBlockInterface |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * Generate the HTML content of this block. |
24 | 25 | * |
@@ -22,13 +22,15 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class BirthDeathMarriageReportModule |
24 | 24 | */ |
25 | -class BirthDeathMarriageReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class BirthDeathMarriageReportModule extends AbstractModule implements ModuleReportInterface |
|
26 | +{ |
|
26 | 27 | /** |
27 | 28 | * How should this module be labelled on tabs, menus, etc.? |
28 | 29 | * |
29 | 30 | * @return string |
30 | 31 | */ |
31 | - public function getTitle() { |
|
32 | + public function getTitle() |
|
33 | + { |
|
32 | 34 | // This text also appears in the .XML file - update both together |
33 | 35 | return /* I18N: Name of a module/report. “Vital records” are life events - birth/marriage/death */ I18N::translate('Vital records'); |
34 | 36 | } |
@@ -38,7 +40,8 @@ discard block |
||
38 | 40 | * |
39 | 41 | * @return string |
40 | 42 | */ |
41 | - public function getDescription() { |
|
43 | + public function getDescription() |
|
44 | + { |
|
42 | 45 | // This text also appears in the .XML file - update both together |
43 | 46 | return /* I18N: Description of the “Vital records” module. “Vital records” are life events - birth/marriage/death */ I18N::translate('A report of vital records for a given date or place.'); |
44 | 47 | } |
@@ -50,7 +53,8 @@ discard block |
||
50 | 53 | * |
51 | 54 | * @return int |
52 | 55 | */ |
53 | - public function defaultAccessLevel() { |
|
56 | + public function defaultAccessLevel() |
|
57 | + { |
|
54 | 58 | return Auth::PRIV_PRIVATE; |
55 | 59 | } |
56 | 60 | |
@@ -59,7 +63,8 @@ discard block |
||
59 | 63 | * |
60 | 64 | * @return Menu |
61 | 65 | */ |
62 | - public function getReportMenu() { |
|
66 | + public function getReportMenu() |
|
67 | + { |
|
63 | 68 | global $WT_TREE; |
64 | 69 | |
65 | 70 | return new Menu( |
@@ -22,13 +22,15 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class AhnentafelReportModule |
24 | 24 | */ |
25 | -class AhnentafelReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class AhnentafelReportModule extends AbstractModule implements ModuleReportInterface |
|
26 | +{ |
|
26 | 27 | /** |
27 | 28 | * How should this module be labelled on tabs, menus, etc.? |
28 | 29 | * |
29 | 30 | * @return string |
30 | 31 | */ |
31 | - public function getTitle() { |
|
32 | + public function getTitle() |
|
33 | + { |
|
32 | 34 | // This text also appears in the .XML file - update both together |
33 | 35 | return /* I18N: Name of a module/report */ I18N::translate('Ancestors'); |
34 | 36 | } |
@@ -38,7 +40,8 @@ discard block |
||
38 | 40 | * |
39 | 41 | * @return string |
40 | 42 | */ |
41 | - public function getDescription() { |
|
43 | + public function getDescription() |
|
44 | + { |
|
42 | 45 | // This text also appears in the .XML file - update both together |
43 | 46 | return /* I18N: Description of the “Ancestors” module */ I18N::translate('A report of an individual’s ancestors, in a narrative style.'); |
44 | 47 | } |
@@ -50,7 +53,8 @@ discard block |
||
50 | 53 | * |
51 | 54 | * @return int |
52 | 55 | */ |
53 | - public function defaultAccessLevel() { |
|
56 | + public function defaultAccessLevel() |
|
57 | + { |
|
54 | 58 | return Auth::PRIV_PRIVATE; |
55 | 59 | } |
56 | 60 | |
@@ -59,7 +63,8 @@ discard block |
||
59 | 63 | * |
60 | 64 | * @return Menu |
61 | 65 | */ |
62 | - public function getReportMenu() { |
|
66 | + public function getReportMenu() |
|
67 | + { |
|
63 | 68 | global $controller, $WT_TREE; |
64 | 69 | |
65 | 70 | return new Menu( |
@@ -22,15 +22,18 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class OccupationReportModule |
24 | 24 | */ |
25 | -class OccupationReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class OccupationReportModule 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('Occupations'); |
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 “Occupations” module */ I18N::translate('A report of individuals who had a given occupation.'); |
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_USER; |
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 $WT_TREE; |
56 | 61 | |
57 | 62 | return new Menu( |
@@ -23,14 +23,17 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * Class LoginBlockModule |
25 | 25 | */ |
26 | -class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { |
|
26 | +class LoginBlockModule extends AbstractModule implements ModuleBlockInterface |
|
27 | +{ |
|
27 | 28 | /** {@inheritdoc} */ |
28 | - public function getTitle() { |
|
29 | + public function getTitle() |
|
30 | + { |
|
29 | 31 | return /* I18N: Name of a module */ I18N::translate('Sign in'); |
30 | 32 | } |
31 | 33 | |
32 | 34 | /** {@inheritdoc} */ |
33 | - public function getDescription() { |
|
35 | + public function getDescription() |
|
36 | + { |
|
34 | 37 | return /* I18N: Description of the “Sign in” module */ I18N::translate('An alternative way to sign in and sign out.'); |
35 | 38 | } |
36 | 39 | |
@@ -43,7 +46,8 @@ discard block |
||
43 | 46 | * |
44 | 47 | * @return string |
45 | 48 | */ |
46 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
49 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
50 | + { |
|
47 | 51 | global $controller; |
48 | 52 | $id = $this->getName() . $block_id; |
49 | 53 | $class = $this->getName() . '_block'; |
@@ -116,17 +120,20 @@ discard block |
||
116 | 120 | } |
117 | 121 | |
118 | 122 | /** {@inheritdoc} */ |
119 | - public function loadAjax() { |
|
123 | + public function loadAjax() |
|
124 | + { |
|
120 | 125 | return false; |
121 | 126 | } |
122 | 127 | |
123 | 128 | /** {@inheritdoc} */ |
124 | - public function isUserBlock() { |
|
129 | + public function isUserBlock() |
|
130 | + { |
|
125 | 131 | return true; |
126 | 132 | } |
127 | 133 | |
128 | 134 | /** {@inheritdoc} */ |
129 | - public function isGedcomBlock() { |
|
135 | + public function isGedcomBlock() |
|
136 | + { |
|
130 | 137 | return true; |
131 | 138 | } |
132 | 139 | |
@@ -135,6 +142,7 @@ discard block |
||
135 | 142 | * |
136 | 143 | * @param int $block_id |
137 | 144 | */ |
138 | - public function configureBlock($block_id) { |
|
145 | + public function configureBlock($block_id) |
|
146 | + { |
|
139 | 147 | } |
140 | 148 | } |
@@ -20,7 +20,8 @@ |
||
20 | 20 | /** |
21 | 21 | * Interface ModuleMenuInterface - Classes and libraries for module system |
22 | 22 | */ |
23 | -interface ModuleMenuInterface { |
|
23 | +interface ModuleMenuInterface |
|
24 | +{ |
|
24 | 25 | /** |
25 | 26 | * The user can re-order menus. Until they do, they are shown in this order. |
26 | 27 | * |