summaryrefslogtreecommitdiff
path: root/app/Module/FanChartModule.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/FanChartModule.php
parent168ff6f357afa9bbd5aa14c12670d19e51ee770c (diff)
downloadwebtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.tar.gz
webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.tar.bz2
webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.zip
Charts as modules - more work
Diffstat (limited to 'app/Module/FanChartModule.php')
-rw-r--r--app/Module/FanChartModule.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/Module/FanChartModule.php b/app/Module/FanChartModule.php
index 117d9c2b13..2eb6f6a2d7 100644
--- a/app/Module/FanChartModule.php
+++ b/app/Module/FanChartModule.php
@@ -58,15 +58,13 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface {
*
* We can only do this if the GD2 library is installed with TrueType support.
*
- * @return Menu
+ * @return Menu|null
*/
public function getChartMenu(Individual $individual) {
- global $controller, $WT_TREE;
-
if (function_exists('imagettftext')) {
return new Menu(
$this->getTitle(),
- 'fanchart.php?rootid=' . $individual->getXref() . '&amp;ged=' . $WT_TREE->getNameUrl(),
+ 'fanchart.php?rootid=' . $individual->getXref() . '&amp;ged=' . $individual->getTree()->getNameUrl(),
'menu-chart-fanchart',
array('rel' => 'nofollow')
);
@@ -75,6 +73,11 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface {
}
}
+ /**
+ * Return a menu item for this chart - for use in individual boxes.
+ *
+ * @return Menu|null
+ */
public function getBoxChartMenu(Individual $individual) {
return $this->getChartMenu($individual);
}