summaryrefslogtreecommitdiff
path: root/app/Module/InteractiveTreeModule.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2016-04-10 15:14:21 +0100
committerGreg Roach <fisharebest@gmail.com>2016-04-11 19:41:58 +0100
commit4eb71cfaf9604652cd62536a0b3b56c6dfd715ad (patch)
treedf6374baef0b06b98ed2fdd84859d3c81f835325 /app/Module/InteractiveTreeModule.php
parent168ff6f357afa9bbd5aa14c12670d19e51ee770c (diff)
downloadwebtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.tar.gz
webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.tar.bz2
webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.zip
Charts as modules - more work
Diffstat (limited to 'app/Module/InteractiveTreeModule.php')
-rw-r--r--app/Module/InteractiveTreeModule.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Module/InteractiveTreeModule.php b/app/Module/InteractiveTreeModule.php
index c7de450c6b..e0676ca79d 100644
--- a/app/Module/InteractiveTreeModule.php
+++ b/app/Module/InteractiveTreeModule.php
@@ -27,7 +27,7 @@ use Fisharebest\Webtrees\Menu;
* Class InteractiveTreeModule
* Tip : you could change the number of generations loaded before ajax calls both in individual page and in treeview page to optimize speed and server load
*/
-class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface,ModuleChartInterface {
+class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface, ModuleChartInterface {
/** {@inheritdoc} */
public function getTitle() {
return /* I18N: Name of a module */ I18N::translate('Interactive tree');
@@ -75,19 +75,22 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface
/**
* Return a menu item for this chart.
*
- * @return Menu
+ * @return Menu|null
*/
public function getChartMenu(Individual $individual) {
- global $controller, $WT_TREE;
-
return new Menu(
$this->getTitle(),
- 'module.php?mod=tree&amp;mod_action=treeview&amp;rootid=' . $individual->getXref() . '&amp;ged=' . $WT_TREE->getNameUrl(),
+ 'module.php?mod=tree&amp;mod_action=treeview&amp;rootid=' . $individual->getXref() . '&amp;ged=' . $individual->getTree()->getNameUrl(),
'menu-chart-tree',
array('rel' => 'nofollow')
);
}
+ /**
+ * Return a menu item for this chart - for use in individual boxes.
+ *
+ * @return Menu|null
+ */
public function getBoxChartMenu(Individual $individual) {
return $this->getChartMenu($individual);
}