summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controller/AncestryController.php10
-rw-r--r--app/Controller/DescendancyController.php6
-rw-r--r--app/Controller/Familybook.php11
-rw-r--r--app/Controller/HourglassController.php7
-rw-r--r--app/Controller/PedigreeController.php13
-rw-r--r--app/Controller/SearchController.php4
-rw-r--r--app/Date.php5
-rw-r--r--app/Place.php6
8 files changed, 29 insertions, 33 deletions
diff --git a/app/Controller/AncestryController.php b/app/Controller/AncestryController.php
index 42e337e759..ec600bc535 100644
--- a/app/Controller/AncestryController.php
+++ b/app/Controller/AncestryController.php
@@ -35,22 +35,20 @@ class AncestryController extends ChartController {
* Startup activity
*/
function __construct() {
- global $bwidth, $bheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS;
- global $DEFAULT_PEDIGREE_GENERATIONS, $PEDIGREE_GENERATIONS, $MAX_PEDIGREE_GENERATIONS, $OLD_PGENS, $box_width, $Dbwidth, $Dbheight;
- global $show_full;
+ global $bwidth, $bheight, $pbwidth, $pbheight, $show_full;
+ global $PEDIGREE_GENERATIONS, $WT_TREE, $OLD_PGENS, $box_width, $Dbwidth, $Dbheight;
parent::__construct();
// Extract form parameters
- $this->show_full = Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
+ $this->show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
$this->show_cousins = Filter::getInteger('show_cousins', 0, 1);
$this->chart_style = Filter::getInteger('chart_style', 0, 3);
$box_width = Filter::getInteger('box_width', 50, 300, 100);
- $PEDIGREE_GENERATIONS = Filter::getInteger('PEDIGREE_GENERATIONS', 2, $MAX_PEDIGREE_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
+ $PEDIGREE_GENERATIONS = Filter::getInteger('PEDIGREE_GENERATIONS', 2, $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'), $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
// This is passed as a global. A parameter would be better...
$show_full = $this->show_full;
-
$OLD_PGENS = $PEDIGREE_GENERATIONS;
// -- size of the detailed boxes based upon optional width parameter
diff --git a/app/Controller/DescendancyController.php b/app/Controller/DescendancyController.php
index 7455917ede..ae5a4ccef5 100644
--- a/app/Controller/DescendancyController.php
+++ b/app/Controller/DescendancyController.php
@@ -49,14 +49,14 @@ class DescendancyController extends ChartController {
* Create the descendancy controller
*/
function __construct() {
- global $bwidth, $bheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS, $show_full;
+ global $bwidth, $bheight, $pbwidth, $pbheight, $WT_TREE, $show_full;
parent::__construct();
// Extract parameters from form
- $this->show_full = Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
+ $this->show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
$this->chart_style = Filter::getInteger('chart_style', 0, 3, 0);
- $this->generations = Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
+ $this->generations = Filter::getInteger('generations', 2, $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS'), $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
$this->box_width = Filter::getInteger('box_width', 50, 300, 100);
// This is passed as a global. A parameter would be better...
diff --git a/app/Controller/Familybook.php b/app/Controller/Familybook.php
index 47f55c9052..dbb1febfe0 100644
--- a/app/Controller/Familybook.php
+++ b/app/Controller/Familybook.php
@@ -49,15 +49,12 @@ class FamilybookController extends ChartController {
parent::__construct();
- $PEDIGREE_FULL_DETAILS = $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS');
- $MAX_DESCENDANCY_GENERATIONS = $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS');
-
// Extract the request parameters
- $this->show_full = Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
+ $this->show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
$this->show_spouse = Filter::getInteger('show_spouse', 0, 1);
- $this->descent = Filter::getInteger('descent', 0, 9, 5);
- $this->generations = Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 2);
- $this->box_width = Filter::getInteger('box_width', 50, 300, 100);
+ $this->descent = Filter::getInteger('descent', 0, 9, 5);
+ $this->generations = Filter::getInteger('generations', 2, $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS'), 2);
+ $this->box_width = Filter::getInteger('box_width', 50, 300, 100);
// Box sizes are set globally in the theme. Modify them here.
global $bwidth, $bheight, $Dbwidth, $bhalfheight, $Dbheight;
diff --git a/app/Controller/HourglassController.php b/app/Controller/HourglassController.php
index d3b4870a92..9410aa978a 100644
--- a/app/Controller/HourglassController.php
+++ b/app/Controller/HourglassController.php
@@ -49,16 +49,15 @@ class HourglassController extends ChartController {
* @param boolean $loadJS
*/
function __construct($rootid = '', $show_full = 1, $loadJS = true) {
- global $bheight, $bwidth, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS;
- global $TEXT_DIRECTION, $show_full;
+ global $bheight, $bwidth, $WT_TREE, $TEXT_DIRECTION, $show_full;
parent::__construct();
// Extract parameters from from
$this->pid = Filter::get('rootid', WT_REGEX_XREF);
- $this->show_full = Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
+ $this->show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
$this->show_spouse = Filter::getInteger('show_spouse', 0, 1, 0);
- $this->generations = Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 3);
+ $this->generations = Filter::getInteger('generations', 2, $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS'), 3);
$this->box_width = Filter::getInteger('box_width', 50, 300, 100);
$this->canLoadJS = $loadJS;
diff --git a/app/Controller/PedigreeController.php b/app/Controller/PedigreeController.php
index 0189c345bc..87bc4fc74f 100644
--- a/app/Controller/PedigreeController.php
+++ b/app/Controller/PedigreeController.php
@@ -41,11 +41,8 @@ class PedigreeController extends ChartController {
* Create a pedigree controller
*/
public function __construct() {
- global $PEDIGREE_FULL_DETAILS, $PEDIGREE_LAYOUT, $MAX_PEDIGREE_GENERATIONS;
- global $DEFAULT_PEDIGREE_GENERATIONS;
- global $bwidth, $bheight, $baseyoffset, $basexoffset, $byspacing, $bxspacing;
-
- global $show_full, $talloffset;
+ global $WT_TREE;
+ global $bwidth, $bheight, $baseyoffset, $basexoffset, $byspacing, $bxspacing, $show_full, $talloffset;
parent::__construct();
$this->linewidth = Theme::theme()->parameter('line-width');
@@ -54,10 +51,10 @@ class PedigreeController extends ChartController {
$this->shadowoffsetX = Theme::theme()->parameter('shadow-offset-x');
$this->shadowoffsetY = Theme::theme()->parameter('shadow-offset-y');
- $this->show_full = Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
- $this->talloffset = Filter::getInteger('talloffset', 0, 3, $PEDIGREE_LAYOUT);
+ $this->show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
+ $this->talloffset = Filter::getInteger('talloffset', 0, 3, $WT_TREE->getPreference('PEDIGREE_LAYOUT'));
$this->box_width = Filter::getInteger('box_width', 50, 300, 100);
- $this->PEDIGREE_GENERATIONS = Filter::getInteger('PEDIGREE_GENERATIONS', 2, $MAX_PEDIGREE_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
+ $this->PEDIGREE_GENERATIONS = Filter::getInteger('PEDIGREE_GENERATIONS', 2, $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'), $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
// With more than 8 generations, we run out of pixels on the <canvas>
if ($this->PEDIGREE_GENERATIONS > 8) {
diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php
index 1a02dac8a8..90a219c6d0 100644
--- a/app/Controller/SearchController.php
+++ b/app/Controller/SearchController.php
@@ -133,7 +133,7 @@ class SearchController extends PageController {
$str = str_replace(array(".", "-", " "), array("_", "_", "_"), $search_tree->getName());
if (isset ($_REQUEST["$str"]) || $topsearch) {
$this->search_trees[$search_tree->getTreeId()] = $search_tree;
- $_REQUEST["$str"] = 'yes';
+ $_REQUEST[$str] = 'yes';
}
}
} else {
@@ -602,7 +602,7 @@ class SearchController extends PageController {
foreach ($this->search_trees as $search_tree) {
$datalist = array();
foreach ($this->myindilist as $individual) {
- if ($individual->getTree->getTreeId() === $search_tree->getTreeId()) {
+ if ($individual->getTree()->getTreeId() === $search_tree->getTreeId()) {
$datalist[] = $individual;
}
}
diff --git a/app/Date.php b/app/Date.php
index 89e30891e2..09495a3f20 100644
--- a/app/Date.php
+++ b/app/Date.php
@@ -209,7 +209,10 @@ class Date {
* @return string
*/
function display($url = false, $date_format = null, $convert_calendars = true) {
- global $TEXT_DIRECTION, $DATE_FORMAT, $CALENDAR_FORMAT;
+ global $TEXT_DIRECTION, $WT_TREE;
+
+ $CALENDAR_FORMAT = $WT_TREE->getPreference('CALENDAR_FORMAT');
+ $DATE_FORMAT = $WT_TREE->getPreference('DATE_FORMAT');
if ($date_format === null) {
$date_format = $DATE_FORMAT;
diff --git a/app/Place.php b/app/Place.php
index a3c936f6f4..deb93e35a5 100644
--- a/app/Place.php
+++ b/app/Place.php
@@ -151,14 +151,16 @@ class Place {
* @return string
*/
public function getShortName() {
- global $SHOW_PEDIGREE_PLACES, $SHOW_PEDIGREE_PLACES_SUFFIX;
+ global $WT_TREE;
+
+ $SHOW_PEDIGREE_PLACES = $WT_TREE->getPreference('SHOW_PEDIGREE_PLACES');
if ($SHOW_PEDIGREE_PLACES >= count($this->gedcom_place)) {
// A short place name - no need to abbreviate
return $this->getFullName();
} else {
// Abbreviate the place name, for lists
- if ($SHOW_PEDIGREE_PLACES_SUFFIX) {
+ if ($WT_TREE->getPreference('SHOW_PEDIGREE_PLACES_SUFFIX')) {
// The *last* $SHOW_PEDIGREE_PLACES components
$short_name = implode(self::GEDCOM_SEPARATOR, array_slice($this->gedcom_place, -$SHOW_PEDIGREE_PLACES));
} else {