@@ -18,40 +18,40 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class JsonController extends BaseController { |
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * {@inheritDoc} |
|
| 23 | - * @see \Fisharebest\Webtrees\Controller\BaseController::pageHeader() |
|
| 24 | - */ |
|
| 25 | - public function pageHeader() { |
|
| 26 | - header('Content-Type: application/json'); |
|
| 27 | - header('Cache-Control: no-cache, must-revalidate'); |
|
| 28 | - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
|
| 29 | - // We've displayed the header - display the footer automatically |
|
| 30 | - register_shutdown_function(array($this, 'pageFooter')); |
|
| 21 | + /** |
|
| 22 | + * {@inheritDoc} |
|
| 23 | + * @see \Fisharebest\Webtrees\Controller\BaseController::pageHeader() |
|
| 24 | + */ |
|
| 25 | + public function pageHeader() { |
|
| 26 | + header('Content-Type: application/json'); |
|
| 27 | + header('Cache-Control: no-cache, must-revalidate'); |
|
| 28 | + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
|
| 29 | + // We've displayed the header - display the footer automatically |
|
| 30 | + register_shutdown_function(array($this, 'pageFooter')); |
|
| 31 | 31 | |
| 32 | - return $this; |
|
| 33 | - } |
|
| 32 | + return $this; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * {@inheritDoc} |
|
| 37 | - * @see \Fisharebest\Webtrees\Controller\BaseController::pageFooter() |
|
| 38 | - */ |
|
| 39 | - public function pageFooter() { |
|
| 40 | - return $this; |
|
| 41 | - } |
|
| 35 | + /** |
|
| 36 | + * {@inheritDoc} |
|
| 37 | + * @see \Fisharebest\Webtrees\Controller\BaseController::pageFooter() |
|
| 38 | + */ |
|
| 39 | + public function pageFooter() { |
|
| 40 | + return $this; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Restrict access. |
|
| 45 | - * |
|
| 46 | - * @param bool $condition |
|
| 47 | - * |
|
| 48 | - * @return $this |
|
| 49 | - */ |
|
| 50 | - public function restrictAccess($condition) { |
|
| 51 | - if ($condition !== true) { |
|
| 52 | - throw new MvcException(403); |
|
| 53 | - } |
|
| 43 | + /** |
|
| 44 | + * Restrict access. |
|
| 45 | + * |
|
| 46 | + * @param bool $condition |
|
| 47 | + * |
|
| 48 | + * @return $this |
|
| 49 | + */ |
|
| 50 | + public function restrictAccess($condition) { |
|
| 51 | + if ($condition !== true) { |
|
| 52 | + throw new MvcException(403); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - return $this; |
|
| 56 | - } |
|
| 55 | + return $this; |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | * {@inhericDoc} |
| 31 | 31 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
| 32 | 32 | */ |
| 33 | - protected function renderContent() { |
|
| 33 | + protected function renderContent() { |
|
| 34 | 34 | |
| 35 | - if($this->data->get('has_sosa', false)) { |
|
| 36 | - $table_id = $this->data->get('table_id'); |
|
| 37 | - ?> |
|
| 35 | + if($this->data->get('has_sosa', false)) { |
|
| 36 | + $table_id = $this->data->get('table_id'); |
|
| 37 | + ?> |
|
| 38 | 38 | |
| 39 | 39 | <div id="sosa-indi-list" class="sosa-list"> |
| 40 | 40 | <table id="<?php echo $table_id;?>"> |
@@ -185,42 +185,42 @@ discard block |
||
| 185 | 185 | <tbody> |
| 186 | 186 | |
| 187 | 187 | <?php foreach($this->data->get('sosa_list') as $sosa => $person) { |
| 188 | - /** @var \Fisharebest\Webtrees\Individual $person */ |
|
| 189 | - if ($person->isPendingAddtion()) { |
|
| 190 | - $class = ' class="new"'; |
|
| 191 | - } elseif ($person->isPendingDeletion()) { |
|
| 192 | - $class = ' class="old"'; |
|
| 193 | - } else { |
|
| 194 | - $class = ''; |
|
| 195 | - } |
|
| 196 | - $dperson = new \MyArtJaub\Webtrees\Individual($person); |
|
| 197 | - ?> |
|
| 188 | + /** @var \Fisharebest\Webtrees\Individual $person */ |
|
| 189 | + if ($person->isPendingAddtion()) { |
|
| 190 | + $class = ' class="new"'; |
|
| 191 | + } elseif ($person->isPendingDeletion()) { |
|
| 192 | + $class = ' class="old"'; |
|
| 193 | + } else { |
|
| 194 | + $class = ''; |
|
| 195 | + } |
|
| 196 | + $dperson = new \MyArtJaub\Webtrees\Individual($person); |
|
| 197 | + ?> |
|
| 198 | 198 | <tr <?php echo $class?>> |
| 199 | 199 | <td class="transparent"><?php echo $sosa; ?></td> |
| 200 | 200 | <td class="transparent"><?php echo $person->getXref(); ?></td> |
| 201 | 201 | <td colspan="2"> |
| 202 | 202 | <?php foreach ($person->getAllNames() as $num=>$name) { |
| 203 | - if ($name['type']=='NAME') { |
|
| 204 | - $title=''; |
|
| 205 | - } else { |
|
| 206 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
| 207 | - } |
|
| 208 | - if ($num==$person->getPrimaryName()) { |
|
| 209 | - $class=' class="name2"'; |
|
| 210 | - $sex_image=$person->getSexImage(); |
|
| 211 | - list($surn, $givn)=explode(',', $name['sort']); |
|
| 212 | - } else { |
|
| 213 | - $class=''; |
|
| 214 | - $sex_image=''; |
|
| 215 | - } ?> |
|
| 203 | + if ($name['type']=='NAME') { |
|
| 204 | + $title=''; |
|
| 205 | + } else { |
|
| 206 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
| 207 | + } |
|
| 208 | + if ($num==$person->getPrimaryName()) { |
|
| 209 | + $class=' class="name2"'; |
|
| 210 | + $sex_image=$person->getSexImage(); |
|
| 211 | + list($surn, $givn)=explode(',', $name['sort']); |
|
| 212 | + } else { |
|
| 213 | + $class=''; |
|
| 214 | + $sex_image=''; |
|
| 215 | + } ?> |
|
| 216 | 216 | <a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>"> |
| 217 | 217 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
| 218 | 218 | </a> |
| 219 | 219 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dperson->getSosaNumbers(), 1, 'smaller'); ?> |
| 220 | 220 | <br/> |
| 221 | 221 | <?php } |
| 222 | - echo $person->getPrimaryParentsNames('parents details1', 'none'); |
|
| 223 | - ?> |
|
| 222 | + echo $person->getPrimaryParentsNames('parents details1', 'none'); |
|
| 223 | + ?> |
|
| 224 | 224 | </td> |
| 225 | 225 | <td style="display:none;"></td> |
| 226 | 226 | <td> |
@@ -231,35 +231,35 @@ discard block |
||
| 231 | 231 | </td> |
| 232 | 232 | <td> |
| 233 | 233 | <?php |
| 234 | - if ($birth_dates=$person->getAllBirthDates()) { |
|
| 235 | - foreach ($birth_dates as $num=>$birth_date) { |
|
| 236 | - if ($num) { ?><br/><?php } ?> |
|
| 234 | + if ($birth_dates=$person->getAllBirthDates()) { |
|
| 235 | + foreach ($birth_dates as $num=>$birth_date) { |
|
| 236 | + if ($num) { ?><br/><?php } ?> |
|
| 237 | 237 | <?php echo $birth_date->display(true); |
| 238 | - } |
|
| 239 | - } else { |
|
| 240 | - $birth_date = new Date(''); |
|
| 241 | - if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
|
| 242 | - $birth_date=$person->getEstimatedBirthDate(); |
|
| 243 | - echo $birth_date->display(true); |
|
| 244 | - } else { |
|
| 245 | - echo ' '; |
|
| 246 | - } |
|
| 247 | - $birth_dates[0] = new Date(''); |
|
| 248 | - } |
|
| 249 | - ?> |
|
| 238 | + } |
|
| 239 | + } else { |
|
| 240 | + $birth_date = new Date(''); |
|
| 241 | + if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
|
| 242 | + $birth_date=$person->getEstimatedBirthDate(); |
|
| 243 | + echo $birth_date->display(true); |
|
| 244 | + } else { |
|
| 245 | + echo ' '; |
|
| 246 | + } |
|
| 247 | + $birth_dates[0] = new Date(''); |
|
| 248 | + } |
|
| 249 | + ?> |
|
| 250 | 250 | </td> |
| 251 | 251 | <td><?php echo $birth_date->julianDay();?></td> |
| 252 | 252 | <td> |
| 253 | 253 | <?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) { |
| 254 | - $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
|
| 255 | - if ($n) { ?><br><?php } ?> |
|
| 254 | + $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
|
| 255 | + if ($n) { ?><br><?php } ?> |
|
| 256 | 256 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
| 257 | 257 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
| 258 | 258 | </a> |
| 259 | 259 | <?php } ?> |
| 260 | 260 | </td> |
| 261 | 261 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
| 262 | - $isBSourced = $dperson->isBirthSourced(); ?> |
|
| 262 | + $isBSourced = $dperson->isBirthSourced(); ?> |
|
| 263 | 263 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isBSourced, 'BIRT', 1, 'medium'); ?></td> |
| 264 | 264 | <td><?php echo $isBSourced; ?></td> |
| 265 | 265 | <?php } else { ?> |
@@ -269,38 +269,38 @@ discard block |
||
| 269 | 269 | <td> |
| 270 | 270 | <?php |
| 271 | 271 | if ($death_dates = $person->getAllDeathDates()) { |
| 272 | - foreach ($death_dates as $num => $death_date) { |
|
| 273 | - if ($num) { ?><br/><?php } ?> |
|
| 272 | + foreach ($death_dates as $num => $death_date) { |
|
| 273 | + if ($num) { ?><br/><?php } ?> |
|
| 274 | 274 | <?php echo $death_date->display(true); |
| 275 | - } |
|
| 276 | - } else { |
|
| 277 | - $death_date = $person->getEstimatedDeathDate(); |
|
| 278 | - if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES') && $death_date->minimumJulianDay() < WT_CLIENT_JD) { |
|
| 279 | - echo $death_date->display(true); |
|
| 280 | - } elseif ($person->isDead()) { |
|
| 281 | - echo I18N::translate('yes'); |
|
| 282 | - $death_date = new Date(''); |
|
| 283 | - } else { |
|
| 284 | - echo ' '; |
|
| 285 | - $death_date = new Date(''); |
|
| 286 | - } |
|
| 287 | - $death_dates[0] = new Date(''); |
|
| 288 | - } ?> |
|
| 275 | + } |
|
| 276 | + } else { |
|
| 277 | + $death_date = $person->getEstimatedDeathDate(); |
|
| 278 | + if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES') && $death_date->minimumJulianDay() < WT_CLIENT_JD) { |
|
| 279 | + echo $death_date->display(true); |
|
| 280 | + } elseif ($person->isDead()) { |
|
| 281 | + echo I18N::translate('yes'); |
|
| 282 | + $death_date = new Date(''); |
|
| 283 | + } else { |
|
| 284 | + echo ' '; |
|
| 285 | + $death_date = new Date(''); |
|
| 286 | + } |
|
| 287 | + $death_dates[0] = new Date(''); |
|
| 288 | + } ?> |
|
| 289 | 289 | </td> |
| 290 | 290 | <td><?php echo $death_date->julianDay(); ?></td> |
| 291 | 291 | <td><?php echo Date::getAge($birth_dates[0], $death_dates[0], 2); ?></td> |
| 292 | 292 | <td><?php echo Date::getAge($birth_dates[0], $death_dates[0], 1); ?></td> |
| 293 | 293 | <td> |
| 294 | 294 | <?php foreach ($person->getAllDeathPlaces() as $n => $death_place) { |
| 295 | - $tmp = new Place($death_place, $person->getTree()); |
|
| 296 | - if ($n) { ?><br><?php } ?> |
|
| 295 | + $tmp = new Place($death_place, $person->getTree()); |
|
| 296 | + if ($n) { ?><br><?php } ?> |
|
| 297 | 297 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
| 298 | 298 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
| 299 | 299 | </a> |
| 300 | 300 | <?php } ?> |
| 301 | 301 | </td> |
| 302 | 302 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
| 303 | - $isDSourced = $dperson->isDeathSourced(); ?> |
|
| 303 | + $isDSourced = $dperson->isDeathSourced(); ?> |
|
| 304 | 304 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isDSourced, 'DEAT', 1, 'medium'); ?></td> |
| 305 | 305 | <td><?php echo $isDSourced; ?></td> |
| 306 | 306 | <?php } else { ?> |
@@ -310,29 +310,29 @@ discard block |
||
| 310 | 310 | <td><?php echo $person->getSex(); ?></td> |
| 311 | 311 | <td> |
| 312 | 312 | <?php if (!$person->canShow() || Date::compare($birth_date, new Date(date('Y') - 100)) > 0) { |
| 313 | - echo 'Y100'; |
|
| 314 | - } else { |
|
| 315 | - echo 'YES'; |
|
| 316 | - } ?> |
|
| 313 | + echo 'Y100'; |
|
| 314 | + } else { |
|
| 315 | + echo 'YES'; |
|
| 316 | + } ?> |
|
| 317 | 317 | </td> |
| 318 | 318 | <td> |
| 319 | 319 | <?php if (Date::compare($death_dates[0], new Date(date('Y') - 100)) > 0) { |
| 320 | - echo 'Y100'; |
|
| 321 | - } elseif ($death_dates[0]->minimumJulianDay() || $person->isDead()) { |
|
| 322 | - echo 'YES'; |
|
| 323 | - } else { |
|
| 324 | - echo 'N'; |
|
| 325 | - } ?> |
|
| 320 | + echo 'Y100'; |
|
| 321 | + } elseif ($death_dates[0]->minimumJulianDay() || $person->isDead()) { |
|
| 322 | + echo 'YES'; |
|
| 323 | + } else { |
|
| 324 | + echo 'N'; |
|
| 325 | + } ?> |
|
| 326 | 326 | </td> |
| 327 | 327 | <td> |
| 328 | 328 | <?php if (!$person->getChildFamilies()) { |
| 329 | - echo 'R'; |
|
| 329 | + echo 'R'; |
|
| 330 | 330 | } // roots |
| 331 | 331 | elseif (!$person->isDead() && $person->getNumberOfChildren() < 1) { |
| 332 | - echo 'L'; |
|
| 332 | + echo 'L'; |
|
| 333 | 333 | } // leaves |
| 334 | 334 | else { |
| 335 | - echo ' '; |
|
| 335 | + echo ' '; |
|
| 336 | 336 | } ?> |
| 337 | 337 | </td> |
| 338 | 338 | </tr> |
@@ -343,12 +343,12 @@ discard block |
||
| 343 | 343 | <th class="ui-state-default" colspan="22"> |
| 344 | 344 | <div class="center"> |
| 345 | 345 | <?php echo I18N::translate('Number of Sosa ancestors: %1$s known / %2$s theoretical (%3$s)', |
| 346 | - I18N::number($this->data->get('sosa_count')), |
|
| 347 | - I18N::number($this->data->get('sosa_theo')), |
|
| 348 | - I18N::percentage($this->data->get('sosa_ratio'),2) |
|
| 349 | - ); ?> |
|
| 346 | + I18N::number($this->data->get('sosa_count')), |
|
| 347 | + I18N::number($this->data->get('sosa_theo')), |
|
| 348 | + I18N::percentage($this->data->get('sosa_ratio'),2) |
|
| 349 | + ); ?> |
|
| 350 | 350 | <?php if($this->data->get('sosa_hidden') > 0) { |
| 351 | - echo '['. I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
| 351 | + echo '['. I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
| 352 | 352 | } ?> |
| 353 | 353 | </div> |
| 354 | 354 | </th> |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | </div> |
| 383 | 383 | </div> |
| 384 | 384 | <?php |
| 385 | - } |
|
| 386 | - } |
|
| 385 | + } |
|
| 386 | + } |
|
| 387 | 387 | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | \ No newline at end of file |
@@ -32,12 +32,12 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function renderContent() { |
| 34 | 34 | |
| 35 | - if($this->data->get('has_sosa', false)) { |
|
| 35 | + if ($this->data->get('has_sosa', false)) { |
|
| 36 | 36 | $table_id = $this->data->get('table_id'); |
| 37 | 37 | ?> |
| 38 | 38 | |
| 39 | 39 | <div id="sosa-indi-list" class="sosa-list"> |
| 40 | - <table id="<?php echo $table_id;?>"> |
|
| 40 | + <table id="<?php echo $table_id; ?>"> |
|
| 41 | 41 | <thead> |
| 42 | 42 | <tr> |
| 43 | 43 | <th colspan="22"> |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | </thead> |
| 185 | 185 | <tbody> |
| 186 | 186 | |
| 187 | - <?php foreach($this->data->get('sosa_list') as $sosa => $person) { |
|
| 187 | + <?php foreach ($this->data->get('sosa_list') as $sosa => $person) { |
|
| 188 | 188 | /** @var \Fisharebest\Webtrees\Individual $person */ |
| 189 | 189 | if ($person->isPendingAddtion()) { |
| 190 | 190 | $class = ' class="new"'; |
@@ -200,18 +200,18 @@ discard block |
||
| 200 | 200 | <td class="transparent"><?php echo $person->getXref(); ?></td> |
| 201 | 201 | <td colspan="2"> |
| 202 | 202 | <?php foreach ($person->getAllNames() as $num=>$name) { |
| 203 | - if ($name['type']=='NAME') { |
|
| 204 | - $title=''; |
|
| 203 | + if ($name['type'] == 'NAME') { |
|
| 204 | + $title = ''; |
|
| 205 | 205 | } else { |
| 206 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
| 206 | + $title = 'title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
| 207 | 207 | } |
| 208 | - if ($num==$person->getPrimaryName()) { |
|
| 209 | - $class=' class="name2"'; |
|
| 210 | - $sex_image=$person->getSexImage(); |
|
| 211 | - list($surn, $givn)=explode(',', $name['sort']); |
|
| 208 | + if ($num == $person->getPrimaryName()) { |
|
| 209 | + $class = ' class="name2"'; |
|
| 210 | + $sex_image = $person->getSexImage(); |
|
| 211 | + list($surn, $givn) = explode(',', $name['sort']); |
|
| 212 | 212 | } else { |
| 213 | - $class=''; |
|
| 214 | - $sex_image=''; |
|
| 213 | + $class = ''; |
|
| 214 | + $sex_image = ''; |
|
| 215 | 215 | } ?> |
| 216 | 216 | <a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>"> |
| 217 | 217 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | </td> |
| 225 | 225 | <td style="display:none;"></td> |
| 226 | 226 | <td> |
| 227 | - <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
| 227 | + <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)).'AAAA'.Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
| 228 | 228 | </td> |
| 229 | 229 | <td> |
| 230 | - <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
| 230 | + <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)).'AAAA'.Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
| 231 | 231 | </td> |
| 232 | 232 | <td> |
| 233 | 233 | <?php |
| 234 | - if ($birth_dates=$person->getAllBirthDates()) { |
|
| 234 | + if ($birth_dates = $person->getAllBirthDates()) { |
|
| 235 | 235 | foreach ($birth_dates as $num=>$birth_date) { |
| 236 | 236 | if ($num) { ?><br/><?php } ?> |
| 237 | 237 | <?php echo $birth_date->display(true); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } else { |
| 240 | 240 | $birth_date = new Date(''); |
| 241 | 241 | if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
| 242 | - $birth_date=$person->getEstimatedBirthDate(); |
|
| 242 | + $birth_date = $person->getEstimatedBirthDate(); |
|
| 243 | 243 | echo $birth_date->display(true); |
| 244 | 244 | } else { |
| 245 | 245 | echo ' '; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | ?> |
| 250 | 250 | </td> |
| 251 | - <td><?php echo $birth_date->julianDay();?></td> |
|
| 251 | + <td><?php echo $birth_date->julianDay(); ?></td> |
|
| 252 | 252 | <td> |
| 253 | 253 | <?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) { |
| 254 | 254 | $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
@@ -345,10 +345,10 @@ discard block |
||
| 345 | 345 | <?php echo I18N::translate('Number of Sosa ancestors: %1$s known / %2$s theoretical (%3$s)', |
| 346 | 346 | I18N::number($this->data->get('sosa_count')), |
| 347 | 347 | I18N::number($this->data->get('sosa_theo')), |
| 348 | - I18N::percentage($this->data->get('sosa_ratio'),2) |
|
| 348 | + I18N::percentage($this->data->get('sosa_ratio'), 2) |
|
| 349 | 349 | ); ?> |
| 350 | - <?php if($this->data->get('sosa_hidden') > 0) { |
|
| 351 | - echo '['. I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
| 350 | + <?php if ($this->data->get('sosa_hidden') > 0) { |
|
| 351 | + echo '['.I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
| 352 | 352 | } ?> |
| 353 | 353 | </div> |
| 354 | 354 | </th> |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | <button type="button" class="ui-state-default btn-toggle-parents"> |
| 361 | 361 | <?php echo I18N::translate('Show parents') ?> |
| 362 | 362 | </button> |
| 363 | - <button id="btn-toggle-statistics-<?php echo $table_id ;?>" type="button" class="ui-state-default btn-toggle-statistics"> |
|
| 363 | + <button id="btn-toggle-statistics-<?php echo $table_id; ?>" type="button" class="ui-state-default btn-toggle-statistics"> |
|
| 364 | 364 | <?php echo I18N::translate('Show statistics charts') ?> |
| 365 | 365 | </button> |
| 366 | 366 | </div> |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | * {@inhericDoc} |
| 25 | 25 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
| 26 | 26 | */ |
| 27 | - protected function renderContent() { |
|
| 27 | + protected function renderContent() { |
|
| 28 | 28 | |
| 29 | - ?> |
|
| 29 | + ?> |
|
| 30 | 30 | |
| 31 | 31 | <div id="maj-sosa-config-page"> |
| 32 | 32 | <h2><?php echo $this->data->get('title'); ?></h2> |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | </div> |
| 47 | 47 | <div class="value"> |
| 48 | 48 | <?php |
| 49 | - $users = $this->data->get('users_settings'); |
|
| 50 | - if(count($users) == 1) { |
|
| 51 | - $root_indi = $users[0]['rootid']; ?> |
|
| 49 | + $users = $this->data->get('users_settings'); |
|
| 50 | + if(count($users) == 1) { |
|
| 51 | + $root_indi = $users[0]['rootid']; ?> |
|
| 52 | 52 | <label> |
| 53 | 53 | <input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?>" /> |
| 54 | 54 | <?php echo $users[0]['user']->getRealNameHtml() ?> |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | <?php } else if(count($users) > 1) { ?> |
| 57 | 57 | <select id='maj-sosa-config-select' name="userid"> |
| 58 | 58 | <?php |
| 59 | - $root_indi = $users[0]['rootid']; |
|
| 60 | - foreach ($this->data->get('users_settings') as $user) { ?> |
|
| 59 | + $root_indi = $users[0]['rootid']; |
|
| 60 | + foreach ($this->data->get('users_settings') as $user) { ?> |
|
| 61 | 61 | <option value="<?php echo $user['user']->getUserId(); ?>"><?php echo $user['user']->getRealNameHtml() ?></option> |
| 62 | 62 | <?php } ?> |
| 63 | 63 | </select> |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | </form> |
| 81 | 81 | |
| 82 | 82 | <?php |
| 83 | - } |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | \ No newline at end of file |
@@ -47,13 +47,13 @@ |
||
| 47 | 47 | <div class="value"> |
| 48 | 48 | <?php |
| 49 | 49 | $users = $this->data->get('users_settings'); |
| 50 | - if(count($users) == 1) { |
|
| 51 | - $root_indi = $users[0]['rootid']; ?> |
|
| 50 | + if (count($users) == 1) { |
|
| 51 | + $root_indi = $users[0]['rootid']; ?> |
|
| 52 | 52 | <label> |
| 53 | 53 | <input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?>" /> |
| 54 | 54 | <?php echo $users[0]['user']->getRealNameHtml() ?> |
| 55 | 55 | </label> |
| 56 | - <?php } else if(count($users) > 1) { ?> |
|
| 56 | + <?php } else if (count($users) > 1) { ?> |
|
| 57 | 57 | <select id='maj-sosa-config-select' name="userid"> |
| 58 | 58 | <?php |
| 59 | 59 | $root_indi = $users[0]['rootid']; |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function getInstance() |
| 45 | 45 | { |
| 46 | - if (null === static::$instance) { |
|
| 47 | - static::$instance = new static(); |
|
| 48 | - } |
|
| 46 | + if (null === static::$instance) { |
|
| 47 | + static::$instance = new static(); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - return static::$instance; |
|
| 50 | + return static::$instance; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::get() |
| 56 | 56 | */ |
| 57 | 57 | public function get($hook_function, $hook_context = null) { |
| 58 | - return new Hook($hook_function, $hook_context); |
|
| 58 | + return new Hook($hook_function, $hook_context); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -73,20 +73,20 @@ discard block |
||
| 73 | 73 | public function getPossibleHooks() { |
| 74 | 74 | static $hooks=null; |
| 75 | 75 | if ($hooks === null) { |
| 76 | - $hooks = array(); |
|
| 76 | + $hooks = array(); |
|
| 77 | 77 | |
| 78 | - // Cannot use the same logic as the core Module loading, |
|
| 79 | - // as this forces a new include of the module.php file. |
|
| 80 | - // This causes issue when classes are defined in this file. |
|
| 81 | - // Cannot use Module::getActiveModules as well, as this is private. |
|
| 82 | - $module_names = Database::prepare( |
|
| 83 | - 'SELECT SQL_CACHE module_name FROM `##module`' |
|
| 84 | - )->fetchOneColumn(); |
|
| 78 | + // Cannot use the same logic as the core Module loading, |
|
| 79 | + // as this forces a new include of the module.php file. |
|
| 80 | + // This causes issue when classes are defined in this file. |
|
| 81 | + // Cannot use Module::getActiveModules as well, as this is private. |
|
| 82 | + $module_names = Database::prepare( |
|
| 83 | + 'SELECT SQL_CACHE module_name FROM `##module`' |
|
| 84 | + )->fetchOneColumn(); |
|
| 85 | 85 | |
| 86 | - foreach($module_names as $module_name) { |
|
| 87 | - $module = Module::getModuleByName($module_name); |
|
| 86 | + foreach($module_names as $module_name) { |
|
| 87 | + $module = Module::getModuleByName($module_name); |
|
| 88 | 88 | |
| 89 | - if($module instanceof HookSubscriberInterface){ |
|
| 89 | + if($module instanceof HookSubscriberInterface){ |
|
| 90 | 90 | $subscribedhooks = $module->getSubscribedHooks(); |
| 91 | 91 | if(is_array($subscribedhooks)){ |
| 92 | 92 | foreach($subscribedhooks as $key => $value){ |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | - } |
|
| 114 | + } |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | return $hooks; |
@@ -153,33 +153,33 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function updateHooks() { |
| 155 | 155 | |
| 156 | - if(Auth::isAdmin()){ |
|
| 157 | - $ihooks = self::getInstalledHooks(); |
|
| 158 | - $phooks = self::getPossibleHooks(); |
|
| 156 | + if(Auth::isAdmin()){ |
|
| 157 | + $ihooks = self::getInstalledHooks(); |
|
| 158 | + $phooks = self::getPossibleHooks(); |
|
| 159 | 159 | |
| 160 | - // Insert hooks not existing yet in the DB |
|
| 161 | - if($phooks !== null){ |
|
| 162 | - foreach($phooks as $phook => $priority){ |
|
| 163 | - $array_hook = explode('#', $phook); |
|
| 164 | - if($ihooks === null || !array_key_exists($phook, $ihooks)){ |
|
| 165 | - $chook = new Hook($array_hook[1], $array_hook[2]); |
|
| 166 | - $chook->subscribe($array_hook[0]); |
|
| 167 | - $chook->setPriority($array_hook[0], $priority); |
|
| 168 | - } |
|
| 169 | - } |
|
| 170 | - } |
|
| 160 | + // Insert hooks not existing yet in the DB |
|
| 161 | + if($phooks !== null){ |
|
| 162 | + foreach($phooks as $phook => $priority){ |
|
| 163 | + $array_hook = explode('#', $phook); |
|
| 164 | + if($ihooks === null || !array_key_exists($phook, $ihooks)){ |
|
| 165 | + $chook = new Hook($array_hook[1], $array_hook[2]); |
|
| 166 | + $chook->subscribe($array_hook[0]); |
|
| 167 | + $chook->setPriority($array_hook[0], $priority); |
|
| 168 | + } |
|
| 169 | + } |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - //Remove hooks not existing any more in the file system |
|
| 173 | - if($ihooks !== null){ |
|
| 174 | - foreach(array_keys($ihooks) as $ihook){ |
|
| 175 | - $array_hook = explode('#', $ihook); |
|
| 176 | - if($phooks === null || !array_key_exists($ihook, $phooks)){ |
|
| 177 | - $chook = new Hook($array_hook[1], $array_hook[2]); |
|
| 178 | - $chook->remove($array_hook[0]); |
|
| 179 | - } |
|
| 180 | - } |
|
| 181 | - } |
|
| 182 | - } |
|
| 172 | + //Remove hooks not existing any more in the file system |
|
| 173 | + if($ihooks !== null){ |
|
| 174 | + foreach(array_keys($ihooks) as $ihook){ |
|
| 175 | + $array_hook = explode('#', $ihook); |
|
| 176 | + if($phooks === null || !array_key_exists($ihook, $phooks)){ |
|
| 177 | + $chook = new Hook($array_hook[1], $array_hook[2]); |
|
| 178 | + $chook->remove($array_hook[0]); |
|
| 179 | + } |
|
| 180 | + } |
|
| 181 | + } |
|
| 182 | + } |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | } |
| 186 | 186 | \ No newline at end of file |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getPossibleHooks() |
| 72 | 72 | */ |
| 73 | 73 | public function getPossibleHooks() { |
| 74 | - static $hooks=null; |
|
| 74 | + static $hooks = null; |
|
| 75 | 75 | if ($hooks === null) { |
| 76 | 76 | $hooks = array(); |
| 77 | 77 | |
@@ -83,31 +83,31 @@ discard block |
||
| 83 | 83 | 'SELECT SQL_CACHE module_name FROM `##module`' |
| 84 | 84 | )->fetchOneColumn(); |
| 85 | 85 | |
| 86 | - foreach($module_names as $module_name) { |
|
| 86 | + foreach ($module_names as $module_name) { |
|
| 87 | 87 | $module = Module::getModuleByName($module_name); |
| 88 | 88 | |
| 89 | - if($module instanceof HookSubscriberInterface){ |
|
| 89 | + if ($module instanceof HookSubscriberInterface) { |
|
| 90 | 90 | $subscribedhooks = $module->getSubscribedHooks(); |
| 91 | - if(is_array($subscribedhooks)){ |
|
| 92 | - foreach($subscribedhooks as $key => $value){ |
|
| 93 | - if(is_int($key)) { |
|
| 91 | + if (is_array($subscribedhooks)) { |
|
| 92 | + foreach ($subscribedhooks as $key => $value) { |
|
| 93 | + if (is_int($key)) { |
|
| 94 | 94 | $hook_item = $value; |
| 95 | 95 | $priority = self::DEFAULT_PRIORITY; |
| 96 | 96 | } |
| 97 | - else{ |
|
| 97 | + else { |
|
| 98 | 98 | $hook_item = explode('#', $key, 2); |
| 99 | 99 | $priority = $value; |
| 100 | 100 | } |
| 101 | - if($hook_item && count($hook_item) == 2){ |
|
| 101 | + if ($hook_item && count($hook_item) == 2) { |
|
| 102 | 102 | $hook_func = $hook_item[0]; |
| 103 | 103 | $hook_cont = $hook_item[1]; |
| 104 | 104 | } |
| 105 | - else{ |
|
| 105 | + else { |
|
| 106 | 106 | $hook_func = $hook_item[0]; |
| 107 | 107 | $hook_cont = 'all'; |
| 108 | 108 | } |
| 109 | - if(method_exists($module, $hook_func)){ |
|
| 110 | - $hooks[$module->getName().'#'.$hook_func.'#'.$hook_cont]=$priority; |
|
| 109 | + if (method_exists($module, $hook_func)) { |
|
| 110 | + $hooks[$module->getName().'#'.$hook_func.'#'.$hook_cont] = $priority; |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | } |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | * {@inheritDoc} |
| 122 | 122 | * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getRawInstalledHooks() |
| 123 | 123 | */ |
| 124 | - public function getRawInstalledHooks(){ |
|
| 125 | - if(self::isModuleOperational()){ |
|
| 124 | + public function getRawInstalledHooks() { |
|
| 125 | + if (self::isModuleOperational()) { |
|
| 126 | 126 | return Database::prepare( |
| 127 | 127 | "SELECT majh_id AS id, majh_module_name AS module, majh_hook_function AS hook, majh_hook_context as context, majh_module_priority AS priority, majh_status AS status". |
| 128 | 128 | " FROM `##maj_hooks`". |
@@ -136,11 +136,11 @@ discard block |
||
| 136 | 136 | * {@inheritDoc} |
| 137 | 137 | * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getInstalledHooks() |
| 138 | 138 | */ |
| 139 | - public function getInstalledHooks(){ |
|
| 140 | - static $installedhooks =null; |
|
| 141 | - if($installedhooks===null){ |
|
| 142 | - $dbhooks=self::getRawInstalledHooks(); |
|
| 143 | - foreach($dbhooks as $dbhook){ |
|
| 139 | + public function getInstalledHooks() { |
|
| 140 | + static $installedhooks = null; |
|
| 141 | + if ($installedhooks === null) { |
|
| 142 | + $dbhooks = self::getRawInstalledHooks(); |
|
| 143 | + foreach ($dbhooks as $dbhook) { |
|
| 144 | 144 | $installedhooks[($dbhook->module).'#'.($dbhook->hook).'#'.($dbhook->context)] = array('id' => $dbhook->id, 'status' => $dbhook->status, 'priority' => $dbhook->priority); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -153,15 +153,15 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function updateHooks() { |
| 155 | 155 | |
| 156 | - if(Auth::isAdmin()){ |
|
| 156 | + if (Auth::isAdmin()) { |
|
| 157 | 157 | $ihooks = self::getInstalledHooks(); |
| 158 | 158 | $phooks = self::getPossibleHooks(); |
| 159 | 159 | |
| 160 | 160 | // Insert hooks not existing yet in the DB |
| 161 | - if($phooks !== null){ |
|
| 162 | - foreach($phooks as $phook => $priority){ |
|
| 161 | + if ($phooks !== null) { |
|
| 162 | + foreach ($phooks as $phook => $priority) { |
|
| 163 | 163 | $array_hook = explode('#', $phook); |
| 164 | - if($ihooks === null || !array_key_exists($phook, $ihooks)){ |
|
| 164 | + if ($ihooks === null || !array_key_exists($phook, $ihooks)) { |
|
| 165 | 165 | $chook = new Hook($array_hook[1], $array_hook[2]); |
| 166 | 166 | $chook->subscribe($array_hook[0]); |
| 167 | 167 | $chook->setPriority($array_hook[0], $priority); |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | //Remove hooks not existing any more in the file system |
| 173 | - if($ihooks !== null){ |
|
| 174 | - foreach(array_keys($ihooks) as $ihook){ |
|
| 173 | + if ($ihooks !== null) { |
|
| 174 | + foreach (array_keys($ihooks) as $ihook) { |
|
| 175 | 175 | $array_hook = explode('#', $ihook); |
| 176 | - if($phooks === null || !array_key_exists($ihook, $phooks)){ |
|
| 176 | + if ($phooks === null || !array_key_exists($ihook, $phooks)) { |
|
| 177 | 177 | $chook = new Hook($array_hook[1], $array_hook[2]); |
| 178 | 178 | $chook->remove($array_hook[0]); |
| 179 | 179 | } |
@@ -93,16 +93,14 @@ |
||
| 93 | 93 | if(is_int($key)) { |
| 94 | 94 | $hook_item = $value; |
| 95 | 95 | $priority = self::DEFAULT_PRIORITY; |
| 96 | - } |
|
| 97 | - else{ |
|
| 96 | + } else{ |
|
| 98 | 97 | $hook_item = explode('#', $key, 2); |
| 99 | 98 | $priority = $value; |
| 100 | 99 | } |
| 101 | 100 | if($hook_item && count($hook_item) == 2){ |
| 102 | 101 | $hook_func = $hook_item[0]; |
| 103 | 102 | $hook_cont = $hook_item[1]; |
| 104 | - } |
|
| 105 | - else{ |
|
| 103 | + } else{ |
|
| 106 | 104 | $hook_func = $hook_item[0]; |
| 107 | 105 | $hook_cont = 'all'; |
| 108 | 106 | } |