summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-01-01 16:20:44 +0000
committerfisharebest <fisharebest@gmail.com>2011-01-01 16:20:44 +0000
commit72ce8ae82edee2abbf15cd4c0fe586d4fdc84a15 (patch)
tree0131c6dd4b71bbcbe72a1ea46fc3b946450b6ef5
parent4ba4bb17cc9c1e05a46fd03fb4c50243c9e6dd32 (diff)
downloadwebtrees-72ce8ae82edee2abbf15cd4c0fe586d4fdc84a15.tar.gz
webtrees-72ce8ae82edee2abbf15cd4c0fe586d4fdc84a15.tar.bz2
webtrees-72ce8ae82edee2abbf15cd4c0fe586d4fdc84a15.zip
Refactoring class names and use autoloading.
-rw-r--r--library/WT/TreeNav.php (renamed from includes/classes/class_treenav.php)53
-rw-r--r--modules/charts/module.php3
-rw-r--r--modules/tree/module.php3
-rw-r--r--treenav.php3
4 files changed, 27 insertions, 35 deletions
diff --git a/includes/classes/class_treenav.php b/library/WT/TreeNav.php
index c3bae315f7..512567dbbd 100644
--- a/includes/classes/class_treenav.php
+++ b/library/WT/TreeNav.php
@@ -1,41 +1,36 @@
<?php
-/**
-* Class file for the tree navigator
-*
-* webtrees: Web based Family History software
- * Copyright (C) 2010 webtrees development team.
- *
- * Derived from PhpGedView
-* Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
-*
-* 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
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-* @package webtrees
-* @version $Id$
-*/
+// Class file for the tree navigator
+//
+// webtrees: Web based Family History software
+// Copyright (C) 2010 webtrees development team.
+//
+// Derived from PhpGedView
+// Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+//
+// 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
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// @version $Id$
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
exit;
}
-define('WT_CLASS_TREENAV_PHP', '');
-
require_once WT_ROOT.'includes/functions/functions_charts.php';
-class TreeNav {
+class WT_TreeNav {
var $rootPerson = null;
var $bwidth = 170;
var $zoomLevel = 0;
diff --git a/modules/charts/module.php b/modules/charts/module.php
index 7a59dd9022..e9d267aee4 100644
--- a/modules/charts/module.php
+++ b/modules/charts/module.php
@@ -31,7 +31,6 @@ if (!defined('WT_WEBTREES')) {
}
require_once WT_ROOT.'includes/classes/class_module.php';
-require_once WT_ROOT.'includes/classes/class_treenav.php';
class charts_WT_Module extends WT_Module implements WT_Module_Block {
// Extend class WT_Module
@@ -77,7 +76,7 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block {
$controller->init($pid,0,3);
$controller->setupJavascript();
} else {
- $nav = new TreeNav($pid, 'blocknav',-1);
+ $nav = new WT_TreeNav($pid, 'blocknav',-1);
$nav->generations = 2;
}
diff --git a/modules/tree/module.php b/modules/tree/module.php
index f068c8da01..e742d88162 100644
--- a/modules/tree/module.php
+++ b/modules/tree/module.php
@@ -33,7 +33,6 @@ if (!defined('WT_WEBTREES')) {
}
require_once WT_ROOT.'includes/classes/class_module.php';
-require_once WT_ROOT.'includes/classes/class_treenav.php';
class tree_WT_Module extends WT_Module implements WT_Module_Tab {
// Extend WT_Module
@@ -66,7 +65,7 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab {
// Implement WT_Module_Tab
public function getTabContent() {
ob_start();
- $inav = new TreeNav($this->controller->pid,'treetab');
+ $inav = new WT_TreeNav($this->controller->pid,'treetab');
$inav->generations = 5;
$inav->zoomLevel = -1;
$inav->drawViewport('treetab', "auto", "600px");
diff --git a/treenav.php b/treenav.php
index 01664c5df1..233621f7bf 100644
--- a/treenav.php
+++ b/treenav.php
@@ -33,7 +33,6 @@
define('WT_SCRIPT_NAME', 'treenav.php');
require './includes/session.php';
-require_once WT_ROOT.'includes/classes/class_treenav.php';
$zoom = 0;
$rootid = '';
@@ -41,7 +40,7 @@ $name = 'nav';
if (isset($_REQUEST['zoom'])) $zoom = $_REQUEST['zoom'];
if (isset($_REQUEST['rootid'])) $rootid = $_REQUEST['rootid'];
if (!empty($_REQUEST['jsname'])) $name = $_REQUEST['jsname'];
-$nav = new TreeNav($rootid, $name, $zoom);
+$nav = new WT_TreeNav($rootid, $name, $zoom);
$nav->generations=6;
$nav->zoomLevel-=1;
print_header(i18n::translate('Interactive tree'));