diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2018-12-19 11:44:03 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2018-12-19 11:44:03 +0000 |
| commit | 5f2ae57322ecd2d23660294256ca8376fd889348 (patch) | |
| tree | 314f927e493bccacf8b3aa00bd1c6d31758fa785 /app/Module/TopPageViewsModule.php | |
| parent | b1ed19986adeaa0c1001a72232d9d0f2be5f99d3 (diff) | |
| download | webtrees-5f2ae57322ecd2d23660294256ca8376fd889348.tar.gz webtrees-5f2ae57322ecd2d23660294256ca8376fd889348.tar.bz2 webtrees-5f2ae57322ecd2d23660294256ca8376fd889348.zip | |
Refactor $ctype global as a parameter
Diffstat (limited to 'app/Module/TopPageViewsModule.php')
| -rw-r--r-- | app/Module/TopPageViewsModule.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/Module/TopPageViewsModule.php b/app/Module/TopPageViewsModule.php index 62f6fb7a32..1d34677d9b 100644 --- a/app/Module/TopPageViewsModule.php +++ b/app/Module/TopPageViewsModule.php @@ -56,15 +56,13 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface * * @param Tree $tree * @param int $block_id - * @param bool $template + * @param string $ctype * @param string[] $cfg * * @return string */ - public function getBlock(Tree $tree, int $block_id, bool $template = true, array $cfg = []): string + public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string { - global $ctype; - $num = $this->getBlockSetting($block_id, 'num', '10'); $count_placement = $this->getBlockSetting($block_id, 'count_placement', 'before'); @@ -98,7 +96,7 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface } $content .= '</table>'; - if ($template) { + if ($ctype) { if ($ctype === 'gedcom' && Auth::isManager($tree)) { $config_url = route('tree-page-block-edit', [ 'block_id' => $block_id, |
