summaryrefslogtreecommitdiff
path: root/app/Module/FamilyTreeStatisticsModule.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-03-29 15:59:42 +0100
committerGreg Roach <fisharebest@gmail.com>2015-03-29 20:49:35 +0100
commite2a378d30d9bd3fff591da7a11c7cb5ead502323 (patch)
tree3c4469c2e08eb9059efd61c40a931ada3dbc0e2c /app/Module/FamilyTreeStatisticsModule.php
parent06fa22107d3ca09d8b7a2c724decbc30c44d4548 (diff)
downloadwebtrees-e2a378d30d9bd3fff591da7a11c7cb5ead502323.tar.gz
webtrees-e2a378d30d9bd3fff591da7a11c7cb5ead502323.tar.bz2
webtrees-e2a378d30d9bd3fff591da7a11c7cb5ead502323.zip
Split class Module into static and abstract parts
Diffstat (limited to 'app/Module/FamilyTreeStatisticsModule.php')
-rw-r--r--app/Module/FamilyTreeStatisticsModule.php112
1 files changed, 56 insertions, 56 deletions
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php
index 7572990da5..c9e360d6f9 100644
--- a/app/Module/FamilyTreeStatisticsModule.php
+++ b/app/Module/FamilyTreeStatisticsModule.php
@@ -19,7 +19,7 @@ namespace Fisharebest\Webtrees;
/**
* Class FamilyTreeStatisticsModule
*/
-class FamilyTreeStatisticsModule extends Module implements ModuleBlockInterface {
+class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockInterface {
/** {@inheritdoc} */
public function getTitle() {
return /* I18N: Name of a module */ I18N::translate('Statistics');
@@ -34,24 +34,24 @@ class FamilyTreeStatisticsModule extends Module implements ModuleBlockInterface
public function getBlock($block_id, $template = true, $cfg = null) {
global $WT_TREE, $ctype;
- $show_last_update = get_block_setting($block_id, 'show_last_update', '1');
- $show_common_surnames = get_block_setting($block_id, 'show_common_surnames', '1');
- $stat_indi = get_block_setting($block_id, 'stat_indi', '1');
- $stat_fam = get_block_setting($block_id, 'stat_fam', '1');
- $stat_sour = get_block_setting($block_id, 'stat_sour', '1');
- $stat_media = get_block_setting($block_id, 'stat_media', '1');
- $stat_repo = get_block_setting($block_id, 'stat_repo', '1');
- $stat_surname = get_block_setting($block_id, 'stat_surname', '1');
- $stat_events = get_block_setting($block_id, 'stat_events', '1');
- $stat_users = get_block_setting($block_id, 'stat_users', '1');
- $stat_first_birth = get_block_setting($block_id, 'stat_first_birth', '1');
- $stat_last_birth = get_block_setting($block_id, 'stat_last_birth', '1');
- $stat_first_death = get_block_setting($block_id, 'stat_first_death', '1');
- $stat_last_death = get_block_setting($block_id, 'stat_last_death', '1');
- $stat_long_life = get_block_setting($block_id, 'stat_long_life', '1');
- $stat_avg_life = get_block_setting($block_id, 'stat_avg_life', '1');
- $stat_most_chil = get_block_setting($block_id, 'stat_most_chil', '1');
- $stat_avg_chil = get_block_setting($block_id, 'stat_avg_chil', '1');
+ $show_last_update = $this->getBlockSetting($block_id, 'show_last_update', '1');
+ $show_common_surnames = $this->getBlockSetting($block_id, 'show_common_surnames', '1');
+ $stat_indi = $this->getBlockSetting($block_id, 'stat_indi', '1');
+ $stat_fam = $this->getBlockSetting($block_id, 'stat_fam', '1');
+ $stat_sour = $this->getBlockSetting($block_id, 'stat_sour', '1');
+ $stat_media = $this->getBlockSetting($block_id, 'stat_media', '1');
+ $stat_repo = $this->getBlockSetting($block_id, 'stat_repo', '1');
+ $stat_surname = $this->getBlockSetting($block_id, 'stat_surname', '1');
+ $stat_events = $this->getBlockSetting($block_id, 'stat_events', '1');
+ $stat_users = $this->getBlockSetting($block_id, 'stat_users', '1');
+ $stat_first_birth = $this->getBlockSetting($block_id, 'stat_first_birth', '1');
+ $stat_last_birth = $this->getBlockSetting($block_id, 'stat_last_birth', '1');
+ $stat_first_death = $this->getBlockSetting($block_id, 'stat_first_death', '1');
+ $stat_last_death = $this->getBlockSetting($block_id, 'stat_last_death', '1');
+ $stat_long_life = $this->getBlockSetting($block_id, 'stat_long_life', '1');
+ $stat_avg_life = $this->getBlockSetting($block_id, 'stat_avg_life', '1');
+ $stat_most_chil = $this->getBlockSetting($block_id, 'stat_most_chil', '1');
+ $stat_avg_chil = $this->getBlockSetting($block_id, 'stat_avg_chil', '1');
// This can be overriden when embedding in an HTML block
$block = '0';
@@ -224,45 +224,45 @@ class FamilyTreeStatisticsModule extends Module implements ModuleBlockInterface
/** {@inheritdoc} */
public function configureBlock($block_id) {
if (Filter::postBool('save') && Filter::checkCsrf()) {
- set_block_setting($block_id, 'show_last_update', Filter::postBool('show_last_update'));
- set_block_setting($block_id, 'show_common_surnames', Filter::postBool('show_common_surnames'));
- set_block_setting($block_id, 'stat_indi', Filter::postBool('stat_indi'));
- set_block_setting($block_id, 'stat_fam', Filter::postBool('stat_fam'));
- set_block_setting($block_id, 'stat_sour', Filter::postBool('stat_sour'));
- set_block_setting($block_id, 'stat_other', Filter::postBool('stat_other'));
- set_block_setting($block_id, 'stat_media', Filter::postBool('stat_media'));
- set_block_setting($block_id, 'stat_repo', Filter::postBool('stat_repo'));
- set_block_setting($block_id, 'stat_surname', Filter::postBool('stat_surname'));
- set_block_setting($block_id, 'stat_events', Filter::postBool('stat_events'));
- set_block_setting($block_id, 'stat_users', Filter::postBool('stat_users'));
- set_block_setting($block_id, 'stat_first_birth', Filter::postBool('stat_first_birth'));
- set_block_setting($block_id, 'stat_last_birth', Filter::postBool('stat_last_birth'));
- set_block_setting($block_id, 'stat_first_death', Filter::postBool('stat_first_death'));
- set_block_setting($block_id, 'stat_last_death', Filter::postBool('stat_last_death'));
- set_block_setting($block_id, 'stat_long_life', Filter::postBool('stat_long_life'));
- set_block_setting($block_id, 'stat_avg_life', Filter::postBool('stat_avg_life'));
- set_block_setting($block_id, 'stat_most_chil', Filter::postBool('stat_most_chil'));
- set_block_setting($block_id, 'stat_avg_chil', Filter::postBool('stat_avg_chil'));
+ $this->setBlockSetting($block_id, 'show_last_update', Filter::postBool('show_last_update'));
+ $this->setBlockSetting($block_id, 'show_common_surnames', Filter::postBool('show_common_surnames'));
+ $this->setBlockSetting($block_id, 'stat_indi', Filter::postBool('stat_indi'));
+ $this->setBlockSetting($block_id, 'stat_fam', Filter::postBool('stat_fam'));
+ $this->setBlockSetting($block_id, 'stat_sour', Filter::postBool('stat_sour'));
+ $this->setBlockSetting($block_id, 'stat_other', Filter::postBool('stat_other'));
+ $this->setBlockSetting($block_id, 'stat_media', Filter::postBool('stat_media'));
+ $this->setBlockSetting($block_id, 'stat_repo', Filter::postBool('stat_repo'));
+ $this->setBlockSetting($block_id, 'stat_surname', Filter::postBool('stat_surname'));
+ $this->setBlockSetting($block_id, 'stat_events', Filter::postBool('stat_events'));
+ $this->setBlockSetting($block_id, 'stat_users', Filter::postBool('stat_users'));
+ $this->setBlockSetting($block_id, 'stat_first_birth', Filter::postBool('stat_first_birth'));
+ $this->setBlockSetting($block_id, 'stat_last_birth', Filter::postBool('stat_last_birth'));
+ $this->setBlockSetting($block_id, 'stat_first_death', Filter::postBool('stat_first_death'));
+ $this->setBlockSetting($block_id, 'stat_last_death', Filter::postBool('stat_last_death'));
+ $this->setBlockSetting($block_id, 'stat_long_life', Filter::postBool('stat_long_life'));
+ $this->setBlockSetting($block_id, 'stat_avg_life', Filter::postBool('stat_avg_life'));
+ $this->setBlockSetting($block_id, 'stat_most_chil', Filter::postBool('stat_most_chil'));
+ $this->setBlockSetting($block_id, 'stat_avg_chil', Filter::postBool('stat_avg_chil'));
}
- $show_last_update = get_block_setting($block_id, 'show_last_update', '1');
- $show_common_surnames = get_block_setting($block_id, 'show_common_surnames', '1');
- $stat_indi = get_block_setting($block_id, 'stat_indi', '1');
- $stat_fam = get_block_setting($block_id, 'stat_fam', '1');
- $stat_sour = get_block_setting($block_id, 'stat_sour', '1');
- $stat_media = get_block_setting($block_id, 'stat_media', '1');
- $stat_repo = get_block_setting($block_id, 'stat_repo', '1');
- $stat_surname = get_block_setting($block_id, 'stat_surname', '1');
- $stat_events = get_block_setting($block_id, 'stat_events', '1');
- $stat_users = get_block_setting($block_id, 'stat_users', '1');
- $stat_first_birth = get_block_setting($block_id, 'stat_first_birth', '1');
- $stat_last_birth = get_block_setting($block_id, 'stat_last_birth', '1');
- $stat_first_death = get_block_setting($block_id, 'stat_first_death', '1');
- $stat_last_death = get_block_setting($block_id, 'stat_last_death', '1');
- $stat_long_life = get_block_setting($block_id, 'stat_long_life', '1');
- $stat_avg_life = get_block_setting($block_id, 'stat_avg_life', '1');
- $stat_most_chil = get_block_setting($block_id, 'stat_most_chil', '1');
- $stat_avg_chil = get_block_setting($block_id, 'stat_avg_chil', '1');
+ $show_last_update = $this->getBlockSetting($block_id, 'show_last_update', '1');
+ $show_common_surnames = $this->getBlockSetting($block_id, 'show_common_surnames', '1');
+ $stat_indi = $this->getBlockSetting($block_id, 'stat_indi', '1');
+ $stat_fam = $this->getBlockSetting($block_id, 'stat_fam', '1');
+ $stat_sour = $this->getBlockSetting($block_id, 'stat_sour', '1');
+ $stat_media = $this->getBlockSetting($block_id, 'stat_media', '1');
+ $stat_repo = $this->getBlockSetting($block_id, 'stat_repo', '1');
+ $stat_surname = $this->getBlockSetting($block_id, 'stat_surname', '1');
+ $stat_events = $this->getBlockSetting($block_id, 'stat_events', '1');
+ $stat_users = $this->getBlockSetting($block_id, 'stat_users', '1');
+ $stat_first_birth = $this->getBlockSetting($block_id, 'stat_first_birth', '1');
+ $stat_last_birth = $this->getBlockSetting($block_id, 'stat_last_birth', '1');
+ $stat_first_death = $this->getBlockSetting($block_id, 'stat_first_death', '1');
+ $stat_last_death = $this->getBlockSetting($block_id, 'stat_last_death', '1');
+ $stat_long_life = $this->getBlockSetting($block_id, 'stat_long_life', '1');
+ $stat_avg_life = $this->getBlockSetting($block_id, 'stat_avg_life', '1');
+ $stat_most_chil = $this->getBlockSetting($block_id, 'stat_most_chil', '1');
+ $stat_avg_chil = $this->getBlockSetting($block_id, 'stat_avg_chil', '1');
echo '<tr><td class="descriptionbox wrap width33">';
echo /* I18N: label for yes/no option */ I18N::translate('Show date of last update?');