summaryrefslogtreecommitdiff
path: root/app/Module/FamilyTreeStatisticsModule.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Module/FamilyTreeStatisticsModule.php')
-rw-r--r--app/Module/FamilyTreeStatisticsModule.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php
index d3651eb32f..0f5752bfd1 100644
--- a/app/Module/FamilyTreeStatisticsModule.php
+++ b/app/Module/FamilyTreeStatisticsModule.php
@@ -27,6 +27,7 @@ use Fisharebest\Webtrees\Module;
use Fisharebest\Webtrees\Query\QueryName;
use Fisharebest\Webtrees\Stats;
use Fisharebest\Webtrees\Theme;
+use Fisharebest\Webtrees\View;
/**
* Class FamilyTreeStatisticsModule
@@ -83,15 +84,6 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn
}
}
- $id = $this->getName() . $block_id;
- $class = $this->getName() . '_block';
- if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
- $title = FontAwesome::linkIcon('preferences', I18N::translate('Preferences'), ['class' => 'btn btn-link', 'href' => 'block_edit.php?block_id=' . $block_id . '&ged=' . $WT_TREE->getNameHtml() . '&ctype=' . $ctype]) . ' ';
- } else {
- $title = '';
- }
- $title .= $this->getTitle() . ' — ' . $WT_TREE->getTitleHtml();
-
$stats = new Stats($WT_TREE);
$content = '';
@@ -201,7 +193,19 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn
}
if ($template) {
- return Theme::theme()->formatBlock($id, $title, $class, $content);
+ if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
+ $config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
+ } else {
+ $config_url = '';
+ }
+
+ return View::make('blocks/template', [
+ 'block' => str_replace('_', '-', $this->getName()),
+ 'id' => $block_id,
+ 'config_url' => $config_url,
+ 'title' => $this->getTitle(),
+ 'content' => $content,
+ ]);
} else {
return $content;
}