summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/WT/Controller/Ancestry.php2
-rw-r--r--library/WT/Controller/Descendancy.php2
-rw-r--r--library/WT/Controller/Fanchart.php16
-rw-r--r--library/WT/Controller/Hourglass.php2
-rw-r--r--library/WT/Controller/Pedigree.php2
-rw-r--r--library/WT/Report/Base.php71
6 files changed, 44 insertions, 51 deletions
diff --git a/library/WT/Controller/Ancestry.php b/library/WT/Controller/Ancestry.php
index 75e7dc41d5..bc4ca54dbe 100644
--- a/library/WT/Controller/Ancestry.php
+++ b/library/WT/Controller/Ancestry.php
@@ -39,7 +39,7 @@ class WT_Controller_Ancestry extends WT_Controller_Chart {
var $cellwidth;
function __construct() {
- global $USE_RIN, $MAX_ALIVE_AGE, $GEDCOM, $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS;
+ global $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS;
global $DEFAULT_PEDIGREE_GENERATIONS, $PEDIGREE_GENERATIONS, $MAX_PEDIGREE_GENERATIONS, $OLD_PGENS, $box_width, $Dbwidth, $Dbheight;
global $show_full;
diff --git a/library/WT/Controller/Descendancy.php b/library/WT/Controller/Descendancy.php
index d553734040..ef79f5ab72 100644
--- a/library/WT/Controller/Descendancy.php
+++ b/library/WT/Controller/Descendancy.php
@@ -52,7 +52,7 @@ class WT_Controller_Descendancy extends WT_Controller_Chart {
var $show_cousins;
function __construct() {
- global $USE_RIN, $MAX_ALIVE_AGE, $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $GEDCOM, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS, $show_full;
+ global $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS, $show_full;
parent::__construct();
diff --git a/library/WT/Controller/Fanchart.php b/library/WT/Controller/Fanchart.php
index cf1c5ecd84..b4c974ccc0 100644
--- a/library/WT/Controller/Fanchart.php
+++ b/library/WT/Controller/Fanchart.php
@@ -75,23 +75,25 @@ class WT_Controller_Fanchart extends WT_Controller_Chart {
$lines = explode("\n", $data);
// more than 1 line : recursive calls
if (count($lines)>1) {
- $text = "";
- foreach ($lines as $indexval => $line) $text .= $this->split_align_text($line, $maxlen)."\n";
+ $text = '';
+ foreach ($lines as $line) {
+ $text .= $this->split_align_text($line, $maxlen)."\n";
+ }
return $text;
}
// process current line word by word
- $split = explode(" ", $data);
- $text = "";
- $line = "";
+ $split = explode(' ', $data);
+ $text = '';
+ $line = '';
// do not split hebrew line
$found = false;
- foreach ($RTLOrd as $indexval => $ord) {
+ foreach ($RTLOrd as $ord) {
if (strpos($data, chr($ord)) !== false) $found=true;
}
if ($found) $line=$data;
else
- foreach ($split as $indexval => $word) {
+ foreach ($split as $word) {
$len = strlen($line);
//if (!empty($line) and ord($line{0})==215) $len/=2; // hebrew text
$wlen = strlen($word);
diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php
index 621e4aabd3..9f12c4e810 100644
--- a/library/WT/Controller/Hourglass.php
+++ b/library/WT/Controller/Hourglass.php
@@ -46,7 +46,7 @@ class WT_Controller_Hourglass extends WT_Controller_Chart {
var $ARID;
function __construct($rootid='', $show_full=1, $generations=3) {
- global $USE_RIN, $MAX_ALIVE_AGE, $GEDCOM, $bheight, $bwidth, $cbwidth, $cbheight, $bhalfheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS;
+ global $bheight, $bwidth, $cbwidth, $cbheight, $bhalfheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS;
global $TEXT_DIRECTION, $show_full;
parent::__construct();
diff --git a/library/WT/Controller/Pedigree.php b/library/WT/Controller/Pedigree.php
index 19c80232dc..61b95ba0ca 100644
--- a/library/WT/Controller/Pedigree.php
+++ b/library/WT/Controller/Pedigree.php
@@ -50,7 +50,7 @@ class WT_Controller_Pedigree extends WT_Controller_Chart {
global $bwidth, $bheight, $cbwidth, $cbheight, $baseyoffset, $basexoffset, $byspacing, $bxspacing;
global $linewidth, $shadowcolor, $shadowblur, $shadowoffsetX, $shadowoffsetY;
- global $BROWSER_TYPE, $show_full, $talloffset;
+ global $show_full, $talloffset;
parent::__construct();
diff --git a/library/WT/Report/Base.php b/library/WT/Report/Base.php
index b083122dd9..2021c9cb50 100644
--- a/library/WT/Report/Base.php
+++ b/library/WT/Report/Base.php
@@ -3682,11 +3682,8 @@ function DescriptionEHandler() {
* @return string
*/
function get_gedcom_value($tag, $level, $gedrec, $truncate='') {
- global $GEDCOM;
- $ged_id=get_id_from_gedcom($GEDCOM);
-
if (empty($gedrec)) {
- return "";
+ return '';
}
$tags = explode(':', $tag);
$origlevel = $level;
@@ -3695,7 +3692,7 @@ function get_gedcom_value($tag, $level, $gedrec, $truncate='') {
}
$subrec = $gedrec;
- foreach ($tags as $indexval => $t) {
+ foreach ($tags as $t) {
$lastsubrec = $subrec;
$subrec = get_sub_record($level, "$level $t", $subrec);
if (empty($subrec) && $origlevel==0) {
@@ -3749,48 +3746,40 @@ function get_gedcom_value($tag, $level, $gedrec, $truncate='') {
}
function add_ancestors(&$list, $pid, $children=false, $generations=-1, $show_empty=false) {
- $total_num_skipped = 0;
- $skipped_gen = 0;
- $num_skipped = 0;
$genlist = array($pid);
$list[$pid]->generation = 1;
while (count($genlist)>0) {
$id = array_shift($genlist);
- if (strpos($id, "empty")===0) continue; // id can be something like “empty7”
+ if (strpos($id, 'empty') === 0) {
+ continue; // id can be something like “empty7”
+ }
$person = WT_Individual::getInstance($id);
- $famids = $person->getChildFamilies();
- if (count($famids)>0) {
- $num_skipped = 0;
- foreach ($famids as $famid => $family) {
- $husband = $family->getHusband();
- $wife = $family->getWife();
+ foreach ($person->getChildFamilies() as $family) {
+ $husband = $family->getHusband();
+ $wife = $family->getWife();
+ if ($husband) {
+ $list[$husband->getXref()] = $husband;
+ $list[$husband->getXref()]->generation = $list[$id]->generation+1;
+ }
+ if ($wife) {
+ $list[$wife->getXref()] = $wife;
+ $list[$wife->getXref()]->generation = $list[$id]->generation+1;
+ }
+ if ($generations == -1 || $list[$id]->generation+1 < $generations) {
if ($husband) {
- $list[$husband->getXref()] = $husband;
- $list[$husband->getXref()]->generation = $list[$id]->generation+1;
+ array_push($genlist, $husband->getXref());
}
if ($wife) {
- $list[$wife->getXref()] = $wife;
- $list[$wife->getXref()]->generation = $list[$id]->generation+1;
- }
- if ($generations == -1 || $list[$id]->generation+1 < $generations) {
- $skipped_gen = $list[$id]->generation+1;
- if ($husband) {
- array_push($genlist, $husband->getXref());
- }
- if ($wife) {
- array_push($genlist, $wife->getXref());
- }
+ array_push($genlist, $wife->getXref());
}
- $total_num_skipped++;
- if ($children) {
- $childs = $family->getChildren();
- foreach ($childs as $child) {
- $list[$child->getXref()] = $child;
- if (isset($list[$id]->generation))
- $list[$child->getXref()]->generation = $list[$id]->generation;
- else
- $list[$child->getXref()]->generation = 1;
- }
+ }
+ if ($children) {
+ foreach ($family->getChildren() as $child) {
+ $list[$child->getXref()] = $child;
+ if (isset($list[$id]->generation))
+ $list[$child->getXref()]->generation = $list[$id]->generation;
+ else
+ $list[$child->getXref()]->generation = 1;
}
}
}
@@ -3799,7 +3788,9 @@ function add_ancestors(&$list, $pid, $children=false, $generations=-1, $show_emp
function add_descendancy(&$list, $pid, $parents=false, $generations=-1) {
$person = WT_Individual::getInstance($pid);
- if ($person==null) return;
+ if ($person==null) {
+ return;
+ }
if (!isset($list[$pid])) {
$list[$pid] = $person;
}
@@ -3841,4 +3832,4 @@ function add_descendancy(&$list, $pid, $parents=false, $generations=-1) {
}
}
}
-}
+} \ No newline at end of file