@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
27 | - ?> |
|
26 | + protected function renderContent() { |
|
27 | + ?> |
|
28 | 28 | <div id="maj-sosa-list-page" class="center"> |
29 | 29 | <h2><?php echo $this->data->get('title'); ?></h2> |
30 | 30 | |
31 | 31 | <?php if($this->data->get('is_setup')) { |
32 | - $selectedgen = $this->data->get('generation'); |
|
33 | - $this->renderSosaHeader(); |
|
34 | - if($this->data->get('has_sosa') ) { |
|
35 | - if($selectedgen > 0) { |
|
36 | - ?> |
|
32 | + $selectedgen = $this->data->get('generation'); |
|
33 | + $this->renderSosaHeader(); |
|
34 | + if($this->data->get('has_sosa') ) { |
|
35 | + if($selectedgen > 0) { |
|
36 | + ?> |
|
37 | 37 | <div id="sosalist-tabs"> |
38 | 38 | <ul> |
39 | 39 | <li><a href="#sosalist-indi"><?php echo I18N::translate('Individuals'); ?></a></li> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <?php } else { ?> |
54 | 54 | <p class="warning"><?php echo I18N::translate('No ancestor has been found for generation %d', $selectedgen); ?></p> |
55 | 55 | <?php } |
56 | - } |
|
56 | + } |
|
57 | 57 | } else { ?> |
58 | 58 | <p class="warning"><?php echo I18N::translate('The list could not be displayed. Reasons might be:'); ?><br/> |
59 | 59 | <ul> |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | <?php } ?> |
65 | 65 | </div> |
66 | 66 | <?php |
67 | - } |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * Render the common header to Sosa Lists, made of the generation selector, and the generation navigator |
|
71 | - */ |
|
72 | - protected function renderSosaHeader() { |
|
73 | - $selectedgen = $this->data->get('generation'); |
|
74 | - $max_gen = $this->data->get('max_gen'); |
|
75 | - ?> |
|
69 | + /** |
|
70 | + * Render the common header to Sosa Lists, made of the generation selector, and the generation navigator |
|
71 | + */ |
|
72 | + protected function renderSosaHeader() { |
|
73 | + $selectedgen = $this->data->get('generation'); |
|
74 | + $max_gen = $this->data->get('max_gen'); |
|
75 | + ?> |
|
76 | 76 | |
77 | 77 | <form method="get" name="setgen" action="module.php"> |
78 | 78 | <input type="hidden" name="mod" value="<?php echo $this->data->get('url_module');?>"> |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | <?php |
119 | 119 | } |
120 | - } |
|
120 | + } |
|
121 | 121 | |
122 | 122 | } |
123 | 123 | |
124 | 124 | \ No newline at end of file |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
27 | - ?> |
|
26 | + protected function renderContent() { |
|
27 | + ?> |
|
28 | 28 | <div id="maj-sosa-stats-page"> |
29 | 29 | <h2><?php echo $this->data->get('title'); ?></h2> |
30 | 30 | |
31 | 31 | <?php if($this->data->get('is_setup')) { |
32 | - $general_stats = $this->data->get('general_stats'); ?> |
|
32 | + $general_stats = $this->data->get('general_stats'); ?> |
|
33 | 33 | <h3><?php echo I18N::translate('General statistics'); ?></h3> |
34 | 34 | <div class="maj-table"> |
35 | 35 | <div class="maj-row"> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | <?php } else { ?> |
135 | 135 | <div class="warning"><?php echo I18N::translate('No Sosa root individual has been defined.'); ?></div> |
136 | 136 | <?php } |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | 139 | } |
140 | 140 | |
141 | 141 | \ No newline at end of file |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * {@inhericDoc} |
33 | 33 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
34 | 34 | */ |
35 | - protected function renderContent() { |
|
35 | + protected function renderContent() { |
|
36 | 36 | |
37 | - if($this->data->get('has_sosa', false)) { |
|
38 | - $table_id = $this->data->get('table_id'); |
|
39 | - ?> |
|
37 | + if($this->data->get('has_sosa', false)) { |
|
38 | + $table_id = $this->data->get('table_id'); |
|
39 | + ?> |
|
40 | 40 | |
41 | 41 | <div id="sosa-fam-list" class="sosa-list"> |
42 | 42 | <table id="<?php echo $table_id; ?>"> |
@@ -187,59 +187,59 @@ discard block |
||
187 | 187 | <tbody> |
188 | 188 | |
189 | 189 | <?php foreach($this->data->get('sosa_list') as $sosa => $family) { |
190 | - /** @var \Fisharebest\Webtrees\Family $person */ |
|
190 | + /** @var \Fisharebest\Webtrees\Family $person */ |
|
191 | 191 | |
192 | - //PERSO Create decorator for Family |
|
193 | - $dfamily = new Family($family); |
|
192 | + //PERSO Create decorator for Family |
|
193 | + $dfamily = new Family($family); |
|
194 | 194 | |
195 | - $husb = $family->getHusband(); |
|
196 | - if (is_null($husb)) { |
|
197 | - $husb = new Individual('H', '0 @H@ INDI', null, $family->getTree()); |
|
198 | - } |
|
199 | - $dhusb = new \MyArtJaub\Webtrees\Individual($husb); |
|
200 | - $wife = $family->getWife(); |
|
201 | - if (is_null($wife)) { |
|
202 | - $wife = new Individual('W', '0 @W@ INDI', null, $family->getTree()); |
|
203 | - } |
|
204 | - $dwife = new \MyArtJaub\Webtrees\Individual($wife); |
|
195 | + $husb = $family->getHusband(); |
|
196 | + if (is_null($husb)) { |
|
197 | + $husb = new Individual('H', '0 @H@ INDI', null, $family->getTree()); |
|
198 | + } |
|
199 | + $dhusb = new \MyArtJaub\Webtrees\Individual($husb); |
|
200 | + $wife = $family->getWife(); |
|
201 | + if (is_null($wife)) { |
|
202 | + $wife = new Individual('W', '0 @W@ INDI', null, $family->getTree()); |
|
203 | + } |
|
204 | + $dwife = new \MyArtJaub\Webtrees\Individual($wife); |
|
205 | 205 | |
206 | - $mdate=$family->getMarriageDate(); |
|
206 | + $mdate=$family->getMarriageDate(); |
|
207 | 207 | |
208 | - if ($family->isPendingAddtion()) { |
|
209 | - $class = ' class="new"'; |
|
210 | - } elseif ($family->isPendingDeletion()) { |
|
211 | - $class = ' class="old"'; |
|
212 | - } else { |
|
213 | - $class = ''; |
|
214 | - } |
|
215 | - ?> |
|
208 | + if ($family->isPendingAddtion()) { |
|
209 | + $class = ' class="new"'; |
|
210 | + } elseif ($family->isPendingDeletion()) { |
|
211 | + $class = ' class="old"'; |
|
212 | + } else { |
|
213 | + $class = ''; |
|
214 | + } |
|
215 | + ?> |
|
216 | 216 | <tr <?php echo $class?>> |
217 | 217 | <td class="transparent"><?php echo I18N::translate('%1$d/%2$d', $sosa, ($sosa + 1) % 10); ?></td> |
218 | 218 | <td class="transparent"><?php echo $sosa; ?></td> |
219 | 219 | <!-- HUSBAND --> |
220 | 220 | <td colspan="2"> |
221 | 221 | <?php foreach ($husb->getAllNames() as $num=>$name) { |
222 | - if ($name['type']=='NAME') { |
|
223 | - $title=''; |
|
224 | - } else { |
|
225 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $husb)).'"'; |
|
226 | - } |
|
227 | - if ($num==$husb->getPrimaryName()) { |
|
228 | - $class=' class="name2"'; |
|
229 | - $sex_image=$husb->getSexImage(); |
|
230 | - list($surn, $givn)=explode(',', $name['sort']); |
|
231 | - } else { |
|
232 | - $class=''; |
|
233 | - $sex_image=''; |
|
234 | - } ?> |
|
222 | + if ($name['type']=='NAME') { |
|
223 | + $title=''; |
|
224 | + } else { |
|
225 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $husb)).'"'; |
|
226 | + } |
|
227 | + if ($num==$husb->getPrimaryName()) { |
|
228 | + $class=' class="name2"'; |
|
229 | + $sex_image=$husb->getSexImage(); |
|
230 | + list($surn, $givn)=explode(',', $name['sort']); |
|
231 | + } else { |
|
232 | + $class=''; |
|
233 | + $sex_image=''; |
|
234 | + } ?> |
|
235 | 235 | <a <?php echo $title.' '.$class; ?> href="<?php echo $husb->getHtmlUrl(); ?>"> |
236 | 236 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
237 | 237 | </a> |
238 | 238 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dhusb->getSosaNumbers(), 1, 'smaller'); ?> |
239 | 239 | <br/> |
240 | 240 | <?php } |
241 | - echo $husb->getPrimaryParentsNames('parents details1', 'none'); |
|
242 | - ?> |
|
241 | + echo $husb->getPrimaryParentsNames('parents details1', 'none'); |
|
242 | + ?> |
|
243 | 243 | </td> |
244 | 244 | <!-- Dummy column to match colspan in header --> |
245 | 245 | <td style="display:none;"></td> |
@@ -255,27 +255,27 @@ discard block |
||
255 | 255 | <!-- WIFE --> |
256 | 256 | <td colspan="2"> |
257 | 257 | <?php foreach ($wife->getAllNames() as $num=>$name) { |
258 | - if ($name['type']=='NAME') { |
|
259 | - $title=''; |
|
260 | - } else { |
|
261 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $wife)).'"'; |
|
262 | - } |
|
263 | - if ($num==$wife->getPrimaryName()) { |
|
264 | - $class=' class="name2"'; |
|
265 | - $sex_image=$wife->getSexImage(); |
|
266 | - list($surn, $givn)=explode(',', $name['sort']); |
|
267 | - } else { |
|
268 | - $class=''; |
|
269 | - $sex_image=''; |
|
270 | - } ?> |
|
258 | + if ($name['type']=='NAME') { |
|
259 | + $title=''; |
|
260 | + } else { |
|
261 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $wife)).'"'; |
|
262 | + } |
|
263 | + if ($num==$wife->getPrimaryName()) { |
|
264 | + $class=' class="name2"'; |
|
265 | + $sex_image=$wife->getSexImage(); |
|
266 | + list($surn, $givn)=explode(',', $name['sort']); |
|
267 | + } else { |
|
268 | + $class=''; |
|
269 | + $sex_image=''; |
|
270 | + } ?> |
|
271 | 271 | <a <?php echo $title.' '.$class; ?> href="<?php echo $wife->getHtmlUrl(); ?>"> |
272 | 272 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
273 | 273 | </a> |
274 | 274 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dwife->getSosaNumbers(), 1, 'smaller'); ?> |
275 | 275 | <br/> |
276 | 276 | <?php } |
277 | - echo $wife->getPrimaryParentsNames('parents details1', 'none'); |
|
278 | - ?> |
|
277 | + echo $wife->getPrimaryParentsNames('parents details1', 'none'); |
|
278 | + ?> |
|
279 | 279 | </td> |
280 | 280 | <!-- Dummy column to match colspan in header --> |
281 | 281 | <td style="display:none;"></td> |
@@ -289,31 +289,31 @@ discard block |
||
289 | 289 | <td><?php Date::getAge($wdate, $mdate, 2); ?></td> |
290 | 290 | <td><?php Date::getAge($wdate, $mdate, 1); ?></td> |
291 | 291 | <td><?php |
292 | - if ($marriage_dates = $family->getAllMarriageDates()) { |
|
293 | - foreach ($marriage_dates as $n => $marriage_date) { |
|
294 | - if ($n) { echo '<br>'; } ?> |
|
292 | + if ($marriage_dates = $family->getAllMarriageDates()) { |
|
293 | + foreach ($marriage_dates as $n => $marriage_date) { |
|
294 | + if ($n) { echo '<br>'; } ?> |
|
295 | 295 | <div><?php echo $marriage_date->display(true); ?></div> |
296 | 296 | <?php } |
297 | - } elseif ($family->getFacts('_NMR')) { |
|
298 | - echo I18N::translate('no'); |
|
299 | - } elseif ($family->getFacts('MARR')) { |
|
300 | - echo I18N::translate('yes'); |
|
301 | - } else { |
|
302 | - echo ' '; |
|
303 | - } ?> |
|
297 | + } elseif ($family->getFacts('_NMR')) { |
|
298 | + echo I18N::translate('no'); |
|
299 | + } elseif ($family->getFacts('MARR')) { |
|
300 | + echo I18N::translate('yes'); |
|
301 | + } else { |
|
302 | + echo ' '; |
|
303 | + } ?> |
|
304 | 304 | </td> |
305 | 305 | <td><?php echo $marriage_dates ? $marriage_date->julianDay() : 0; ?></td> |
306 | 306 | <td><?php |
307 | - foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) { |
|
308 | - $tmp = new Place($marriage_place, $family->getTree()); |
|
309 | - if ($n) { ?><br><?php } ?> |
|
307 | + foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) { |
|
308 | + $tmp = new Place($marriage_place, $family->getTree()); |
|
309 | + if ($n) { ?><br><?php } ?> |
|
310 | 310 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
311 | 311 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
312 | 312 | </a> |
313 | 313 | <?php } ?> |
314 | 314 | </td> |
315 | 315 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
316 | - $isMSourced = $dfamily->isMarriageSourced(); ?> |
|
316 | + $isMSourced = $dfamily->isMarriageSourced(); ?> |
|
317 | 317 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isMSourced, 'MARR', 1, 'medium'); ?></td> |
318 | 318 | <td><?php echo $isMSourced; ?></td> |
319 | 319 | <?php } else { ?> |
@@ -326,30 +326,30 @@ discard block |
||
326 | 326 | <td><?php |
327 | 327 | if (!$mdate->isOK()) { echo 'U'; } |
328 | 328 | else { |
329 | - if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } |
|
330 | - else { echo 'YES'; } |
|
329 | + if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } |
|
330 | + else { echo 'YES'; } |
|
331 | 331 | } |
332 | 332 | if ($family->getFacts(WT_EVENTS_DIV)) { echo 'D'; } |
333 | 333 | if (count($husb->getSpouseFamilies()) > 1 || count($wife->getSpouseFamilies()) > 1) { |
334 | - echo 'M'; |
|
334 | + echo 'M'; |
|
335 | 335 | } ?> |
336 | 336 | </td> |
337 | 337 | <td><?php |
338 | - if ($husb->isDead() && $wife->isDead()) { echo 'Y'; } |
|
339 | - if ($husb->isDead() && !$wife->isDead()) { |
|
340 | - if ($wife->getSex() == 'F') { echo 'H'; } |
|
341 | - if ($wife->getSex() == 'M') { echo 'W'; } // male partners |
|
342 | - } |
|
343 | - if (!$husb->isDead() && $wife->isDead()) { |
|
344 | - if ($husb->getSex() == 'M') { echo 'W'; } |
|
345 | - if ($husb->getSex() == 'F') { echo 'H'; } // female partners |
|
346 | - } |
|
347 | - if (!$husb->isDead() && !$wife->isDead()) { echo 'N'; } ?> |
|
338 | + if ($husb->isDead() && $wife->isDead()) { echo 'Y'; } |
|
339 | + if ($husb->isDead() && !$wife->isDead()) { |
|
340 | + if ($wife->getSex() == 'F') { echo 'H'; } |
|
341 | + if ($wife->getSex() == 'M') { echo 'W'; } // male partners |
|
342 | + } |
|
343 | + if (!$husb->isDead() && $wife->isDead()) { |
|
344 | + if ($husb->getSex() == 'M') { echo 'W'; } |
|
345 | + if ($husb->getSex() == 'F') { echo 'H'; } // female partners |
|
346 | + } |
|
347 | + if (!$husb->isDead() && !$wife->isDead()) { echo 'N'; } ?> |
|
348 | 348 | </td> |
349 | 349 | <td><?php |
350 | - if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } |
|
351 | - elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } |
|
352 | - else { echo ' '; } ?> |
|
350 | + if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } |
|
351 | + elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } |
|
352 | + else { echo ' '; } ?> |
|
353 | 353 | </td> |
354 | 354 | </tr> |
355 | 355 | <?php } ?> |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | <p class="warning"><?php echo I18N::translate('No family has been found for generation %d', $this->data->get('generation')); ?></p> |
388 | 388 | <?php |
389 | 389 | } |
390 | - } |
|
390 | + } |
|
391 | 391 | |
392 | 392 | } |
393 | 393 | |
394 | 394 | \ No newline at end of file |
@@ -23,18 +23,18 @@ |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
26 | + protected function renderContent() { |
|
27 | 27 | |
28 | - if($this->data->get('is_success', false)) { |
|
29 | - ?> |
|
28 | + if($this->data->get('is_success', false)) { |
|
29 | + ?> |
|
30 | 30 | <i class="icon-maj-success" title="<?php echo I18N::translate('Success'); ?>"></i> |
31 | 31 | <?php echo I18N::translate('Success'); ?> |
32 | 32 | <?php } else { ?> |
33 | 33 | <i class="icon-maj-error" title="<?php echo I18N::translate('Error'); ?>"></i> |
34 | 34 | <?php echo I18N::translate('Error'); ?> |
35 | 35 | <?php if($error = $this->data->get('error')) { echo ' - ' . $error; } |
36 | - } |
|
37 | - } |
|
36 | + } |
|
37 | + } |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | 41 | \ No newline at end of file |
@@ -23,17 +23,17 @@ |
||
23 | 23 | |
24 | 24 | Database::exec( |
25 | 25 | "CREATE TABLE IF NOT EXISTS `##maj_hooks` (". |
26 | - " majh_id INTEGER AUTO_INCREMENT NOT NULL,". |
|
27 | - " majh_hook_function VARCHAR(32) NOT NULL,". |
|
26 | + " majh_id INTEGER AUTO_INCREMENT NOT NULL,". |
|
27 | + " majh_hook_function VARCHAR(32) NOT NULL,". |
|
28 | 28 | " majh_hook_context VARCHAR(32) NOT NULL DEFAULT 'all',". |
29 | - " majh_module_name VARCHAR(32) NOT NULL,". |
|
30 | - " majh_module_priority INTEGER NOT NULL DEFAULT 99,". |
|
31 | - " majh_status ENUM('enabled', 'disabled') NOT NULL DEFAULT 'enabled',". |
|
32 | - " PRIMARY KEY (majh_id),". |
|
33 | - " UNIQUE KEY `##maj_hooks_uk` (majh_hook_function, majh_hook_context, majh_module_name),". |
|
34 | - " FOREIGN KEY `##module_name_fk1` (majh_module_name)". |
|
29 | + " majh_module_name VARCHAR(32) NOT NULL,". |
|
30 | + " majh_module_priority INTEGER NOT NULL DEFAULT 99,". |
|
31 | + " majh_status ENUM('enabled', 'disabled') NOT NULL DEFAULT 'enabled',". |
|
32 | + " PRIMARY KEY (majh_id),". |
|
33 | + " UNIQUE KEY `##maj_hooks_uk` (majh_hook_function, majh_hook_context, majh_module_name),". |
|
34 | + " FOREIGN KEY `##module_name_fk1` (majh_module_name)". |
|
35 | 35 | " REFERENCES `##module` (module_name) ON DELETE CASCADE ON UPDATE CASCADE". |
36 | - ") COLLATE utf8_unicode_ci ENGINE=InnoDB" |
|
36 | + ") COLLATE utf8_unicode_ci ENGINE=InnoDB" |
|
37 | 37 | ); |
38 | 38 | } |
39 | 39 | } |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | * {@inhericDoc} |
26 | 26 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
27 | 27 | */ |
28 | - protected function renderContent() { |
|
28 | + protected function renderContent() { |
|
29 | 29 | |
30 | - $table_id = $this->data->get('table_id'); |
|
30 | + $table_id = $this->data->get('table_id'); |
|
31 | 31 | |
32 | - ?> |
|
32 | + ?> |
|
33 | 33 | <ol class="breadcrumb small"> |
34 | 34 | <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li> |
35 | 35 | <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | </div> |
80 | 80 | |
81 | 81 | <?php |
82 | - } |
|
82 | + } |
|
83 | 83 | |
84 | 84 | } |
85 | 85 | |
86 | 86 | \ No newline at end of file |
@@ -49,62 +49,62 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Protected constructor. |
|
53 | - */ |
|
54 | - protected function __construct() |
|
55 | - { |
|
56 | - $this->modules_list = array(); |
|
57 | - } |
|
52 | + * Protected constructor. |
|
53 | + */ |
|
54 | + protected function __construct() |
|
55 | + { |
|
56 | + $this->modules_list = array(); |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * {@inheritDoc} |
|
61 | - * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational() |
|
62 | - */ |
|
63 | - public function isOperational($moduleName) { |
|
64 | - if(!array_key_exists($moduleName, $this->modules_list)) { |
|
65 | - if($module = fw\Module::getModuleByName($moduleName)) { |
|
66 | - if($module instanceof DependentInterface) { |
|
67 | - if($module->validatePrerequisites()) { |
|
68 | - $this->modules_list[$moduleName] = TRUE; |
|
69 | - return true; |
|
70 | - } else { |
|
71 | - // Do not cache the result, |
|
72 | - // as they could change by the next call to the method |
|
73 | - return false; |
|
74 | - } |
|
75 | - } |
|
76 | - else { |
|
77 | - $this->modules_list[$moduleName] = TRUE; |
|
78 | - return true; |
|
79 | - } |
|
80 | - } |
|
81 | - else { |
|
82 | - $this->modules_list[$moduleName] = FALSE; |
|
83 | - } |
|
84 | - } |
|
85 | - return $this->modules_list[$moduleName]; |
|
59 | + /** |
|
60 | + * {@inheritDoc} |
|
61 | + * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational() |
|
62 | + */ |
|
63 | + public function isOperational($moduleName) { |
|
64 | + if(!array_key_exists($moduleName, $this->modules_list)) { |
|
65 | + if($module = fw\Module::getModuleByName($moduleName)) { |
|
66 | + if($module instanceof DependentInterface) { |
|
67 | + if($module->validatePrerequisites()) { |
|
68 | + $this->modules_list[$moduleName] = TRUE; |
|
69 | + return true; |
|
70 | + } else { |
|
71 | + // Do not cache the result, |
|
72 | + // as they could change by the next call to the method |
|
73 | + return false; |
|
74 | + } |
|
75 | + } |
|
76 | + else { |
|
77 | + $this->modules_list[$moduleName] = TRUE; |
|
78 | + return true; |
|
79 | + } |
|
80 | + } |
|
81 | + else { |
|
82 | + $this->modules_list[$moduleName] = FALSE; |
|
83 | + } |
|
84 | + } |
|
85 | + return $this->modules_list[$moduleName]; |
|
86 | 86 | |
87 | - } |
|
87 | + } |
|
88 | 88 | |
89 | 89 | |
90 | - /** |
|
91 | - * Private clone method to prevent cloning of the instance of the |
|
92 | - * *ModuleManager* instance. |
|
93 | - * |
|
94 | - * @return void |
|
95 | - */ |
|
96 | - private function __clone() |
|
97 | - { |
|
98 | - } |
|
90 | + /** |
|
91 | + * Private clone method to prevent cloning of the instance of the |
|
92 | + * *ModuleManager* instance. |
|
93 | + * |
|
94 | + * @return void |
|
95 | + */ |
|
96 | + private function __clone() |
|
97 | + { |
|
98 | + } |
|
99 | 99 | |
100 | - /** |
|
101 | - * Private unserialize method to prevent unserializing of the *ModuleManager* |
|
102 | - * instance. |
|
103 | - * |
|
104 | - * @return void |
|
105 | - */ |
|
106 | - private function __wakeup() |
|
107 | - { |
|
108 | - } |
|
100 | + /** |
|
101 | + * Private unserialize method to prevent unserializing of the *ModuleManager* |
|
102 | + * instance. |
|
103 | + * |
|
104 | + * @return void |
|
105 | + */ |
|
106 | + private function __wakeup() |
|
107 | + { |
|
108 | + } |
|
109 | 109 | |
110 | 110 | } |
@@ -28,56 +28,56 @@ |
||
28 | 28 | */ |
29 | 29 | class AdminConfigController extends MvcController |
30 | 30 | { |
31 | - /** |
|
32 | - * Manage updates sent from the AdminConfig@index form. |
|
33 | - */ |
|
34 | - protected function update() { |
|
35 | - global $WT_TREE; |
|
31 | + /** |
|
32 | + * Manage updates sent from the AdminConfig@index form. |
|
33 | + */ |
|
34 | + protected function update() { |
|
35 | + global $WT_TREE; |
|
36 | 36 | |
37 | - if(Auth::isAdmin()){ |
|
37 | + if(Auth::isAdmin()){ |
|
38 | 38 | |
39 | - $this->module->setSetting('MAJ_TITLE_PREFIX', Filter::post('MAJ_TITLE_PREFIX')); |
|
39 | + $this->module->setSetting('MAJ_TITLE_PREFIX', Filter::post('MAJ_TITLE_PREFIX')); |
|
40 | 40 | |
41 | - $this->module->setSetting('MAJ_ADD_HTML_HEADER', Filter::postInteger('MAJ_ADD_HTML_HEADER', 0, 1)); |
|
42 | - $this->module->setSetting('MAJ_SHOW_HTML_HEADER', Filter::postInteger('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE)); |
|
43 | - $this->module->setSetting('MAJ_HTML_HEADER', Filter::post('MAJ_HTML_HEADER')); |
|
41 | + $this->module->setSetting('MAJ_ADD_HTML_HEADER', Filter::postInteger('MAJ_ADD_HTML_HEADER', 0, 1)); |
|
42 | + $this->module->setSetting('MAJ_SHOW_HTML_HEADER', Filter::postInteger('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE)); |
|
43 | + $this->module->setSetting('MAJ_HTML_HEADER', Filter::post('MAJ_HTML_HEADER')); |
|
44 | 44 | |
45 | - $this->module->setSetting('MAJ_ADD_HTML_FOOTER', Filter::postInteger('MAJ_ADD_HTML_FOOTER', 0, 1)); |
|
46 | - $this->module->setSetting('MAJ_SHOW_HTML_FOOTER', Filter::postInteger('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE)); |
|
47 | - $this->module->setSetting('MAJ_HTML_FOOTER', Filter::post('MAJ_HTML_FOOTER')); |
|
45 | + $this->module->setSetting('MAJ_ADD_HTML_FOOTER', Filter::postInteger('MAJ_ADD_HTML_FOOTER', 0, 1)); |
|
46 | + $this->module->setSetting('MAJ_SHOW_HTML_FOOTER', Filter::postInteger('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE)); |
|
47 | + $this->module->setSetting('MAJ_HTML_FOOTER', Filter::post('MAJ_HTML_FOOTER')); |
|
48 | 48 | |
49 | - $this->module->setSetting('MAJ_DISPLAY_CNIL', Filter::postInteger('MAJ_DISPLAY_CNIL', 0, 1)); |
|
50 | - $this->module->setSetting('MAJ_CNIL_REFERENCE', Filter::post('MAJ_CNIL_REFERENCE')); |
|
49 | + $this->module->setSetting('MAJ_DISPLAY_CNIL', Filter::postInteger('MAJ_DISPLAY_CNIL', 0, 1)); |
|
50 | + $this->module->setSetting('MAJ_CNIL_REFERENCE', Filter::post('MAJ_CNIL_REFERENCE')); |
|
51 | 51 | |
52 | - FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->module->getTitle()), 'success'); |
|
52 | + FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->module->getTitle()), 'success'); |
|
53 | 53 | |
54 | - return; |
|
55 | - } |
|
56 | - } |
|
54 | + return; |
|
55 | + } |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * Pages |
|
60 | - */ |
|
58 | + /** |
|
59 | + * Pages |
|
60 | + */ |
|
61 | 61 | |
62 | - /** |
|
63 | - * AdminConfig@index |
|
64 | - */ |
|
65 | - public function index() { |
|
66 | - global $WT_TREE; |
|
62 | + /** |
|
63 | + * AdminConfig@index |
|
64 | + */ |
|
65 | + public function index() { |
|
66 | + global $WT_TREE; |
|
67 | 67 | |
68 | - $action = Filter::post('action'); |
|
69 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
68 | + $action = Filter::post('action'); |
|
69 | + if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
70 | 70 | |
71 | - Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
72 | - $ctrl = new PageController(); |
|
73 | - $ctrl |
|
74 | - ->restrictAccess(Auth::isAdmin()) |
|
75 | - ->setPageTitle($this->module->getTitle()); |
|
71 | + Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
72 | + $ctrl = new PageController(); |
|
73 | + $ctrl |
|
74 | + ->restrictAccess(Auth::isAdmin()) |
|
75 | + ->setPageTitle($this->module->getTitle()); |
|
76 | 76 | |
77 | - $view_bag = new ViewBag(); |
|
78 | - $view_bag->set('title', $ctrl->getPageTitle()); |
|
79 | - $view_bag->set('module', $this->module); |
|
77 | + $view_bag = new ViewBag(); |
|
78 | + $view_bag->set('title', $ctrl->getPageTitle()); |
|
79 | + $view_bag->set('module', $this->module); |
|
80 | 80 | |
81 | - ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render(); |
|
82 | - } |
|
81 | + ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render(); |
|
82 | + } |
|
83 | 83 | } |
84 | 84 | \ No newline at end of file |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | * {@inhericDoc} |
29 | 29 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
30 | 30 | */ |
31 | - protected function renderContent() { |
|
31 | + protected function renderContent() { |
|
32 | 32 | |
33 | - if (Module::getModuleByName('ckeditor')) { |
|
34 | - CkeditorModule::enableEditor($this->ctrl); |
|
35 | - } |
|
33 | + if (Module::getModuleByName('ckeditor')) { |
|
34 | + CkeditorModule::enableEditor($this->ctrl); |
|
35 | + } |
|
36 | 36 | |
37 | - /** @var AbstractModule $module */ |
|
38 | - $module = $this->data->get('module'); |
|
39 | - ?> |
|
37 | + /** @var AbstractModule $module */ |
|
38 | + $module = $this->data->get('module'); |
|
39 | + ?> |
|
40 | 40 | <ol class="breadcrumb small"> |
41 | 41 | <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li> |
42 | 42 | <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li> |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | </form> |
188 | 188 | |
189 | 189 | <?php |
190 | - } |
|
190 | + } |
|
191 | 191 | |
192 | 192 | } |
193 | 193 | |
194 | 194 | \ No newline at end of file |