summaryrefslogtreecommitdiff
path: root/includes/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'includes/controllers')
-rw-r--r--includes/controllers/advancedsearch_ctrl.php22
-rw-r--r--includes/controllers/ancestry_ctrl.php2
-rw-r--r--includes/controllers/descendancy_ctrl.php6
-rw-r--r--includes/controllers/family_ctrl.php6
-rw-r--r--includes/controllers/hourglass_ctrl.php38
-rw-r--r--includes/controllers/individual_ctrl.php26
-rw-r--r--includes/controllers/lifespan_ctrl.php44
-rw-r--r--includes/controllers/media_ctrl.php14
-rw-r--r--includes/controllers/pedigree_ctrl.php14
-rw-r--r--includes/controllers/search_ctrl.php44
-rw-r--r--includes/controllers/timeline_ctrl.php16
11 files changed, 116 insertions, 116 deletions
diff --git a/includes/controllers/advancedsearch_ctrl.php b/includes/controllers/advancedsearch_ctrl.php
index 9637d2fbab..5f3a189927 100644
--- a/includes/controllers/advancedsearch_ctrl.php
+++ b/includes/controllers/advancedsearch_ctrl.php
@@ -139,7 +139,7 @@ class AdvancedSearchController extends SearchController {
$newvalues = array();
$newplus = array();
$rels = array();
- foreach($this->fields as $j=>$field) {
+ foreach ($this->fields as $j=>$field) {
if (strpos($this->fields[$j], "FAMC:HUSB:NAME")===0 || strpos($this->fields[$j], "FAMC:WIFE:NAME")===0) {
$rels[$this->fields[$j]] = $this->values[$j];
continue;
@@ -152,7 +152,7 @@ class AdvancedSearchController extends SearchController {
$this->fields = $newfields;
$this->values = $newvalues;
$this->plusminus = $newplus;
- foreach($rels as $field=>$value) {
+ foreach ($rels as $field=>$value) {
$this->fields[] = $field;
$this->values[] = $value;
}
@@ -178,7 +178,7 @@ class AdvancedSearchController extends SearchController {
$sqltables = " FROM `##".$table."`";
$sqlwhere = " WHERE ".$prefix."_file=".WT_GED_ID;
$keepfields = $this->fields;
- for($i=0; $i<$fct; $i++) {
+ for ($i=0; $i<$fct; $i++) {
$field = $this->fields[$i];
if (empty($field)) continue;
$value='';
@@ -324,7 +324,7 @@ class AdvancedSearchController extends SearchController {
}
//-- alter the fields and recurse to generate a subquery for spouse/parent fields
$oldfields = $this->fields;
- for($j=0; $j<$fct; $j++) {
+ for ($j=0; $j<$fct; $j++) {
//-- if it doesn't start with FAMS or FAMC then remove that field
if (preg_match("/^".$parts[0].":/", $this->fields[$j])==0) {
$this->fields[$j]='';
@@ -336,7 +336,7 @@ class AdvancedSearchController extends SearchController {
$sqlwhere .= " AND ROW(FAMS.f_id, FAMS.f_file) IN (".$subsql.")";
$this->fields = $oldfields;
//-- remove all of the fam fields so they don't show up again
- for($j=0; $j<$fct; $j++) {
+ for ($j=0; $j<$fct; $j++) {
//-- if it does start with FAMS or FAMC then remove that field
if (preg_match("/^".$parts[0].":/", $this->fields[$j])>0) {
$this->fields[$j]='';
@@ -351,7 +351,7 @@ class AdvancedSearchController extends SearchController {
}
//-- alter the fields and recurse to generate a subquery for spouse/parent fields
$oldfields = $this->fields;
- for($j=0; $j<$fct; $j++) {
+ for ($j=0; $j<$fct; $j++) {
//-- if it doesn't start with FAMS or FAMC then remove that field
if (preg_match("/^".$parts[0].":/", $this->fields[$j])==0) {
$this->fields[$j]='';
@@ -363,7 +363,7 @@ class AdvancedSearchController extends SearchController {
$sqlwhere .= " AND ROW(FAMC.f_id, FAMC.f_file) IN (".$subsql.")";
$this->fields = $oldfields;
//-- remove all of the fam fields so they don't show up again
- for($j=0; $j<$fct; $j++) {
+ for ($j=0; $j<$fct; $j++) {
//-- if it does start with FAMS or FAMC then remove that field
if (preg_match("/^".$parts[0].":/", $this->fields[$j])>0) {
$this->fields[$j]='';
@@ -378,7 +378,7 @@ class AdvancedSearchController extends SearchController {
}
//-- alter the fields and recurse to generate a subquery for spouse/parent fields
$oldfields = $this->fields;
- for($j=0; $j<$fct; $j++) {
+ for ($j=0; $j<$fct; $j++) {
//-- if it doesn't start with FAMS or FAMC then remove that field
if (preg_match("/^".$parts[0].":/", $this->fields[$j])==0) {
$this->fields[$j]='';
@@ -390,7 +390,7 @@ class AdvancedSearchController extends SearchController {
if ($parts[0]=='WIFE') $sqlwhere .= " AND ROW(f_wife, f_file) IN (".$subsql.")";
$this->fields = $oldfields;
//-- remove all of the fam fields so they don't show up again
- for($j=0; $j<$fct; $j++) {
+ for ($j=0; $j<$fct; $j++) {
//-- if it does start with HUSB or WIFE then remove that field
if (preg_match("/^".$parts[0].":/", $this->fields[$j])>0) {
$this->fields[$j]='';
@@ -403,7 +403,7 @@ class AdvancedSearchController extends SearchController {
$ct = count($parts);
$liketmp='';
- for($j=0; $j<$ct; $j++) {
+ for ($j=0; $j<$ct; $j++) {
$liketmp.= "%".($j+1)." ".$parts[$j]." %";
//if ($j<$ct-1) {
//$sqlwhere .= "%";
@@ -418,7 +418,7 @@ class AdvancedSearchController extends SearchController {
//echo $sql;
if ($justSql) return $sql;
$rows=WT_DB::prepare($sql)->fetchAll(PDO::FETCH_ASSOC);
- foreach ($rows as $row){
+ foreach ($rows as $row) {
$row['xref']=$row['i_id'];
$row['ged_id']=$row['i_file'];
$row['type'] = 'INDI';
diff --git a/includes/controllers/ancestry_ctrl.php b/includes/controllers/ancestry_ctrl.php
index ee3a4960e8..d0de373820 100644
--- a/includes/controllers/ancestry_ctrl.php
+++ b/includes/controllers/ancestry_ctrl.php
@@ -140,7 +140,7 @@ class AncestryController extends BaseController {
$parents = false;
$famrec = "";
$famid = "";
- foreach($famids as $famid=>$family) {
+ foreach ($famids as $famid=>$family) {
if (!is_null($family)) {
$famrec = $family->getGedcomRecord();
$parents = find_parents_in_record($famrec);
diff --git a/includes/controllers/descendancy_ctrl.php b/includes/controllers/descendancy_ctrl.php
index 353014206c..a3de123406 100644
--- a/includes/controllers/descendancy_ctrl.php
+++ b/includes/controllers/descendancy_ctrl.php
@@ -128,7 +128,7 @@ class DescendancyController extends BaseController {
if (is_null($person)) return;
$families = $person->getSpouseFamilies();
if ($depth<2) return;
- foreach($families as $famid => $family) {
+ foreach ($families as $famid => $family) {
print_sosa_family($family->getXref(), "", -1, $label, $person->getXref(), $gpid, $personcount);
$personcount++;
$children = $family->getChildren();
@@ -164,7 +164,7 @@ function print_child_descendancy(&$person, $depth) {
echo "<td>&nbsp;</td>";
echo "<td>";
$sfamids = $person->getChildFamilies();
- foreach($sfamids as $famid => $family) {
+ foreach ($sfamids as $famid => $family) {
$parents = find_parents($famid);
if ($parents) {
$parid=$parents["HUSB"];
@@ -250,7 +250,7 @@ function print_family_descendancy(&$person, &$family, $depth) {
echo "<td>&nbsp;</td>";
echo "<td>";
$sfamids = find_family_ids($id);
- foreach($sfamids as $indexval => $sfamid) {
+ foreach ($sfamids as $indexval => $sfamid) {
$parents = find_parents($sfamid);
if ($parents) {
$parid=$parents["HUSB"];
diff --git a/includes/controllers/family_ctrl.php b/includes/controllers/family_ctrl.php
index 92c573848a..c3e39f4bbb 100644
--- a/includes/controllers/family_ctrl.php
+++ b/includes/controllers/family_ctrl.php
@@ -75,10 +75,10 @@ class FamilyController extends BaseController {
}
}
//-- if no record was found create a default empty one
- if (find_updated_record($this->famid, WT_GED_ID)!==null){
+ if (find_updated_record($this->famid, WT_GED_ID)!==null) {
$this->famrec = "0 @".$this->famid."@ FAM\n";
$this->family = new Family($this->famrec);
- } else if (!$this->family){
+ } else if (!$this->family) {
return false;
}
}
@@ -256,7 +256,7 @@ class FamilyController extends BaseController {
// Produce the submenus in localized name order
- foreach($menuList as $menuType => $menuName) {
+ foreach ($menuList as $menuType => $menuName) {
switch ($menuType) {
case "parentTimeLine":
// charts / parents_timeline
diff --git a/includes/controllers/hourglass_ctrl.php b/includes/controllers/hourglass_ctrl.php
index c2c8ce782a..cb7f78df8b 100644
--- a/includes/controllers/hourglass_ctrl.php
+++ b/includes/controllers/hourglass_ctrl.php
@@ -135,7 +135,7 @@ class HourglassController extends BaseController {
$families = $person->getChildFamilies();
//-- calculate how tall the lines should be
$lh = ($bhalfheight+3) * pow(2, ($this->generations-$count-1));
- foreach($families as $famid => $family) {
+ foreach ($families as $famid => $family) {
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"empty-cells: show;\">";
$parents = find_parents($famid);
$height="100%";
@@ -220,16 +220,16 @@ class HourglassController extends BaseController {
$children = array();
if ($count < $this->dgenerations) {
//-- put all of the children in a common array
- foreach($families as $famid => $family) {
+ foreach ($families as $famid => $family) {
$famNum ++;
$chs = $family->getChildren();
- foreach($chs as $c=>$child) $children[] = $child;
+ foreach ($chs as $c=>$child) $children[] = $child;
}
$ct = count($children);
if ($ct>0) {
echo "<table style=\"position: relative; top: auto; text-align: $tablealign;\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
- for($i=0; $i<$ct; $i++) {
+ for ($i=0; $i<$ct; $i++) {
if (($i>0)&&($i<$ct-1)) $rowspan=1;
/* @var $person2 Person */
$person2 = $children[$i];
@@ -273,18 +273,18 @@ class HourglassController extends BaseController {
if ($count==$this->dgenerations) {
$numkids = 1;
$tbwidth = $bwidth+16;
- for($j=$count; $j<$this->dgenerations; $j++) {
+ for ($j=$count; $j<$this->dgenerations; $j++) {
echo "<div style=\"width: ".($tbwidth)."px;\"><br /></div></td><td width=\"$bwidth\">";
}
$kcount = 0;
- foreach($families as $famid=>$family) $kcount+=$family->getNumberOfChildren();
+ foreach ($families as $famid=>$family) $kcount+=$family->getNumberOfChildren();
if ($kcount==0) {
echo "<div style=\"width: ".($this->arrwidth)."px;\"><br /></div></td><td width=\"$bwidth\">";
} else {
echo "<div style=\"width: ".($this->arrwidth)."px;\"><a href=\"$pid\" onclick=\"return ChangeDis('td_".$pid."','".$pid."','".$this->show_full."','".$this->show_spouse."','".$this->box_width."')\"><img src=\"".$WT_IMAGES["larrow"]."\" border=\"0\" alt=\"\" /></a></div>";
//-- move the arrow up to line up with the correct box
if ($this->show_spouse) {
- foreach($families as $famid => $family) {
+ foreach ($families as $famid => $family) {
/* @var $family Family */
if (!is_null($family)) {
$spouse = $family->getSpouse($person);
@@ -304,7 +304,7 @@ class HourglassController extends BaseController {
//----- Print the spouse
if ($this->show_spouse) {
- foreach($families as $famid => $family) {
+ foreach ($families as $famid => $family) {
/* @var $family Family */
if (!is_null($family)) {
$spouse = $family->getSpouse($person);
@@ -337,7 +337,7 @@ class HourglassController extends BaseController {
//-- make sure there is more than 1 child in the family with parents
$cfamids = $person->getChildFamilies();
$num=0;
- foreach($cfamids as $famid=>$family) {
+ foreach ($cfamids as $famid=>$family) {
if (!is_null($family)) {
$num += $family->getNumberOfChildren();
}
@@ -352,7 +352,7 @@ class HourglassController extends BaseController {
echo "<div id=\"childbox\" dir=\"".$TEXT_DIRECTION."\" style=\"width:".$bwidth."px; height:".$bheight."px; visibility: hidden;\">";
echo "<table class=\"person_box\"><tr><td>";
- foreach($famids as $famid=>$family) {
+ foreach ($famids as $famid=>$family) {
if (!is_null($family)) {
$spouse = $family->getSpouse($person);
if (!empty($spouse)) {
@@ -369,7 +369,7 @@ class HourglassController extends BaseController {
}
$children = $family->getChildren();
- foreach($children as $id=>$child) {
+ foreach ($children as $id=>$child) {
$cid = $child->getXref();
echo "&nbsp;&nbsp;<a href=\"hourglass.php?pid={$cid}&amp;show_spouse={$this->show_spouse}&amp;show_full={$this->show_full}&amp;generations={$this->generations}&amp;box_width={$this->box_width}\"><span ";
$name = $child->getFullName();
@@ -388,9 +388,9 @@ class HourglassController extends BaseController {
echo "<img src=\"".$WT_IMAGES["rarrow"]."\" border=\"0\" alt=\"\" /> ";
//-- print the siblings
- foreach($cfamids as $famid=>$family) {
+ foreach ($cfamids as $famid=>$family) {
if (!is_null($family)) {
- if(!is_null($family->getHusband()) || !is_null($family->getWife())) {
+ if (!is_null($family->getHusband()) || !is_null($family->getWife())) {
echo "<span class=\"name1\"><br />".i18n::translate('Parents')."<br /></span>";
$husb = $family->getHusband();
if (!empty($husb)) {
@@ -421,7 +421,7 @@ class HourglassController extends BaseController {
$num = $family->getNumberOfChildren();
if ($num>2) echo "<span class=\"name1\"><br />".i18n::translate('Siblings')."<br /></span>";
if ($num==2) echo "<span class=\"name1\"><br />".i18n::translate('Sibling')."<br /></span>";
- foreach($children as $id=>$child) {
+ foreach ($children as $id=>$child) {
$cid = $child->getXref();
if ($cid!=$pid) {
echo "&nbsp;&nbsp;<a href=\"hourglass.php?pid={$cid}&amp;show_spouse={$this->show_spouse}&amp;show_full={$this->show_full}&amp;generations={$this->generations}&amp;box_width={$this->box_width}\"><span ";
@@ -463,9 +463,9 @@ class HourglassController extends BaseController {
$famids = $person->getSpouseFamilies();
if ($person->getNumberOfChildren()==0) return $depth-1;
$maxdc = $depth;
- foreach($famids as $famid => $family){
+ foreach ($famids as $famid => $family) {
$ct = preg_match_all("/1 CHIL @(.*)@/", $family->getGedcomRecord(), $match, PREG_SET_ORDER);
- for($i=0; $i<$ct; $i++) {
+ for ($i=0; $i<$ct; $i++) {
$chil = trim($match[$i][1]);
$dc = $this->max_descendency_generations($chil, $depth+1);
if ($dc >= $this->generations) return $dc;
@@ -529,7 +529,7 @@ class HourglassController extends BaseController {
function sizeLines() {
var vlines;
vlines = document.getElementsByName("tvertline");
- for(i=0; i < vlines.length; i++) {
+ for (i=0; i < vlines.length; i++) {
var pid = vlines[i].id.substr(vlines[i].id.indexOf("_")+1);
var hline = document.getElementById("table_"+pid);
var hline2 = document.getElementById("table2_"+pid);
@@ -538,7 +538,7 @@ class HourglassController extends BaseController {
}
vlines = document.getElementsByName("bvertline");
- for(i=0; i < vlines.length; i++) {
+ for (i=0; i < vlines.length; i++) {
var pid = vlines[i].id.substr(vlines[i].id.indexOf("_")+1);
var hline = document.getElementById("table_"+pid);
var hline2 = document.getElementById("table2_"+pid);
@@ -547,7 +547,7 @@ class HourglassController extends BaseController {
vlines = document.getElementsByName("pvline");
//alert(vlines[0].parentNode.parentNode.parentNode);
- for(i=0; i < vlines.length; i++) {
+ for (i=0; i < vlines.length; i++) {
//vlines[i].parentNode.style.height="50%";
vlines[i].style.height=(vlines[i].parentNode.offsetHeight/2)+'px';
}
diff --git a/includes/controllers/individual_ctrl.php b/includes/controllers/individual_ctrl.php
index 8200b445f0..43dd2b676e 100644
--- a/includes/controllers/individual_ctrl.php
+++ b/includes/controllers/individual_ctrl.php
@@ -93,10 +93,10 @@ class IndividualController extends BaseController {
$this->default_tab=get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB');
}
- if (find_person_record($this->pid, WT_GED_ID) || find_updated_record($this->pid, WT_GED_ID)!==null){
+ if (find_person_record($this->pid, WT_GED_ID) || find_updated_record($this->pid, WT_GED_ID)!==null) {
$this->indi = new Person($gedrec, false);
$this->indi->ged_id=WT_GED_ID; // This record is from a file
- } else if (!$this->indi){
+ } else if (!$this->indi) {
return false;
}
@@ -197,7 +197,7 @@ class IndividualController extends BaseController {
// Initialise tabs
$this->tabs = WT_Module::getActiveTabs();
- foreach($this->tabs as $mod) {
+ foreach ($this->tabs as $mod) {
$mod->setController($this);
if ($mod->hasTabContent()) {
if (empty($this->default_tab)) {
@@ -384,7 +384,7 @@ class IndividualController extends BaseController {
echo '</dl>';
echo '</div>';
$ct = preg_match_all('/\n2 (\w+) (.*)/', $factrec, $nmatch, PREG_SET_ORDER);
- for($i=0; $i<$ct; $i++) {
+ for ($i=0; $i<$ct; $i++) {
echo '<div>';
$fact = trim($nmatch[$i][1]);
if (($fact!="SOUR")&&($fact!="NOTE")&&($fact!="GIVN")&&($fact!="SURN")&&($fact!="SPFX")) {
@@ -678,7 +678,7 @@ class IndividualController extends BaseController {
$labels["sister"] = i18n::translate('Sister');
$labels["brother"] = i18n::translate('Brother');
}
- if ($type=="step"){
+ if ($type=="step") {
$labels["parent"] = i18n::translate('Step-Parent');
$labels["mother"] = i18n::translate('Step-Mother');
$labels["father"] = i18n::translate('Step-Father');
@@ -733,7 +733,7 @@ class IndividualController extends BaseController {
//-- step families : set the label for the common parent
if ($type=="step") {
$fams = $this->indi->getChildFamilies();
- foreach($fams as $key=>$fam) {
+ foreach ($fams as $key=>$fam) {
if ($fam->hasParent($husb)) $labels["father"] = i18n::translate('Father');
if ($fam->hasParent($wife)) $labels["mother"] = i18n::translate('Mother');
}
@@ -801,11 +801,11 @@ class IndividualController extends BaseController {
$merged_children = array();
$new_children = $newfamily->getChildren();
$num = count($children);
- for($i=0; $i<$num; $i++) {
+ for ($i=0; $i<$num; $i++) {
$child = $children[$i];
if (!is_null($child)) {
$found = false;
- foreach($new_children as $key=>$newchild) {
+ foreach ($new_children as $key=>$newchild) {
if (!is_null($newchild)) {
if ($child->equals($newchild)) {
$found = true;
@@ -817,10 +817,10 @@ class IndividualController extends BaseController {
else $merged_children[] = $child;
}
}
- foreach($new_children as $key=>$newchild) {
+ foreach ($new_children as $key=>$newchild) {
if (!is_null($newchild)) {
$found = false;
- foreach($children as $key1=>$child) {
+ foreach ($children as $key1=>$child) {
if (!is_null($child)) {
if ($child->equals($newchild)) {
$found = true;
@@ -836,7 +836,7 @@ class IndividualController extends BaseController {
}
//-- set the labels for the children
$num = count($children);
- for($i=0; $i<$num; $i++) {
+ for ($i=0; $i<$num; $i++) {
if (!is_null($children[$i])) {
$label = $labels["sibling"];
$sex = $children[$i]->getSex();
@@ -860,7 +860,7 @@ class IndividualController extends BaseController {
}
}
$num = count($newchildren);
- for($i=0; $i<$num; $i++) {
+ for ($i=0; $i<$num; $i++) {
$label = $labels["sibling"];
$sex = $newchildren[$i]->getSex();
if ($sex=="F") {
@@ -877,7 +877,7 @@ class IndividualController extends BaseController {
$newchildren[$i]->setLabel($label);
}
$num = count($delchildren);
- for($i=0; $i<$num; $i++) {
+ for ($i=0; $i<$num; $i++) {
$label = $labels["sibling"];
$sex = $delchildren[$i]->getSex();
if ($sex=="F") {
diff --git a/includes/controllers/lifespan_ctrl.php b/includes/controllers/lifespan_ctrl.php
index 2f52a9b301..8ab83cd62c 100644
--- a/includes/controllers/lifespan_ctrl.php
+++ b/includes/controllers/lifespan_ctrl.php
@@ -116,7 +116,7 @@ class LifespanController extends BaseController {
}
//-- gets the immediate family for the individual being added if the include immediate family checkbox is checked.
- if (safe_GET('addFamily', 'yes')=='yes'){
+ if (safe_GET('addFamily', 'yes')=='yes') {
if (isset($newpid)) $this->addFamily($newpid);
}
@@ -204,7 +204,7 @@ class LifespanController extends BaseController {
$this->timelineMaxYear=max($this->timelineMaxYear, $ddate->gregorianYear() ? $ddate->gregorianYear() : date('Y'));
}
- if($this->timelineMaxYear > $this->currentYear){
+ if ($this->timelineMaxYear > $this->currentYear) {
$this->timelineMaxYear = $this->currentYear;
}
@@ -229,31 +229,31 @@ class LifespanController extends BaseController {
$this->pids[] = $newpid;
$families = $person->getSpouseFamilies();
//-- foreach gets the spouse and children of the individual.
- foreach($families as $famID => $family){
- if($newpid != $family->getHusbId()) {
+ foreach ($families as $famID => $family) {
+ if ($newpid != $family->getHusbId()) {
if ($gen>0) $this->pids[] = addFamily($family->getHusbId(), $gen-1);
else $this->pids[] = $family->getHusbId();
}
- if($newpid != $family->getWifeId()) {
+ if ($newpid != $family->getWifeId()) {
if ($gen>0) $this->pids[] = addFamily($family->getWifeId(), $gen-1);
else $this->pids[] = $family->getWifeId();
}
$children = $family->getChildren();
- foreach($children as $childID => $child){
+ foreach ($children as $childID => $child) {
if ($gen>0) $this->pids[] = addFamily($child->getXref(), $gen-1);
else $this->pids[] = $child->getXref();
}
}
$families = $person->getChildFamilies();
//-- foreach gets the father, mother and sibblings of the individual.
- foreach($families as $famID => $family){
+ foreach ($families as $famID => $family) {
if ($gen>0) $this->pids[] = addFamily($family->getHusbId(), $gen-1);
else $this->pids[] = $family->getHusbId();
if ($gen>0) $this->pids[] = addFamily($family->getWifeId(), $gen-1);
else $this->pids[] = $family->getWifeId();
$children = $family->getChildren();
- foreach($children as $childID => $child){
- if($newpid != $child->getXref()) {
+ foreach ($children as $childID => $child) {
+ if ($newpid != $child->getXref()) {
if ($gen>0) $this->pids[] = addFamily($child->getXref(), $gen-1);
else $this->pids[] = $child->getXref();
}
@@ -269,7 +269,7 @@ class LifespanController extends BaseController {
case 1 : //rounds beginning year
$this->birthMod = ($year % 5);
$year = $year - ($this->birthMod);
- if($temp == $year){
+ if ($temp == $year) {
$this->modTest = 0;
}
else $this->modTest = 1;
@@ -277,7 +277,7 @@ class LifespanController extends BaseController {
case 2 : //rounds end year
$this->deathMod = ($year % 5);
//Only executed if the year needs to be modified
- if($this->deathMod > 0) {
+ if ($this->deathMod > 0) {
$this->endMod = (5 - ($this->deathMod));
}
else {
@@ -319,7 +319,7 @@ class LifespanController extends BaseController {
$rows = array();
$modFix = 0;
- if($this->modTest == 1){
+ if ($this->modTest == 1) {
$modFix = (9 * $this->birthMod);
}
//base case
@@ -329,7 +329,7 @@ class LifespanController extends BaseController {
foreach ($ar as $key => $value) {
//Creates appropriate color scheme to show relationships
$this->currentsex = $value->getSex();
- if ($this->currentsex == "M"){
+ if ($this->currentsex == "M") {
$this->Mcolorindex++;
if (!isset($this->malecolorR[$this->Mcolorindex])) $this->Mcolorindex=0;
$this->malecolorR[$this->Mcolorindex];
@@ -338,16 +338,16 @@ class LifespanController extends BaseController {
$this->malecolorG[$this->Mcolorindex];
$red = dechex($this->malecolorR[$this->Mcolorindex]);
$green =dechex($this->malecolorR[$this->Mcolorindex]);
- if(strlen($red)<2){
+ if (strlen($red)<2) {
$red = "0".$red;
}
- if(strlen($green)<2){
+ if (strlen($green)<2) {
$green = "0".$green;
}
$this->color = "#".$red.$green.dechex($this->malecolorB);
}
- else if($this->currentsex == "F"){
+ else if ($this->currentsex == "F") {
$this->Fcolorindex++;
if (!isset($this->femalecolorG[$this->Fcolorindex])) $this->Fcolorindex = 0;
$this->femalecolorG[$this->Fcolorindex];
@@ -356,7 +356,7 @@ class LifespanController extends BaseController {
$this->femalecolorB[$this->Fcolorindex];
$this->color = "#".dechex($this->femalecolorR).dechex($this->femalecolorG[$this->Fcolorindex]).dechex($this->femalecolorB[$this->Fcolorindex]);
}
- else{
+ else {
$this->color = $this->colors[$this->colorindex];
}
@@ -400,7 +400,7 @@ class LifespanController extends BaseController {
$Y = $top;
$Z = $zindex;
$ready = false;
- while(!$ready) {
+ while (!$ready) {
if (!isset($rows[$Y])) {
$ready = true;
$rows[$Y]["x1"] = $startPos;
@@ -437,7 +437,7 @@ class LifespanController extends BaseController {
$eventinformation = Array();
$eventspacing = Array();
- foreach($unparsedEvents as $index=>$val) {
+ foreach ($unparsedEvents as $index=>$val) {
$date = $val->getDate();
if (!empty($date)) {
$fact = $val->getTag();
@@ -466,7 +466,7 @@ class LifespanController extends BaseController {
$ddate=$value->getEstimatedDeathDate();
if ($width > ($minlength +110)) {
echo "<div id=\"bar_", $value->getXref(), "\" style=\"position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">";
- foreach($eventinformation as $evtwidth=>$val){
+ foreach ($eventinformation as $evtwidth=>$val) {
echo "<div style=\"position:absolute; left:", $evtwidth, ";\"><a class=\"showit\" href=\"#\" style=\"top:-2px; font-size:10px;\"><b>";
$text = explode("-fact, ", $val);
$fact = $text[0];
@@ -494,7 +494,7 @@ class LifespanController extends BaseController {
} else {
if ($width > $minlength +5) {
echo "<div style=\"text-align: left; position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">";
- foreach($eventinformation as $evtwidth=>$val){
+ foreach ($eventinformation as $evtwidth=>$val) {
echo "<div style=\"position:absolute; left:".$evtwidth." \"><a class=\"showit\" href=\"#\" style=\"top:-2px; font-size:10px;\"><b>";
$text = explode("-fact,", $val);
$fact = $text[0];
@@ -526,7 +526,7 @@ class LifespanController extends BaseController {
echo "<a class=\"showit\" href=\"".$value->getHtmlUrl()."\"><b>";
echo abbreviate_fact('BIRT');
echo "</b><span>".$value->getSexImage().$indiName."<br/>".translate_fact('BIRT')." ".strip_tags($bdate->Display(false))." ".PrintReady($value->getBirthPlace())."<br/>";
- foreach($eventinformation as $evtwidth=>$val){
+ foreach ($eventinformation as $evtwidth=>$val) {
$text = explode("-fact,", $val);
$val = $text[1];
echo $val."<br />";
diff --git a/includes/controllers/media_ctrl.php b/includes/controllers/media_ctrl.php
index a860df4fb6..beaa2679b1 100644
--- a/includes/controllers/media_ctrl.php
+++ b/includes/controllers/media_ctrl.php
@@ -68,10 +68,10 @@ class MediaController extends BaseController{
}
//Checks to see if the File Name ($filename) exists
- if (!empty($filename)){
+ if (!empty($filename)) {
//If the File Name ($filename) is set, then it will call the method to get the Media ID ($this->mid) from the File Name ($filename)
$this->mid = get_media_id_from_file($filename);
- if (!$this->mid){
+ if (!$this->mid) {
//This will set the Media ID to be false if the File given doesn't match to anything in the database
$this->mid = false;
// create a very basic gedcom record for this file so that the functions of the media object will work
@@ -81,7 +81,7 @@ class MediaController extends BaseController{
}
//checks to see if the Media ID ($this->mid) is set. If the Media ID isn't set then there isn't any information avaliable for that picture the picture doesn't exist.
- if ($this->mid){
+ if ($this->mid) {
//This creates a Media Object from the getInstance method of the Media Class. It takes the Media ID ($this->mid) and creates the object.
$this->mediaobject = Media::getInstance($this->mid);
//This sets the controller ID to be the Media ID
@@ -337,9 +337,9 @@ class MediaController extends BaseController{
else $newfacts[] = new Event("1 TYPE ".i18n::translate('Other'));
//-- loop through new facts and add them to the list if they are any changes
//-- compare new and old facts of the Personal Fact and Details tab 1
- for($i=0; $i<count($facts); $i++) {
+ for ($i=0; $i<count($facts); $i++) {
$found=false;
- foreach($newfacts as $indexval => $newfact) {
+ foreach ($newfacts as $indexval => $newfact) {
if (trim($newfact->gedcomRecord)==trim($facts[$i]->gedcomRecord)) {
$found=true;
break;
@@ -349,9 +349,9 @@ class MediaController extends BaseController{
$facts[$i]->gedcomRecord.="\nWT_OLD\n";
}
}
- foreach($newfacts as $indexval => $newfact) {
+ foreach ($newfacts as $indexval => $newfact) {
$found=false;
- foreach($facts as $indexval => $fact) {
+ foreach ($facts as $indexval => $fact) {
if (trim($fact->gedcomRecord)==trim($newfact->gedcomRecord)) {
$found=true;
break;
diff --git a/includes/controllers/pedigree_ctrl.php b/includes/controllers/pedigree_ctrl.php
index 8e4af5c92f..19d5bcdd96 100644
--- a/includes/controllers/pedigree_ctrl.php
+++ b/includes/controllers/pedigree_ctrl.php
@@ -118,7 +118,7 @@ class PedigreeController extends BaseController {
$this->treesize = pow(2, (int)($this->PEDIGREE_GENERATIONS))-1;
//-- ancestry_array puts everyone at $i+1
- for($i=0; $i<$this->treesize; $i++) {
+ for ($i=0; $i<$this->treesize; $i++) {
$this->treeid[$i] = $this->treeid[$i+1];
}
@@ -157,7 +157,7 @@ class PedigreeController extends BaseController {
if ($this->treesize<3) $this->treesize=3;
// -- loop through all of id's in the array starting at the last and working to the first
//-- calculation the box positions
- for($i=($this->treesize-1); $i>=0; $i--) {
+ for ($i=($this->treesize-1); $i>=0; $i--) {
// -- check to see if we have moved to the next generation
if ($i < floor($this->treesize / (pow(2, $this->curgen)))) {
$this->curgen++;
@@ -191,13 +191,13 @@ class PedigreeController extends BaseController {
if ($i%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * ($this->curgen-1));
else $this->yoffset=$this->yoffset + (($boxspacing/2) * ($this->curgen-1));
$pgen = $this->curgen;
- while($parent>0) {
+ while ($parent>0) {
if ($parent%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * $pgen);
else $this->yoffset=$this->yoffset + (($boxspacing/2) * $pgen);
$pgen++;
if ($pgen>3) {
$temp=0;
- for($j=1; $j<($pgen-2); $j++) $temp += (pow(2, $j)-1);
+ for ($j=1; $j<($pgen-2); $j++) $temp += (pow(2, $j)-1);
if ($parent%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * $temp);
else $this->yoffset=$this->yoffset + (($boxspacing/2) * $temp);
}
@@ -205,7 +205,7 @@ class PedigreeController extends BaseController {
}
if ($this->curgen>3) {
$temp=0;
- for($j=1; $j<($this->curgen-2); $j++) $temp += (pow(2, $j)-1);
+ for ($j=1; $j<($this->curgen-2); $j++) $temp += (pow(2, $j)-1);
if ($i%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * $temp);
else $this->yoffset=$this->yoffset + (($boxspacing/2) * $temp);
}
@@ -238,7 +238,7 @@ class PedigreeController extends BaseController {
//-- calculate the smallest yoffset and adjust the tree to that offset
$minyoffset = 0;
- for($i=0; $i<count($this->treeid); $i++) {
+ for ($i=0; $i<count($this->treeid); $i++) {
if ($SHOW_EMPTY_BOXES || !empty($treeid[$i])) {
if (!empty($offsetarray[$i])) {
if (($minyoffset==0)||($minyoffset>$this->offsetarray[$i]["y"])) $minyoffset = $this->offsetarray[$i]["y"];
@@ -287,7 +287,7 @@ class PedigreeController extends BaseController {
if (empty($treeid[$index])) {
$pgen=$curgen;
$genoffset=0;
- while($pgen<=$this->PEDIGREE_GENERATIONS) {
+ while ($pgen<=$this->PEDIGREE_GENERATIONS) {
$genoffset += pow(2, ($this->PEDIGREE_GENERATIONS-$pgen));
$pgen++;
}
diff --git a/includes/controllers/search_ctrl.php b/includes/controllers/search_ctrl.php
index dda24feffa..a9a20e0e0f 100644
--- a/includes/controllers/search_ctrl.php
+++ b/includes/controllers/search_ctrl.php
@@ -127,10 +127,10 @@ class SearchController extends BaseController {
if (isset ($_REQUEST["replace"])) {
$this->replace = $_REQUEST["replace"];
- if(isset($_REQUEST["replaceNames"])) $this->replaceNames = true;
- if(isset($_REQUEST["replacePlaces"])) $this->replacePlaces = true;
- if(isset($_REQUEST["replacePlacesWord"])) $this->replacePlacesWord = true;
- if(isset($_REQUEST["replaceAll"])) $this->replaceAll = true;
+ if (isset($_REQUEST["replaceNames"])) $this->replaceNames = true;
+ if (isset($_REQUEST["replacePlaces"])) $this->replacePlaces = true;
+ if (isset($_REQUEST["replacePlacesWord"])) $this->replacePlacesWord = true;
+ if (isset($_REQUEST["replaceAll"])) $this->replaceAll = true;
}
// Aquire all the variables values from the $_REQUEST
@@ -316,9 +316,9 @@ class SearchController extends BaseController {
foreach ($varNames as $key => $varName) {
if (isset ($_REQUEST[$varName]))
{
- if($varName == "action")
- if($_REQUEST[$varName] == "replace")
- if(!WT_USER_CAN_ACCEPT)
+ if ($varName == "action")
+ if ($_REQUEST[$varName] == "replace")
+ if (!WT_USER_CAN_ACCEPT)
{
$this->action = "general";
continue;
@@ -491,47 +491,47 @@ class SearchController extends BaseController {
$adv_name_tags = preg_split("/[\s,;: ]+/", $ADVANCED_NAME_FACTS);
$name_tags = array_unique(array_merge($STANDARD_NAME_FACTS, $adv_name_tags));
$name_tags[] = "_MARNM";
- foreach($this->myindilist as $id=>$individual) {
+ foreach ($this->myindilist as $id=>$individual) {
$indirec=find_gedcom_record($individual->getXref(), WT_GED_ID, true);
$oldRecord = $indirec;
$newRecord = $indirec;
- if($this->replaceAll) {
+ if ($this->replaceAll) {
$newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord);
} else {
- if($this->replaceNames) {
- foreach($name_tags as $f=>$tag) {
+ if ($this->replaceNames) {
+ foreach ($name_tags as $f=>$tag) {
$newRecord = preg_replace("~(\d) ".$tag." (.*)".$oldquery."(.*)~i", "$1 ".$tag." $2".$this->replace."$3", $newRecord);
}
}
- if($this->replacePlaces) {
+ if ($this->replacePlaces) {
if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
}
}
//-- if the record changed replace the record otherwise remove it from the search results
- if($newRecord != $oldRecord) {
+ if ($newRecord != $oldRecord) {
replace_gedrec($individual->getXref(), WT_GED_ID, $newRecord);
} else {
unset($this->myindilist[$id]);
}
}
- foreach($this->myfamlist as $id=>$family) {
+ foreach ($this->myfamlist as $id=>$family) {
$indirec=find_gedcom_record($family->getXref(), WT_GED_ID, true);
$oldRecord = $indirec;
$newRecord = $indirec;
- if($this->replaceAll) {
+ if ($this->replaceAll) {
$newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord);
}
else {
- if($this->replacePlaces) {
+ if ($this->replacePlaces) {
if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
}
}
//-- if the record changed replace the record otherwise remove it from the search results
- if($newRecord != $oldRecord) {
+ if ($newRecord != $oldRecord) {
replace_gedrec($family->getXref(), WT_GED_ID, $newRecord);
} else {
unset($this->myfamlist[$id]);
@@ -546,17 +546,17 @@ class SearchController extends BaseController {
if ($this->replaceAll) {
$newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord);
} else {
- if($this->replaceNames) {
+ if ($this->replaceNames) {
$newRecord = preg_replace("~(\d) TITL (.*)".$oldquery."(.*)~i", "$1 TITL $2".$this->replace."$3", $newRecord);
$newRecord = preg_replace("~(\d) ABBR (.*)".$oldquery."(.*)~i", "$1 ABBR $2".$this->replace."$3", $newRecord);
}
- if($this->replacePlaces) {
+ if ($this->replacePlaces) {
if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
}
}
//-- if the record changed replace the record otherwise remove it from the search results
- if($newRecord != $oldRecord) {
+ if ($newRecord != $oldRecord) {
replace_gedrec($source->getXref(), WT_GED_ID, $newRecord);
} else {
unset($this->mysourcelist[$id]);
@@ -572,7 +572,7 @@ class SearchController extends BaseController {
$newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord);
}
//-- if the record changed replace the record otherwise remove it from the search results
- if($newRecord != $oldRecord) {
+ if ($newRecord != $oldRecord) {
replace_gedrec($note->getXref(), WT_GED_ID, $newRecord);
} else {
unset($this->mynotelist[$id]);
@@ -1016,7 +1016,7 @@ class SearchController extends BaseController {
}
}
$tempURL .= "&amp;resultsPageNum={$pageNum}";
- foreach($this->sgeds as $i=>$key) {
+ foreach ($this->sgeds as $i=>$key) {
$str = str_replace(array (".", "-", " "), array ("_", "_", "_"), $key);
$tempURL .= "&amp;{$str}=yes";
}
diff --git a/includes/controllers/timeline_ctrl.php b/includes/controllers/timeline_ctrl.php
index dbb73b7299..57f39435ab 100644
--- a/includes/controllers/timeline_ctrl.php
+++ b/includes/controllers/timeline_ctrl.php
@@ -84,7 +84,7 @@ class TimelineController extends BaseController {
$remove = safe_GET_xref('remove');
//-- cleanup user input
$newpids = array();
- foreach($this->pids as $key=>$value) {
+ foreach ($this->pids as $key=>$value) {
if ($value!=$remove) {
$newpids[] = $value;
$person = Person::getInstance($value);
@@ -94,7 +94,7 @@ class TimelineController extends BaseController {
$this->pids = $newpids;
$this->pidlinks = "";
/* @var $indi Person */
- foreach($this->people as $p=>$indi) {
+ foreach ($this->people as $p=>$indi) {
if (!is_null($indi) && $indi->canDisplayDetails()) {
//-- setup string of valid pids for links
$this->pidlinks .= "pids[]=".$indi->getXref()."&amp;";
@@ -110,7 +110,7 @@ class TimelineController extends BaseController {
}
// find all the fact information
$indi->add_family_facts(false);
- foreach($indi->getIndiFacts() as $event) {
+ foreach ($indi->getIndiFacts() as $event) {
//-- get the fact type
$fact = $event->getTag();
if (!in_array($fact, $this->nonfacts)) {
@@ -148,7 +148,7 @@ class TimelineController extends BaseController {
*/
function checkPrivacy() {
$printed = false;
- for($i=0; $i<count($this->people); $i++) {
+ for ($i=0; $i<count($this->people); $i++) {
if (!is_null($this->people[$i])) {
if (!$this->people[$i]->canDisplayDetails()) {
if ($this->people[$i]->canDisplayName()) {
@@ -198,7 +198,7 @@ class TimelineController extends BaseController {
$i=1;
$j=0;
$tyoffset = 0;
- while(isset($placements[$place])) {
+ while (isset($placements[$place])) {
if ($i==$j) {
$tyoffset = $this->bheight * $i;
$i++;
@@ -234,7 +234,7 @@ class TimelineController extends BaseController {
$husbid=$family->getHusbId();
$wifeid=$family->getWifeId();
//-- Retrieve husband and wife age
- for($p=0; $p<count($this->pids); $p++) {
+ for ($p=0; $p<count($this->pids); $p++) {
if ($this->pids[$p]==$husbid) {
$husb=$family->getHusband();
if (is_null($husb)) $husb = new Person('');
@@ -269,7 +269,7 @@ class TimelineController extends BaseController {
if ($place!=null) {
if ($desc!=null) echo " - ";
$plevels = explode(',', $place);
- for($plevel=0; $plevel<$SHOW_PEDIGREE_PLACES; $plevel++) {
+ for ($plevel=0; $plevel<$SHOW_PEDIGREE_PLACES; $plevel++) {
if (!empty($plevels[$plevel])) {
if ($plevel>0) echo ", ";
echo PrintReady($plevels[$plevel]);
@@ -280,7 +280,7 @@ class TimelineController extends BaseController {
//-- print spouse name for marriage events
$spouse = Person::getInstance($event->getSpouseId());
if ($spouse) {
- for($p=0; $p<count($this->pids); $p++) {
+ for ($p=0; $p<count($this->pids); $p++) {
if ($this->pids[$p]==$spouse->getXref()) break;
}
if ($p==count($this->pids)) $p = $event->temp;