From 6f021f780be7c181ecc6fe06a645f1a6ded0936a Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Sun, 18 Jan 2015 21:44:41 +0000 Subject: Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- .../_CENS/census_3_search_add.php | 824 +++++++++--------- modules_v3/batch_update/admin_batch_update.php | 286 +++---- modules_v3/googlemap/module.php | 926 ++++++++++----------- 3 files changed, 1018 insertions(+), 1018 deletions(-) (limited to 'modules_v3') diff --git a/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php b/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php index 55df699418..8697e31870 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php @@ -50,8 +50,8 @@ if (!defined('WT_WEBTREES')) { "; - echo "" ; - echo "  ".WT_I18N::translate('Search'); + echo ""; + echo "  " . WT_I18N::translate('Search'); echo ''; ?> @@ -75,7 +75,7 @@ if (!defined('WT_WEBTREES')) { '; - $headImg2 = ''; + $headImg2 = ''; echo WT_I18N::translate('Click %s to choose individual as head of family.', $headImg); ?> @@ -94,13 +94,13 @@ if (!defined('WT_WEBTREES')) { $chBLDarray = Array(); foreach ($family->getChildren() as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } @@ -108,7 +108,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getHusband()) { //-- Parents Husbands Parents -------------------------------------- - $gparent=$family->getHusband(); + $gparent = $family->getHusband(); foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); $pwife = $cfamily->getWife(); @@ -119,14 +119,14 @@ if (!defined('WT_WEBTREES')) { //-- Parents Husbands Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> ", "getSex(); // gend = Gender ?>", "=0) { + if ($married >= 0) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> @@ -217,7 +217,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getWife()) { //-- Parents Wifes Parent Family --------------------------- - $gparent=$family->getWife(); + $gparent = $family->getWife(); $cfamily = null; foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); @@ -229,25 +229,25 @@ if (!defined('WT_WEBTREES')) { //-- Wifes Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available if ($cfamily && $cfamily->getHusband()) { $husbnams = $cfamily->getHusband()->getAllNames(); - if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { + if ($husbnams[0]['surname'] == "@N.N." || $husbnams[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $husbnams[0]['surname']; } } - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> @@ -287,21 +287,21 @@ if (!defined('WT_WEBTREES')) { ?>", "getSex(); // gend = Gender ?>", "=0 && isset($nam[1])) { + if ($married >= 0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> @@ -339,40 +339,40 @@ if (!defined('WT_WEBTREES')) { foreach ($family->getChildren() as $child) { // Get Child’s Children’s Name DOB DOD ---- - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name// Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } // Get child’s marriage status ---- - $married=""; - $marrdate=""; + $married = ""; + $marrdate = ""; foreach ($child->getSpouseFamilies() as $childfamily) { - $marrdate=$childfamily->getMarriageDate(); + $marrdate = $childfamily->getMarriageDate(); $married = WT_Date::Compare($censdate, $marrdate); } $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> @@ -416,21 +416,21 @@ if (!defined('WT_WEBTREES')) { ?>", "getSex(); // gend = Gender ?>", "0) { + if ($married > 0) { echo "M"; // cond = Condition (Married) - } else if ($married<0 || ($married=="0") ) { + } else if ($married < 0 || ($married == "0")) { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $child->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } @@ -478,13 +478,13 @@ if (!defined('WT_WEBTREES')) { $chBLDarray = Array(); foreach ($family->getChildren() as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } @@ -492,7 +492,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getHusband()) { //-- Step Husbands Parent Family -------------------------------------- - $gparent=$family->getHusband(); + $gparent = $family->getHusband(); foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); $pwife = $cfamily->getWife(); @@ -503,14 +503,14 @@ if (!defined('WT_WEBTREES')) { //-- Step Husbands Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> @@ -552,21 +552,21 @@ if (!defined('WT_WEBTREES')) { ?>", "getSex(); // gend = Gender ?>", "=0) { + if ($married >= 0) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> @@ -602,7 +602,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getWife()) { //-- Step Wifes Parent Family -------------------------------------- - $gparent=$family->getWife(); + $gparent = $family->getWife(); $cfamily = null; foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); @@ -614,25 +614,25 @@ if (!defined('WT_WEBTREES')) { //-- Step Wifes Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available if ($cfamily && $cfamily->getHusband()) { $husbnams = $cfamily->getHusband()->getAllNames(); - if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { + if ($husbnams[0]['surname'] == "@N.N." || $husbnams[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $husbnams[0]['surname']; } } - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> ", "", "getSex(); // gend = Gender ?>", "=0 && isset($nam[1])) { + if ($married >= 0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> @@ -724,33 +724,33 @@ if (!defined('WT_WEBTREES')) { foreach ($family->getChildren() as $child) { // Get Child’s Children - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> @@ -777,7 +777,7 @@ if (!defined('WT_WEBTREES')) { if (($child->canShow())) { ?> ", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $child->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $child->getFullName(); // Full Name (Link) ?> getChildren() as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } @@ -867,7 +867,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getHusband()) { //-- Spouse Husbands Parents -------------------------------------- - $gparent=$family->getHusband(); + $gparent = $family->getHusband(); foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); $pwife = $cfamily->getWife(); @@ -878,14 +878,14 @@ if (!defined('WT_WEBTREES')) { //-- Spouse Husbands Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> ", "getSex(); // gend = Gender ?>", "=0) { + if ($married >= 0) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> @@ -977,7 +977,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getWife()) { //-- Spouse Wifes Parents -------------------------------------- - $gparent=$family->getWife(); + $gparent = $family->getWife(); $cfamily = null; foreach ($gparent->getChildFamilies() as $cfamily) { $husb = $cfamily->getHusband(); @@ -989,25 +989,25 @@ if (!defined('WT_WEBTREES')) { //-- Spouse Wifes Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available if ($cfamily && $cfamily->getHusband()) { $husbnams = $cfamily->getHusband()->getAllNames(); - if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { + if ($husbnams[0]['surname'] == "@N.N." || $husbnams[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $husbnams[0]['surname']; } } - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> ", "getSex(); // gend = Gender ?>", "=0 && isset($nam[1])) { + if ($married >= 0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> @@ -1098,42 +1098,42 @@ if (!defined('WT_WEBTREES')) { foreach ($family->getChildren() as $child) { // Get Spouse child’s marriage status - $married=""; - $marrdate=""; + $married = ""; + $marrdate = ""; foreach ($child->getSpouseFamilies() as $childfamily) { - $marrdate=$childfamily->getMarriageDate(); + $marrdate = $childfamily->getMarriageDate(); $married = WT_Date::Compare($censdate, $marrdate); } // Get Child’s Children - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name// Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } // Get Spouse child’s details $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - for ($i=0; $i getXref()."&gedcom=".WT_GEDURL."\">"; + echo "getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo ""; ?> @@ -1158,7 +1158,7 @@ if (!defined('WT_WEBTREES')) { if (($child->canShow())) { ?> ", "getSex(); // gend = Gender ?>", "0) { + if ($married > 0) { echo "M"; // cond = Condition (Married) - } else if ($married<0 || ($married=="0") ) { + } else if ($married < 0 || ($married == "0")) { echo "S"; // cond = Condition (Single) } else { echo ""; // cond = Condition (Not Known) } ?>", "minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "getbirthyear(); // age = Census Date minus YOB + echo $censyear - $child->getbirthyear(); // age = Census Date minus YOB ?>", "getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "", "", "getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> getFullName(); // Full Name (Link) + echo $child->getFullName(); // Full Name (Link) ?> '','F'=>'F', 'U'=>'NN'); + $tmp = array('M'=>'', 'F'=>'F', 'U'=>'NN'); $isF = $tmp[$person->getSex()]; $spouselinks = ''; $parentlinks = ''; @@ -1264,20 +1264,20 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($person->canShowName()) { //-- draw a box for the family popup - if ($TEXT_DIRECTION=="rtl") { + if ($TEXT_DIRECTION == "rtl") { $spouselinks .= "
"; - $spouselinks .= "" . WT_I18N::translate('Family') . " (" .$person->getFullName(). ")
"; + $spouselinks .= "" . WT_I18N::translate('Family') . " (" . $person->getFullName() . ")
"; $parentlinks .= "
"; - $parentlinks .= "" . WT_I18N::translate('Parents') . " (" .$person->getFullName(). ")
"; + $parentlinks .= "" . WT_I18N::translate('Parents') . " (" . $person->getFullName() . ")
"; $step_parentlinks .= "
"; - $step_parentlinks .= "" . WT_I18N::translate('Parents') . " (" .$person->getFullName(). ")
"; + $step_parentlinks .= "" . WT_I18N::translate('Parents') . " (" . $person->getFullName() . ")
"; } else { $spouselinks .= "
"; - $spouselinks .= "" . WT_I18N::translate('Family') . " (" .$person->getFullName(). ")
"; + $spouselinks .= "" . WT_I18N::translate('Family') . " (" . $person->getFullName() . ")
"; $parentlinks .= "
"; - $parentlinks .= "" . WT_I18N::translate('Parents') . " (" .$person->getFullName(). ")
"; + $parentlinks .= "" . WT_I18N::translate('Parents') . " (" . $person->getFullName() . ")
"; $step_parentlinks .= "'. - '' . + ''; } @@ -403,12 +403,12 @@ class base_plugin { function getActionButtons($xref) { if (Auth::user()->getPreference('auto_accept')) { return array( - batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update'), + batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update'), batch_update::createSubmitButton(WT_I18N::translate('Update all'), $xref, 'update_all') ); } else { return array( - batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update') + batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update') ); } } @@ -421,34 +421,34 @@ class base_plugin { * @return string */ function getActionPreview(WT_GedcomRecord $record) { - $old_lines=preg_split('/[\n]+/', $record->getGedcom()); - $new_lines=preg_split('/[\n]+/', $this->updateRecord($record->getXref(), $record->getGedcom())); + $old_lines = preg_split('/[\n]+/', $record->getGedcom()); + $new_lines = preg_split('/[\n]+/', $this->updateRecord($record->getXref(), $record->getGedcom())); // Find matching lines using longest-common-subsequence algorithm. - $lcs=self::LongestCommonSubsequence($old_lines, $new_lines, 0, count($old_lines)-1, 0, count($new_lines)-1); + $lcs = self::LongestCommonSubsequence($old_lines, $new_lines, 0, count($old_lines) - 1, 0, count($new_lines) - 1); - $diff_lines=array(); - $last_old=-1; - $last_new=-1; + $diff_lines = array(); + $last_old = -1; + $last_new = -1; while ($lcs) { - list($old, $new)=array_shift($lcs); - while ($last_old<$old-1) { - $diff_lines[]=self::decorateDeletedText($old_lines[++$last_old]); + list($old, $new) = array_shift($lcs); + while ($last_old < $old - 1) { + $diff_lines[] = self::decorateDeletedText($old_lines[++$last_old]); } - while ($last_new<$new-1) { - $diff_lines[]=self::decorateInsertedText($new_lines[++$last_new]); + while ($last_new < $new - 1) { + $diff_lines[] = self::decorateInsertedText($new_lines[++$last_new]); } - $diff_lines[]=$new_lines[$new]; - $last_old=$old; - $last_new=$new; + $diff_lines[] = $new_lines[$new]; + $last_old = $old; + $last_new = $new; } - while ($last_old'.self::createEditLinks(implode("\n", $diff_lines)).''; + return '
' . self::createEditLinks(implode("\n", $diff_lines)) . '
'; } /** @@ -464,21 +464,21 @@ class base_plugin { * @return array */ private static function LongestCommonSubsequence($X, $Y, $x1, $x2, $y1, $y2) { - if ($x2-$x1>=0 && $y2-$y1>=0) { - if ($X[$x1]==$Y[$y1]) { + if ($x2 - $x1 >= 0 && $y2 - $y1 >= 0) { + if ($X[$x1] == $Y[$y1]) { // Match at start of sequence - $tmp=self::LongestCommonSubsequence($X, $Y, $x1+1, $x2, $y1+1, $y2); + $tmp = self::LongestCommonSubsequence($X, $Y, $x1 + 1, $x2, $y1 + 1, $y2); array_unshift($tmp, array($x1, $y1)); return $tmp; - } elseif ($X[$x2]==$Y[$y2]) { + } elseif ($X[$x2] == $Y[$y2]) { // Match at end of sequence - $tmp=self::LongestCommonSubsequence($X, $Y, $x1, $x2-1, $y1, $y2-1); + $tmp = self::LongestCommonSubsequence($X, $Y, $x1, $x2 - 1, $y1, $y2 - 1); array_push($tmp, array($x2, $y2)); return $tmp; } else { // No match. Look for subsequences - $tmp1=self::LongestCommonSubsequence($X, $Y, $x1, $x2, $y1, $y2-1); - $tmp2=self::LongestCommonSubsequence($X, $Y, $x1, $x2-1, $y1, $y2); + $tmp1 = self::LongestCommonSubsequence($X, $Y, $x1, $x2, $y1, $y2 - 1); + $tmp2 = self::LongestCommonSubsequence($X, $Y, $x1, $x2 - 1, $y1, $y2); return count($tmp1) > count($tmp2) ? $tmp1 : $tmp2; } } else { @@ -495,7 +495,7 @@ class base_plugin { * @return string */ static function decorateInsertedText($text) { - return ''.$text.''; + return '' . $text . ''; } /** @@ -506,7 +506,7 @@ class base_plugin { * @return string */ static function decorateDeletedText($text) { - return ''.$text.''; + return '' . $text . ''; } /** diff --git a/modules_v3/googlemap/module.php b/modules_v3/googlemap/module.php index 5a9af2c51d..a61cb1ce90 100644 --- a/modules_v3/googlemap/module.php +++ b/modules_v3/googlemap/module.php @@ -47,7 +47,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Create GM tables, if not already present try { - WT_DB::updateSchema(WT_ROOT.WT_MODULES_DIR.'/googlemap/db_schema/', 'GM_SCHEMA_VERSION', 5); + WT_DB::updateSchema(WT_ROOT . WT_MODULES_DIR . '/googlemap/db_schema/', 'GM_SCHEMA_VERSION', 5); } catch (PDOException $ex) { // The schema update scripts should never fail. If they do, there is no clean recovery. die($ex); @@ -56,21 +56,21 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Set default values try { // TODO: do this once only, in a db_schema upgrade script? - $this->setSetting('GM_MAP_TYPE', $this->getSetting('GM_MAP_TYPE', 'G_NORMAL_MAP')); // G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP - $this->setSetting('GM_MAX_ZOOM', $this->getSetting('GM_MAX_ZOOM', '20')); // max zoom level - $this->setSetting('GM_MIN_ZOOM', $this->getSetting('GM_MIN_ZOOM', '2')); // min zoom level - $this->setSetting('GM_PRECISION_0', $this->getSetting('GM_PRECISION_0', '0')); // Country level - $this->setSetting('GM_PRECISION_1', $this->getSetting('GM_PRECISION_1', '1')); // State level - $this->setSetting('GM_PRECISION_2', $this->getSetting('GM_PRECISION_2', '2')); // City level - $this->setSetting('GM_PRECISION_3', $this->getSetting('GM_PRECISION_3', '3')); // Neighborhood level - $this->setSetting('GM_PRECISION_4', $this->getSetting('GM_PRECISION_4', '4')); // House level - $this->setSetting('GM_PRECISION_5', $this->getSetting('GM_PRECISION_5', '5')); // Max prcision level - $this->setSetting('GM_XSIZE', $this->getSetting('GM_XSIZE', '600')); // X-size of Google map - $this->setSetting('GM_YSIZE', $this->getSetting('GM_YSIZE', '400')); // Y-size of Google map - $this->setSetting('GM_PH_XSIZE', $this->getSetting('GM_PH_XSIZE', '500')); // X-size of Place Hierarchy Google map - $this->setSetting('GM_PH_YSIZE', $this->getSetting('GM_PH_YSIZE', '350')); // Y-size of Place Hierarchy Google map - $this->setSetting('GM_PH_MARKER', $this->getSetting('GM_PH_MARKER', 'G_FLAG')); // Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon - $this->setSetting('GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE', '0')); // Display full place name or only the actual level name + $this->setSetting('GM_MAP_TYPE', $this->getSetting('GM_MAP_TYPE', 'G_NORMAL_MAP')); // G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP + $this->setSetting('GM_MAX_ZOOM', $this->getSetting('GM_MAX_ZOOM', '20')); // max zoom level + $this->setSetting('GM_MIN_ZOOM', $this->getSetting('GM_MIN_ZOOM', '2')); // min zoom level + $this->setSetting('GM_PRECISION_0', $this->getSetting('GM_PRECISION_0', '0')); // Country level + $this->setSetting('GM_PRECISION_1', $this->getSetting('GM_PRECISION_1', '1')); // State level + $this->setSetting('GM_PRECISION_2', $this->getSetting('GM_PRECISION_2', '2')); // City level + $this->setSetting('GM_PRECISION_3', $this->getSetting('GM_PRECISION_3', '3')); // Neighborhood level + $this->setSetting('GM_PRECISION_4', $this->getSetting('GM_PRECISION_4', '4')); // House level + $this->setSetting('GM_PRECISION_5', $this->getSetting('GM_PRECISION_5', '5')); // Max prcision level + $this->setSetting('GM_XSIZE', $this->getSetting('GM_XSIZE', '600')); // X-size of Google map + $this->setSetting('GM_YSIZE', $this->getSetting('GM_YSIZE', '400')); // Y-size of Google map + $this->setSetting('GM_PH_XSIZE', $this->getSetting('GM_PH_XSIZE', '500')); // X-size of Place Hierarchy Google map + $this->setSetting('GM_PH_YSIZE', $this->getSetting('GM_PH_YSIZE', '350')); // Y-size of Place Hierarchy Google map + $this->setSetting('GM_PH_MARKER', $this->getSetting('GM_PH_MARKER', 'G_FLAG')); // Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon + $this->setSetting('GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE', '0')); // Display full place name or only the actual level name } catch (Exception $ex) { // Perhaps the module hasn't been installed yet (no entry in wt_modules) } @@ -88,7 +88,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu /** {@inheritdoc} */ public function modAction($mod_action) { - switch($mod_action) { + switch ($mod_action) { case 'admin_config': $this->config(); break; @@ -118,7 +118,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu /** {@inheritdoc} */ public function getConfigLink() { - return 'module.php?mod='.$this->getName().'&mod_action=admin_config'; + return 'module.php?mod=' . $this->getName() . '&mod_action=admin_config'; } /** {@inheritdoc} */ @@ -165,7 +165,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '', WT_I18N::translate('Geographic data'), ''; echo ''; echo '
'; echo '
"; - $step_parentlinks .= "" . WT_I18N::translate('Parents') . " (" .$person->getFullName(). ")
"; + $step_parentlinks .= "" . WT_I18N::translate('Parents') . " (" . $person->getFullName() . ")
"; } $persons = ''; @@ -1296,13 +1296,13 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $chBLDarray = Array(); foreach ($children as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1311,7 +1311,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($husb || $children) { if ($husb) { // Parent Husbands Parents - $gparent=WT_Individual::getInstance($husb->getXref()); + $gparent = WT_Individual::getInstance($husb->getXref()); $parfams = $gparent->getChildFamilies(); foreach ($parfams as $pfamily) { $phusb = $pfamily->getHusband(); @@ -1324,54 +1324,54 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $person_parent = 'Yes'; if ($husb->canShowName()) { $nam = $husb->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - for ($i=0; $igetXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $parentlinks .= "'" . $husb->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Married Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Married Name } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Father in Law',"; // label = 1st Gen Male Relationship } else { $parentlinks .= "'Grand-Father',"; // label = 2st Gen Male Relationship } - $parentlinks .= "'".$husb->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $husb->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($husb->getBirthDate()->minJD()+$husb->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($husb->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$husb->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($husb->getBirthDate()->minJD() + $husb->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($husb->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $husb->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($husb->getDeathDate()->minJD()+$husb->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($husb->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($husb->getDeathDate()->minJD() + $husb->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($husb->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pHusbFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace } if (isset($pHusbMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace } - if (isset($chBLDarray) && $husb->getSex()=="F") { + if (isset($chBLDarray) && $husb->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1399,59 +1399,59 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { } // Parent Wifes Details - $person_parent="Yes"; + $person_parent = "Yes"; if ($wife->canShowName()) { $nam = $wife->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); - for ($i=0; $igetXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $parentlinks .= "'" . $wife->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulmn))."',"; + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',"; } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Mother in Law',"; // label = 1st Gen Female Relationship } else { $parentlinks .= "'Grand-Mother',"; // label = 2st Gen Female Relationship } - $parentlinks .= "'".$wife->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $wife->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($wife->getBirthDate()->minJD()+$wife->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($wife->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($wife->getBirthDate()->minJD() + $wife->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($wife->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $wife->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($wife->getDeathDate()->minJD()+$wife->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($wife->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($wife->getDeathDate()->minJD() + $wife->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($wife->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pWifeFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($pWifeMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $wife->getSex()=="F") { + if (isset($chBLDarray) && $wife->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1478,13 +1478,13 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $chBLDarray = Array(); foreach ($children as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1495,7 +1495,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if (($husb || $children) && $husb !== $person) { if ($husb) { // Step Husbands Parents - $gparent=WT_Individual::getInstance($husb->getXref()); + $gparent = WT_Individual::getInstance($husb->getXref()); $parfams = $gparent->getChildFamilies(); foreach ($parfams as $pfamily) { $phusb = $pfamily->getHusband(); @@ -1507,54 +1507,54 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $person_step = 'Yes'; if ($husb->canShowName()) { $nam = $husb->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - for ($i=0; $igetXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $parentlinks .= "'" . $husb->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Married Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Married Name } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Step Father-in-Law',"; // label = 1st Gen Male Relationship } else { $parentlinks .= "'Step Grand-Father',"; // label = 2st Gen Male Relationship } - $parentlinks .= "'".$husb->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $husb->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($husb->getBirthDate()->minJD()+$husb->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($husb->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$husb->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($husb->getBirthDate()->minJD() + $husb->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($husb->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $husb->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($husb->getDeathDate()->minJD()+$husb->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($husb->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($husb->getDeathDate()->minJD() + $husb->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($husb->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pHusbFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace } if (isset($pHusbMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace } - if (isset($chBLDarray) && $husb->getSex()=="F") { + if (isset($chBLDarray) && $husb->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1575,7 +1575,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($wife || $children) { if ($wife) { // Step Wifes Parents - $gparent=WT_Individual::getInstance($wife->getXref()); + $gparent = WT_Individual::getInstance($wife->getXref()); $parfams = $gparent->getChildFamilies(); foreach ($parfams as $pfamily) { $pwhusb = $pfamily->getHusband(); @@ -1587,56 +1587,56 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $person_step = 'Yes'; if ($wife->canShowName()) { $nam = $wife->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); - for ($i=0; $igetXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $parentlinks .= "'" . $wife->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulmn))."',"; // mnam = Full Married Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',"; // mnam = Full Married Name } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Step Mother-in-Law',"; // label = 1st Gen Female Relationship } else { $parentlinks .= "'Step Grand-Mother',"; // label = 2st Gen Female Relationship } - $parentlinks .= "'".$wife->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $wife->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($wife->getBirthDate()->minJD()+$wife->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($wife->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($wife->getBirthDate()->minJD() + $wife->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($wife->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $wife->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($wife->getDeathDate()->minJD()+$wife->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($wife->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($wife->getDeathDate()->minJD() + $wife->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($wife->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pWifeFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($pWifeMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $wife->getSex()=="F") { + if (isset($chBLDarray) && $wife->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1663,13 +1663,13 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $chBLDarray = Array(); foreach ($children as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); // Child’s Full Name + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1679,7 +1679,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($spouse) { // Spouse Parents - $gparent=WT_Individual::getInstance($spouse->getXref()); + $gparent = WT_Individual::getInstance($spouse->getXref()); $spousefams = $gparent->getChildFamilies(); foreach ($spousefams as $pfamily) { $phusb = $pfamily->getHusband(); @@ -1691,67 +1691,67 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { // Spouse Details if ($spouse->canShowName()) { $nam = $spouse->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); // If spouse is a wife, then get her married name or default to her birth name - for ($i=0; $igetXref()."',"; // pid = PID - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $spouselinks .= "'" . $spouse->getXref() . "',"; // pid = PID + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; if (isset($fulmn)) { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulmn))."',"; + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',"; } else { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; } - if ($currpid=="Son" || $currpid=="Daughter") { - if ($spouse->getSex()=="M") { + if ($currpid == "Son" || $currpid == "Daughter") { + if ($spouse->getSex() == "M") { $spouselinks .= "'Son in Law',"; // label = Male Relationship } else { $spouselinks .= "'Daughter in Law',"; // label = Female Relationship } } else { - if ($spouse->getSex()=="M") { + if ($spouse->getSex() == "M") { $spouselinks .= "'Brother in Law',"; // label = Male Relationship } else { $spouselinks .= "'Sister in Law',"; // label = Female Relationship } } - $spouselinks .= "'".$spouse->getSex()."',"; // sex = Gender - $spouselinks .= "''".","; // cond = Condition (Married etc) + $spouselinks .= "'" . $spouse->getSex() . "',"; // sex = Gender + $spouselinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $spouselinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; + $spouselinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; } - $spouselinks .= "'".(($spouse->getBirthDate()->minJD()+$spouse->getBirthDate()->maxJD())/2)."',"; - if ($spouse->getbirthyear()>=1) { - $spouselinks .= "'".($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth + $spouselinks .= "'" . (($spouse->getBirthDate()->minJD() + $spouse->getBirthDate()->maxJD()) / 2) . "',"; + if ($spouse->getbirthyear() >= 1) { + $spouselinks .= "'" . ($censyear - $spouse->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $spouselinks .= "''".","; // age = Undefined + $spouselinks .= "''" . ","; // age = Undefined } - $spouselinks .= "'".(($spouse->getDeathDate()->minJD()+$spouse->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $spouselinks .= "''".","; // occu = Occupation - $spouselinks .= "'".WT_Filter::escapeHtml($spouse->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $spouselinks .= "'" . (($spouse->getDeathDate()->minJD() + $spouse->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $spouselinks .= "''" . ","; // occu = Occupation + $spouselinks .= "'" . WT_Filter::escapeHtml($spouse->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pSpouseFBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($pSpouseFBP)."'".","; // fbirthpl = Fathers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($pSpouseFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($pSpouseMBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($pSpouseMBP)."'".","; // mbirthpl = Mothers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($pSpouseMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $spouse->getSex()=="F") { + if (isset($chBLDarray) && $spouse->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $spouselinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $spouselinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $spouselinks .= "''"; } @@ -1771,10 +1771,10 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { // Children $spouselinks .= "
    "; foreach ($children as $child) { - $persons="Yes"; + $persons = "Yes"; // Child’s Parents - $gparent=WT_Individual::getInstance($child->getXref()); + $gparent = WT_Individual::getInstance($child->getXref()); foreach ($gparent->getChildFamilies() as $family) { $husb = $family->getHusband(); $wife = $family->getWife(); @@ -1783,18 +1783,18 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { } // Child’s Children - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); // Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); // Child’s Full Name + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1812,75 +1812,75 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $spouselinks .= '
  • '; if ($child->canShowName()) { $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); // Get childs married name if available - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - if ($chhusbnam[0]['surname']=="@N.N." || $chhusbnam[0]['surname']=="") { + if ($chhusbnam[0]['surname'] == "@N.N." || $chhusbnam[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $chhusbnam[0]['surname']; } - for ($i=0; $igetXref()."',"; - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $spouselinks .= "'" . $child->getXref() . "',"; + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($chfulmn)) { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($chfulmn))."',"; // mnam = Full Married Name + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($chfulmn)) . "',"; // mnam = Full Married Name } else { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Son" || $currpid=="Daughter") { - if ($child->getSex()=="M") { + if ($currpid == "Son" || $currpid == "Daughter") { + if ($child->getSex() == "M") { $spouselinks .= "'Grand-Son',"; // label = Male Relationship } else { $spouselinks .= "'Grand-Daughter',"; // label = Female Relationship } } else { - if ($child->getSex()=="M") { + if ($child->getSex() == "M") { $spouselinks .= "'Nephew',"; // label = Male Relationship } else { $spouselinks .= "'Niece',"; // label = Female Relationship } } - $spouselinks .= "'".$child->getSex()."',"; // sex = Gender - $spouselinks .= "''".","; // cond = Condition (Married etc) + $spouselinks .= "'" . $child->getSex() . "',"; // sex = Gender + $spouselinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $spouselinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $spouselinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } else { - $spouselinks .= "'nm'".","; + $spouselinks .= "'nm'" . ","; } - $spouselinks .= "'".(($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($child->getbirthyear()>=1) { - $spouselinks .= "'".($censyear-$child->getbirthyear())."',"; // age = Census Year - Year of Birth + $spouselinks .= "'" . (($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($child->getbirthyear() >= 1) { + $spouselinks .= "'" . ($censyear - $child->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $spouselinks .= "''".","; // age = Undefined + $spouselinks .= "''" . ","; // age = Undefined } - $spouselinks .= "'".(($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $spouselinks .= "''".","; // occu = Occupation - $spouselinks .= "'".WT_Filter::escapeHtml($child->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $spouselinks .= "'" . (($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $spouselinks .= "''" . ","; // occu = Occupation + $spouselinks .= "'" . WT_Filter::escapeHtml($child->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($ChildFBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($ChildFBP)."'".","; // fbirthpl = Fathers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($ChildFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($ChildMBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($ChildMBP)."'".","; // mbirthpl = Mothers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($ChildMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $child->getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $spouselinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $spouselinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $spouselinks .= "''"; } diff --git a/modules_v3/batch_update/admin_batch_update.php b/modules_v3/batch_update/admin_batch_update.php index 8a7caa8aa3..d6db1e0a43 100644 --- a/modules_v3/batch_update/admin_batch_update.php +++ b/modules_v3/batch_update/admin_batch_update.php @@ -24,17 +24,17 @@ require_once WT_ROOT . 'includes/functions/functions_edit.php'; * Class batch_update */ class batch_update { - var $plugin =null; // Form parameter: chosen plugin - var $xref =null; // Form parameter: record to update - var $action =null; // Form parameter: how to update record - var $data =null; // Form parameter: additional details for $action - var $plugins =null; // Array of available plugins - var $PLUGIN =null; // An instance of a plugin object - var $all_xrefs=null; // An array of all xrefs that might need to be updated - var $prev_xref=null; // The previous xref to process - var $curr_xref=null; // The xref to process - var $next_xref=null; // The next xref to process - var $record =null; // A GedcomRecord object corresponding to $curr_xref + var $plugin = null; // Form parameter: chosen plugin + var $xref = null; // Form parameter: record to update + var $action = null; // Form parameter: how to update record + var $data = null; // Form parameter: additional details for $action + var $plugins = null; // Array of available plugins + var $PLUGIN = null; // An instance of a plugin object + var $all_xrefs = null; // An array of all xrefs that might need to be updated + var $prev_xref = null; // The previous xref to process + var $curr_xref = null; // The xref to process + var $next_xref = null; // The next xref to process + var $record = null; // A GedcomRecord object corresponding to $curr_xref /** * What is the name of this plugin? @@ -52,64 +52,64 @@ class batch_update { */ function main() { // HTML common to all pages - $html= - self::getJavascript(). - '
    '. - ''. - ''. - ''. - ''. // will be set by javascript for next update - ''. // will be set by javascript for next update - ''. - ''. - '
    '.WT_I18N::translate('Family tree').''.select_edit_control('ged', WT_Tree::getNameList(), '', WT_GEDCOM, 'onchange="reset_reload();"'). - '
    '.WT_I18N::translate('Batch update').'' . + '' . + '' . + '' . // will be set by javascript for next update + '' . // will be set by javascript for next update + '' . + '' . + ''; + $html .= ''; if (!Auth::user()->getPreference('auto_accept')) { - $html.=''; + $html .= ''; } // If a plugin is selected, display the details if ($this->PLUGIN) { - $html.=$this->PLUGIN->getOptionsForm(); - if (substr($this->action, -4)=='_all') { + $html .= $this->PLUGIN->getOptionsForm(); + if (substr($this->action, -4) == '_all') { // Reset - otherwise we might "undo all changes", which refreshes the // page, which makes them all again! - $html.=''; + $html .= ''; } else { if ($this->curr_xref) { // Create an object, so we can get the latest version of the name. - $this->record=WT_GedcomRecord::getInstance($this->curr_xref); - - $html.= - '
    ' . WT_I18N::translate('Family tree') . '' . select_edit_control('ged', WT_Tree::getNameList(), '', WT_GEDCOM, 'onchange="reset_reload();"') . + '
    ' . WT_I18N::translate('Batch update') . ''; + $html .= ''; if ($this->PLUGIN) { - $html.='
    '.$this->PLUGIN->getDescription().''; + $html .= '
    ' . $this->PLUGIN->getDescription() . ''; } - $html.='
    '.WT_I18N::translate('Your user account does not have “automatically approve changes” enabled. You will only be able to change one record at a time.').'
    ' . WT_I18N::translate('Your user account does not have “automatically approve changes” enabled. You will only be able to change one record at a time.') . '
    '. - '
    '. - self::createSubmitButton(WT_I18N::translate('previous'), $this->prev_xref). - self::createSubmitButton(WT_I18N::translate('next'), $this->next_xref). - ''.$this->record->getFullName().''. - '
    '. - '
    '.implode('
    ',$this->PLUGIN->getActionButtons($this->curr_xref, $this->record)).'
    '. - '
    '. + $this->record = WT_GedcomRecord::getInstance($this->curr_xref); + + $html .= + '
    ' . + ''; } else { - $html.=''; + $html .= ''; } } } - $html.='
    ' . + self::createSubmitButton(WT_I18N::translate('previous'), $this->prev_xref) . + self::createSubmitButton(WT_I18N::translate('next'), $this->next_xref) . + '' . $this->record->getFullName() . '' . + '
    ' . + '
    ' . implode('
    ', $this->PLUGIN->getActionButtons($this->curr_xref, $this->record)) . '
    ' . + '
    ' . $this->PLUGIN->getActionPreview($this->record) . '
    '.WT_I18N::translate('Nothing found.').'
    ' . WT_I18N::translate('Nothing found.') . '
    '; + $html .= '
    '; return $html; } @@ -118,24 +118,24 @@ class batch_update { * Constructor - initialise variables and validate user-input */ public function __construct() { - $this->plugins=self::getPluginList(); // List of available plugins - $this->plugin =WT_Filter::get('plugin'); // User parameters - $this->xref =WT_Filter::get('xref', WT_REGEX_XREF); - $this->action =WT_Filter::get('action'); - $this->data =WT_Filter::get('data'); + $this->plugins = self::getPluginList(); // List of available plugins + $this->plugin = WT_Filter::get('plugin'); // User parameters + $this->xref = WT_Filter::get('xref', WT_REGEX_XREF); + $this->action = WT_Filter::get('action'); + $this->data = WT_Filter::get('data'); // Don't do any processing until a plugin is chosen. if ($this->plugin && array_key_exists($this->plugin, $this->plugins)) { - $this->PLUGIN=new $this->plugin; + $this->PLUGIN = new $this->plugin; $this->PLUGIN->getOptions(); $this->getAllXrefs(); switch ($this->action) { case 'update': - $record=self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]); + $record = self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]); if ($this->PLUGIN->doesRecordNeedUpdate($this->xref, $record)) { - $newrecord=$this->PLUGIN->updateRecord($this->xref, $record); - if ($newrecord!=$record) { + $newrecord = $this->PLUGIN->updateRecord($this->xref, $record); + if ($newrecord != $record) { if ($newrecord) { WT_GedcomRecord::getInstance($this->xref)->updateRecord($newrecord, $this->PLUGIN->chan); } else { @@ -143,14 +143,14 @@ class batch_update { } } } - $this->xref=$this->findNextXref($this->xref); + $this->xref = $this->findNextXref($this->xref); break; case 'update_all': foreach ($this->all_xrefs as $xref=>$type) { - $record=self::getLatestRecord($xref, $type); + $record = self::getLatestRecord($xref, $type); if ($this->PLUGIN->doesRecordNeedUpdate($xref, $record)) { - $newrecord=$this->PLUGIN->updateRecord($xref, $record); - if ($newrecord!=$record) { + $newrecord = $this->PLUGIN->updateRecord($xref, $record); + if ($newrecord != $record) { if ($newrecord) { WT_GedcomRecord::getInstance($this->xref)->updateRecord($newrecord, $this->PLUGIN->chan); } else { @@ -159,7 +159,7 @@ class batch_update { } } } - $this->xref=''; + $this->xref = ''; return; default: break; @@ -170,20 +170,20 @@ class batch_update { // been specified at all. if (array_key_exists($this->xref, $this->all_xrefs) && $this->PLUGIN->doesRecordNeedUpdate($this->xref, self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]))) { - $this->curr_xref=$this->xref; + $this->curr_xref = $this->xref; } // The requested record doesn't need updating - find one that does if (!$this->curr_xref) { - $this->curr_xref=$this->findNextXref($this->xref); + $this->curr_xref = $this->findNextXref($this->xref); } if (!$this->curr_xref) { - $this->curr_xref=$this->findPrevXref($this->xref); + $this->curr_xref = $this->findPrevXref($this->xref); } // If we've found a record to update, get details and look for the next/prev if ($this->curr_xref) { - $this->record=self::getLatestRecord($this->curr_xref, $this->all_xrefs[$this->curr_xref]); - $this->prev_xref=$this->findPrevXref($this->curr_xref); - $this->next_xref=$this->findNextXref($this->curr_xref); + $this->record = self::getLatestRecord($this->curr_xref, $this->all_xrefs[$this->curr_xref]); + $this->prev_xref = $this->findPrevXref($this->curr_xref); + $this->next_xref = $this->findNextXref($this->curr_xref); } } } @@ -197,8 +197,8 @@ class batch_update { */ function findNextXref($xref) { foreach (array_keys($this->all_xrefs) as $key) { - if ($key>$xref) { - $record=self::getLatestRecord($key, $this->all_xrefs[$key]); + if ($key > $xref) { + $record = self::getLatestRecord($key, $this->all_xrefs[$key]); if ($this->PLUGIN->doesRecordNeedUpdate($key, $record)) { return $key; } @@ -216,8 +216,8 @@ class batch_update { */ function findPrevXref($xref) { foreach (array_reverse(array_keys($this->all_xrefs)) as $key) { - if ($key<$xref) { - $record=self::getLatestRecord($key, $this->all_xrefs[$key]); + if ($key < $xref) { + $record = self::getLatestRecord($key, $this->all_xrefs[$key]); if ($this->PLUGIN->doesRecordNeedUpdate($key, $record)) { return $key; } @@ -230,36 +230,36 @@ class batch_update { * Generate a list of all XREFs. */ function getAllXrefs() { - $sql=array(); - $vars=array(); + $sql = array(); + $vars = array(); foreach ($this->PLUGIN->getRecordTypesToUpdate() as $type) { switch ($type) { case 'INDI': - $sql[]="SELECT i_id, 'INDI' FROM `##individuals` WHERE i_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT i_id, 'INDI' FROM `##individuals` WHERE i_file=?"; + $vars[] = WT_GED_ID; break; case 'FAM': - $sql[]="SELECT f_id, 'FAM' FROM `##families` WHERE f_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT f_id, 'FAM' FROM `##families` WHERE f_file=?"; + $vars[] = WT_GED_ID; break; case 'SOUR': - $sql[]="SELECT s_id, 'SOUR' FROM `##sources` WHERE s_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT s_id, 'SOUR' FROM `##sources` WHERE s_file=?"; + $vars[] = WT_GED_ID; break; case 'OBJE': - $sql[]="SELECT m_id, 'OBJE' FROM `##media` WHERE m_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT m_id, 'OBJE' FROM `##media` WHERE m_file=?"; + $vars[] = WT_GED_ID; break; default: - $sql[]="SELECT o_id, ? FROM `##other` WHERE o_type=? AND o_file=?"; - $vars[]=$type; - $vars[]=$type; - $vars[]=WT_GED_ID; + $sql[] = "SELECT o_id, ? FROM `##other` WHERE o_type=? AND o_file=?"; + $vars[] = $type; + $vars[] = $type; + $vars[] = WT_GED_ID; break; } } - $this->all_xrefs= - WT_DB::prepare(implode(' UNION ', $sql).' ORDER BY 1 ASC') + $this->all_xrefs = + WT_DB::prepare(implode(' UNION ', $sql) . ' ORDER BY 1 ASC') ->execute($vars) ->fetchAssoc(); } @@ -270,14 +270,14 @@ class batch_update { * @return base_plugin[] */ static function getPluginList() { - $array=array(); - $dir=dirname(__FILE__).'/plugins/'; - $dir_handle=opendir($dir); - while ($file=readdir($dir_handle)) { - if (substr($file, -4)=='.php') { - require dirname(__FILE__).'/plugins/'.$file; - $class=basename($file, '.php').'_bu_plugin'; - $array[$class]=new $class; + $array = array(); + $dir = dirname(__FILE__) . '/plugins/'; + $dir_handle = opendir($dir); + while ($file = readdir($dir_handle)) { + if (substr($file, -4) == '.php') { + require dirname(__FILE__) . '/plugins/' . $file; + $class = basename($file, '.php') . '_bu_plugin'; + $array[$class] = new $class; } } closedir($dir_handle); @@ -292,13 +292,13 @@ class batch_update { */ static function getJavascript() { return - '' ; } @@ -313,14 +313,14 @@ class batch_update { * * @return string */ - static function createSubmitButton($text, $xref, $action='', $data='') { + static function createSubmitButton($text, $xref, $action = '', $data = '') { return - ''; + ''; } /** @@ -361,7 +361,7 @@ class batch_update { * string updateRecord($xref, $gedrec) */ class base_plugin { - var $chan=false; // User option; update change record + var $chan = false; // User option; update change record /** * Default is to operate on INDI records @@ -376,7 +376,7 @@ class base_plugin { * Default option is just the "don't update CHAN record" */ function getOptions() { - $this->chan=WT_Filter::getBool('chan'); + $this->chan = WT_Filter::getBool('chan'); } /** @@ -386,10 +386,10 @@ class base_plugin { */ function getOptionsForm() { return - '
'.WT_I18N::translate('Do not update the “last change” record').'
' . WT_I18N::translate('Do not update the “last change” record') . '
'; - echo '', WT_I18N::translate('Place check'),''; + echo '', WT_I18N::translate('Place check'), ''; echo '
'; } @@ -197,15 +197,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // end echo '
'; echo ''; - return '
'.ob_get_clean().'
'; + return '
' . ob_get_clean() . '
'; } else { - $html=''; - $html.=''; + $html = '
'.WT_I18N::translate('No map data for this person'); - $html.='
'; + $html .= ''; if (Auth::isAdmin()) { - $html.=''; + $html .= ''; } return $html; } @@ -227,7 +227,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * A form to edit the module configuration. */ private function config() { - require WT_ROOT.'includes/functions/functions_edit.php'; + require WT_ROOT . 'includes/functions/functions_edit.php'; $action = WT_Filter::post('action'); @@ -238,28 +238,28 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->pageHeader() ->addInlineJavascript('jQuery("#tabs").tabs();'); - if ($action=='update') { - $this->setSetting('GM_MAP_TYPE', WT_Filter::post('NEW_GM_MAP_TYPE')); - $this->setSetting('GM_USE_STREETVIEW', WT_Filter::post('NEW_GM_USE_STREETVIEW')); - $this->setSetting('GM_MIN_ZOOM', WT_Filter::post('NEW_GM_MIN_ZOOM')); - $this->setSetting('GM_MAX_ZOOM', WT_Filter::post('NEW_GM_MAX_ZOOM')); - $this->setSetting('GM_XSIZE', WT_Filter::post('NEW_GM_XSIZE')); - $this->setSetting('GM_YSIZE', WT_Filter::post('NEW_GM_YSIZE')); - $this->setSetting('GM_PRECISION_0', WT_Filter::post('NEW_GM_PRECISION_0')); - $this->setSetting('GM_PRECISION_1', WT_Filter::post('NEW_GM_PRECISION_1')); - $this->setSetting('GM_PRECISION_2', WT_Filter::post('NEW_GM_PRECISION_2')); - $this->setSetting('GM_PRECISION_3', WT_Filter::post('NEW_GM_PRECISION_3')); - $this->setSetting('GM_PRECISION_4', WT_Filter::post('NEW_GM_PRECISION_4')); - $this->setSetting('GM_PRECISION_5', WT_Filter::post('NEW_GM_PRECISION_5')); - $this->setSetting('GM_COORD', WT_Filter::post('NEW_GM_COORD')); - $this->setSetting('GM_PLACE_HIERARCHY', WT_Filter::post('NEW_GM_PLACE_HIERARCHY')); - $this->setSetting('GM_PH_XSIZE', WT_Filter::post('NEW_GM_PH_XSIZE')); - $this->setSetting('GM_PH_YSIZE', WT_Filter::post('NEW_GM_PH_YSIZE')); - $this->setSetting('GM_PH_MARKER', WT_Filter::post('NEW_GM_PH_MARKER')); - $this->setSetting('GM_DISP_SHORT_PLACE', WT_Filter::post('NEW_GM_DISP_SHORT_PLACE')); - - for ($i=1; $i<=9; $i++) { - $this->setSetting('GM_PREFIX_' . $i, WT_Filter::post('NEW_GM_PREFIX_' . $i)); + if ($action == 'update') { + $this->setSetting('GM_MAP_TYPE', WT_Filter::post('NEW_GM_MAP_TYPE')); + $this->setSetting('GM_USE_STREETVIEW', WT_Filter::post('NEW_GM_USE_STREETVIEW')); + $this->setSetting('GM_MIN_ZOOM', WT_Filter::post('NEW_GM_MIN_ZOOM')); + $this->setSetting('GM_MAX_ZOOM', WT_Filter::post('NEW_GM_MAX_ZOOM')); + $this->setSetting('GM_XSIZE', WT_Filter::post('NEW_GM_XSIZE')); + $this->setSetting('GM_YSIZE', WT_Filter::post('NEW_GM_YSIZE')); + $this->setSetting('GM_PRECISION_0', WT_Filter::post('NEW_GM_PRECISION_0')); + $this->setSetting('GM_PRECISION_1', WT_Filter::post('NEW_GM_PRECISION_1')); + $this->setSetting('GM_PRECISION_2', WT_Filter::post('NEW_GM_PRECISION_2')); + $this->setSetting('GM_PRECISION_3', WT_Filter::post('NEW_GM_PRECISION_3')); + $this->setSetting('GM_PRECISION_4', WT_Filter::post('NEW_GM_PRECISION_4')); + $this->setSetting('GM_PRECISION_5', WT_Filter::post('NEW_GM_PRECISION_5')); + $this->setSetting('GM_COORD', WT_Filter::post('NEW_GM_COORD')); + $this->setSetting('GM_PLACE_HIERARCHY', WT_Filter::post('NEW_GM_PLACE_HIERARCHY')); + $this->setSetting('GM_PH_XSIZE', WT_Filter::post('NEW_GM_PH_XSIZE')); + $this->setSetting('GM_PH_YSIZE', WT_Filter::post('NEW_GM_PH_YSIZE')); + $this->setSetting('GM_PH_MARKER', WT_Filter::post('NEW_GM_PH_MARKER')); + $this->setSetting('GM_DISP_SHORT_PLACE', WT_Filter::post('NEW_GM_DISP_SHORT_PLACE')); + + for ($i = 1; $i <= 9; $i++) { + $this->setSetting('GM_PREFIX_' . $i, WT_Filter::post('NEW_GM_PREFIX_' . $i)); $this->setSetting('GM_POSTFIX_' . $i, WT_Filter::post('NEW_GM_POSTFIX_' . $i)); } @@ -310,7 +310,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu - + @@ -322,16 +322,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu - + @@ -342,14 +342,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu
' . WT_I18N::translate('No map data for this person'); + $html .= '
'; - $html.=''.WT_I18N::translate('Google Maps™ preferences'). ''; - $html.='
'; + $html .= '' . WT_I18N::translate('Google Maps™ preferences') . ''; + $html .= '
WT_I18N::translate('hide'),true=>WT_I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW')); ?>WT_I18N::translate('hide'), true=>WT_I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW')); ?>
: :
- + '; } else { @@ -643,13 +643,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $j++; } echo ''; ?> '; + echo ''; } if ($j == 4) { echo ''; @@ -727,10 +727,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu @@ -741,7 +741,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '; echo ''; echo '
@@ -357,8 +357,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu @@ -366,32 +366,32 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu @@ -400,17 +400,17 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu - + - + - + - +
     
     
     
     
     
     
getSetting('GM_DISP_SHORT_PLACE')); ?>
getSetting('GM_COORD')); ?>
@@ -491,7 +491,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $action = WT_Filter::post('action'); $countrySelected = WT_Filter::get('countrySelected', null, 'Countries'); - $stateSelected = WT_Filter::get('stateSelected', null, 'States'); + $stateSelected = WT_Filter::get('stateSelected', null, 'States'); $country = array(); if (is_dir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/flags')) { @@ -525,7 +525,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $rep = opendir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/' . $stateSelected); while ($file = readdir($rep)) { if (stristr($file, '.png')) { - $flags_s[] = substr($file, 0, strlen($file)-4); + $flags_s[] = substr($file, 0, strlen($file) - 4); } } closedir($rep); @@ -538,7 +538,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu window.opener.document.editplaces.icon.value = 'places/flags/.png'; window.opener.document.getElementById('flagsDiv').innerHTML = "googlemap/places/flags/.png\">    "; - + window.opener.document.editplaces.icon.value = 'places/.png'; window.opener.document.getElementById('flagsDiv').innerHTML = "googlemap/places/.png\">    "; @@ -566,10 +566,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu
- + '.$flags[$i].'' . $flags[$i] . '  ', $flags[$i], '
- +   ', $flags_s[$i], '  ', $flags_s[$i], '
- + - +
'; // print summary statistics if (isset($curgen)) { - $total=pow(2,$curgen)-1; + $total = pow(2, $curgen) - 1; echo WT_I18N::plural( '%1$d individual displayed, out of the normal total of %2$d, from %3$d generations.', '%1$d individuals displayed, out of the normal total of %2$d, from %3$d generations.', @@ -877,7 +877,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($priv) { echo WT_I18N::plural('%s individual is private.', '%s individuals are private.', $priv, $priv), '
'; } - if ($count+$priv != $total) { + if ($count + $priv != $total) { if ($miscount == 0) { echo WT_I18N::translate('No ancestors in the database.'), "
"; } else { @@ -892,8 +892,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '
'; - echo '';// close #pedigreemap_chart - echo '';// close #pedigreemap-page + echo ''; // close #pedigreemap_chart + echo ''; // close #pedigreemap-page ?> @@ -912,7 +912,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu global $controller, $SHOW_HIGHLIGHT_IMAGES, $PEDIGREE_GENERATIONS; // The HomeControl returns the map to the original position and style - $js='function HomeControl(controlDiv, pm_map) {'. + $js = 'function HomeControl(controlDiv, pm_map) {' . // Set CSS styles for the DIV containing the control // Setting padding to 5 px will offset the control from the edge of the map 'controlDiv.style.paddingTop = "5px"; @@ -935,7 +935,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu controlText.style.fontSize = "12px"; controlText.style.paddingLeft = "15px"; controlText.style.paddingRight = "15px"; - controlText.innerHTML = "'.WT_I18N::translate('Redraw map').'<\/b>"; + controlText.innerHTML = "'.WT_I18N::translate('Redraw map') . '<\/b>"; controlUI.appendChild(controlText);'. // Setup the click event listeners: simply set the map to original LatLng 'google.maps.event.addDomListener(controlUI, "click", function() { @@ -956,7 +956,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu google.maps.event.trigger(gmarkers[i], "click"); }'. // this variable will collect the html which will eventually be placed in the side_bar - 'var side_bar_html = "";'. + 'var side_bar_html = "";' . // arrays to hold copies of the markers and html used by the side_bar // because the function closure trick doesnt work there 'var gmarkers = []; @@ -1246,7 +1246,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu lastlinkid=linkid; });'. // save the info we need to use later for the side_bar - 'gmarkers[i] = marker;'. + 'gmarkers[i] = marker;' . // add a line to the side_bar html 'side_bar_html += "
" + html +"
"; i++; @@ -1305,14 +1305,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $name = $person->getFullName(); // -- check to see if we have moved to the next generation - if ($i+1 >= pow(2, $curgen)) { + if ($i + 1 >= pow(2, $curgen)) { $curgen++; } $relationship = get_close_relationship_name($controller->root, $person); - $event = ' '. - ''.$relationship.''; + $event = ' ' . + '' . $relationship . ''; // add thumbnail image if ($SHOW_HIGHLIGHT_IMAGES) { $image = $person->displayImage(); @@ -1322,18 +1322,18 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // end of add image $dataleft = WT_Filter::escapeJs($image . $event . ' — ' . $name); - $datamid = WT_Filter::escapeJs(' ('.WT_I18N::translate('View person').')'); - $dataright = WT_Filter::escapeJs('
'. WT_I18N::translate('Birth:') . ' ' . $person->getBirthDate()->display() . ' — ' . $person->getBirthPlace()); + $datamid = WT_Filter::escapeJs(' (' . WT_I18N::translate('View person') . ')'); + $dataright = WT_Filter::escapeJs('
' . WT_I18N::translate('Birth:') . ' ' . $person->getBirthDate()->display() . ' — ' . $person->getBirthPlace()); $latlongval[$i] = $this->getLatitudeAndLongitudeFromPlaceLocation($person->getBirthPlace()); if ($latlongval[$i]) { - $lat[$i] = (double)str_replace(array('N', 'S', ','), array('', '-', '.'), $latlongval[$i]->pl_lati); - $lon[$i] = (double)str_replace(array('E', 'W', ','), array('', '-', '.'), $latlongval[$i]->pl_long); + $lat[$i] = (double) str_replace(array('N', 'S', ','), array('', '-', '.'), $latlongval[$i]->pl_lati); + $lon[$i] = (double) str_replace(array('E', 'W', ','), array('', '-', '.'), $latlongval[$i]->pl_long); if ($lat[$i] || $lon[$i]) { if (!$hideflags && $latlongval[$i]->pl_icon) { $flags[$i] = $latlongval[$i]->pl_icon; $ffile = strrchr($latlongval[$i]->pl_icon, '/'); - $ffile = substr($ffile,1, strpos($ffile, '.')-1); + $ffile = substr($ffile, 1, strpos($ffile, '.') - 1); if (empty($flags[$ffile])) { $flags[$ffile] = $i; // Only generate the flag once $js .= 'var point = new google.maps.LatLng(' . $lat[$i] . ',' . $lon[$i] . ');'; @@ -1386,14 +1386,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $js .= "' title='" . WT_I18N::translate('Pedigree map') . "'>" . $dataleft . "" . $datamid . $dataright . "\", \"" . $marker_number . "\");"; // Construct the polygon lines if (!$hidelines) { - $to_child = (intval(($i-1)/2)); // Draw a line from parent to child - if (array_key_exists($to_child, $lat) && $lat[$to_child]!=0 && $lon[$to_child]!=0) { - $js.=' + $to_child = (intval(($i - 1) / 2)); // Draw a line from parent to child + if (array_key_exists($to_child, $lat) && $lat[$to_child] != 0 && $lon[$to_child] != 0) { + $js .= ' var linecolor; var plines; - var lines = [new google.maps.LatLng('.$lat[$i].','.$lon[$i].'), - new google.maps.LatLng('.$lat[$to_child].','.$lon[$to_child].')]; - linecolor = "'.$colored_line[$curgen].'"; + var lines = [new google.maps.LatLng('.$lat[$i] . ',' . $lon[$i] . '), + new google.maps.LatLng('.$lat[$to_child] . ',' . $lon[$to_child] . ')]; + linecolor = "'.$colored_line[$curgen] . '"; plines = new google.maps.Polygon({ paths: lines, strokeColor: linecolor, @@ -1406,8 +1406,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } // Extend and fit marker bounds - $js.='bounds.extend(point);'; - $js.='pm_map.fitBounds(bounds);'; + $js .= 'bounds.extend(point);'; + $js .= 'pm_map.fitBounds(bounds);'; $count++; } } @@ -1415,23 +1415,23 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $latlongval[$i] = null; } } - $js.='pm_map.setCenter(bounds.getCenter());'. + $js .= 'pm_map.setCenter(bounds.getCenter());' . // Close the sidebar highlight when the infowindow is closed 'google.maps.event.addListener(infowindow, "closeclick", function() { document.getElementById(lastlinkid).className = "person_box:target"; });'. // put the assembled side_bar_html contents into the side_bar div - 'document.getElementById("side_bar").innerHTML = side_bar_html;'. + 'document.getElementById("side_bar").innerHTML = side_bar_html;' . // create the context menu div 'var contextmenu = document.createElement("div"); contextmenu.style.visibility="hidden"; - contextmenu.innerHTML = "
  '.WT_I18N::translate('Zoom in').'  
" - + "
  '.WT_I18N::translate('Zoom out').'  
" - + "
  '.WT_I18N::translate('Zoom in here').'
" - + "
  '.WT_I18N::translate('Zoom out here').'  
" - + "
  '.WT_I18N::translate('Center map here').'  
";'. + contextmenu.innerHTML = "
  '.WT_I18N::translate('Zoom in') . '  
" + + "
  '.WT_I18N::translate('Zoom out') . '  
" + + "
  '.WT_I18N::translate('Zoom in here') . '
" + + "
  '.WT_I18N::translate('Zoom out here') . '  
" + + "
  '.WT_I18N::translate('Center map here') . '  
";' . // listen for singlerightclick - 'google.maps.event.addListener(pm_map,"singlerightclick", function(pixel,tile) {'. + 'google.maps.event.addListener(pm_map,"singlerightclick", function(pixel,tile) {' . // store the "pixel" info in case we need it later // adjust the context menu location if near an egde // create a GControlPosition @@ -1447,15 +1447,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu }); '. // functions that perform the context menu options - 'function zoomIn() {'. + 'function zoomIn() {' . // perform the requested operation - 'pm_map.zoomIn();'. + 'pm_map.zoomIn();' . // hide the context menu now that it has been used 'contextmenu.style.visibility="hidden"; } function zoomOut() {'. // perform the requested operation - 'pm_map.zoomOut();'. + 'pm_map.zoomOut();' . // hide the context menu now that it has been used 'contextmenu.style.visibility="hidden"; } @@ -1493,9 +1493,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * ... */ private function adminPlaceCheck() { - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; - $action = WT_Filter::get('action', '','go'); + $action = WT_Filter::get('action', '', 'go'); $gedcom_id = WT_Filter::get('gedcom_id', null, WT_GED_ID); $country = WT_Filter::get('country', '.+', 'XYZ'); $state = WT_Filter::get('state', '.+', 'XYZ'); @@ -1511,16 +1511,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu @@ -1538,27 +1538,27 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '; - if ($country!='XYZ') { + if ($country != 'XYZ') { echo ''; } @@ -1568,63 +1568,63 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo ' checked="checked"'; } echo '>'; - echo '';// close div gm_check + echo ''; // close div gm_check echo ''; - echo '';//close form placecheck + echo ''; //close form placecheck echo '
'; switch ($action) { case 'go': //Identify gedcom file - $trees=WT_Tree::getAll(); + $trees = WT_Tree::getAll(); echo '
', $trees[$gedcom_id]->tree_title_html, '
'; //Select all '2 PLAC ' tags in the file and create array - $place_list=array(); - $ged_data=WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_gedcom LIKE ? AND i_file=?") + $place_list = array(); + $ged_data = WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_gedcom LIKE ? AND i_file=?") ->execute(array("%\n2 PLAC %", $gedcom_id)) ->fetchOneColumn(); foreach ($ged_data as $ged_datum) { preg_match_all('/\n2 PLAC (.+)/', $ged_datum, $matches); foreach ($matches[1] as $match) { - $place_list[$match]=true; + $place_list[$match] = true; } } - $ged_data=WT_DB::prepare("SELECT f_gedcom FROM `##families` WHERE f_gedcom LIKE ? AND f_file=?") + $ged_data = WT_DB::prepare("SELECT f_gedcom FROM `##families` WHERE f_gedcom LIKE ? AND f_file=?") ->execute(array("%\n2 PLAC %", $gedcom_id)) ->fetchOneColumn(); foreach ($ged_data as $ged_datum) { preg_match_all('/\n2 PLAC (.+)/', $ged_datum, $matches); foreach ($matches[1] as $match) { - $place_list[$match]=true; + $place_list[$match] = true; } } // Unique list of places - $place_list=array_keys($place_list); + $place_list = array_keys($place_list); // Apply_filter - if ($country=='XYZ') { - $filter='.*$'; + if ($country == 'XYZ') { + $filter = '.*$'; } else { - $filter=preg_quote($country).'$'; - if ($state!='XYZ') { - $filter=preg_quote($state).', '.$filter; + $filter = preg_quote($country) . '$'; + if ($state != 'XYZ') { + $filter = preg_quote($state) . ', ' . $filter; } } - $place_list=preg_grep('/'.$filter.'/', $place_list); + $place_list = preg_grep('/' . $filter . '/', $place_list); //sort the array, limit to unique values, and count them usort($place_list, array('WT_I18N', 'strcasecmp')); - $i=count($place_list); + $i = count($place_list); //calculate maximum no. of levels to display - $x=0; - $max=0; - while ($x<$i) { - $levels=explode(",", $place_list[$x]); - $parts=count($levels); - if ($parts>$max) $max=$parts; - $x++;} - $x=0; + $x = 0; + $max = 0; + while ($x < $i) { + $levels = explode(",", $place_list[$x]); + $parts = count($levels); + if ($parts > $max) $max = $parts; + $x++; } + $x = 0; //scripts for edit, add and refresh ?> @@ -1642,117 +1642,117 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '; echo '
- ', WT_I18N::translate('Google Maps™ preferences'),' + ', WT_I18N::translate('Google Maps™ preferences'), ' - ', WT_I18N::translate('Geographic data'),' + ', WT_I18N::translate('Geographic data'), ' - ', WT_I18N::translate('Place check'),' + ', WT_I18N::translate('Place check'), '
'; echo ''; echo ''; echo ''; - while ($cols<$max) { + while ($cols < $max) { if ($cols == 0) { echo ''; } else { - echo ''; + echo ''; } $cols++; } echo ''; - $cols=0; - while ($cols<$max) { + $cols = 0; + while ($cols < $max) { echo ''; $cols++; } echo ''; - $countrows=0; + $countrows = 0; $matched = array(); - while ($x<$i) { - $placestr=""; - $levels=explode(",", $place_list[$x]); - $parts=count($levels); - $levels=array_reverse($levels); - $placestr.="$ppart) { - $ppart=urlencode(trim($ppart)); - $placestr.="&parent[$pindex]=".$ppart.""; + $ppart = urlencode(trim($ppart)); + $placestr .= "&parent[$pindex]=" . $ppart . ""; } - $placestr.="\">".$place_list[$x].""; - $gedplace=""; - $z=0; - $id=0; - $level=0; - $matched[$x]=0;// used to exclude places where the gedcom place is matched at all levels - $mapstr_edit=""; - $mapstr7="')\">"; - $mapstr8=""; + $placestr .= "\">" . $place_list[$x] . ""; + $gedplace = ""; + $z = 0; + $id = 0; + $level = 0; + $matched[$x] = 0; // used to exclude places where the gedcom place is matched at all levels + $mapstr_edit = ""; + $mapstr7 = "')\">"; + $mapstr8 = ""; $plac = array(); $lati = array(); $long = array(); - while ($z<$parts) { - if ($levels[$z]==' ' || $levels[$z]=='') - $levels[$z]="unknown";// GoogleMap module uses "unknown" while GEDCOM uses , , + while ($z < $parts) { + if ($levels[$z] == ' ' || $levels[$z] == '') + $levels[$z] = "unknown"; // GoogleMap module uses "unknown" while GEDCOM uses , , - $levels[$z]=rtrim(ltrim($levels[$z])); + $levels[$z] = rtrim(ltrim($levels[$z])); - $placelist = $this->createPossiblePlaceNames($levels[$z], $z+1); // add the necessary prefix/postfix values to the place name + $placelist = $this->createPossiblePlaceNames($levels[$z], $z + 1); // add the necessary prefix/postfix values to the place name foreach ($placelist as $key=>$placename) { - $row= + $row = WT_DB::prepare("SELECT pl_id, pl_place, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place") ->execute(array($z, $id, $placename)) ->fetchOneRow(PDO::FETCH_ASSOC); if (!empty($row['pl_id'])) { - $row['pl_placerequested']=$levels[$z]; // keep the actual place name that was requested so we can display that instead of what is in the db + $row['pl_placerequested'] = $levels[$z]; // keep the actual place name that was requested so we can display that instead of what is in the db break; } } - if ($row['pl_id']!='') { - $id=$row['pl_id']; + if ($row['pl_id'] != '') { + $id = $row['pl_id']; } - if ($row['pl_place']!='') { - $placestr2=$mapstr_edit.$id."&level=".$level.$mapstr3.$mapstr5.WT_I18N::translate('Zoom=').$row['pl_zoom'].$mapstr6.$row['pl_placerequested'].$mapstr8; - if ($row['pl_place']=='unknown') + if ($row['pl_place'] != '') { + $placestr2 = $mapstr_edit . $id . "&level=" . $level . $mapstr3 . $mapstr5 . WT_I18N::translate('Zoom=') . $row['pl_zoom'] . $mapstr6 . $row['pl_placerequested'] . $mapstr8; + if ($row['pl_place'] == 'unknown') $matched[$x]++; } else { - if ($levels[$z]=="unknown") { - $placestr2=$mapstr_add.$id."&level=".$level.$mapstr3.$mapstr7."".rtrim(ltrim(WT_I18N::translate('unknown')))."".$mapstr8;$matched[$x]++; + if ($levels[$z] == "unknown") { + $placestr2 = $mapstr_add . $id . "&level=" . $level . $mapstr3 . $mapstr7 . "" . rtrim(ltrim(WT_I18N::translate('unknown'))) . "" . $mapstr8; $matched[$x]++; } else { - $placestr2=$mapstr_add.$id."&place_name=".urlencode($levels[$z])."&level=".$level.$mapstr3.$mapstr7.''.rtrim(ltrim($levels[$z])).''.$mapstr8;$matched[$x]++; + $placestr2 = $mapstr_add . $id . "&place_name=" . urlencode($levels[$z]) . "&level=" . $level . $mapstr3 . $mapstr7 . '' . rtrim(ltrim($levels[$z])) . '' . $mapstr8; $matched[$x]++; } } - $plac[$z]="\n"; - if ($row['pl_lati']=='0') { - $lati[$z]=""; - } elseif ($row['pl_lati']!='') { - $lati[$z]=""; + $plac[$z] = "\n"; + if ($row['pl_lati'] == '0') { + $lati[$z] = ""; + } elseif ($row['pl_lati'] != '') { + $lati[$z] = ""; } else { - $lati[$z]="";$matched[$x]++; + $lati[$z] = ""; $matched[$x]++; } - if ($row['pl_long']=='0') { - $long[$z]=""; - } elseif ($row['pl_long']!='') { - $long[$z]=""; + if ($row['pl_long'] == '0') { + $long[$z] = ""; + } elseif ($row['pl_long'] != '') { + $long[$z] = ""; } else { - $long[$z]="";$matched[$x]++; + $long[$z] = ""; $matched[$x]++; } $level++; - $mapstr3=$mapstr3."&parent[".$z."]=".WT_Filter::escapeJs($row['pl_placerequested']); - $mapstr4=$mapstr4."&parent[".$z."]=".WT_Filter::escapeJs($levels[$z]); + $mapstr3 = $mapstr3 . "&parent[" . $z . "]=" . WT_Filter::escapeJs($row['pl_placerequested']); + $mapstr4 = $mapstr4 . "&parent[" . $z . "]=" . WT_Filter::escapeJs($levels[$z]); $z++; } if ($matching) { - $matched[$x]=1; + $matched[$x] = 1; } - if ($matched[$x]!=0) { + if ($matched[$x] != 0) { echo $gedplace; - $z=0; - while ($z<$max) { - if ($z<$parts) { + $z = 0; + while ($z < $max) { + if ($z < $parts) { echo $plac[$z]; echo $lati[$z]; echo $long[$z]; @@ -1932,14 +1932,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } if ($ctla && $ctlo) { $i++; - $gmarks[$i]=array( + $gmarks[$i] = array( 'class' => 'optionbox', 'date' => $fact->getDate()->display(true), 'fact_label' => $fact->getLabel(), 'image' => $spouse ? $spouse->displayImage() : Theme::theme()->icon($fact), 'info' => $fact->getValue(), - 'lat' => str_replace(array('N', 'S', ','), array('', '-', '.') , $match1[1]), - 'lng' => str_replace(array('E', 'W', ','), array('', '-', '.') , $match2[1]), + 'lat' => str_replace(array('N', 'S', ','), array('', '-', '.'), $match1[1]), + 'lng' => str_replace(array('E', 'W', ','), array('', '-', '.'), $match2[1]), 'name' => $spouse ? 'getFullName() . '' : '', 'pl_icon' => '', 'place' => $fact->getPlace()->getFullName(), @@ -1992,7 +1992,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $ctlo = preg_match('/\n4 LONG (.+)/', $birthrec, $match2); if ($ctla && $ctlo) { $i++; - $gmarks[$i]=array( + $gmarks[$i] = array( 'date' => $birth->getDate()->display(true), 'image' => $child->displayImage(), 'info' => '', @@ -2330,24 +2330,24 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Add the markers to the map from the $gmarks array var locations = [ - $gmark) { ?> + $gmark) { ?> { - "event": "", - "lat": "", - "lng": "", - "date": "", - "info": "", - "name": "", - "place": "", - "tooltip": "", - "image": "", - "pl_icon": "", - "sv_lati": "", - "sv_long": "", - "sv_bearing": "", + "event": "", + "lat": "", + "lng": "", + "date": "", + "info": "", + "name": "", + "place": "", + "tooltip": "", + "image": "", + "pl_icon": "", + "sv_lati": "", + "sv_long": "", + "sv_bearing": "", "sv_elevation": "", - "sv_zoom": "" + "sv_zoom": "" } ]; @@ -2599,7 +2599,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu WT_DB::prepare("SELECT pl_place, pl_id, pl_lati, pl_long, pl_zoom, sv_long, sv_lati, sv_bearing, sv_elevation, sv_zoom FROM `##placelocation` WHERE pl_id=?") ->execute(array($levelm)) ->fetch(PDO::FETCH_ASSOC); - if ($STREETVIEW && $level!=0 ) { + if ($STREETVIEW && $level != 0) { echo '
googleMapsScript(), '">'; - $plzoom = $latlng['pl_zoom']; // Map zoom level + $plzoom = $latlng['pl_zoom']; // Map zoom level if (Auth::isAdmin()) { $placecheck_url = 'module.php?mod=googlemap&mod_action=admin_placecheck'; - if ($parent && isset($parent[0]) ) { - $placecheck_url .= '&country='.$parent[0]; + if ($parent && isset($parent[0])) { + $placecheck_url .= '&country=' . $parent[0]; if (isset($parent[1])) { - $placecheck_url .= '&state='.$parent[1]; + $placecheck_url .= '&state=' . $parent[1]; } } $adminplaces_url = 'module.php?mod=googlemap&mod_action=admin_places'; if ($latlng && isset($latlng['pl_id'])) { - $adminplaces_url .= '&parent='.$latlng['pl_id']; + $adminplaces_url .= '&parent=' . $latlng['pl_id']; } echo '
- 0) { ?> + 0) { ?> - +
', WT_I18N::translate('Place'), '', WT_I18N::translate('Geographic data'), '
', WT_I18N::translate('Country'), '', WT_I18N::translate('Level'), ' ', $cols+1, '', WT_I18N::translate('Level'), ' ', $cols + 1, '
', WT_Gedcom_Tag::getLabel('PLAC'), '', WT_I18N::translate('Latitude'), '', WT_I18N::translate('Longitude'), '
".$placestr."
" . $placestr . "".$placestr2."".$row['pl_lati']."".$row['pl_lati']."" . $placestr2 . "" . $row['pl_lati'] . "" . $row['pl_lati'] . "XX".$row['pl_long']."".$row['pl_long']."" . $row['pl_long'] . "" . $row['pl_long'] . "XX
'; echo '', WT_I18N::translate('Google Maps™ preferences'), ''; echo ' | '; - echo '', WT_I18N::translate('Geographic data'), ''; + echo '', WT_I18N::translate('Geographic data'), ''; echo ' | '; - echo '', WT_I18N::translate('Place check'), ''; + echo '', WT_I18N::translate('Place check'), ''; if (array_key_exists('batch_update', WT_Module::getActiveModules())) { - $placelevels=preg_replace('/, '.WT_I18N::translate('unknown').'/', ', ', $placelevels); // replace ", unknown" with ", " - $placelevels=substr($placelevels, 2); // remove the leading ", " + $placelevels = preg_replace('/, ' . WT_I18N::translate('unknown') . '/', ', ', $placelevels); // replace ", unknown" with ", " + $placelevels = substr($placelevels, 2); // remove the leading ", " if ($placelevels) { - $batchupdate_url='module.php?mod=batch_update&mod_action=admin_batch_update&plugin=search_replace_bu_plugin&method=exact&ged='.WT_GEDCOM.'&search='.urlencode($placelevels); // exact match + $batchupdate_url = 'module.php?mod=batch_update&mod_action=admin_batch_update&plugin=search_replace_bu_plugin&method=exact&ged=' . WT_GEDCOM . '&search=' . urlencode($placelevels); // exact match echo ' | '; - echo '', WT_I18N::translate('Batch update'), ''; + echo '', WT_I18N::translate('Batch update'), ''; } } } @@ -2656,32 +2656,32 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '); global $pl_lati, $pl_long; - if ($level>=1) { - $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlng['pl_lati']); // WT_placelocation lati - $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlng['pl_long']); // WT_placelocation long + if ($level >= 1) { + $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlng['pl_lati']); // WT_placelocation lati + $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlng['pl_long']); // WT_placelocation long // Check if Streetview location parameters are stored in database - $placeid = $latlng['pl_id']; // Placelocation place id - $sv_lat = $latlng['sv_lati']; // StreetView Point of View Latitude - $sv_lng = $latlng['sv_long']; // StreetView Point of View Longitude - $sv_dir = $latlng['sv_bearing']; // StreetView Point of View Direction (degrees from North) - $sv_pitch = $latlng['sv_elevation']; // StreetView Point of View Elevation (+90 to -90 degrees (+=down, -=up) - $sv_zoom = $latlng['sv_zoom']; // StreetView Point of View Zoom (0, 1, 2 or 3) + $placeid = $latlng['pl_id']; // Placelocation place id + $sv_lat = $latlng['sv_lati']; // StreetView Point of View Latitude + $sv_lng = $latlng['sv_long']; // StreetView Point of View Longitude + $sv_dir = $latlng['sv_bearing']; // StreetView Point of View Direction (degrees from North) + $sv_pitch = $latlng['sv_elevation']; // StreetView Point of View Elevation (+90 to -90 degrees (+=down, -=up) + $sv_zoom = $latlng['sv_zoom']; // StreetView Point of View Zoom (0, 1, 2 or 3) // Check if Street View Lati/Long are the default of 0 or null, if so use regular Place Lati/Long to set an initial location for the panda ------------ - if (($latlng['sv_lati']==null && $latlng['sv_long']==null) || ($latlng['sv_lati']==0 && $latlng['sv_long']==0)) { + if (($latlng['sv_lati'] == null && $latlng['sv_long'] == null) || ($latlng['sv_lati'] == 0 && $latlng['sv_long'] == 0)) { $sv_lat = $pl_lati; $sv_lng = $pl_long; } // Set Street View parameters to numeric value if NULL (avoids problem with Google Street View™ Pane not rendering) - if ($sv_dir==null) { - $sv_dir=0; + if ($sv_dir == null) { + $sv_dir = 0; } - if ($sv_pitch==null) { - $sv_pitch=0; + if ($sv_pitch == null) { + $sv_pitch = 0; } - if ($sv_zoom==null) { - $sv_zoom=1; + if ($sv_zoom == null) { + $sv_zoom = 1; } ?> @@ -2691,11 +2691,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ". - WT_Gedcom_Tag::getLabel('LONG')."". - /* I18N: Compass bearing (in degrees), for street-view mapping */ WT_I18N::translate('Bearing')."". - /* I18N: Angle of elevation (in degrees), for street-view mapping */ WT_I18N::translate('Elevation')."". - WT_I18N::translate('Zoom')." + WT_Gedcom_Tag::getLabel('LATI') . "" . + WT_Gedcom_Tag::getLabel('LONG') . "" . + /* I18N: Compass bearing (in degrees), for street-view mapping */ WT_I18N::translate('Bearing') . "" . + /* I18N: Angle of elevation (in degrees), for street-view mapping */ WT_I18N::translate('Elevation') . "" . + WT_I18N::translate('Zoom') . " "); if (Auth::isAdmin()) { echo ""; @@ -2766,7 +2766,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * @param string $placelevels * @param boolean $lastlevel */ - private function printGoogleMapMarkers($place2, $level, $parent, $levelm, $linklevels, $placelevels, $lastlevel=false) { + private function printGoogleMapMarkers($place2, $level, $parent, $levelm, $linklevels, $placelevels, $lastlevel = false) { if (($place2['lati'] == NULL) || ($place2['long'] == NULL) || (($place2['lati'] == '0') && ($place2['long'] == '0'))) { echo 'var icon_type = new google.maps.MarkerImage();'; echo 'icon_type.image = "', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/marker_yellow.png";'; @@ -2801,13 +2801,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } else { if ($place2['place'] == 'Unknown') { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes(WT_I18N::translate('unknown').$placelevels); + echo addslashes(WT_I18N::translate('unknown') . $placelevels); } else { echo WT_I18N::translate('unknown'); } } else { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes($place2['place'].$placelevels); + echo addslashes($place2['place'] . $placelevels); } else { echo addslashes($place2['place']); } @@ -2817,8 +2817,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($lastlevel) { $this->printHowManyPeople($level, $parent); } else { - $parent[$level]=$place2['place']; - $this->printHowManyPeople($level+1, $parent); + $parent[$level] = $place2['place']; + $this->printHowManyPeople($level + 1, $parent); } echo '
', WT_I18N::translate('This place has no coordinates'); if (Auth::isAdmin()) @@ -2831,12 +2831,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($lati >= 0) { $lati = abs($lati); } elseif ($lati < 0) { - $lati = '-'.abs($lati); + $lati = '-' . abs($lati); } if ($long >= 0) { $long = abs($long); } elseif ($long < 0) { - $long = '-'.abs($long); + $long = '-' . abs($long); } // flags by kiwi3685 --- @@ -2880,13 +2880,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } else { if ($place2['place'] == 'Unknown') { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes(WT_I18N::translate('unknown').$placelevels); + echo addslashes(WT_I18N::translate('unknown') . $placelevels); } else { echo WT_I18N::translate('unknown'); } } else { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes($place2['place'].$placelevels); + echo addslashes($place2['place'] . $placelevels); } else { echo addslashes($place2['place']); } @@ -2896,11 +2896,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($lastlevel) { $this->printHowManyPeople($level, $parent); } else { - $parent[$level]=$place2['place']; - $this->printHowManyPeople($level+1, $parent); + $parent[$level] = $place2['place']; + $this->printHowManyPeople($level + 1, $parent); } - $temp=addslashes($place2['place']); - $temp=str_replace(array('‎', '‏'), array(WT_UTF8_LRM, WT_UTF8_RLM), $temp); + $temp = addslashes($place2['place']); + $temp = str_replace(array('‎', '‏'), array(WT_UTF8_LRM, WT_UTF8_RLM), $temp); if (!$this->getSetting('GM_COORD')) { echo "

\", icon_type, \"", $temp, "\");"; } else { @@ -2972,13 +2972,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Creates a marker whose info window displays the given name function createMarker(point, html, icon, name) { // Choose icon and shadow ============ - if (icon.image && '.$level.'<=3) { - if (icon.image!="'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/images/marker_yellow.png") { + if (icon.image && '.$level . '<=3) { + if (icon.image!="'.WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/images/marker_yellow.png") { var iconImage = new google.maps.MarkerImage(icon.image, new google.maps.Size(25, 15), new google.maps.Point(0,0), new google.maps.Point(1, 45)); - var iconShadow = new google.maps.MarkerImage("'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/images/flag_shadow.png", + var iconShadow = new google.maps.MarkerImage("'.WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/images/flag_shadow.png", new google.maps.Size(35, 45), new google.maps.Point(0,0), new google.maps.Point(1, 45)); @@ -3045,21 +3045,21 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '); $levelm = $this->setLevelMap($level, $parent); - if (isset($levelo[0])) $levelo[0]=0; - $numls = count($parent)-1; + if (isset($levelo[0])) $levelo[0] = 0; + $numls = count($parent) - 1; $levelo = $this->checkWhereAmI($numls, $levelm); - if ($numfound<2 && ($level==1 || !isset($levelo[$level-1]))) { + if ($numfound < 2 && ($level == 1 || !isset($levelo[$level - 1]))) { $controller->addInlineJavascript('map.maxZoom=6;'); - } elseif ($numfound<2 && !isset($levelo[$level-2])) { - } elseif ($level==2) { + } elseif ($numfound < 2 && !isset($levelo[$level - 2])) { + } elseif ($level == 2) { $controller->addInlineJavascript('map.maxZoom=10;'); } //create markers ob_start(); // TODO: rewrite print_gm_markers, and the functions called therein, to either return text or add JS directly. - if ($numfound==0 && $level>0) { - if (isset($levelo[($level-1)])) { // ** BH not sure yet what this if statement is for ... TODO ** + if ($numfound == 0 && $level > 0) { + if (isset($levelo[($level - 1)])) { // ** BH not sure yet what this if statement is for ... TODO ** // show the current place on the map $place = WT_DB::prepare("SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id=?") @@ -3070,10 +3070,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // re-calculate the hierarchy information required to display the current place $thisloc = $parent; array_pop($thisloc); - $thislevel = $level-1 ; - $thislinklevels = substr($linklevels,0,strrpos($linklevels,'&')); - if (strpos($placelevels,',',1)) { - $thisplacelevels = substr($placelevels,strpos($placelevels,',',1)); + $thislevel = $level - 1; + $thislinklevels = substr($linklevels, 0, strrpos($linklevels, '&')); + if (strpos($placelevels, ',', 1)) { + $thisplacelevels = substr($placelevels, strpos($placelevels, ',', 1)); } else { // this is the top level, remove everything $thisplacelevels = ''; @@ -3085,26 +3085,26 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } // display any sub-places - $placeidlist=array(); + $placeidlist = array(); foreach ($place_names as $placename) { $thisloc = $parent; $thisloc[] = $placename; - $this_levelm = $this->setLevelMap($level+1, $thisloc); + $this_levelm = $this->setLevelMap($level + 1, $thisloc); if ($this_levelm) $placeidlist[] = $this_levelm; } if ($placeidlist) { // flip the array (thus removing duplicates) - $placeidlist=array_flip($placeidlist); + $placeidlist = array_flip($placeidlist); // remove entry for parent location unset($placeidlist[$levelm]); } if ($placeidlist) { // the keys are all we care about (this reverses the earlier array_flip, and ensures there are no "holes" in the array) - $placeidlist=array_keys($placeidlist); + $placeidlist = array_keys($placeidlist); // note: this implode/array_fill code generates one '?' for each entry in the $placeidlist array $placelist = - WT_DB::prepare('SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id IN ('.implode(',', array_fill(0, count($placeidlist), '?')).')') + WT_DB::prepare('SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id IN (' . implode(',', array_fill(0, count($placeidlist), '?')) . ')') ->execute($placeidlist) ->fetchAll(PDO::FETCH_ASSOC); @@ -3142,14 +3142,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * @return int */ private function getHighestIndex() { - return (int)WT_DB::prepare("SELECT MAX(pl_id) FROM `##placelocation`")->fetchOne(); + return (int) WT_DB::prepare("SELECT MAX(pl_id) FROM `##placelocation`")->fetchOne(); } /** * @return int */ private function getHighestLevel() { - return (int)WT_DB::prepare("SELECT MAX(pl_level) FROM `##placelocation`")->fetchOne(); + return (int) WT_DB::prepare("SELECT MAX(pl_level) FROM `##placelocation`")->fetchOne(); } /** @@ -3173,9 +3173,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ))->fetchAll(); } else { $rows = WT_DB::prepare( - "SELECT DISTINCT pl_id, pl_place, pl_lati, pl_long, pl_zoom, pl_icon". - " FROM `##placelocation`". - " INNER JOIN `##places` ON `##placelocation`.pl_place=`##places`.p_place". + "SELECT DISTINCT pl_id, pl_place, pl_lati, pl_long, pl_zoom, pl_icon" . + " FROM `##placelocation`" . + " INNER JOIN `##places` ON `##placelocation`.pl_place=`##places`.p_place" . " WHERE pl_parent_id = :parent_id" . " ORDER BY pl_place COLLATE :collation" )->execute(array( @@ -3253,12 +3253,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * ... */ private function placesEdit() { - require WT_ROOT.'includes/functions/functions_edit.php'; + require WT_ROOT . 'includes/functions/functions_edit.php'; $GM_MAX_ZOOM = $this->getSetting('GM_MAX_ZOOM'); - $action = WT_Filter::post('action', null, WT_Filter::get('action')); - $placeid = WT_Filter::post('placeid', null, WT_Filter::get('placeid')); + $action = WT_Filter::post('action', null, WT_Filter::get('action')); + $placeid = WT_Filter::post('placeid', null, WT_Filter::get('placeid')); $place_name = WT_Filter::post('place_name', null, WT_Filter::get('place_name')); $controller = new WT_Controller_Simple; @@ -3268,17 +3268,17 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->addInlineJavascript('$("", {rel: "stylesheet", type: "text/css", href: "' . WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/css/wt_v3_googlemap.css"}).appendTo("head");') ->pageHeader(); - $where_am_i=$this->placeIdToHierarchy($placeid); - $level=count($where_am_i); + $where_am_i = $this->placeIdToHierarchy($placeid); + $level = count($where_am_i); - if ($action=='addrecord' && Auth::isAdmin()) { - $statement= + if ($action == 'addrecord' && Auth::isAdmin()) { + $statement = WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); if (($_POST['LONG_CONTROL'] == '') || ($_POST['NEW_PLACE_LONG'] == '') || ($_POST['NEW_PLACE_LATI'] == '')) { - $statement->execute(array($this->getHighestIndex()+1, $placeid, $level, $_POST['NEW_PLACE_NAME'], null, null, $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); + $statement->execute(array($this->getHighestIndex() + 1, $placeid, $level, $_POST['NEW_PLACE_NAME'], null, null, $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); } else { - $statement->execute(array($this->getHighestIndex()+1, $placeid, $level, $_POST['NEW_PLACE_NAME'], $_POST['LONG_CONTROL'][3].$_POST['NEW_PLACE_LONG'], $_POST['LATI_CONTROL'][3].$_POST['NEW_PLACE_LATI'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); + $statement->execute(array($this->getHighestIndex() + 1, $placeid, $level, $_POST['NEW_PLACE_NAME'], $_POST['LONG_CONTROL'][3] . $_POST['NEW_PLACE_LONG'], $_POST['LATI_CONTROL'][3] . $_POST['NEW_PLACE_LATI'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); } // autoclose window when update successful unless debug on @@ -3289,14 +3289,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu exit; } - if ($action=='updaterecord' && Auth::isAdmin()) { - $statement= + if ($action == 'updaterecord' && Auth::isAdmin()) { + $statement = WT_DB::prepare("UPDATE `##placelocation` SET pl_place=?, pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?"); if (($_POST['LONG_CONTROL'] == '') || ($_POST['NEW_PLACE_LONG'] == '') || ($_POST['NEW_PLACE_LATI'] == '')) { $statement->execute(array($_POST['NEW_PLACE_NAME'], null, null, $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'], $placeid)); } else { - $statement->execute(array($_POST['NEW_PLACE_NAME'], $_POST['LATI_CONTROL'][3].$_POST['NEW_PLACE_LATI'], $_POST['LONG_CONTROL'][3].$_POST['NEW_PLACE_LONG'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'], $placeid)); + $statement->execute(array($_POST['NEW_PLACE_NAME'], $_POST['LATI_CONTROL'][3] . $_POST['NEW_PLACE_LATI'], $_POST['LONG_CONTROL'][3] . $_POST['NEW_PLACE_LONG'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'], $placeid)); } // autoclose window when update successful unless debug on @@ -3324,16 +3324,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu exit; } - if ($action=="update") { + if ($action == "update") { // --- find the place in the file - $row= + $row = WT_DB::prepare("SELECT pl_place, pl_lati, pl_long, pl_icon, pl_parent_id, pl_level, pl_zoom FROM `##placelocation` WHERE pl_id=?") ->execute(array($placeid)) ->fetchOneRow(); $place_name = $row->pl_place; $place_icon = $row->pl_icon; $selected_country = explode("/", $place_icon); - if (isset($selected_country[1]) && $selected_country[1]!="flags") + if (isset($selected_country[1]) && $selected_country[1] != "flags") $selected_country = $selected_country[1]; else $selected_country = "Countries"; @@ -3342,9 +3342,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $zoomfactor = $row->pl_zoom; $parent_lati = "0.0"; $parent_long = "0.0"; - if ($row->pl_lati!==null && $row->pl_long!==null) { - $place_lati = (float)(str_replace(array('N', 'S', ','), array('', '-', '.') , $row->pl_lati)); - $place_long = (float)(str_replace(array('E', 'W', ','), array('', '-', '.') , $row->pl_long)); + if ($row->pl_lati !== null && $row->pl_long !== null) { + $place_lati = (float) (str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati)); + $place_long = (float) (str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long)); } else { $place_lati = null; $place_long = null; @@ -3352,57 +3352,57 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } do { - $row= + $row = WT_DB::prepare("SELECT pl_lati, pl_long, pl_parent_id, pl_zoom FROM `##placelocation` WHERE pl_id=?") ->execute(array($parent_id)) ->fetchOneRow(); if (!$row) { break; } - if ($row->pl_lati!==null && $row->pl_long!==null) { - $parent_lati = (float)(str_replace(array('N', 'S', ','), array('', '-', '.') , $row->pl_lati)); - $parent_long = (float)(str_replace(array('E', 'W', ','), array('', '-', '.') , $row->pl_long)); + if ($row->pl_lati !== null && $row->pl_long !== null) { + $parent_lati = (float) (str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati)); + $parent_long = (float) (str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long)); if ($zoomfactor == 1) { $zoomfactor = $row->pl_zoom; } } $parent_id = $row->pl_parent_id; } - while ($row->pl_parent_id!=0 && $row->pl_lati===null && $row->pl_long===null); + while ($row->pl_parent_id != 0 && $row->pl_lati === null && $row->pl_long === null); echo '', WT_Filter::escapeHtml(str_replace('Unknown', WT_I18N::translate('unknown'), implode(WT_I18N::$list_separator, array_reverse($where_am_i, true)))), '
'; } - if ($action=='add') { + if ($action == 'add') { // --- find the parent place in the file if ($placeid != 0) { - if (!isset($place_name)) $place_name = ''; + if (!isset($place_name)) $place_name = ''; $place_lati = null; $place_long = null; $zoomfactor = 1; $parent_lati = '0.0'; $parent_long = '0.0'; $place_icon = ''; - $parent_id=$placeid; + $parent_id = $placeid; do { - $row= + $row = WT_DB::prepare("SELECT pl_lati, pl_long, pl_parent_id, pl_zoom, pl_level FROM `##placelocation` WHERE pl_id=?") ->execute(array($parent_id)) ->fetchOneRow(); - if ($row->pl_lati!==null && $row->pl_long!==null) { - $parent_lati=str_replace(array('N', 'S', ','), array('', '-', '.') , $row->pl_lati); - $parent_long=str_replace(array('E', 'W', ','), array('', '-', '.') , $row->pl_long); - $zoomfactor=$row->pl_zoom; - if ($zoomfactor>$GM_MAX_ZOOM) { - $zoomfactor=$GM_MAX_ZOOM; + if ($row->pl_lati !== null && $row->pl_long !== null) { + $parent_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati); + $parent_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long); + $zoomfactor = $row->pl_zoom; + if ($zoomfactor > $GM_MAX_ZOOM) { + $zoomfactor = $GM_MAX_ZOOM; } - $level=$row->pl_level+1; + $level = $row->pl_level + 1; } $parent_id = $row->pl_parent_id; - } while ($row->pl_parent_id!=0 && $row->pl_lati===null && $row->pl_long===null); + } while ($row->pl_parent_id != 0 && $row->pl_lati === null && $row->pl_long === null); } else { - if (!isset($place_name)) $place_name = ''; + if (!isset($place_name)) $place_name = ''; $place_lati = null; $place_long = null; $parent_lati = "0.0"; @@ -3414,9 +3414,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } $selected_country = 'Countries'; - if (!isset($place_name) || $place_name=="") echo '', WT_I18N::translate('unknown'); + if (!isset($place_name) || $place_name == "") echo '', WT_I18N::translate('unknown'); else echo '', $place_name; - if (count($where_am_i)>0) + if (count($where_am_i) > 0) echo ', ', WT_Filter::escapeHtml(str_replace('Unknown', WT_I18N::translate('unknown'), implode(WT_I18N::$list_separator, array_reverse($where_am_i, true)))), '
'; echo '

'; } @@ -3741,15 +3741,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Create the Main Location Marker '+name+'<\/div>'; var marker = new google.maps.Marker({ @@ -3931,7 +3931,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } function showLocation_level(address) { - address += '0) echo ', ', addslashes(implode(', ', array_reverse($where_am_i, true))); ?>'; + address += ' 0) echo ', ', addslashes(implode(', ', array_reverse($where_am_i, true))); ?>'; geocoder.geocode({'address': address}, addAddressToMap); } @@ -3975,7 +3975,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu
- + $precision2) ? ($precision = $precision1) : ($precision = $precision2); - if ($precision == -1 ) ($level > 3) ? ($precision = 3) : ($precision = $level); + if ($precision == -1) ($level > 3) ? ($precision = 3) : ($precision = $level); elseif ($precision > 5) { $precision = 5; } ?> @@ -4031,12 +4031,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu - + - +
- getSetting('GM_PRECISION_0')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_0'); ?>"> + getSetting('GM_PRECISION_0')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_0'); ?>"> - getSetting('GM_PRECISION_1')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_1'); ?>"> + getSetting('GM_PRECISION_1')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_1'); ?>"> - getSetting('GM_PRECISION_2')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_2'); ?>"> + getSetting('GM_PRECISION_2')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_2'); ?>"> - getSetting('GM_PRECISION_3')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_3'); ?>"> + getSetting('GM_PRECISION_3')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_3'); ?>"> - getSetting('GM_PRECISION_4')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_4'); ?>"> + getSetting('GM_PRECISION_4')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_4'); ?>"> - =$this->getSetting('GM_PRECISION_5')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_5'); ?>"> + = $this->getSetting('GM_PRECISION_5')) echo "checked=\"checked\""; ?> value="getSetting('GM_PRECISION_5'); ?>">
restrictAccess(Auth::isAdmin()); - if ($action=='ExportFile' && Auth::isAdmin()) { + if ($action == 'ExportFile' && Auth::isAdmin()) { Zend_Session::writeClose(); $tmp = $this->placeIdToHierarchy($parent); $maxLevel = $this->getHighestLevel(); - if ($maxLevel>8) $maxLevel=8; + if ($maxLevel > 8) $maxLevel = 8; $tmp[0] = 'places'; - $outputFileName=preg_replace('/[:;\/\\\(\)\{\}\[\] $]/', '_', implode('-', $tmp)).'.csv'; + $outputFileName = preg_replace('/[:;\/\\\(\)\{\}\[\] $]/', '_', implode('-', $tmp)) . '.csv'; header('Content-Type: application/octet-stream'); - header('Content-Disposition: attachment; filename="'.$outputFileName.'"'); + header('Content-Disposition: attachment; filename="' . $outputFileName . '"'); echo '"', WT_I18N::translate('Level'), '";"', WT_I18N::translate('Country'), '";'; - if ($maxLevel>0) echo '"', WT_I18N::translate('State'), '";'; - if ($maxLevel>1) echo '"', WT_I18N::translate('County'), '";'; - if ($maxLevel>2) echo '"', WT_I18N::translate('City'), '";'; - if ($maxLevel>3) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>4) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>5) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>6) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>7) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 0) echo '"', WT_I18N::translate('State'), '";'; + if ($maxLevel > 1) echo '"', WT_I18N::translate('County'), '";'; + if ($maxLevel > 2) echo '"', WT_I18N::translate('City'), '";'; + if ($maxLevel > 3) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 4) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 5) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 6) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 7) echo '"', WT_I18N::translate('Place'), '";'; echo '"', WT_I18N::translate('Longitude'), '";"', WT_I18N::translate('Latitude'), '";'; echo '"', WT_I18N::translate('Zoom level'), '";"', WT_I18N::translate('Icon'), '";', WT_EOL; $this->outputLevel($parent); @@ -4127,9 +4127,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu
execute(array(WT_GED_ID, WT_GED_ID)) @@ -4147,7 +4147,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($placelist[$j]['lati'] < 0) { $placelist[$j]['lati'][0] = 'S'; } else { - $placelist[$j]['lati'] = 'N'.$placelist[$j]['lati']; + $placelist[$j]['lati'] = 'N' . $placelist[$j]['lati']; } } } @@ -4158,7 +4158,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($placelist[$j]['long'] < 0) { $placelist[$j]['long'][0] = 'W'; } else { - $placelist[$j]['long'] = 'E'.$placelist[$j]['long']; + $placelist[$j]['long'] = 'E' . $placelist[$j]['long']; } } } @@ -4184,9 +4184,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $placelistUniq[$j]['long'] = $place['long']; $j = $j + 1; } elseif (($place['place'] == $prevPlace) && (($place['lati'] != $prevLati) || ($place['long'] != $prevLong))) { - if (($placelistUniq[$j-1]['lati'] == 0) || ($placelistUniq[$j-1]['long'] == 0)) { - $placelistUniq[$j-1]['lati'] = $place['lati']; - $placelistUniq[$j-1]['long'] = $place['long']; + if (($placelistUniq[$j - 1]['lati'] == 0) || ($placelistUniq[$j - 1]['long'] == 0)) { + $placelistUniq[$j - 1]['lati'] = $place['lati']; + $placelistUniq[$j - 1]['long'] = $place['long']; } elseif (($place['lati'] != '0') || ($place['long'] != '0')) { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '
'; } @@ -4198,32 +4198,32 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $highestIndex = $this->getHighestIndex(); - $default_zoom_level=array(4, 7, 10, 12); + $default_zoom_level = array(4, 7, 10, 12); foreach ($placelistUniq as $k=>$place) { - $parent=preg_split('/ *, */', $place['place']); - $parent=array_reverse($parent); - $parent_id=0; - for ($i=0; $iexecute(array($i, $parent_id, $escparent)) ->fetchOneRow(); - if ($i < count($parent)-1) { + if ($i < count($parent) - 1) { // Create higher-level places, if necessary if (empty($row)) { $highestIndex++; WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)") ->execute(array($highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '
'; - $parent_id=$highestIndex; + $parent_id = $highestIndex; } else { - $parent_id=$row->pl_id; + $parent_id = $row->pl_id; } } else { // Create lowest-level place, if necessary @@ -4233,7 +4233,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '
'; } else { - if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati']!='0' && $place['long']!='0') { + if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?") ->execute(array($place['lati'], $place['long'], $row->pl_id)); echo WT_Filter::escapeHtml($escparent), '
'; @@ -4242,12 +4242,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } } - $parent=0; + $parent = 0; } - if ($action=='ImportFile') { + if ($action == 'ImportFile') { $placefiles = array(); - $this->findFiles(WT_MODULES_DIR.'googlemap/extra'); + $this->findFiles(WT_MODULES_DIR . 'googlemap/extra'); sort($placefiles); ?>
@@ -4256,15 +4256,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu
@@ -4294,7 +4294,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $country_names = array(); $stats = new WT_Stats(WT_GEDCOM); foreach ($stats->iso3166() as $key=>$value) { - $country_names[$key]=WT_I18N::translate($key); + $country_names[$key] = WT_I18N::translate($key); } if (isset($_POST['cleardatabase'])) { WT_DB::exec("DELETE FROM `##placelocation` WHERE 1=1"); @@ -4302,7 +4302,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if (!empty($_FILES['placesfile']['tmp_name'])) { $lines = file($_FILES['placesfile']['tmp_name']); } elseif (!empty($_REQUEST['localfile'])) { - $lines = file(WT_MODULES_DIR.'googlemap/extra'.$_REQUEST['localfile']); + $lines = file(WT_MODULES_DIR . 'googlemap/extra' . $_REQUEST['localfile']); } // Strip BYTE-ORDER-MARK, if present if (!empty($lines[0]) && substr($lines[0], 0, 3) === WT_UTF8_BOM) { @@ -4319,16 +4319,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } $fields = count($fieldrec); $set_icon = true; - if (!is_dir(WT_MODULES_DIR.'googlemap/places/flags/')) { + if (!is_dir(WT_MODULES_DIR . 'googlemap/places/flags/')) { $set_icon = false; } foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); - if (is_numeric($fieldrec[0]) && $fieldrec[0]<=$maxLevel) { + if (is_numeric($fieldrec[0]) && $fieldrec[0] <= $maxLevel) { $placelist[$j] = array(); $placelist[$j]['place'] = ''; - for ($ii=$fields-4; $ii>1; $ii--) { - if ($fieldrec[0] > $ii-2) $placelist[$j]['place'] .= $fieldrec[$ii].','; + for ($ii = $fields - 4; $ii > 1; $ii--) { + if ($fieldrec[0] > $ii - 2) $placelist[$j]['place'] .= $fieldrec[$ii] . ','; } foreach ($country_names as $countrycode => $countryname) { if ($countrycode == strtoupper($fieldrec[1])) { @@ -4337,11 +4337,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } $placelist[$j]['place'] .= $fieldrec[1]; - $placelist[$j]['long'] = $fieldrec[$fields-4]; - $placelist[$j]['lati'] = $fieldrec[$fields-3]; - $placelist[$j]['zoom'] = $fieldrec[$fields-2]; - if($set_icon) { - $placelist[$j]['icon'] = trim($fieldrec[$fields-1]); + $placelist[$j]['long'] = $fieldrec[$fields - 4]; + $placelist[$j]['lati'] = $fieldrec[$fields - 3]; + $placelist[$j]['zoom'] = $fieldrec[$fields - 2]; + if ($set_icon) { + $placelist[$j]['icon'] = trim($fieldrec[$fields - 1]); } else { $placelist[$j]['icon'] = ''; } @@ -4364,11 +4364,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $placelistUniq[$j]['icon'] = $place['icon']; $j = $j + 1; } elseif (($place['place'] == $prevPlace) && (($place['lati'] != $prevLati) || ($place['long'] != $prevLong))) { - if (($placelistUniq[$j-1]['lati'] == 0) || ($placelistUniq[$j-1]['long'] == 0)) { - $placelistUniq[$j-1]['lati'] = $place['lati']; - $placelistUniq[$j-1]['long'] = $place['long']; - $placelistUniq[$j-1]['zoom'] = $place['zoom']; - $placelistUniq[$j-1]['icon'] = $place['icon']; + if (($placelistUniq[$j - 1]['lati'] == 0) || ($placelistUniq[$j - 1]['long'] == 0)) { + $placelistUniq[$j - 1]['lati'] = $place['lati']; + $placelistUniq[$j - 1]['long'] = $place['long']; + $placelistUniq[$j - 1]['zoom'] = $place['zoom']; + $placelistUniq[$j - 1]['icon'] = $place['icon']; } elseif (($place['lati'] != '0') || ($place['long'] != '0')) { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '
'; } @@ -4386,42 +4386,42 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu foreach ($placelistUniq as $k=>$place) { $parent = explode(',', $place['place']); $parent = array_reverse($parent); - $parent_id=0; - for ($i=0; $iexecute(array($i, $parent_id, $escparent)) ->fetchOneRow(); if (empty($row)) { // this name does not yet exist: create entry if (!isset($_POST['updateonly'])) { $highestIndex = $highestIndex + 1; - if (($i+1) == count($parent)) { + if (($i + 1) == count($parent)) { $zoomlevel = $place['zoom']; } elseif (isset($default_zoom_level[$i])) { $zoomlevel = $default_zoom_level[$i]; } else { $zoomlevel = $this->getSetting('GM_MAX_ZOOM'); } - if (($place['lati'] == '0') || ($place['long'] == '0') || (($i+1) < count($parent))) { + if (($place['lati'] == '0') || ($place['long'] == '0') || (($i + 1) < count($parent))) { WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?)") ->execute(array($highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon'])); } else { //delete leading zero - $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.') , $place['lati']); - $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.') , $place['long']); + $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place['lati']); + $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $place['long']); if ($pl_lati >= 0) { - $place['lati'] = 'N'.abs($pl_lati); + $place['lati'] = 'N' . abs($pl_lati); } elseif ($pl_lati < 0) { - $place['lati'] = 'S'.abs($pl_lati); + $place['lati'] = 'S' . abs($pl_lati); } if ($pl_long >= 0) { - $place['long'] = 'E'.abs($pl_long); + $place['long'] = 'E' . abs($pl_long); } elseif ($pl_long < 0) { - $place['long'] = 'W'.abs($pl_long); + $place['long'] = 'W' . abs($pl_long); } WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)") ->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon'])); @@ -4430,7 +4430,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } else { $parent_id = $row->pl_id; - if ((isset($_POST['overwritedata'])) && ($i+1 == count($parent))) { + if ((isset($_POST['overwritedata'])) && ($i + 1 == count($parent))) { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?") ->execute(array($place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id)); } else { @@ -4446,11 +4446,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } } - $parent=0; + $parent = 0; } - if ($action=='DeleteRecord') { - $exists= + if ($action == 'DeleteRecord') { + $exists = WT_DB::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?") ->execute(array($deleteRecord)) ->fetchOne(); @@ -4466,7 +4466,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ?> '; - $where_am_i=$this->placeIdToHierarchy($parent); + $where_am_i = $this->placeIdToHierarchy($parent); foreach (array_reverse($where_am_i, true) as $id=>$place) { - if ($id==$parent) { + if ($id == $parent) { if ($place != 'Unknown') { echo WT_Filter::escapeHtml($place); } else { @@ -4512,9 +4512,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '', help_link('PLE_ACTIVE','googlemap'), ''; + echo '>', help_link('PLE_ACTIVE', 'googlemap'), ''; - $placelist=$this->getPlaceListLocation($parent, $inactive); + $placelist = $this->getPlaceListLocation($parent, $inactive); echo '
'; echo ''; echo ''; @@ -4548,11 +4548,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } echo ''; echo ''; - $noRows= + $noRows = WT_DB::prepare("SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id=?") ->execute(array($place['place_id'])) ->fetchOne(); - if ($noRows==0) { ?> + if ($noRows == 0) { ?> -- cgit v1.3
', WT_Gedcom_Tag::getLabel('PLAC'), '