diff options
| author | Greg Roach <fisharebest@gmail.com> | 2016-04-10 15:14:21 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2016-04-11 19:41:58 +0100 |
| commit | 4eb71cfaf9604652cd62536a0b3b56c6dfd715ad (patch) | |
| tree | df6374baef0b06b98ed2fdd84859d3c81f835325 /app/Module/RelationshipsChartModule.php | |
| parent | 168ff6f357afa9bbd5aa14c12670d19e51ee770c (diff) | |
| download | webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.tar.gz webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.tar.bz2 webtrees-4eb71cfaf9604652cd62536a0b3b56c6dfd715ad.zip | |
Charts as modules - more work
Diffstat (limited to 'app/Module/RelationshipsChartModule.php')
| -rw-r--r-- | app/Module/RelationshipsChartModule.php | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/app/Module/RelationshipsChartModule.php b/app/Module/RelationshipsChartModule.php index 79c1c3f7ad..590aef19ac 100644 --- a/app/Module/RelationshipsChartModule.php +++ b/app/Module/RelationshipsChartModule.php @@ -52,34 +52,38 @@ class RelationshipsChartModule extends AbstractModule implements ModuleChartInte public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - + /** * Return a menu item for this chart. * - * @return Menu + * @return Menu|null */ public function getChartMenu(Individual $individual) { - global $controller, $WT_TREE; - - $gedcomid = $WT_TREE->getUserPreference(Auth::user(), 'gedcomid'); + $tree = $individual->getTree(); + $gedcomid = $tree->getUserPreference(Auth::user(), 'gedcomid'); - if ($gedcomid && $individual->getXref()) { + if ($gedcomid) { return new Menu( - I18N::translate('Relationship to me'), - 'relationship.php?pid1=' . $gedcomid . '&pid2=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), - 'menu-chart-relationship', + I18N::translate('Relationship to me'), + 'relationship.php?pid1=' . $gedcomid . '&pid2=' . $individual->getXref() . '&ged=' . $tree->getNameUrl(), + 'menu-chart-relationship', array('rel' => 'nofollow') ); } else { return new Menu( - I18N::translate('Relationships'), - 'relationship.php?pid1=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), - 'menu-chart-relationship', + I18N::translate('Relationships'), + 'relationship.php?pid1=' . $individual->getXref() . '&ged=' . $tree->getNameUrl(), + 'menu-chart-relationship', 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); } |
