summaryrefslogtreecommitdiff
path: root/modules_v3
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2013-06-23 21:59:58 +0000
committerfisharebest <fisharebest@gmail.com>2013-06-23 21:59:58 +0000
commitcdfabec83ab553139eee68f8490d988b200df6a2 (patch)
tree988faa9333a4cfc78bbfa990fe3794889d2ae3d0 /modules_v3
parent535f5d3688d1c1fafbe4e48efa9ce8d526cd256b (diff)
downloadwebtrees-cdfabec83ab553139eee68f8490d988b200df6a2.tar.gz
webtrees-cdfabec83ab553139eee68f8490d988b200df6a2.tar.bz2
webtrees-cdfabec83ab553139eee68f8490d988b200df6a2.zip
Use objects, not XREFs
Diffstat (limited to 'modules_v3')
-rw-r--r--modules_v3/charts/module.php4
-rw-r--r--modules_v3/tree/class_treeview.php6
-rw-r--r--modules_v3/tree/module.php6
3 files changed, 6 insertions, 10 deletions
diff --git a/modules_v3/charts/module.php b/modules_v3/charts/module.php
index aec4c6a8ea..989be576ef 100644
--- a/modules_v3/charts/module.php
+++ b/modules_v3/charts/module.php
@@ -2,7 +2,7 @@
// Classes and libraries for module system
//
// webtrees: Web based Family History software
-// Copyright (C) 2012 webtrees development team.
+// Copyright (C) 2013 webtrees development team.
//
// Derived from PhpGedView
// Copyright (C) 2010 John Finlay
@@ -140,7 +140,7 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block {
$content .= '<script>jQuery("head").append(\'<link rel="stylesheet" href="'.$mod->css().'" type="text/css" />\');</script>';
$content .= '<script src="'.$mod->js().'"></script>';
- list($html, $js) = $tv->drawViewport($person->getXref(), 2);
+ list($html, $js) = $tv->drawViewport($person, 2);
$content .= $html.'<script>'.$js.'</script>';
$content .= '</td>';
}
diff --git a/modules_v3/tree/class_treeview.php b/modules_v3/tree/class_treeview.php
index e4b41b49fa..07065fbdf8 100644
--- a/modules_v3/tree/class_treeview.php
+++ b/modules_v3/tree/class_treeview.php
@@ -55,13 +55,9 @@ class TreeView {
* @param string $rootPersonId the id of the root person
* @param int $generations number of generations to draw
*/
- public function drawViewport($rootPersonId, $generations) {
+ public function drawViewport(WT_Person $rootPerson, $generations) {
global $GEDCOM, $controller;
- $rootPerson = WT_Person::getInstance($rootPersonId);
- if (is_null($rootPerson)) {
- $rootPerson = new WT_Person('');
- }
if (WT_SCRIPT_NAME == 'individual.php') {
$path = 'individual.php?pid='.$rootPerson->getXref().'&amp;ged='.$GEDCOM.'&allPartners='.($this->allPartners ? "false" : "true").'#tree';
} else {
diff --git a/modules_v3/tree/module.php b/modules_v3/tree/module.php
index aac495a285..72954be3b3 100644
--- a/modules_v3/tree/module.php
+++ b/modules_v3/tree/module.php
@@ -3,7 +3,7 @@
//
// 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
//
-// Copyright (C) 2012 webtrees development team
+// Copyright (C) 2013 webtrees development team
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab {
require_once WT_MODULES_DIR.$this->getName().'/class_treeview.php';
$tv = new TreeView('tvTab');
- list($html, $js) = $tv->drawViewport($controller->record->getXref(), 3);
+ list($html, $js) = $tv->drawViewport($controller->record, 3);
return
'<script src="' . $this->js() . '"></script>' .
'<script>' . $js . '</script>' .
@@ -105,7 +105,7 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab {
$person=$controller->getSignificantIndividual();
- list($html, $js)=$tv->drawViewport($person->getXref(), 4);
+ list($html, $js)=$tv->drawViewport($person, 4);
$controller
->setPageTitle(WT_I18N::translate('Interactive tree of %s', $person->getFullName()))