summaryrefslogtreecommitdiff
path: root/app/Module/RelationshipsChartModule.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/RelationshipsChartModule.php
parent168ff6f357afa9bbd5aa14c12670d19e51ee770c (diff)
downloadwebtrees-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.php30
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 . '&amp;pid2=' . $individual->getXref() . '&amp;ged=' . $WT_TREE->getNameUrl(),
- 'menu-chart-relationship',
+ I18N::translate('Relationship to me'),
+ 'relationship.php?pid1=' . $gedcomid . '&amp;pid2=' . $individual->getXref() . '&amp;ged=' . $tree->getNameUrl(),
+ 'menu-chart-relationship',
array('rel' => 'nofollow')
);
} else {
return new Menu(
- I18N::translate('Relationships'),
- 'relationship.php?pid1=' . $individual->getXref() . '&amp;ged=' . $WT_TREE->getNameUrl(),
- 'menu-chart-relationship',
+ I18N::translate('Relationships'),
+ 'relationship.php?pid1=' . $individual->getXref() . '&amp;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);
}