summaryrefslogtreecommitdiff
path: root/app/Module/InteractiveTreeModule.php
diff options
context:
space:
mode:
authorric2016 <ric@richard-cissee.de>2016-03-31 20:49:59 +0200
committerGreg Roach <fisharebest@gmail.com>2016-04-11 19:41:58 +0100
commit168ff6f357afa9bbd5aa14c12670d19e51ee770c (patch)
tree359eb97b96f124e4a6f9431d91254becd85ab59f /app/Module/InteractiveTreeModule.php
parentebac970f8cc2f9fb6cca1e49d322d284c17f5229 (diff)
downloadwebtrees-168ff6f357afa9bbd5aa14c12670d19e51ee770c.tar.gz
webtrees-168ff6f357afa9bbd5aa14c12670d19e51ee770c.tar.bz2
webtrees-168ff6f357afa9bbd5aa14c12670d19e51ee770c.zip
Charts As Modules
Diffstat (limited to 'app/Module/InteractiveTreeModule.php')
-rw-r--r--app/Module/InteractiveTreeModule.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/app/Module/InteractiveTreeModule.php b/app/Module/InteractiveTreeModule.php
index dc461efb16..c7de450c6b 100644
--- a/app/Module/InteractiveTreeModule.php
+++ b/app/Module/InteractiveTreeModule.php
@@ -21,12 +21,13 @@ use Fisharebest\Webtrees\Filter;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Module\InteractiveTree\TreeView;
+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 {
+class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface,ModuleChartInterface {
/** {@inheritdoc} */
public function getTitle() {
return /* I18N: Name of a module */ I18N::translate('Interactive tree');
@@ -70,7 +71,27 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface
public function canLoadAjax() {
return true;
}
-
+
+ /**
+ * Return a menu item for this chart.
+ *
+ * @return Menu
+ */
+ 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(),
+ 'menu-chart-tree',
+ array('rel' => 'nofollow')
+ );
+ }
+
+ public function getBoxChartMenu(Individual $individual) {
+ return $this->getChartMenu($individual);
+ }
+
/** {@inheritdoc} */
public function getPreLoadContent() {
// We cannot use jQuery("head").append(<link rel="stylesheet" ...as jQuery is not loaded at this time