diff options
146 files changed, 1702 insertions, 1702 deletions
@@ -454,7 +454,7 @@ class PEAR // $error_code is a non-empty array here; // we walk through it trying to unset all // values - foreach($error_code as $key => $error) { + foreach ($error_code as $key => $error) { if ($this->_checkDelExpect($error)) { $deleted = true; } else { diff --git a/addsearchlink.php b/addsearchlink.php index cfbc8ee2c0..1fe341b20c 100644 --- a/addsearchlink.php +++ b/addsearchlink.php @@ -45,7 +45,7 @@ if (isset($_REQUEST['server'])) $server = $_REQUEST['server']; if (isset($_REQUEST['indiName'])) $indiName = $_REQUEST['indiName']; //To use addsearchlink you should have come from a multisearch result link -if(isset($pid) && isset($server) && isset($indiName)) +if (isset($pid) && isset($server) && isset($indiName)) { ?> @@ -56,7 +56,7 @@ if ($pending_changes) { $verify_msg = false; $warn_msg = false; -foreach(get_all_users() as $user_id=>$user_name) { +foreach (get_all_users() as $user_id=>$user_name) { if (!get_user_setting($user_id, 'verified_by_admin') && get_user_setting($user_id, 'verified')) { $verify_msg = true; } @@ -73,7 +73,7 @@ echo WT_JS_START, 'function showchanges() {window.location.reload();}', WT_JS_EN ?> <script type="text/javascript"> //<![CDATA[ - jQuery(document).ready(function(){ + jQuery(document).ready(function() { jQuery("#tabs").tabs(); }); //]]> diff --git a/ancestry.php b/ancestry.php index e3034f1364..1bd063a26a 100644 --- a/ancestry.php +++ b/ancestry.php @@ -215,7 +215,7 @@ case 1: $person=Person::getInstance($pid); if (!is_null($person)) { $famids=$person->getChildFamilies(); - foreach($famids as $famid=>$family) { + foreach ($famids as $famid=>$family) { $parents=find_parents_in_record($family->getGedcomRecord()); if ($parents) { print_sosa_family($famid, $pid, $i); diff --git a/calendar.php b/calendar.php index 632dcc7a21..e665b02f64 100644 --- a/calendar.php +++ b/calendar.php @@ -134,7 +134,7 @@ echo '</h2></td></tr>'; // Day selector echo '<tr><td class="descriptionbox vmiddle">'; echo i18n::translate('Day'), help_link('annivers_date_select'), '</td><td colspan="7" class="optionbox">'; -for($d=1; $d<=$days_in_month; $d++) { +for ($d=1; $d<=$days_in_month; $d++) { // Format the day number using the calendar $tmp=new GedcomDate($cal_date->Format("%@ {$d} %O %E")); $d_fmt=$tmp->date1->Format('%j'); if ($d==$cal_date->d) diff --git a/client.php b/client.php index 695493dc93..23b478df15 100644 --- a/client.php +++ b/client.php @@ -113,7 +113,7 @@ case 'listgedcoms': exit; default: // All other actions require an authenticated connection - if (empty($_SESSION['connected'])){ + if (empty($_SESSION['connected'])) { addToLog($action." ERROR 12: use 'connect' action to initiate a session.", 'debug'); echo "ERROR 12: use 'connect' action to initiate a session.\n"; exit; @@ -146,7 +146,7 @@ case 'get': $head_date = get_sub_record(1, "1 DATE", $head); $lines = explode("\n", $head_date); $head_date = ""; - foreach($lines as $line) { + foreach ($lines as $line) { $num = $line{0}; $head_date.=($num+1).substr($line, 1)."\n"; } @@ -160,7 +160,7 @@ case 'get': } if (!safe_REQUEST($_REQUEST,'keepfile')) { $ct = preg_match_all("/ FILE (.*)/", $gedrecords, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $mediaurl = WT_SERVER_NAME.WT_SCRIPT_PATH.$MEDIA_DIRECTORY.extract_filename($match[$i][1]); $gedrecords = str_replace($match[$i][1], $mediaurl, $gedrecords); } @@ -283,7 +283,7 @@ case 'search': $sindilist=search_indis(array($query), array($GED_ID), 'AND', true); echo "SUCCESS\n"; addToLog($action." query=$query SUCCESS", 'debug'); - foreach($sindilist as $indi) { + foreach ($sindilist as $indi) { echo $indi->getXref(), "\n"; } } else { @@ -301,7 +301,7 @@ case 'soundex': $sindilist=search_indis_soundex($soundex, $lastname, $firstname, $place, array($GED_ID)); echo "SUCCESS\n"; addToLog($action." lastname=$lastname firstname=$firstname SUCCESS", 'debug'); - foreach($sindilist as $indi) { + foreach ($sindilist as $indi) { echo $indi->getXref(), "\n"; } } else { @@ -430,7 +430,7 @@ case 'getchanges': echo "ERROR 24: You cannot retrieve updates for more than 180 days.\n"; } else { echo "SUCCESS\n"; - foreach(get_recent_changes($lastdate->MinJD()) as $xref) { + foreach (get_recent_changes($lastdate->MinJD()) as $xref) { echo "{$xref}\n"; } } diff --git a/dir_editor.php b/dir_editor.php index cf81a307a9..bd3f35a199 100644 --- a/dir_editor.php +++ b/dir_editor.php @@ -89,9 +89,9 @@ echo '<p class="center"><input TYPE="button" VALUE="', i18n::translate('Return t echo i18n::translate('To delete a file or subdirectory from the data directory drag it to the wastebasket or select its checkbox. Click the Delete button to permanently remove the indicated files.'), '<br /><br />', i18n::translate('Files marked with %s are required for proper operation and cannot be removed.', '<img src="./images/RESN_confidential.gif" alt="" />'), '<br />', i18n::translate('Files marked with %s have important settings or pending change data and should only be deleted if you are sure you know what you are doing.', '<img src="./images/RESN_locked.gif" alt="" />'); //post back -if(isset($_REQUEST["to_delete"])) { +if (isset($_REQUEST["to_delete"])) { echo "<span class=\"error\">", i18n::translate('Deleted files:'), "</span><br/>"; - foreach($_REQUEST["to_delete"] as $k=>$v) { + foreach ($_REQUEST["to_delete"] as $k=>$v) { if (is_dir($INDEX_DIRECTORY.$v)) { full_rmdir($INDEX_DIRECTORY.$v); } elseif (file_exists($INDEX_DIRECTORY.$v)) { @@ -110,7 +110,7 @@ require_once WT_ROOT.'js/scriptaculous.js.htm'; <!-- function warnuser(cbox) { if (cbox.checked) { - if(!confirm('<?php echo i18n::translate('This file contains important information such as language settings or pending change data. Are you sure you want to delete this file?'); ?>')) cbox.checked = false; + if (!confirm('<?php echo i18n::translate('This file contains important information such as language settings or pending change data. Are you sure you want to delete this file?'); ?>')) cbox.checked = false; } } //--> @@ -136,7 +136,7 @@ function warnuser(cbox) { echo "<img src=\"./images/RESN_confidential.gif\" alt=\"\" /> "; echo "<span class=\"name2\">".$entry."</span>"; } - else{ + else { echo "<li class=\"facts_value\" name=\"$entry\" style=\"cursor:move;margin-bottom:2px;\" id=\"li_$entry\" >"; echo "<input type=\"checkbox\" name=\"to_delete[]\" value=\"".$entry."\" />"; echo $entry; @@ -165,7 +165,7 @@ function warnuser(cbox) { new Effect.BlindDown('reorder_list', {duration: 1}); <?php - foreach($elements as $key=>$val) + foreach ($elements as $key=>$val) { echo "new Draggable('".$val."', {revert:true});"; } @@ -189,7 +189,7 @@ function ul_clear() list = document.getElementById('reorder_list'); children = list.childNodes; - for(i=0; i<children.length; i++) { + for (i=0; i<children.length; i++) { node = children[i]; if (node.tagName=='li' || node.tagName=='LI') { //node.className='facts_value'; @@ -200,7 +200,7 @@ function ul_clear() function removeAll() { var elements = document.getElementsByName('to_delete[]'); - for(i=0; i<elements.length; i++) { + for (i=0; i<elements.length; i++) { node = elements[i]; if (!node.attributes.warn) node.checked = true; } diff --git a/downloadbackup.php b/downloadbackup.php index 4dfcf254c7..92c7805c54 100644 --- a/downloadbackup.php +++ b/downloadbackup.php @@ -39,7 +39,7 @@ if (!WT_USER_GEDCOM_ADMIN || !preg_match('/\.zip$/', $fname)) { exit; } -if(ini_get('zlib.output_compression')) @ini_set('zlib.output_compression', 'Off'); +if (ini_get('zlib.output_compression')) @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); // required header('Expires: 0'); diff --git a/edit_interface.php b/edit_interface.php index 924bf6407c..449ab6bd37 100644 --- a/edit_interface.php +++ b/edit_interface.php @@ -775,8 +775,8 @@ case 'addsourceaction': } if (!empty($AUTH)) $newgedrec .= "1 AUTH $AUTH\n"; if (!empty($PUBL)) { - foreach (preg_split("/\r?\n/", $PUBL) as $k=>$line){ - if ( $k==0 ) { + foreach (preg_split("/\r?\n/", $PUBL) as $k=>$line) { + if ($k==0) { $newgedrec .= "1 PUBL $line\n"; } else { $newgedrec .= "2 CONT $line\n"; @@ -877,7 +877,7 @@ case 'addnoteaction': if (!empty($AUTH)) $newgedrec .= "1 AUTH $AUTH\n"; if (!empty($PUBL)) { foreach (preg_split("/\r?\n/", $PUBL) as $k=>$line) { - if ( $k==0 ) { + if ($k==0) { $newgedrec .= "1 PUBL $line\n"; } else { $newgedrec .= "2 CONT $line\n"; @@ -1132,7 +1132,7 @@ case 'addrepoaction': } if (!empty($ADDR)) { foreach (preg_split("/\r?\n/", $ADDR) as $k=>$line) { - if ( $k==0 ) { + if ($k==0) { $newgedrec .= "1 ADDR {$line}\n"; } else { $newgedrec .= "2 CONT {$line}\n"; @@ -1181,7 +1181,7 @@ case 'update': $cens_pids=explode(', ', $pids_array); } - if (!isset($cens_pids)){ + if (!isset($cens_pids)) { $cens_pids = array($pid); $idnums=""; } else { @@ -1904,7 +1904,7 @@ case 'al_reset_media_update': // Reset sort using Album Page case 'al_reorder_media_update': // Update sort using Album Page if (isset($_REQUEST['order1'])) $order1 = $_REQUEST['order1']; if (isset($_POST['currtab'])) $currtab = $_POST['currtab']; - function SwapArray($Array){ + function SwapArray($Array) { $Values = array(); while (list($Key, $Val) = each($Array)) $Values[$Val] = $Key; diff --git a/edit_merge.php b/edit_merge.php index 9c74813cf7..c56f3ccb1b 100644 --- a/edit_merge.php +++ b/edit_merge.php @@ -90,7 +90,7 @@ if ($action!="choose") { $facts2 = array(); $prev_tags = array(); $ct = preg_match_all('/\n1 (\w+)/', $gedrec1, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $fact = trim($match[$i][1]); if (isset($prev_tags[$fact])) { $prev_tags[$fact]++; @@ -102,7 +102,7 @@ if ($action!="choose") { } $prev_tags = array(); $ct = preg_match_all('/\n1 (\w+)/', $gedrec2, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $fact = trim($match[$i][1]); if (isset($prev_tags[$fact])) { $prev_tags[$fact]++; @@ -125,8 +125,8 @@ if ($action!="choose") { $skip1 = array(); $skip2 = array(); echo "<table border=\"1\">\n"; - foreach($facts1 as $i=>$fact1) { - foreach($facts2 as $j=>$fact2) { + foreach ($facts1 as $i=>$fact1) { + foreach ($facts2 as $j=>$fact2) { if (utf8_strtoupper($fact1["subrec"])==utf8_strtoupper($fact2["subrec"])) { $skip1[] = $i; $skip2[] = $j; @@ -145,7 +145,7 @@ if ($action!="choose") { echo "<tr><td class=\"list_label\">", i18n::translate('Record'), " ", $gid1, "</td><td class=\"list_label\">", i18n::translate('Record'), " ", $gid2, "</td></tr>\n"; echo "<tr><td valign=\"top\" class=\"list_value\">\n"; echo "<table border=\"1\">\n"; - foreach($facts1 as $i=>$fact1) { + foreach ($facts1 as $i=>$fact1) { if (($fact1["fact"]!="CHAN")&&(!in_array($i, $skip1))) { echo "<tr><td><input type=\"checkbox\" name=\"keep1[]\" value=\"", $i, "\" checked=\"checked\" /></td>"; echo "<td>", nl2br($fact1["subrec"]), "</td></tr>\n"; @@ -154,7 +154,7 @@ if ($action!="choose") { echo "</table>\n"; echo "</td><td valign=\"top\" class=\"list_value\">\n"; echo "<table border=\"1\">\n"; - foreach($facts2 as $j=>$fact2) { + foreach ($facts2 as $j=>$fact2) { if (($fact2["fact"]!="CHAN")&&(!in_array($j, $skip2))) { echo "<tr><td><input type=\"checkbox\" name=\"keep2[]\" value=\"", $j, "\" checked=\"checked\" /></td>"; echo "<td>", nl2br($fact2["subrec"]), "</td></tr>\n"; @@ -214,7 +214,7 @@ if ($action!="choose") { )->execute(array(WT_GED_ID, $gid2)); } $newgedrec = "0 @$gid1@ $type1\n"; - for($i=0; ($i<count($facts1) || $i<count($facts2)); $i++) { + for ($i=0; ($i<count($facts1) || $i<count($facts2)); $i++) { if (isset($facts1[$i])) { if (in_array($i, $keep1)) { $newgedrec .= $facts1[$i]["subrec"]."\n"; diff --git a/editconfig_gedcom.php b/editconfig_gedcom.php index 3332307642..5ba2f2d250 100644 --- a/editconfig_gedcom.php +++ b/editconfig_gedcom.php @@ -274,7 +274,7 @@ case 'update': if (!$errors) { // copy the .htaccess file from INDEX_DIRECTORY to NEW_MEDIA_FIREWALL_ROOTDIR in case it is still in a web-accessible area if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true) { - if ( (file_exists($INDEX_DIRECTORY.".htaccess")) && (is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY)) && (!file_exists($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess")) ) { + if ((file_exists($INDEX_DIRECTORY.".htaccess")) && (is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY)) && (!file_exists($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess")) ) { @copy($INDEX_DIRECTORY.".htaccess", $NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess"); if (!file_exists($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess")) { $errors = true; @@ -369,7 +369,7 @@ print_header(i18n::translate('GEDCOM configuration')); <script type="text/javascript"> //<![CDATA[ jQuery.noConflict(); - jQuery(document).ready(function(){ + jQuery(document).ready(function() { jQuery("#tabs").tabs(); }); //]]> diff --git a/expand_view.php b/expand_view.php index 6ec1d19afa..8b15cab75d 100644 --- a/expand_view.php +++ b/expand_view.php @@ -42,7 +42,7 @@ sort_facts($subfacts); $f2 = 0; /* @var $event Event */ -foreach($subfacts as $indexval => $event) { +foreach ($subfacts as $indexval => $event) { if ($event->canShow()) { if ($f2>0) echo "<br />"; $f2++; diff --git a/family.php b/family.php index 018b6b1e0f..13ea0c2635 100644 --- a/family.php +++ b/family.php @@ -38,7 +38,7 @@ $controller->init(); print_header($controller->getPageTitle()); // completely prevent display if privacy dictates so -if (!$controller->family){ +if (!$controller->family) { echo "<b>", i18n::translate('Unable to find record with ID'), "</b><br /><br />"; print_footer(); exit; @@ -127,10 +127,10 @@ if (empty($SEARCH_SPIDER) && $controller->accept_success) { </table> <br /> <?php -if(empty($SEARCH_SPIDER)) +if (empty($SEARCH_SPIDER)) print_footer(); else { - if($SHOW_SPIDER_TAGLINE) + if ($SHOW_SPIDER_TAGLINE) echo i18n::translate('Search Engine Spider Detected').": ".$SEARCH_SPIDER; echo "</div></body></html>"; } diff --git a/familybook.php b/familybook.php index c1de624e50..d41794a619 100644 --- a/familybook.php +++ b/familybook.php @@ -120,7 +120,7 @@ function print_descendency($person, $count) { if ($numkids==0) { $numkids = 1; $tbwidth = $bwidth+16; - for($j=$count; $j<$dgenerations; $j++) { + for ($j=$count; $j<$dgenerations; $j++) { echo "</td><td width=\"$bwidth\">"; } } @@ -149,7 +149,7 @@ function print_person_pedigree($pid, $count) { if ($count>=$generations) return; $famids = find_family_ids($pid); $hheight = ($bhalfheight+3) * pow(2,($generations-$count-1)); - foreach($famids as $indexval => $famid) { + foreach ($famids as $indexval => $famid) { echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"empty-cells: show;\">"; $parents = find_parents($famid); $height="100%"; diff --git a/fanchart.php b/fanchart.php index 534ccc6921..6f12af9f60 100644 --- a/fanchart.php +++ b/fanchart.php @@ -55,7 +55,7 @@ function split_align_text($data, $maxlen) { // do not split hebrew line $found = false; - foreach($RTLOrd as $indexval => $ord) { + foreach ($RTLOrd as $indexval => $ord) { if (strpos($data, chr($ord)) !== false) $found=true; } if ($found) $line=$data; @@ -341,7 +341,7 @@ function print_fan_chart($treeid, $fanw=640, $fandeg=270) { $num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch,PREG_SET_ORDER); if ($num>2) echo "<br /><span class=\"name1\">".i18n::translate('Siblings')."</span>"; if ($num==2) echo "<br /><span class=\"name1\">".i18n::translate('Sibling')."</span>"; - for($i=0; $i<$num; $i++) { + for ($i=0; $i<$num; $i++) { $cpid = $smatch[$i][1]; if ($cpid!=$pid) { $person=Person::getInstance($cpid); @@ -59,8 +59,8 @@ function getPreselectedTags(&$preselDefault, &$preselCustom) { $all = strlen($qs) ? explode(',', strtoupper($qs)) : array(); $preselDefault = array(); $preselCustom = array(); - foreach($all as $one) { - if(array_key_exists($one, $FACTS)) { + foreach ($all as $one) { + if (array_key_exists($one, $FACTS)) { $preselDefault[] = $one; } else { $preselCustom[] = $one; @@ -92,10 +92,10 @@ $thumbdir = stripcslashes(preg_replace($srch, $repl, $directory)); //-- prevent script from accessing an area outside of the media directory //-- and keep level consistency -if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)){ +if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)) { $directory = $MEDIA_DIRECTORY; $level = 0; -} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){ +} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0) { $directory = $MEDIA_DIRECTORY; $level = 0; } @@ -152,7 +152,7 @@ case "facts": echo WT_JS_START; ?> function pasteid(id, name, thumb) { - if(thumb) { + if (thumb) { window.opener.<?php echo $callback; ?>(id, name, thumb); <?php if (!$multiple) echo "window.close();"; ?> } else { @@ -164,7 +164,7 @@ echo WT_JS_START; if (id.match("I")=="I") { var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links¬eid=newnote&pid='+id, 'win01', 'top=50, left=600, width=420, height=650, resizable=1, scrollbars=1'); if (window.focus) {win01.focus();} - }else if (id.match("F")=="F") { + } else if (id.match("F")=="F") { // TODO --- alert('Opening Navigator with family id entered will come later'); } */ @@ -318,7 +318,7 @@ if ($type == "media" && $MULTI_MEDIA) { echo "</td></tr>"; echo "<tr><td class=\"list_label width10\" wstyle=\"padding: 5px;\">"; echo "<input type=\"checkbox\" name=\"showthumb\" value=\"true\""; - if( $showthumb) echo "checked=\"checked\""; + if ($showthumb) echo "checked=\"checked\""; echo "onclick=\"javascript: this.form.submit();\" />", i18n::translate('Show thumbnails'); echo help_link('show_thumb'); echo "</td></tr>"; @@ -426,7 +426,7 @@ if ($type == "specialchar") { echo "<select id=\"language_filter\" name=\"language_filter\" onchange=\"submit();\">"; echo "<option value=\"\">", i18n::translate('Change language'), "</option>"; $language_options = ""; - foreach($specialchar_languages as $key=>$value) { + foreach ($specialchar_languages as $key=>$value) { $language_options.= "<option value=\"$key\">$value</option>"; } $language_options = str_replace("\"$language_filter\"", "\"$language_filter\" selected", $language_options); @@ -462,7 +462,7 @@ if ($type == "facts") { var row=document.createElement("tr"),cell,o; row.appendChild(cell=document.createElement("td")); o=null; - if(document.all) { + if (document.all) { //Old IEs handle the creation of a checkbox already checked, as far as I know, only in this way try { o=document.createElement("<input type='checkbox' id='tag"+this._counter+"' "+(this.selected?"checked='checked'":"")+" />"); @@ -470,11 +470,11 @@ if ($type == "facts") { o=null; } } - if(!o) { + if (!o) { o=document.createElement("input"); o.setAttribute("id","tag"+this._counter); o.setAttribute("type","checkbox"); - if(this.selected) o.setAttribute("checked", "checked"); + if (this.selected) o.setAttribute("checked", "checked"); } o.DefaultTag=this; o.ParentRow=row; @@ -503,10 +503,10 @@ if ($type == "facts") { ,_timer:null ,clear:function() { var n=TheList.childNodes.length; - while(n) TheList.removeChild(TheList.childNodes[--n]); + while (n) TheList.removeChild(TheList.childNodes[--n]); } ,_clearTimer:function() { - if(this._timer!=null) { + if (this._timer!=null) { clearTimeout(this._timer); this._timer=null; } @@ -518,39 +518,39 @@ if ($type == "facts") { ,refreshNow:function(force) { this._clearTimer(); var s=document.getElementById("tbxFilter").value.toLowerCase().replace(/\s+/g," ").replace(/^ | $/g,""),k; - if(force||(typeof(this._curFilter)!="string")||(this._curFilter!=s)) { + if (force||(typeof(this._curFilter)!="string")||(this._curFilter!=s)) { this._curFilter=s; this.clear(); - for(k=0;k<DefaultTags.length;k++) { - if(DefaultTags[k].LowerName.indexOf(this._curFilter)>=0) DefaultTags[k].view(); + for (k=0;k<DefaultTags.length;k++) { + if (DefaultTags[k].LowerName.indexOf(this._curFilter)>=0) DefaultTags[k].view(); } } } ,recount:function() { var k,n=0; - for(k=0;k<DefaultTags.length;k++) - if(DefaultTags[k].selected) + for (k=0;k<DefaultTags.length;k++) + if (DefaultTags[k].selected) n++; document.getElementById("layCurSelectedCount").innerHTML=n.toString(); } ,showSelected:function() { this._clearTimer(); this.clear(); - for(var k=0;k<DefaultTags.length;k++) { - if(DefaultTags[k].selected) + for (var k=0;k<DefaultTags.length;k++) { + if (DefaultTags[k].selected) DefaultTags[k].view(); } } }; function initPickFact() { - var n,i,j,tmp,preselectedDefaultTags="\x01<?php foreach($preselDefault as $p) echo addslashes($p), '\\x01'; ?>"; + var n,i,j,tmp,preselectedDefaultTags="\x01<?php foreach ($preselDefault as $p) echo addslashes($p), '\\x01'; ?>"; DefaultTags=[<?php $firstFact=TRUE; - foreach($FACTS as $factId => $factName) { + foreach ($FACTS as $factId => $factName) { if (preg_match('/^_?[A-Z0-9]+$/', $factId, $matches)) { - if($firstFact) $firstFact=FALSE; + if ($firstFact) $firstFact=FALSE; else echo ','; echo 'new DefaultTag("'.addslashes($factId).'","'.addslashes($factName).'",preselectedDefaultTags.indexOf("\\x01'.addslashes($factId).'\\x01")>=0)'; } @@ -558,9 +558,9 @@ if ($type == "facts") { ?>]; //Sort defined tags alphabetically by name n=DefaultTags.length - for(i=0;i<(n-1);i++) { - for(j=(i+1);j<n;j++) { - if(DefaultTags[i].LowerName>DefaultTags[j].LowerName) { + for (i=0;i<(n-1);i++) { + for (j=(i+1);j<n;j++) { + if (DefaultTags[i].LowerName>DefaultTags[j].LowerName) { tmp=DefaultTags[i]; DefaultTags[i]=DefaultTags[j]; DefaultTags[j]=tmp; @@ -578,13 +578,13 @@ if ($type == "facts") { } function DoOK() { var result=[],k,linearResult,custom; - for(k=0;k<DefaultTags.length;k++) { - if(DefaultTags[k].selected) result.push(DefaultTags[k].Id); + for (k=0;k<DefaultTags.length;k++) { + if (DefaultTags[k].selected) result.push(DefaultTags[k].Id); } linearResult="\x01"+result.join("\x01")+"\x01"; custom=document.getElementById("tbxCustom").value.toUpperCase().replace(/\s/g,"").split(","); - for(k=0;k<custom.length;k++) { - if(linearResult.indexOf("\x01"+custom[k]+"\x01")<0) { + for (k=0;k<custom.length;k++) { + if (linearResult.indexOf("\x01"+custom[k]+"\x01")<0) { linearResult+=custom[k]+"\x01"; result.push(custom[k]); } @@ -619,7 +619,7 @@ if ($type == "facts") { <td><td></tbody></table> <table id="tabAction"><tbody><tr> - <td><button id="btnOk" disabled="disabled" onclick="if(!this.disabled)DoOK();"><?php echo i18n::translate('Accept'); ?></button></td> + <td><button id="btnOk" disabled="disabled" onclick="if (!this.disabled)DoOK();"><?php echo i18n::translate('Accept'); ?></button></td> <td><button onclick="window.close();return false"><?php echo i18n::translate('Cancel'); ?></button></td> <tr></tbody></table> <?php @@ -645,7 +645,7 @@ if ($action=="filter") { if ($myindilist) { echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; usort($myindilist, array('GedcomRecord', 'Compare')); - foreach($myindilist as $indi) { + foreach ($myindilist as $indi) { echo $indi->format_list('li', true); } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total individuals'), ' ', count($myindilist), '</tr></td>'; @@ -670,7 +670,7 @@ if ($action=="filter") { $curged = $GEDCOM; echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; usort($myfamlist, array('GedcomRecord', 'Compare')); - foreach($myfamlist as $family) { + foreach ($myfamlist as $family) { echo $family->format_list('li', true); } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total families'), ' ', count($myfamlist), '</tr></td>'; @@ -693,10 +693,10 @@ if ($action=="filter") { if ($level>0) { $levels = explode("/", $directory); $pdir = ""; - for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/"; + for ($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/"; $levels = explode("/", $thumbdir); $pthumb = ""; - for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; + for ($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; $uplink = "<a href=\"find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; } @@ -715,7 +715,7 @@ if ($action=="filter") { // display the directory list if (count($dirs) || $level) { sort($dirs); - if ($level){ + if ($level) { echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">"; echo $uplink, "</td></tr>"; } @@ -758,7 +758,7 @@ if ($action=="filter") { if ($chooseType=="media" && empty($media["XREF"])) $isvalid = false; // skip unlinked media files } if ($isvalid) { - if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0){ + if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0) { $imgsize = findImageSize($media["FILE"]); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; @@ -786,7 +786,7 @@ if ($action=="filter") { if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo "<br />"; } - if (!$embed){ + if (!$embed) { echo "<a href=\"javascript:;\" onclick=\"pasteid('", addslashes($media["FILE"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- "; } else echo "<a href=\"javascript:;\" onclick=\"pasteid('", $media["XREF"], "', '", addslashes($media["TITL"]), "', '", addslashes($media["THUMB"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- "; @@ -847,7 +847,7 @@ if ($action=="filter") { $levels = array_reverse($levels); // -- reverse the array so that we get the top level first $placetext = ""; $j=0; - foreach($levels as $indexval => $level) { + foreach ($levels as $indexval => $level) { if ($j>0) $placetext .= ", "; $placetext .= trim($level); $j++; @@ -856,7 +856,7 @@ if ($action=="filter") { } uasort($revplacelist, "utf8_strcasecmp"); echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; - foreach($revplacelist as $place) { + foreach ($revplacelist as $place) { echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", str_replace(array("'", '"'), array("\'", '"'), $place), "');\">", PrintReady($place), "</a></li>"; } echo "</ul></td></tr>"; @@ -944,7 +944,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($lcspecialchars as $key=>$value) { + foreach ($lcspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; @@ -958,7 +958,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($ucspecialchars as $key=>$value) { + foreach ($ucspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; @@ -972,7 +972,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($otherspecialchars as $key=>$value) { + foreach ($otherspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; diff --git a/gedcheck.php b/gedcheck.php index 02e1b055c4..9c81b9c3b2 100644 --- a/gedcheck.php +++ b/gedcheck.php @@ -426,7 +426,7 @@ function add_structure($prefix, $min, $max, $structure) add_structure($prefix.'FAM:', 0, 9999, '<<MULTIMEDIA_LINK>>'); break; case '<<FAMILY_EVENT_STRUCTURE>>': - foreach(array('ANUL','CENS','DIV','DIVF','ENGA','MARB','MARC','MARL','MARS','RESI') as $event) { + foreach (array('ANUL','CENS','DIV','DIVF','ENGA','MARB','MARC','MARL','MARS','RESI') as $event) { add_element ($prefix.$event, $min, $max, $TAG['NULL']); add_structure($prefix.$event.':', 0, 1, '<<FAMILY_EVENT_DETAIL>>'); } @@ -503,16 +503,16 @@ function add_structure($prefix, $min, $max, $structure) add_element ($prefix.'AGE', 0, 1, $TAG['AGE_AT_EVENT']); break; case '<<INDIVIDUAL_EVENT_STRUCTURE>>': - foreach(array('BIRT','CHR') as $event) { + foreach (array('BIRT','CHR') as $event) { add_element ($prefix.$event, $min, $max, 'Y?'); add_structure($prefix.$event.':', 0, 1, '<<INDIVIDUAL_EVENT_DETAIL>>'); add_element ($prefix.$event.':FAMC', 0, 1, $TAG['XREF']); } - foreach(array('DEAT') as $event) { + foreach (array('DEAT') as $event) { add_element ($prefix.$event, $min, $max, 'Y?'); add_structure($prefix.$event.':', 0, 1, '<<INDIVIDUAL_EVENT_DETAIL>>'); } - foreach(array('BURI','CREM','BAPM','BARM','BASM','BLES','CHRA','CONF','FCOM','ORDN','NATU','EMIG','IMMI','CENS','PROB','WILL','GRAD','RETI','EVEN') as $event) { + foreach (array('BURI','CREM','BAPM','BARM','BASM','BLES','CHRA','CONF','FCOM','ORDN','NATU','EMIG','IMMI','CENS','PROB','WILL','GRAD','RETI','EVEN') as $event) { add_element ($prefix.$event, $min, $max, $TAG['NULL']); add_structure($prefix.$event.':', 0, 1, '<<INDIVIDUAL_EVENT_DETAIL>>'); } diff --git a/genservice.php b/genservice.php index 8fbb37a773..e32190d0ba 100644 --- a/genservice.php +++ b/genservice.php @@ -35,7 +35,7 @@ require './includes/session.php'; * in order to set the correct session during initialization. */ //Only include and set the session if it's not a wsdl request -if(!isset($_SERVER['QUERY_STRING']) || strstr($_SERVER['QUERY_STRING'],'wsdl')===false) +if (!isset($_SERVER['QUERY_STRING']) || strstr($_SERVER['QUERY_STRING'],'wsdl')===false) { if (isset($HTTP_RAW_POST_DATA)) { //-- set the session id diff --git a/imageview.php b/imageview.php index 11ae3f3746..06eacb223f 100644 --- a/imageview.php +++ b/imageview.php @@ -101,8 +101,8 @@ print_simple_header(i18n::translate('Image viewer')); msY = e.pageY; } // catch possible negative values in NS4 - if (msX < 0){msX = 0;} - if (msY < 0){msY = 0;} + if (msX < 0) {msX = 0;} + if (msY < 0) {msY = 0;} if (movei!="") { ileft = parseInt(movei.style.left); itop = parseInt(movei.style.top); @@ -121,8 +121,8 @@ print_simple_header(i18n::translate('Image viewer')); if (document.images.length == 3) { height=document.images[0].height+80; width=document.images[0].width+20; - if(width > screen.width-100) width = screen.width-100; - if(height > screen.height-110) height = screen.height-110; + if (width > screen.width-100) width = screen.width-100; + if (height > screen.height-110) height = screen.height-110; if (document.layers) window.resizeTo(width+20,height+20) else if (document.all) window.resizeTo(width+30,height+50) else if (document.getElementById) window.resizeTo(width+40,height+20) diff --git a/includes/authentication.php b/includes/authentication.php index 43d98bf27d..fbf06000ee 100644 --- a/includes/authentication.php +++ b/includes/authentication.php @@ -86,7 +86,7 @@ function authenticateUser($user_name, $password, $basic=false) { */ function basicHTTPAuthenticateUser() { $user_id = getUserId(); - if (empty($user_id)){ //not logged in. + if (empty($user_id)) { //not logged in. if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || (! authenticateUser($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], true))) { header('WWW-Authenticate: Basic realm="' . i18n::translate('webtrees Authentication System') . '"'); @@ -380,7 +380,7 @@ function addMessage($message) { $email1 .= $fromFullName."\r\n\r\n".$message["body"]; } if (!isset($message["no_from"])) { - if (stristr($from, $WEBTREES_EMAIL)){ + if (stristr($from, $WEBTREES_EMAIL)) { $from = getUserEmail(get_gedcom_setting(WT_GED_ID, 'WEBMASTER_USER_ID')); } if (!$user_id_from) { diff --git a/includes/classes/class_date.php b/includes/classes/class_date.php index 6119b8d3e7..0db8a0c7f8 100644 --- a/includes/classes/class_date.php +++ b/includes/classes/class_date.php @@ -1013,12 +1013,12 @@ class HebrewDate extends JewishDate { $thousands = $num / 1000; //get # thousands $sb = ""; //append thousands to String - if($num % 1000 == 0) { // in year is 5000, 4000 etc + if ($num % 1000 == 0) { // in year is 5000, 4000 etc $sb .= $jOnes[$thousands]; $sb .= self::GERSH; $sb .= " "; $sb .= self::ALAFIM; //add # of thousands plus word thousand (overide alafim boolean) - } else if($DISPLAY_JEWISH_THOUSANDS) { // if alafim boolean display thousands + } else if ($DISPLAY_JEWISH_THOUSANDS) { // if alafim boolean display thousands $sb .= $jOnes[$thousands]; $sb .= self::GERSH; //append thousands quote $sb .= " "; @@ -1027,14 +1027,14 @@ class HebrewDate extends JewishDate { $hundreds = $num / 100; // # of hundreds $sb .= $jHundreds[$hundreds]; //add hundreds to String $num = $num % 100; //remove 100s - if($num == 15) { //special case 15 + if ($num == 15) { //special case 15 $sb .= $tavTaz[0]; - } else if($num == 16) { //special case 16 + } else if ($num == 16) { //special case 16 $sb .= $tavTaz[1]; } else { $tens = $num / 10; - if($num % 10 == 0) { // if evenly divisable by 10 - if($singleDigitYear == false) { + if ($num % 10 == 0) { // if evenly divisable by 10 + if ($singleDigitYear == false) { $sb .= $jTenEnds[$tens]; // use end letters so that for example 5750 will end with an end nun } else { $sb .= $jTens[$tens]; // use standard letters so that for example 5050 will end with a regular nun diff --git a/includes/classes/class_event.php b/includes/classes/class_event.php index 4b90f74437..70c99b754b 100644 --- a/includes/classes/class_event.php +++ b/includes/classes/class_event.php @@ -271,7 +271,7 @@ class Event { if (!$this->canShow()) return ""; $data = ""; - if ($this->gedcomRecord != "1 DEAT"){ + if ($this->gedcomRecord != "1 DEAT") { $data .= "<span class=\"details_label\">".$this->getLabel($ABBREVIATE_CHART_LABELS)."</span> "; } $emptyfacts = array("BIRT","CHR","DEAT","BURI","CREM","ADOP","BAPM","BARM","BASM","BLES","CHRA","CONF","FCOM","ORDN","NATU","EMIG","IMMI","CENS","PROB","WILL","GRAD","RETI","BAPL","CONL","ENDL","SLGC","EVEN","MARR","SLGS","MARL","ANUL","CENS","DIV","DIVF","ENGA","MARB","MARC","MARS","OBJE","CHAN","_SEPR","RESI", "DATA", "MAP"); diff --git a/includes/classes/class_family.php b/includes/classes/class_family.php index 0354a4d090..8023d2d5a4 100644 --- a/includes/classes/class_family.php +++ b/includes/classes/class_family.php @@ -185,12 +185,12 @@ class Family extends GedcomRecord { if ($this->children_loaded) return; $this->childrenIds = array(); $this->numChildren = preg_match_all('/1\s*CHIL\s*@(.*)@/', $this->gedrec, $smatch, PREG_SET_ORDER); - for($i=0; $i<$this->numChildren; $i++) { + for ($i=0; $i<$this->numChildren; $i++) { //-- get the childs ids $chil = trim($smatch[$i][1]); $this->childrenIds[] = $chil; } - foreach($this->childrenIds as $t=>$chil) { + foreach ($this->childrenIds as $t=>$chil) { $child=Person::getInstance($chil); if (!is_null($child)) $this->children[] = $child; } @@ -249,7 +249,7 @@ class Family extends GedcomRecord { function hasChild(&$person) { if (is_null($person)) return false; $this->loadChildren(); - foreach($this->children as $key=>$child) { + foreach ($this->children as $key=>$child) { if ($person->equals($child)) return true; } return false; @@ -311,7 +311,7 @@ class Family extends GedcomRecord { * get the marriage year * @return string */ - function getMarriageYear($est = true, $cal = ''){ + function getMarriageYear($est = true, $cal = '') { // TODO - change the design to use julian days, not gregorian years. $mdate = $this->getMarriageDate(); $mdate = $mdate->MinDate(); @@ -323,7 +323,7 @@ class Family extends GedcomRecord { * get the marriage month * @return string */ - function getMarriageMonth($est = true, $cal = ''){ + function getMarriageMonth($est = true, $cal = '') { // TODO - change the design to use julian days, not gregorian years. $mdate = $this->getMarriageDate(); $mdate=$mdate->MinDate(); diff --git a/includes/classes/class_gedcomrecord.php b/includes/classes/class_gedcomrecord.php index df529b8d9f..0e5ed61e57 100644 --- a/includes/classes/class_gedcomrecord.php +++ b/includes/classes/class_gedcomrecord.php @@ -809,7 +809,7 @@ class GedcomRecord { $factrec = ''; // -- complete fact record $line = ''; // -- temporary line buffer $linenum=1; - for($i=1; $i<=$lct; $i++) { + for ($i=1; $i<=$lct; $i++) { if ($i<$lct) { $line = $indilines[$i]; } else { @@ -819,7 +819,7 @@ class GedcomRecord { $line=' '; } if ($i==$lct||$line{0}==1) { - if ($i>1){ + if ($i>1) { $event = new Event($factrec, $linenum); $fact = $event->getTag(); if ($nfacts==NULL || !in_array($fact, $nfacts)) { @@ -847,9 +847,9 @@ class GedcomRecord { $diff->parseFacts(); //-- update old facts - foreach($this->facts as $key=>$event) { + foreach ($this->facts as $key=>$event) { $found = false; - foreach($diff->facts as $indexval => $newevent) { + foreach ($diff->facts as $indexval => $newevent) { $newfact = $newevent->getGedcomRecord(); $newfact=preg_replace("/\\\/", '/', $newfact); if (trim($newfact)==trim($event->getGedcomRecord())) { @@ -862,9 +862,9 @@ class GedcomRecord { } } //-- look for new facts - foreach($diff->facts as $key=>$newevent) { + foreach ($diff->facts as $key=>$newevent) { $found = false; - foreach($this->facts as $indexval => $event) { + foreach ($this->facts as $indexval => $event) { $newfact = $newevent->getGedcomRecord(); $newfact=preg_replace("/\\\/", '/', $newfact); if (trim($newfact)==trim($event->getGedcomRecord())) { diff --git a/includes/classes/class_localclient.php b/includes/classes/class_localclient.php index 958d3540b9..6aaf812c33 100644 --- a/includes/classes/class_localclient.php +++ b/includes/classes/class_localclient.php @@ -107,12 +107,12 @@ class LocalClient extends ServiceClient { $search_results = search_indis(array($query), array($this->gedfile), 'AND', true); // loop thru the returned result of the method call - foreach($search_results as $gid=>$indi) + foreach ($search_results as $gid=>$indi) { // privatize the gedcoms returned $gedrec = privatize_gedcom($indi["gedcom"]); // set the fields that exist and return all the results that are not private - if(preg_match("~".$query."~i",$gedrec)>0) + if (preg_match("~".$query."~i",$gedrec)>0) { $person = new SOAP_Value('person', 'person', ""); $person->PID = $gid; diff --git a/includes/classes/class_media.php b/includes/classes/class_media.php index eafc23f754..a0c578bedc 100644 --- a/includes/classes/class_media.php +++ b/includes/classes/class_media.php @@ -74,7 +74,7 @@ class Media extends GedcomRecord { * get the media note * @return string */ - function getNote(){ + function getNote() { if (is_null($this->note)) { $this->note=get_gedcom_value('NOTE', 1, $this->getGedcomRecord()); } @@ -114,7 +114,7 @@ class Media extends GedcomRecord { if ($this->serverfilename) return $this->serverfilename; $localfilename = $this->getLocalFilename(); if (!empty($localfilename)) { - if (file_exists($localfilename)){ + if (file_exists($localfilename)) { // found image in unprotected directory $this->fileexists = 2; $this->serverfilename = $localfilename; @@ -122,7 +122,7 @@ class Media extends GedcomRecord { } if ($USE_MEDIA_FIREWALL) { $protectedfilename = get_media_firewall_path($localfilename); - if (file_exists($protectedfilename)){ + if (file_exists($protectedfilename)) { // found image in protected directory $this->fileexists = 3; $this->serverfilename = $protectedfilename; diff --git a/includes/classes/class_menu.php b/includes/classes/class_menu.php index 94dc04d39a..92f4f82d7e 100644 --- a/includes/classes/class_menu.php +++ b/includes/classes/class_menu.php @@ -300,7 +300,7 @@ class Menu { } } $output .= "\" onmouseover=\"show_submenu('{$this->parentmenu}'); show_submenu('{$submenuid}');\" onmouseout=\"timeout_submenu('menu{$id}_subs');\">\n"; - foreach($this->submenus as $submenu) { + foreach ($this->submenus as $submenu) { $submenu->parentmenu = $submenuid; $output .= $submenu->getMenu(); } diff --git a/includes/classes/class_menubar.php b/includes/classes/class_menubar.php index 4bbe432bc8..58d488e856 100644 --- a/includes/classes/class_menubar.php +++ b/includes/classes/class_menubar.php @@ -120,7 +120,7 @@ class MenuBar { $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_indis"); $menu->addSubmenu($submenu); } - if (WT_USER_GEDCOM_ADMIN){ + if (WT_USER_GEDCOM_ADMIN) { $menu->addSeparator(); //-- admin submenu $submenu = new Menu(i18n::translate('Administration'), "admin.php"); @@ -211,7 +211,7 @@ class MenuBar { asort($menuList); // Produce the submenus in localized name order - foreach($menuList as $menuType => $menuName) { + foreach ($menuList as $menuType => $menuName) { switch ($menuType) { case "pedigree": //-- pedigree @@ -300,7 +300,7 @@ class MenuBar { asort($menuList); // Produce the submenus in localized name order - foreach($menuList as $menuType => $menuName) { + foreach ($menuList as $menuType => $menuName) { switch ($menuType) { case "parentTimeLine": // charts / parents_timeline @@ -511,7 +511,7 @@ class MenuBar { // Produce the submenus in localized name order - foreach($menuList as $menuType => $menuName) { + foreach ($menuList as $menuType => $menuName) { switch ($menuType) { case "individual": //-- indi list sub menu @@ -771,7 +771,7 @@ class MenuBar { //-- add contact links to help menu $menu->addSeparator(); $menuitems = contact_menus(); - foreach($menuitems as $menuitem) { + foreach ($menuitems as $menuitem) { $submenu = new Menu($menuitem["label"], $menuitem["link"]); $submenu->addIcon('mypage'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_contact"); diff --git a/includes/classes/class_person.php b/includes/classes/class_person.php index 455a629edd..1bf8f98686 100644 --- a/includes/classes/class_person.php +++ b/includes/classes/class_person.php @@ -196,7 +196,7 @@ class Person extends GedcomRecord { * get the birth year * @return string the year of birth */ - function getBirthYear(){ + function getBirthYear() { return $this->getBirthDate()->MinDate()->Format('%Y'); } @@ -925,12 +925,12 @@ class Person extends GedcomRecord { } } } - if($otherfacts){ + if ($otherfacts) { if (!$hasdiv && !is_null($spouse)) $this->add_spouse_facts($spouse, $family->getGedcomRecord()); $this->add_children_facts($family); } } - if($otherfacts){ + if ($otherfacts) { $this->add_parents_facts($this); $this->add_historical_facts(); $this->add_asso_facts(); @@ -1132,13 +1132,13 @@ class Person extends GedcomRecord { if ($option=='_NEPH') { $rela='sibchi'; $parent_sex = Person::getInstance($except)->getSex(); - if ($sex=='F') { $rela='sibdau'; - if ($parent_sex=='F'){ $rela='sisdau'; $op='_NIE1';} - if ($parent_sex=='M'){ $rela='brodau'; $op='_NIE2';} + if ($sex=='F') { $rela='sibdau'; + if ($parent_sex=='F') { $rela='sisdau'; $op='_NIE1';} + if ($parent_sex=='M') { $rela='brodau'; $op='_NIE2';} } - if ($sex=='M') { $rela='sibson'; - if ($parent_sex=='F'){ $rela='sisson'; $op='_NEP1';} - if ($parent_sex=='M'){ $rela='broson'; $op='_NEP2';} + if ($sex=='M') { $rela='sibson'; + if ($parent_sex=='F') { $rela='sisson'; $op='_NEP1';} + if ($parent_sex=='M') { $rela='broson'; $op='_NEP2';} } } // add child birth @@ -1404,7 +1404,7 @@ class Person extends GedcomRecord { break; } } - if (!$found){ + if (!$found) { $event = new Event($factrec); $event->setParentObject($this); $this->indifacts[] = $event; diff --git a/includes/classes/class_reportbase.php b/includes/classes/class_reportbase.php index 5232e9e4b2..b14b0d9cd8 100644 --- a/includes/classes/class_reportbase.php +++ b/includes/classes/class_reportbase.php @@ -49,7 +49,7 @@ $ascii_langs = array("en", "da", "nl", "fr", "he", "hu", "de", "nn", "es"); //-- setup special characters array to force embedded fonts $SpecialOrds = $RTLOrd; -for($i=195; $i<215; $i++) $SpecialOrds[] = $i; +for ($i=195; $i<215; $i++) $SpecialOrds[] = $i; if (!isset($embed_fonts)) { if (in_array(WT_LOCALE, $ascii_langs)) { @@ -493,7 +493,7 @@ class Element { function addText($t) { global $embed_fonts, $SpecialOrds, $wt_report, $reportTitle, $reportDescription; - foreach($SpecialOrds as $ord) { + foreach ($SpecialOrds as $ord) { if (strpos($t, chr($ord))!==false) { $embed_fonts = true; } @@ -569,7 +569,7 @@ class Html extends Element { function getStart() { $str = "<".$this->tag." "; - foreach($this->attrs as $key=>$value) { + foreach ($this->attrs as $key=>$value) { $str .= $key."=\"".$value."\" "; } $str .= ">"; @@ -1010,7 +1010,7 @@ class Footnote extends Element { function addText($t) { global $embed_fonts, $SpecialOrds; - foreach($SpecialOrds as $ord) { + foreach ($SpecialOrds as $ord) { if (strpos($t, chr($ord))!==false) { $embed_fonts = true; } @@ -1428,7 +1428,7 @@ function startElement($parser, $name, $attrs) { $newattrs = array(); $match = array(); - foreach($attrs as $key=>$value) { + foreach ($attrs as $key=>$value) { if (preg_match("/^\\$(\w+)$/", $value, $match)) { if ((isset($vars[$match[1]]["id"]))&&(!isset($vars[$match[1]]["gedcom"]))) { $value = $vars[$match[1]]["id"]; @@ -1890,7 +1890,7 @@ function GedcomSHandler($attrs) { if (empty($newgedrec)) { $tgedrec = $gedrec; $newgedrec = ""; - foreach($tags as $tag) { + foreach ($tags as $tag) { if (preg_match("/\\$(.+)/", $tag, $match)) { if (isset($vars[$match[1]]["gedcom"])) { $newgedrec = $vars[$match[1]]["gedcom"]; @@ -2176,9 +2176,9 @@ function GetPersonNameSHandler($attrs) { $name = preg_replace("/\(.*\) ?/", "", $name); //removes () and text inbetween - what about ", [ and { etc? $words = explode(" ", $name); $name = $words[count($words)-1]; - for($i=count($words)-2; $i>=0; $i--) { + for ($i=count($words)-2; $i>=0; $i--) { $len = utf8_strlen($name); - for($j=count($words)-3; $j>=0; $j--) { + for ($j=count($words)-3; $j>=0; $j--) { $len += utf8_strlen($words[$j]); } if ($len>$attrs["truncate"]) { @@ -2361,12 +2361,12 @@ function RepeatTagEHandler() { // @deprecated //$line = xml_get_current_line_number($parser)-1; $lineoffset = 0; - foreach($repeatsStack as $rep) { + foreach ($repeatsStack as $rep) { $lineoffset += $rep[1]; } //-- read the xml from the file $lines = file($report); - while(strpos($lines[$lineoffset + $repeatBytes], "<RepeatTag")===false) { + while (strpos($lines[$lineoffset + $repeatBytes], "<RepeatTag")===false) { $lineoffset--; } $lineoffset++; @@ -2374,7 +2374,7 @@ function RepeatTagEHandler() { $line_nr = $lineoffset + $repeatBytes; // RepeatTag Level counter $count = 1; - while(0 < $count) { + while (0 < $count) { if (strstr($lines[$line_nr], "<RepeatTag")!==false) { $count++; } elseif (strstr($lines[$line_nr], "</RepeatTag")!==false) { @@ -2391,11 +2391,11 @@ function RepeatTagEHandler() { // Save original values array_push($parserStack, $parser); $oldgedrec = $gedrec; - // PHP 5.2.3 has a bug with foreach(), so don't use that here, while 5.2.3 is on the market - // while() has the fastest execution speed + // PHP 5.2.3 has a bug with foreach (), so don't use that here, while 5.2.3 is on the market + // while () has the fastest execution speed $count = count($repeats); $i = 0; - while($i < $count) { + while ($i < $count) { $gedrec = $repeats[$i]; //-- start the sax parser $repeat_parser = xml_parser_create(); @@ -2544,7 +2544,7 @@ function FactsSHandler($attrs) { } sort_facts($facts); $repeats = array(); - foreach($facts as $event) { + foreach ($facts as $event) { if (strpos($tag.",", $event->getTag())===false) { $repeats[]=$event->getGedComRecord(); } @@ -2599,20 +2599,20 @@ function FactsEHandler() { $line = xml_get_current_line_number($parser)-1; $lineoffset = 0; - foreach($repeatsStack as $rep) { + foreach ($repeatsStack as $rep) { $lineoffset += $rep[1]; } //-- read the xml from the file $lines = file($report); - while(($lineoffset + $repeatBytes > 0) and (strpos($lines[$lineoffset + $repeatBytes], "<Facts ")) === false) { + while (($lineoffset + $repeatBytes > 0) and (strpos($lines[$lineoffset + $repeatBytes], "<Facts ")) === false) { $lineoffset--; } $lineoffset++; $reportxml = "<tempdoc>\n"; $i = $line + $lineoffset; $line_nr = $repeatBytes + $lineoffset; - while($line_nr < $i) { + while ($line_nr < $i) { $reportxml .= $lines[$line_nr]; $line_nr++; } @@ -2625,7 +2625,7 @@ function FactsEHandler() { $count = count($repeats); $i = 0; $match = array(); - while($i < $count) { + while ($i < $count) { $gedrec = $repeats[$i]; $fact = ""; $desc = ""; @@ -2703,7 +2703,7 @@ function SetVarSHandler($attrs) { } $count = preg_match_all("/\\$(\w+)/", $value, $match, PREG_SET_ORDER); $i=0; - while($i<$count) { + while ($i<$count) { $t = $vars[$match[$i][1]]["id"]; $value = preg_replace("/\\$".$match[$i][1]."/", $t, $value, 1); $i++; @@ -2760,7 +2760,7 @@ function ifSHandler($attrs) { $match = array(); $count = preg_match_all("/@([\w:\.]+)/", $condition, $match, PREG_SET_ORDER); $i = 0; - while( $i < $count ) { + while ( $i < $count ) { $id = $match[$i][1]; $value="\"\""; if ($id=="ID") { @@ -3196,19 +3196,19 @@ function ListSHandler($attrs) { $sql_order_by[]="{$attr}.d_julianday1"; } unset($attrs[$attr]); // This filter has been fully processed - } elseif (($listname=="individual") && (preg_match('/^NAME CONTAINS (.*)$/', $value, $match))){ + } elseif (($listname=="individual") && (preg_match('/^NAME CONTAINS (.*)$/', $value, $match))) { // Do nothing, unless you have to - if (($match[1] != "") or ($sortby=="NAME")){ + if (($match[1] != "") or ($sortby=="NAME")) { $sql_join[]="JOIN `##name` AS {$attr} ON (n_file={$sql_col_prefix}file AND n_id={$sql_col_prefix}id)"; // Search the DB only if there is any name supplied - if ($match[1] != ""){ + if ($match[1] != "") { $names = explode(" ", $match[1]); - foreach ($names as $name){ + foreach ($names as $name) { $sql_where[]="{$attr}.n_full LIKE ".WT_DB::quote(utf8_strtoupper("%{$name}%")); } } // Let the DB do the name sorting even when no name was entered - if ($sortby=="NAME"){ + if ($sortby=="NAME") { $sortby=""; $sql_order_by[]="{$attr}.n_sort"; } @@ -3236,7 +3236,7 @@ function ListSHandler($attrs) { * Place any other filter before these filters because they will pick up any filters that has not been processed * Also, do not unset() these two filters. These are just the first primary filters to reduce the returned list from the DB */ - elseif (($listname=="individual") and (preg_match('/^(\w*):*(\w*) CONTAINS (.*)$/', $value, $match))){ + elseif (($listname=="individual") and (preg_match('/^(\w*):*(\w*) CONTAINS (.*)$/', $value, $match))) { $query = ""; // Level 1 tag if ($match[1] != "") $query .= "%1 {$match[1]}%"; @@ -3246,7 +3246,7 @@ function ListSHandler($attrs) { if ($match[3] != "") $query .= "%{$match[3]}%"; $sql_where[] = "i_gedcom LIKE ".WT_DB::quote(utf8_strtoupper($query)); unset($query); - } elseif (($listname=="family") and (preg_match('/^(\w*):*(\w*) CONTAINS (.*)$/', $value, $match))){ + } elseif (($listname=="family") and (preg_match('/^(\w*):*(\w*) CONTAINS (.*)$/', $value, $match))) { $query = ""; // Level 1 tag if ($match[1] != "") $query .= "%1 {$match[1]}%"; @@ -3276,7 +3276,7 @@ function ListSHandler($attrs) { $filters = array(); $filters2 = array(); if ((isset($attrs["filter1"])) and (count($list) > 0)) { - foreach($attrs as $key=>$value) { + foreach ($attrs as $key=>$value) { if (preg_match("/filter(\d)/", $key)) { $condition = $value; if (preg_match("/@(\w+)/", $condition, $match)) { @@ -3311,7 +3311,7 @@ function ListSHandler($attrs) { //-- only limit to a level number if we are specifically looking at a level if (count($tags)>1) { $level = 1; - foreach($tags as $t) { + foreach ($tags as $t) { if (!empty($searchstr)) { $searchstr.="[^\n]*(\n[2-9][^\n]*)*\n"; } @@ -3361,11 +3361,11 @@ function ListSHandler($attrs) { } if ($filters2) { $mylist = array(); - foreach($list as $indi) { + foreach ($list as $indi) { $key=$indi->getXref(); $grec=$indi->getGedcomRecord(); $keep = true; - foreach($filters2 as $filter) { + foreach ($filters2 as $filter) { if ($keep) { $tag = $filter["tag"]; $expr = $filter["expr"]; @@ -3476,12 +3476,12 @@ function ListEHandler() { // @deprecated //$line = xml_get_current_line_number($parser)-1; $lineoffset = 0; - foreach($repeatsStack as $rep) { + foreach ($repeatsStack as $rep) { $lineoffset += $rep[1]; } //-- read the xml from the file $lines = file($report); - while((strpos($lines[$lineoffset + $repeatBytes], "<List")===false) && (($lineoffset + $repeatBytes) > 0)) { + while ((strpos($lines[$lineoffset + $repeatBytes], "<List")===false) && (($lineoffset + $repeatBytes) > 0)) { $lineoffset--; } $lineoffset++; @@ -3489,7 +3489,7 @@ function ListEHandler() { $line_nr = $lineoffset + $repeatBytes; // List Level counter $count = 1; - while(0 < $count) { + while (0 < $count) { if (strpos($lines[$line_nr], "<List")!==false) { $count++; } elseif (strpos($lines[$line_nr], "</List")!==false) { @@ -3612,7 +3612,7 @@ function RelativesSHandler($attrs) { switch ($group) { case "child-family": $famids = $person->getChildFamilies(); - foreach($famids as $family) { + foreach ($famids as $family) { $husband = $family->getHusband(); $wife = $family->getWife(); if (!empty($husband)) { @@ -3622,14 +3622,14 @@ function RelativesSHandler($attrs) { $list[$wife->getXref()] = $wife; } $children = $family->getChildren(); - foreach($children as $child) { + foreach ($children as $child) { if (!empty($child)) $list[$child->getXref()] = $child; } } break; case "spouse-family": $famids = $person->getSpouseFamilies(); - foreach($famids as $family) { + foreach ($famids as $family) { $husband = $family->getHusband(); $wife = $family->getWife(); if (!empty($husband)) { @@ -3639,7 +3639,7 @@ function RelativesSHandler($attrs) { $list[$wife->getXref()] = $wife; } $children = $family->getChildren(); - foreach($children as $child) { + foreach ($children as $child) { if (!empty($child)) $list[$child->getXref()] = $child; } } @@ -3717,12 +3717,12 @@ function RelativesEHandler() { // @deprecated //$line = xml_get_current_line_number($parser)-1; $lineoffset = 0; - foreach($repeatsStack as $rep) { + foreach ($repeatsStack as $rep) { $lineoffset += $rep[1]; } //-- read the xml from the file $lines = file($report); - while((strpos($lines[$lineoffset + $repeatBytes], "<Relatives")===false) && (($lineoffset + $repeatBytes) > 0)) { + while ((strpos($lines[$lineoffset + $repeatBytes], "<Relatives")===false) && (($lineoffset + $repeatBytes) > 0)) { $lineoffset--; } $lineoffset++; @@ -3730,7 +3730,7 @@ function RelativesEHandler() { $line_nr = $lineoffset + $repeatBytes; // Relatives Level counter $count = 1; - while(0 < $count) { + while (0 < $count) { if (strpos($lines[$line_nr], "<Relatives")!==false) { $count++; } elseif (strpos($lines[$line_nr], "</Relatives")!==false) { @@ -3750,7 +3750,7 @@ function RelativesEHandler() { $list_total = count($list); $list_private = 0; - foreach($list as $key => $value) { + foreach ($list as $key => $value) { if (isset($value->generation)) { $generation = $value->generation; } diff --git a/includes/classes/class_reporthtml.php b/includes/classes/class_reporthtml.php index 0b84575982..66f9022f1f 100644 --- a/includes/classes/class_reporthtml.php +++ b/includes/classes/class_reporthtml.php @@ -162,7 +162,7 @@ class ReportBaseHTML extends ReportBase { } function runPageHeader() { - foreach($this->pageHeaderElements as $element) { + foreach ($this->pageHeaderElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -175,8 +175,8 @@ class ReportBaseHTML extends ReportBase { function Footnotes() { $this->currentStyle = ""; - if(!empty($this->printedfootnotes)) { - foreach($this->printedfootnotes as $element) { + if (!empty($this->printedfootnotes)) { + foreach ($this->printedfootnotes as $element) { $element->renderFootnote($this); } } @@ -205,7 +205,7 @@ class ReportBaseHTML extends ReportBase { // Setting up the styles echo "\n<style type=\"text/css\">\n"; - foreach($this->Styles as $class => $style) { + foreach ($this->Styles as $class => $style) { echo ".", $class, "{\n"; if ($style["font"]=="dejavusans") { $style["font"] = $this->defaultFont; @@ -226,7 +226,7 @@ class ReportBaseHTML extends ReportBase { </head>\n<body> <div id=\"headermargin\" style=\"position:relative; top:auto; height:", $this->headermargin, "pt; width:", $this->noMarginWidth, "pt;\"></div> <div id=\"headerdiv\" style=\"position:relative; top:auto; width:", $this->noMarginWidth, "pt;\">"; - foreach($this->headerElements as $element) { + foreach ($this->headerElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -242,7 +242,7 @@ class ReportBaseHTML extends ReportBase { $this->Y = 0; $this->maxY = 0; $this->runPageHeader(); - foreach($this->bodyElements as $element) { + foreach ($this->bodyElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -259,7 +259,7 @@ class ReportBaseHTML extends ReportBase { $this->Y = 0; $this->X = 0; $this->maxY = 0; - foreach($this->footerElements as $element) { + foreach ($this->footerElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -382,7 +382,7 @@ class ReportBaseHTML extends ReportBase { $ct = count($this->printedfootnotes); $i = 0; $val = $footnote->getValue(); - while($i < $ct) { + while ($i < $ct) { if ($this->printedfootnotes[$i]->getValue() == $val) { // If this footnote already exist then set up the numbers for this object $footnote->setNum($i + 1); @@ -431,7 +431,7 @@ class ReportBaseHTML extends ReportBase { function getFootnotesHeight($cellWidth) { $h = 0; - foreach($this->printedfootnotes as $element) { + foreach ($this->printedfootnotes as $element) { $h += $element->getFootnoteHeight($this, $cellWidth); } return $h; @@ -540,7 +540,7 @@ class ReportBaseHTML extends ReportBase { // Line Feed counter $lfct = count($lines); $wraptext = ''; - foreach($lines as $line) { + foreach ($lines as $line) { $wtext = ''; $wtext = utf8_wordwrap($line, $lw, "\n", true); $wraptext .= $wtext; @@ -821,7 +821,7 @@ class HtmlHTML extends Html { if (!empty($this->attrs["pgvrstyle"])) $html->setCurrentStyle($this->attrs["pgvrstyle"]); $this->text = $this->getStart(). $this->text; - foreach($this->elements as $element) { + foreach ($this->elements as $element) { if (is_string($element) && $element=="footnotetexts") { $html->Footnotes(); } elseif (is_string($element) && $element=="addpage") { @@ -872,35 +872,35 @@ class TextBoxHTML extends TextBox { // Element counter $cE = count($this->elements); //-- collapse duplicate elements - for($i = 0; $i < $cE; $i++){ + for ($i = 0; $i < $cE; $i++) { $element = $this->elements[$i]; - if (is_object($element)){ - if ($element->get_type() == "Text"){ - if (!empty($footnote_element)){ + if (is_object($element)) { + if ($element->get_type() == "Text") { + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } $footnote_element = array(); } - if (empty($lastelement)){ + if (empty($lastelement)) { $lastelement = $element; } else { // Checking if the Text has the same style - if ($element->getStyleName() == $lastelement->getStyleName()){ + if ($element->getStyleName() == $lastelement->getStyleName()) { $lastelement->addText(str_replace("\n", "<br />", $element->getValue())); - } elseif (!empty($lastelement)){ + } elseif (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = $element; } } } // Collect the Footnote links - elseif ($element->get_type() == "Footnote"){ + elseif ($element->get_type() == "Footnote") { // Check if the Footnote has been set with it's link number $html->checkFootnote($element); // Save first the last element if any - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = array(); } @@ -908,28 +908,28 @@ class TextBoxHTML extends TextBox { $footnote_element[$element->num] = $element; } //-- do not keep empty footnotes - elseif (($element->get_type() != "Footnote") || (trim($element->getValue()) != "")){ - if (!empty($footnote_element)){ + elseif (($element->get_type() != "Footnote") || (trim($element->getValue()) != "")) { + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } $footnote_element = array(); } - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = array(); } $newelements[] = $element; } } else { - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = array(); } - if (!empty($footnote_element)){ + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } $footnote_element = array(); @@ -937,12 +937,12 @@ class TextBoxHTML extends TextBox { $newelements[] = $element; } } - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; } - if (!empty($footnote_element)){ + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } } @@ -1003,7 +1003,7 @@ class TextBoxHTML extends TextBox { $lw = array(); // Element counter $cE = count($this->elements); - for($i = 0; $i < $cE; $i++) { + for ($i = 0; $i < $cE; $i++) { if (is_object($this->elements[$i])) { $ew = $this->elements[$i]->setWrapWidth($cW - $w - 2, $cW); if ($ew == $cW) @@ -1093,7 +1093,7 @@ class TextBoxHTML extends TextBox { $html->SetXY(0, 0); // Print the text elements - foreach($this->elements as $element) { + foreach ($this->elements as $element) { if (is_object($element)) { $element->render($html, $cX, false); } elseif (is_string($element) && $element=="footnotetexts") { @@ -1228,7 +1228,7 @@ class TextHTML extends Text { $wrapWidthRemaining = $this->wrapWidthRemaining; $lines = explode("\n", $this->text); // Go throught the text line by line - foreach($lines as $line) { + foreach ($lines as $line) { // Line width in points + a little margin $lw = $html->GetStringWidth($line); // If the line has to be wraped @@ -1236,7 +1236,7 @@ class TextHTML extends Text { $words = explode(" ", $line); $addspace = count($words); $lw = 0; - foreach($words as $word) { + foreach ($words as $word) { $addspace--; $lw += $html->GetStringWidth($word." "); if ($lw <= $wrapWidthRemaining) { @@ -1368,7 +1368,7 @@ class FootnoteHTML extends Footnote { } // Returns the Object if already numbered else false - if (empty($this->num)){ + if (empty($this->num)) { $html->checkFootnote($this); } @@ -1384,7 +1384,7 @@ class FootnoteHTML extends Footnote { $wrapWidthRemaining = $this->wrapWidthRemaining; $lines = explode("\n", $this->numText); // Go throught the text line by line - foreach($lines as $line) { + foreach ($lines as $line) { // Line width in points + a little margin $lw = $html->GetStringWidth($line); // If the line has to be wraped @@ -1392,7 +1392,7 @@ class FootnoteHTML extends Footnote { $words = explode(" ", $line); $addspace = count($words); $lw = 0; - foreach($words as $word) { + foreach ($words as $word) { $addspace--; $lw += $html->GetStringWidth($word." "); if ($lw <= $wrapWidthRemaining) { @@ -1452,7 +1452,7 @@ class PageHeaderHTML extends PageHeader { function render(&$html) { $html->clearPageHeader(); - foreach($this->elements as $element) { + foreach ($this->elements as $element) { $html->addPageHeader($element); } } diff --git a/includes/classes/class_reportpdf.php b/includes/classes/class_reportpdf.php index bdcf6024a4..791bd8cb33 100644 --- a/includes/classes/class_reportpdf.php +++ b/includes/classes/class_reportpdf.php @@ -320,7 +320,7 @@ class PDF extends TCPDF { * PDF Header -PDF */ function Header() { - foreach($this->headerElements as $element) { + foreach ($this->headerElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -329,7 +329,7 @@ class PDF extends TCPDF { $this->newPage(); } } - foreach($this->pageHeaderElements as $element) { + foreach ($this->pageHeaderElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -345,7 +345,7 @@ class PDF extends TCPDF { */ function Body() { $this->AddPage(); - foreach($this->bodyElements as $key => $element) { + foreach ($this->bodyElements as $key => $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -362,7 +362,7 @@ class PDF extends TCPDF { * PDF Footnotes -PDF */ function Footnotes() { - foreach($this->printedfootnotes as $element) { + foreach ($this->printedfootnotes as $element) { if (($this->GetY() + $element->getFootnoteHeight($this)) > $this->getPageHeight()) { $this->AddPage(); } @@ -377,7 +377,7 @@ class PDF extends TCPDF { * PDF Footer -PDF */ function Footer() { - foreach($this->footerElements as $element) { + foreach ($this->footerElements as $element) { if (is_object($element)) { $element->render($this); } elseif (is_string($element) && $element=="footnotetexts") { @@ -519,7 +519,7 @@ class PDF extends TCPDF { */ function getMaxLineWidth() { $m = $this->getMargins(); - if ($this->getRTL()){ + if ($this->getRTL()) { return ($this->getRemainingWidth() + $m["right"]); } else { return ($this->getRemainingWidth() + $m["left"]); @@ -528,7 +528,7 @@ class PDF extends TCPDF { function getFootnotesHeight() { $h=0; - foreach($this->printedfootnotes as $element) { + foreach ($this->printedfootnotes as $element) { $h+=$element->getHeight($this); } return $h; @@ -556,7 +556,7 @@ class PDF extends TCPDF { $ct = count($this->printedfootnotes); $val = $footnote->getValue(); $i = 0; - while($i < $ct) { + while ($i < $ct) { if ($this->printedfootnotes[$i]->getValue() == $val) { // If this footnote already exist then set up the numbers for this object $footnote->setNum($i + 1); @@ -577,7 +577,7 @@ class PDF extends TCPDF { * This function will make sure that images will not be overwritten */ function newPage() { - if ($this->lastpicpage > $this->getPage()){ + if ($this->lastpicpage > $this->getPage()) { $this->setPage($this->lastpicpage); } $this->AddPage(); @@ -775,7 +775,7 @@ class HtmlPDF extends Html { } $this->text = $this->getStart().$this->text; - foreach($this->elements as $element) { + foreach ($this->elements as $element) { if (is_string($element) && $element=="footnotetexts") { $pdf->Footnotes(); } elseif (is_string($element) && $element=="addpage") { @@ -835,35 +835,35 @@ class TextBoxPDF extends TextBox { // Element counter $cE = count($this->elements); //-- collapse duplicate elements - for($i = 0; $i < $cE; $i++){ + for ($i = 0; $i < $cE; $i++) { $element = $this->elements[$i]; - if (is_object($element)){ - if ($element->get_type() == "Text"){ - if (!empty($footnote_element)){ + if (is_object($element)) { + if ($element->get_type() == "Text") { + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } $footnote_element = array(); } - if (empty($lastelement)){ + if (empty($lastelement)) { $lastelement = $element; } else { // Checking if the Text has the same style - if ($element->getStyleName() == $lastelement->getStyleName()){ + if ($element->getStyleName() == $lastelement->getStyleName()) { $lastelement->addText(str_replace("\n", "<br />", $element->getValue())); - } elseif (!empty($lastelement)){ + } elseif (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = $element; } } } // Collect the Footnote links - elseif ($element->get_type() == "Footnote"){ + elseif ($element->get_type() == "Footnote") { // Check if the Footnote has been set with it's link number $pdf->checkFootnote($element); // Save first the last element if any - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = array(); } @@ -871,28 +871,28 @@ class TextBoxPDF extends TextBox { $footnote_element[$element->num] = $element; } //-- do not keep empty footnotes - elseif (($element->get_type() != "Footnote") || (trim($element->getValue()) != "")){ - if (!empty($footnote_element)){ + elseif (($element->get_type() != "Footnote") || (trim($element->getValue()) != "")) { + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } $footnote_element = array(); } - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = array(); } $newelements[] = $element; } } else { - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; $lastelement = array(); } - if (!empty($footnote_element)){ + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } $footnote_element = array(); @@ -900,12 +900,12 @@ class TextBoxPDF extends TextBox { $newelements[] = $element; } } - if (!empty($lastelement)){ + if (!empty($lastelement)) { $newelements[] = $lastelement; } - if (!empty($footnote_element)){ + if (!empty($footnote_element)) { ksort($footnote_element); - foreach ($footnote_element as $links){ + foreach ($footnote_element as $links) { $newelements[] = $links; } } @@ -964,7 +964,7 @@ class TextBoxPDF extends TextBox { // Element counter $cE = count($this->elements); //-- calculate the text box height + width - for($i = 0; $i < $cE; $i++) { + for ($i = 0; $i < $cE; $i++) { if (is_object($this->elements[$i])) { $ew = $this->elements[$i]->setWrapWidth($cWT - $w, $cWT); if ($ew == $cWT) { @@ -1059,7 +1059,7 @@ class TextBoxPDF extends TextBox { } // Change the margins X, Width if (!$pdf->getRTL()) { - if ($this->padding){ + if ($this->padding) { $pdf->SetLeftMargin($cX + $cM["cell"]); $pdf->SetRightMargin($pdf->getRemainingWidthPDF() - $cW + $cM["right"]); } @@ -1068,7 +1068,7 @@ class TextBoxPDF extends TextBox { $pdf->SetRightMargin($pdf->getRemainingWidthPDF() - $cW + $cM["right"]); } } else { - if ($this->padding){ + if ($this->padding) { $pdf->SetRightMargin($cX + $cM["cell"]); $pdf->SetLeftMargin($pdf->getRemainingWidthPDF() - $cW + $cM["left"]); } else { @@ -1080,7 +1080,7 @@ class TextBoxPDF extends TextBox { $cPN = $pdf->getPage(); // Render the elements (write text, print picture...) - foreach($this->elements as $element) { + foreach ($this->elements as $element) { if (is_object($element)) { $element->render($pdf); } elseif (is_string($element) and $element == "footnotetexts") { @@ -1201,7 +1201,7 @@ class TextPDF extends Text { $newtext = ""; $lines = explode("\n", $this->text); // Go throught the text line by line - foreach($lines as $line) { + foreach ($lines as $line) { // Line width in points + a little margin $lw = $pdf->GetStringWidth($line); // If the line has to be wraped @@ -1209,7 +1209,7 @@ class TextPDF extends Text { $words = explode(" ", $line); $addspace = count($words); $lw = 0; - foreach($words as $word) { + foreach ($words as $word) { $addspace--; $lw += $pdf->GetStringWidth($word." "); if ($lw <= $wrapWidthRemaining) { @@ -1337,7 +1337,7 @@ class FootnotePDF extends Footnote { } // Returns the Object if already numbered else false - if (empty($this->num)){ + if (empty($this->num)) { $pdf->checkFootnote($this); } @@ -1354,7 +1354,7 @@ class FootnotePDF extends Footnote { $newtext = ""; $lines = explode("\n", $this->numText); // Go throught the text line by line - foreach($lines as $line) { + foreach ($lines as $line) { // Line width in points $lw = ceil($pdf->GetStringWidth($line)); // If the line has to be wraped @@ -1362,7 +1362,7 @@ class FootnotePDF extends Footnote { $words = explode(" ", $line); $addspace = count($words); $lw = 0; - foreach($words as $word) { + foreach ($words as $word) { $addspace--; $lw += ceil($pdf->GetStringWidth($word." ")); if ($lw < $wrapWidthRemaining) { @@ -1426,7 +1426,7 @@ class PageHeaderPDF extends PageHeader { */ function render(&$pdf) { $pdf->clearPageHeader(); - foreach($this->elements as $element) { + foreach ($this->elements as $element) { $pdf->addPageHeader($element); } } diff --git a/includes/classes/class_serviceclient.php b/includes/classes/class_serviceclient.php index bc4e09b6be..17aa414b13 100644 --- a/includes/classes/class_serviceclient.php +++ b/includes/classes/class_serviceclient.php @@ -162,7 +162,7 @@ class ServiceClient extends GedcomRecord { $this->authenticate(); $info = $this->soapClient->ServiceInfo(); //print_r($info); - foreach($info->gedcoms as $ind=>$gedobj) { + foreach ($info->gedcoms as $ind=>$gedobj) { if ($gedobj->ID==$this->gedfile) break; } $this->title = $gedobj->title; @@ -183,20 +183,20 @@ class ServiceClient extends GedcomRecord { $newrecs = array(); //-- make sure we don't get circular links - foreach($remoterecs as $ind2=>$subrec2) { + foreach ($remoterecs as $ind2=>$subrec2) { if (strpos($subrec2, "1 RFN")===false) { $newrecs[] = $subrec2; } } - foreach($localrecs as $ind=>$subrec) { + foreach ($localrecs as $ind=>$subrec) { $found = false; if (strpos($subrec, "1 CHAN")===false) { $subrec = trim($subrec); $orig_subrec = $subrec; $subrec = preg_replace("/\s+/", " ", $subrec); - foreach($remoterecs as $ind2=>$subrec2) { + foreach ($remoterecs as $ind2=>$subrec2) { $subrec2 = trim($subrec2); $subrec2 = preg_replace("/\s+/", " ", $subrec2); @@ -222,7 +222,7 @@ class ServiceClient extends GedcomRecord { $ct = preg_match("/0 @(.*)@ (\w*)/", $record2, $match); if ($ct>0) $localrec = preg_replace("/0 @(.*)@ (\w*)/", "0 @$1@ ".trim($match[2]), $localrec); //-- add all of the new records - foreach($newrecs as $ind=>$subrec) { + foreach ($newrecs as $ind=>$subrec) { $localrec .= trim($subrec)."\n"; } $localrec = trim($localrec); @@ -252,7 +252,7 @@ class ServiceClient extends GedcomRecord { /** * Updates Family Records such as children, spouse, and parents */ - function UpdateFamily($record1,$record2){ + function UpdateFamily($record1,$record2) { // This makes sure there is a record in both the server and client else it returns the record that // exist if any if (empty($record1)) { @@ -268,7 +268,7 @@ class ServiceClient extends GedcomRecord { if ($ct>0) { $personId1 = $match[1]; $type1 = trim($match[2]); - if ($type1!="INDI"){ + if ($type1!="INDI") { return $record1; } } @@ -276,7 +276,7 @@ class ServiceClient extends GedcomRecord { if ($ct>0) { $personId2 = $match[1]; $type2 = trim($match[2]); - if ($type2!="INDI"){ + if ($type2!="INDI") { return $record1; } } @@ -297,22 +297,22 @@ class ServiceClient extends GedcomRecord { $firstTimeFamily=true; // starting the comparisons for family as child - if(empty($List1FamilyChildID)){ + if (empty($List1FamilyChildID)) { //-- add all remote ids - foreach($List2FamilyChildID as $famc=>$famCild2){ + foreach ($List2FamilyChildID as $famc=>$famCild2) { $FamilyListChild[] = $famCild2; } - } elseif(empty($List2FamilyChildID)){ + } elseif (empty($List2FamilyChildID)) { //-- nothing to do if there are no remote families } else { // Creating the first family - foreach($List1FamilyChildID as $famc=>$famCild1){ - if(!empty($famCild1)){ + foreach ($List1FamilyChildID as $famc=>$famCild1) { + if (!empty($famCild1)) { // Creating the Secound Family - foreach($List2FamilyChildID as $famc=>$famCild2){ - if(!empty($famCild2)){ - if(!$this->CompairForUpdateFamily($famCild1,$famCild2)){ - if($firstTimeFamily){ + foreach ($List2FamilyChildID as $famc=>$famCild2) { + if (!empty($famCild2)) { + if (!$this->CompairForUpdateFamily($famCild1,$famCild2)) { + if ($firstTimeFamily) { $FamilyListChild[] = $famCild2; } } else { @@ -324,24 +324,24 @@ class ServiceClient extends GedcomRecord { } } // starting the comparisons for family as spouse - if(empty($List1FamilySpouseID)){ + if (empty($List1FamilySpouseID)) { //-- add all remote ids - foreach($List2FamilySpouseID as $fams=>$famSpouse2){ - if(!empty($famSpouse2)){ + foreach ($List2FamilySpouseID as $fams=>$famSpouse2) { + if (!empty($famSpouse2)) { $FamilyListSpouse[] = $famSpouse2; } } - } elseif(empty($List2FamilySpouseID)){ + } elseif (empty($List2FamilySpouseID)) { //-- don't do anything if there are no remote families } else { // Creating the first family - foreach($List1FamilySpouseID as $fams=>$famSpouse1){ - if(!empty($famSpouse1)){ + foreach ($List1FamilySpouseID as $fams=>$famSpouse1) { + if (!empty($famSpouse1)) { // Creating the Secound Family - foreach($List2FamilySpouseID as $fams=>$famSpouse2){ - if(!empty($famSpouse2)){ - if(!$this->CompairForUpdateFamily($famSpouse1,$famSpouse2)){ - if($firstTimeFamily){ + foreach ($List2FamilySpouseID as $fams=>$famSpouse2) { + if (!empty($famSpouse2)) { + if (!$this->CompairForUpdateFamily($famSpouse1,$famSpouse2)) { + if ($firstTimeFamily) { $FamilyListSpouse[] = $famSpouse2; } } else { @@ -353,15 +353,15 @@ class ServiceClient extends GedcomRecord { } } // This Adds any new familys to the person. - if (count($FamilyListChild)>0){ - for ($i=0;$i<count($FamilyListChild);$i++){ + if (count($FamilyListChild)>0) { + for ($i=0;$i<count($FamilyListChild);$i++) { $record1.="\n1 FAMC @"; if (strpos($FamilyListChild[$i], $this->xref)!==0) $record1 .= $this->xref.":"; $record1 .= $FamilyListChild[$i]."@"; } } - if(count($FamilyListSpouse)>0){ - for($i=0;$i<count($FamilyListSpouse);$i++){ + if (count($FamilyListSpouse)>0) { + for ($i=0;$i<count($FamilyListSpouse);$i++) { $record1.="\n1 FAMS @"; if (strpos($FamilyListSpouse[$i], $this->xref)!==0) $record1 .= $this->xref.":"; $record1 .= $FamilyListSpouse[$i]."@"; @@ -373,7 +373,7 @@ class ServiceClient extends GedcomRecord { /** * This mergest the the two familys together */ - function MergeForUpdateFamily($Family1,$Family2,$Familylist,&$FamilyListReturn){ + function MergeForUpdateFamily($Family1,$Family2,$Familylist,&$FamilyListReturn) { global $GEDCOM; require_once WT_ROOT.'includes/functions/functions_edit.php'; @@ -408,40 +408,40 @@ class ServiceClient extends GedcomRecord { $children1=$family1->getChildren(); $children2=$family2->getChildren(); - if(count($FamilyListReturn)>0){ // removes the updated family from the list so it does not get added later. + if (count($FamilyListReturn)>0) { // removes the updated family from the list so it does not get added later. $index=null; - for($i=0; $i<count($FamilyListReturn); $i++){ - if($FamilyListReturn[$i]==$Family2){ + for ($i=0; $i<count($FamilyListReturn); $i++) { + if ($FamilyListReturn[$i]==$Family2) { $ndex=$i; break; } } - if($index!=null){ + if ($index!=null) { unset($FamilyListReturn[$index]); } } $famupdated = false; // Merging starts here, the merging of children. - if(empty($children1)) { + if (empty($children1)) { $children1=$children2; - } elseif(empty($children2)) { + } elseif (empty($children2)) { } else { // Children are looped to see if they need to be added or merged to an esisting child - foreach($children2 as $childID2=>$Child2){ - if(!empty($Child2)) { + foreach ($children2 as $childID2=>$Child2) { + if (!empty($Child2)) { //echo "<br/>child 2 Xref ".$Child2->getXref()."-".$childID2; $found = false; //-- compare to children in local family - foreach($children1 as $childID1=>$Child1){ - if(!empty($Child1)){ + foreach ($children1 as $childID1=>$Child1) { + if (!empty($Child1)) { //echo "<br/>child 2 Xref ".$Child2->getXref()." == ".$Child1->getXref(); $found=$this->ComparePeople($Child1,$Child2); if ($found) break; } } - if($found){ + if ($found) { $childrec = $Child1->getGedcomRecord(); if (strpos($childrec, "1 RFN ".$this->xref.":")===false) { $childrec .= "\n1 RFN ".$Child2->getXref(); @@ -469,15 +469,15 @@ class ServiceClient extends GedcomRecord { } // Merge Father basicly they just add the rfn numer and let the merge handle it latter - if(empty($father1)){ - if(!empty($father2)){ + if (empty($father1)) { + if (!empty($father2)) { $father1=$father2; $famrec1 .="\n1 HUSB @".$father1->getXref()."@"; //echo "<br/> adding for fahter ".$father1->getXref(); replace_gedrec($family1->getXref(), WT_GED_ID, $famrec1); } - } elseif(!empty($father2)){ - if($this->ComparePeople($father1,$father2)){ + } elseif (!empty($father2)) { + if ($this->ComparePeople($father1,$father2)) { $fatherrec = $father1->getGedcomRecord(); if (strpos($fatherrec, "1 RFN ".$this->xref.":")===false) { $fatherrec .= "\n1 RFN ".$father2->getXref(); @@ -488,15 +488,15 @@ class ServiceClient extends GedcomRecord { } } // Merge Mother - if(empty($mother1)){ - if(!empty($mother2)){ + if (empty($mother1)) { + if (!empty($mother2)) { $mother1=$mother2; $famrec1 .="\n1 WIFE @".$mother1->getXref()."@"; //echo "<br/> adding for mother ".$mother1->getXref(); replace_gedrec($family1->getXref(), WT_GED_ID, $famrec1); } - } else if(!empty($mother2)){ - if($this->ComparePeople($mother1,$mother2)){ + } else if (!empty($mother2)) { + if ($this->ComparePeople($mother1,$mother2)) { $motherrec = $mother1->getGedcomRecord(); if (strpos($motherrec, "1 RFN ".$this->xref.":")===false) { $motherrec .= "\n1 RFN ".$mother2->getXref(); @@ -544,11 +544,11 @@ class ServiceClient extends GedcomRecord { } $father2 = $family2->getHusband(); $CountFamily2+=1.0; - if(empty($father1)){ + if (empty($father1)) { unset($father1); $CountFamily1-=1.0; } - if(empty($father2)){ + if (empty($father2)) { unset($father2); $CountFamily2-=1.0; } @@ -556,11 +556,11 @@ class ServiceClient extends GedcomRecord { // Creat the mothers if their is some $mother2=$family2->getWife(); $CountFamily2+=1.0; - if(empty($mother1)){ + if (empty($mother1)) { unset($mother1); $CountFamily1-=1.0; } - if(empty($mother2)){ + if (empty($mother2)) { unset($mother2); $CountFamily2-=1.0; } @@ -572,11 +572,11 @@ class ServiceClient extends GedcomRecord { // finds the probablity that they are the same family Bassed of both sites information $CountFamily1 += count($children1); $CountFamily2 += count($children2); - foreach($children1 as $childID1=>$Person1){ + foreach ($children1 as $childID1=>$Person1) { if (!empty($Person1)) { - foreach($children2 as $childID2=>$Person2){ - if(!empty($Person2)){ - if($this->ComparePeople($Person1,$Person2)){ + foreach ($children2 as $childID2=>$Person2) { + if (!empty($Person2)) { + if ($this->ComparePeople($Person1,$Person2)) { $ChanceSameFamily+=1.0; //echo "<br />".$Person1->getXref()." equals ".$Person2->getXref(); break; @@ -586,27 +586,27 @@ class ServiceClient extends GedcomRecord { } } - if(empty($father1)) { - } elseif(empty($father2)){ + if (empty($father1)) { + } elseif (empty($father2)) { } else { - if($this->ComparePeople($father1,$father2)){ + if ($this->ComparePeople($father1,$father2)) { $ChanceSameFamily+=1.0; } } - if(empty($mother1)) { - } elseif(empty($mother2)) { + if (empty($mother1)) { + } elseif (empty($mother2)) { } else { - if($this->ComparePeople($mother1,$mother2)){ + if ($this->ComparePeople($mother1,$mother2)) { $ChanceSameFamily+=1.0; } } - if($CountFamily1!=0&&$CountFamily2!=0){ + if ($CountFamily1!=0&&$CountFamily2!=0) { $ChanceSame=(($ChanceSameFamily/$CountFamily1)+($ChanceSameFamily/$CountFamily2))/2; //echo "<br />chancesame=".$ChanceSameFamily." count1=".$CountFamily1." count2=".$CountFamily2." ".$family1->getXref()." compared to ".$family2->getXref()." is ".$ChanceSame; } else return false; - if($ChanceSame<0.5){ // If the probabilty is less then 0.5 or 50% then the current family is stored here to be added later + if ($ChanceSame<0.5) { // If the probabilty is less then 0.5 or 50% then the current family is stored here to be added later return false; } else { return true; } } @@ -636,7 +636,7 @@ class ServiceClient extends GedcomRecord { * false if they are not. It only compares the name, sex birthdate, and deathdate * of the person */ - static function ComparePeople(&$Person1,&$Person2){ + static function ComparePeople(&$Person1,&$Person2) { $PersonName1=$Person1->getFullName(); $PersonSex1=$Person1->getSex(); $PersonBirth1=$Person1->getEstimatedBirthDate(); @@ -649,9 +649,9 @@ class ServiceClient extends GedcomRecord { $count=0; $Probability=0; - if (!empty($PersonName1)&&!empty($PersonName2)){ + if (!empty($PersonName1)&&!empty($PersonName2)) { $lev = levenshtein(utf8_strtolower($PersonName1), utf8_strtolower($PersonName2)); - if($lev<4){ + if ($lev<4) { $Probability+=2; } else $Probability-=2; @@ -686,7 +686,7 @@ class ServiceClient extends GedcomRecord { } $prob=$Probability/$count; - if($prob<0.5){ + if ($prob<0.5) { return false; } else { return true; @@ -702,7 +702,7 @@ class ServiceClient extends GedcomRecord { function checkIds($gedrec) { $ids_checked = array(); $ct = preg_match_all("/@(".$this->xref.":.*)@/", $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $id = trim($match[$i][1]); if (isset($ids_checked[$id])) continue; $ids_checked[$id]=true; @@ -870,7 +870,7 @@ class ServiceClient extends GedcomRecord { if (isset($namespace[0]) && isset($wsdl->bindings[$namespace[0]]['operations'])) { $operations = array_keys($wsdl->bindings[$namespace[0]]['operations']); - for($i = 0; $i<count($operations); $i++) { + for ($i = 0; $i<count($operations); $i++) { $wsdl->bindings[$namespace[0]]['operations'][$operations[$i]]['input']['use'] = 'literal'; $wsdl->bindings[$namespace[0]]['operations'][$operations[$i]]['output']['use'] = 'literal'; } diff --git a/includes/classes/class_stats.php b/includes/classes/class_stats.php index 830ab8357f..7d622a5d19 100644 --- a/includes/classes/class_stats.php +++ b/includes/classes/class_stats.php @@ -389,9 +389,9 @@ class stats { function chartIndisWithSources($params=null) { global $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot_indi = $this->totalIndividuals(); if ($tot_indi==0) { @@ -428,9 +428,9 @@ class stats { function chartFamsWithSources($params=null) { global $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot_fam = $this->totalFamilies(); $tot_sfam = $this->totalFamsWithSources(); @@ -634,10 +634,10 @@ class stats { function chartSex($params=null) { global $TEXT_DIRECTION, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_female = strtolower($params[1]);}else{$color_female = 'ffd1dc';} - if (isset($params[2]) && $params[2] != '') {$color_male = strtolower($params[2]);}else{$color_male = '84beff';} - if (isset($params[3]) && $params[3] != '') {$color_unknown = strtolower($params[3]);}else{$color_unknown = '777777';} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_female = strtolower($params[1]);} else {$color_female = 'ffd1dc';} + if (isset($params[2]) && $params[2] != '') {$color_male = strtolower($params[2]);} else {$color_male = '84beff';} + if (isset($params[3]) && $params[3] != '') {$color_unknown = strtolower($params[3]);} else {$color_unknown = '777777';} $sizes = explode('x', $size); $tot_f = $this->totalSexFemalesPercentage(); $tot_m = $this->totalSexMalesPercentage(); @@ -708,10 +708,10 @@ class stats { function chartMortality($params=null) { global $TEXT_DIRECTION, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_living = strtolower($params[1]);}else{$color_living = 'ffffff';} - if (isset($params[2]) && $params[2] != '') {$color_dead = strtolower($params[2]);}else{$color_dead = 'cccccc';} - if (isset($params[3]) && $params[3] != '') {$color_unknown = strtolower($params[3]);}else{$color_unknown = '777777';} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_living = strtolower($params[1]);} else {$color_living = 'ffffff';} + if (isset($params[2]) && $params[2] != '') {$color_dead = strtolower($params[2]);} else {$color_dead = 'cccccc';} + if (isset($params[3]) && $params[3] != '') {$color_unknown = strtolower($params[3]);} else {$color_unknown = '777777';} $sizes = explode('x', $size); $tot_l = $this->totalLivingPercentage(); $tot_d = $this->totalDeceasedPercentage(); @@ -806,9 +806,9 @@ class stats { function chartMedia($params=null) { global $TEXT_DIRECTION, $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y, $MEDIA_TYPES; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot = $this->_totalMediaType('all'); // Beware divide by zero @@ -1305,9 +1305,9 @@ class stats { } $rows=self::_runSQL($sql); if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot = 0; foreach ($rows as $values) { @@ -1363,9 +1363,9 @@ class stats { } $rows=self::_runSQL($sql); if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot = 0; foreach ($rows as $values) { @@ -1527,7 +1527,7 @@ class stats { } else { $sex_search = ''; } - if ($params !== null && isset($params[0])) {$total = $params[0];}else{$total = 10;} + if ($params !== null && isset($params[0])) {$total = $params[0];} else {$total = 10;} $total=(int)$total; $rows=self::_runSQL('' .' SELECT ' @@ -1599,7 +1599,7 @@ class stats { } else { $sex_search = ''; } - if ($params !== null && isset($params[0])) {$total = $params[0];}else{$total = 10;} + if ($params !== null && isset($params[0])) {$total = $params[0];} else {$total = 10;} $total=(int)$total; $rows=self::_runSQL('' .' SELECT' @@ -1700,7 +1700,7 @@ class stats { function statsAge($simple=true, $related='BIRT', $sex='BOTH', $year1=-1, $year2=-1, $params=null) { if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = '230x250';} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = '230x250';} $sizes = explode('x', $size); $rows=self::_runSQL('' .' SELECT' @@ -1763,7 +1763,7 @@ class stats { } else { $offset = 0; $counter = array(); - while($offset = strpos($title, " ", $offset + 1)){ + while ($offset = strpos($title, " ", $offset + 1)) { $counter[] = $offset; } $half = floor(count($counter)/2); @@ -1957,7 +1957,7 @@ class stats { * Query the database for marriage tags. */ function _marriageQuery($type='full', $age_dir='ASC', $sex='F', $show_years=false) { - if ($sex == 'F') {$sex_field = 'f_wife';}else{$sex_field = 'f_husb';} + if ($sex == 'F') {$sex_field = 'f_wife';} else {$sex_field = 'f_husb';} if ($age_dir != 'ASC') {$age_dir = 'DESC';} $rows=self::_runSQL('' /* //old @@ -2079,7 +2079,7 @@ class stats { function _ageOfMarriageQuery($type='list', $age_dir='ASC', $params=null) { global $TEXT_DIRECTION; - if ($params !== null && isset($params[0])) {$total = $params[0];}else{$total = 10;} + if ($params !== null && isset($params[0])) {$total = $params[0];} else {$total = 10;} if ($age_dir != 'ASC') {$age_dir = 'DESC';} $hrows=self::_runSQL('' .' SELECT DISTINCT' @@ -2211,7 +2211,7 @@ class stats { function _ageBetweenSpousesQuery($type='list', $age_dir='DESC', $params=null) { global $TEXT_DIRECTION; - if ($params !== null && isset($params[0])) {$total = $params[0];}else{$total = 10;} + if ($params !== null && isset($params[0])) {$total = $params[0];} else {$total = 10;} if ($age_dir=='DESC') { $query1 = ' MIN(wifebirth.d_julianday2-husbbirth.d_julianday1) AS age'; $query2 = ' wifebirth.d_julianday2 >= husbbirth.d_julianday1 AND' @@ -2281,7 +2281,7 @@ class stats { } function _parentsQuery($type='full', $age_dir='ASC', $sex='F', $show_years=false) { - if ($sex == 'F') {$sex_field = 'WIFE';}else{$sex_field = 'HUSB';} + if ($sex == 'F') {$sex_field = 'WIFE';} else {$sex_field = 'HUSB';} if ($age_dir != 'ASC') {$age_dir = 'DESC';} $rows=self::_runSQL('' .' SELECT' @@ -2396,9 +2396,9 @@ class stats { $rows=self::_runSQL($sql); if (!isset($rows)) {return 0;} if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot = 0; foreach ($rows as $values) { @@ -2472,9 +2472,9 @@ class stats { $rows=self::_runSQL($sql); if (!isset($rows)) {return 0;} if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} $sizes = explode('x', $size); $tot = 0; foreach ($rows as $values) { @@ -2523,7 +2523,7 @@ class stats { function statsMarrAge($simple=true, $sex='M', $year1=-1, $year2=-1, $params=null) { if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = '200x250';} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = '200x250';} $sizes = explode('x', $size); $rows=self::_runSQL('' .' SELECT' @@ -2607,7 +2607,7 @@ class stats { } else { $offset = 0; $counter = array(); - while($offset = strpos(i18n::translate('Average age in century of marriage'), " ", $offset + 1)){ + while ($offset = strpos(i18n::translate('Average age in century of marriage'), " ", $offset + 1)) { $counter[] = $offset; } $half = floor(count($counter)/2); @@ -2789,7 +2789,7 @@ class stats { function _topTenFamilyQuery($type='list', $params=null) { global $TEXT_DIRECTION; - if ($params !== null && isset($params[0])) {$total = $params[0];}else{$total = 10;} + if ($params !== null && isset($params[0])) {$total = $params[0];} else {$total = 10;} $total=(int)$total; $rows=self::_runSQL('' .' SELECT' @@ -2803,7 +2803,7 @@ class stats { .' tot DESC LIMIT '.$total ); if (!isset($rows[0])) {return '';} - if(count($rows) < $total){$total = count($rows);} + if (count($rows) < $total) {$total = count($rows);} $top10 = array(); for ($c = 0; $c < $total; $c++) { $family=Family::getInstance($rows[$c]['id']); @@ -2832,8 +2832,8 @@ class stats { function _ageBetweenSiblingsQuery($type='list', $params=null) { global $TEXT_DIRECTION; if ($params === null) {$params = array();} - if (isset($params[0])) {$total = $params[0];}else{$total = 10;} - if (isset($params[1])) {$one = $params[1];}else{$one = false;} // each family only once if true + if (isset($params[0])) {$total = $params[0];} else {$total = 10;} + if (isset($params[1])) {$one = $params[1];} else {$one = false;} // each family only once if true $total=(int)$total; $rows=self::_runSQL('' .' SELECT DISTINCT' @@ -2950,10 +2950,10 @@ class stats { function chartLargestFamilies($params=null) { global $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_L_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_L_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} - if (isset($params[3]) && $params[3] != '') {$total = strtolower($params[3]);}else{$total = 10;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_L_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[3]) && $params[3] != '') {$total = strtolower($params[3]);} else {$total = 10;} $sizes = explode('x', $size); $total=(int)$total; $rows=self::_runSQL('' @@ -2972,7 +2972,7 @@ class stats { foreach ($rows as $row) {$tot += $row['tot'];} $chd = ''; $chl = array(); - foreach ($rows as $row){ + foreach ($rows as $row) { $family=Family::getInstance($row['id']); if ($family->canDisplayDetails()) { if ($tot==0) { @@ -3004,7 +3004,7 @@ class stats { function statsChildren($simple=true, $sex='BOTH', $year1=-1, $year2=-1, $params=null) { if ($simple) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = '220x200';} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = '220x200';} $sizes = explode('x', $size); $max = 0; $rows=self::_runSQL('' @@ -3139,7 +3139,7 @@ class stats { } function chartNoChildrenFamilies($year1=-1, $year2=-1, $params=null) { - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = '220x200';} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = '220x200';} $sizes = explode('x', $size); if ($year1>=0 && $year2>=0) { $years = " married.d_year BETWEEN '{$year1}' AND '{$year2}' AND"; @@ -3207,7 +3207,7 @@ class stats { function _topTenGrandFamilyQuery($type='list', $params=null) { global $TEXT_DIRECTION; - if ($params !== null && isset($params[0])) {$total = $params[0];}else{$total = 10;} + if ($params !== null && isset($params[0])) {$total = $params[0];} else {$total = 10;} $total=(int)$total; $rows=self::_runSQL('' .' SELECT' @@ -3271,9 +3271,9 @@ class stats { global $TEXT_DIRECTION, $SURNAME_LIST_STYLE, $GEDCOM; $ged_id=get_id_from_gedcom($GEDCOM); - if (is_array($params) && isset($params[0]) && $params[0] != '') {$threshold = strtolower($params[0]);}else{$threshold = get_gedcom_setting($ged_id, 'COMMON_NAMES_THRESHOLD');} - if(is_array($params) && isset($params[1]) && $params[1] != '' && $params[1] >= 0){$maxtoshow = strtolower($params[1]);}else{$maxtoshow = false;} - if(is_array($params) && isset($params[2]) && $params[2] != ''){$sorting = strtolower($params[2]);}else{$sorting = 'alpha';} + if (is_array($params) && isset($params[0]) && $params[0] != '') {$threshold = strtolower($params[0]);} else {$threshold = get_gedcom_setting($ged_id, 'COMMON_NAMES_THRESHOLD');} + if (is_array($params) && isset($params[1]) && $params[1] != '' && $params[1] >= 0) {$maxtoshow = strtolower($params[1]);} else {$maxtoshow = false;} + if (is_array($params) && isset($params[2]) && $params[2] != '') {$sorting = strtolower($params[2]);} else {$sorting = 'alpha';} $surname_list = get_common_surnames($threshold); if (count($surname_list) == 0) return ''; uasort($surname_list, array('stats', '_name_total_rsort')); @@ -3317,11 +3317,11 @@ class stats { function chartCommonSurnames($params=null) { global $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} - if (isset($params[3]) && $params[3] != '') {$threshold = strtolower($params[3]);}else{$threshold = get_gedcom_setting($this->_ged_id, 'COMMON_NAMES_THRESHOLD');} - if (isset($params[4]) && $params[4] != '') {$maxtoshow = strtolower($params[4]);}else{$maxtoshow = 7;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[3]) && $params[3] != '') {$threshold = strtolower($params[3]);} else {$threshold = get_gedcom_setting($this->_ged_id, 'COMMON_NAMES_THRESHOLD');} + if (isset($params[4]) && $params[4] != '') {$maxtoshow = strtolower($params[4]);} else {$maxtoshow = 7;} $sizes = explode('x', $size); $tot_indi = $this->totalIndividuals(); $surnames = get_common_surnames($threshold); @@ -3383,9 +3383,9 @@ class stats { static $sort_types = array('count'=>'asort', 'rcount'=>'arsort', 'alpha'=>'ksort', 'ralpha'=>'krsort'); static $sort_flags = array('count'=>SORT_NUMERIC, 'rcount'=>SORT_NUMERIC, 'alpha'=>SORT_STRING, 'ralpha'=>SORT_STRING); - if(is_array($params) && isset($params[0]) && $params[0] != '' && $params[0] >= 0){$threshold = strtolower($params[0]);}else{$threshold = 1;} - if(is_array($params) && isset($params[1]) && $params[1] != '' && $params[1] >= 0){$maxtoshow = strtolower($params[1]);}else{$maxtoshow = 10;} - if(is_array($params) && isset($params[2]) && $params[2] != '' && isset($sort_types[strtolower($params[2])])){$sorting = strtolower($params[2]);}else{$sorting = 'rcount';} + if (is_array($params) && isset($params[0]) && $params[0] != '' && $params[0] >= 0) {$threshold = strtolower($params[0]);} else {$threshold = 1;} + if (is_array($params) && isset($params[1]) && $params[1] != '' && $params[1] >= 0) {$maxtoshow = strtolower($params[1]);} else {$maxtoshow = 10;} + if (is_array($params) && isset($params[2]) && $params[2] != '' && isset($sort_types[strtolower($params[2])])) {$sorting = strtolower($params[2]);} else {$sorting = 'rcount';} switch ($sex) { case 'M': @@ -3426,7 +3426,7 @@ class stats { if ($type=='chart') return $nameList; $common = array(); foreach ($nameList as $given=>$total) { - if ($maxtoshow !== -1) {if($maxtoshow-- <= 0){break;}} + if ($maxtoshow !== -1) {if ($maxtoshow-- <= 0) {break;}} if ($total < $threshold) {break;} if ($show_tot) { $tot = PrintReady("[{$total}]"); @@ -3468,38 +3468,38 @@ class stats { } } - static function commonGiven($params=array(1,10,'alpha')){return self::_commonGivenQuery('B', 'nolist', false, $params);} - static function commonGivenTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('B', 'nolist', true, $params);} - static function commonGivenList($params=array(1,10,'alpha')){return self::_commonGivenQuery('B', 'list', false, $params);} - static function commonGivenListTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('B', 'list', true, $params);} - static function commonGivenTable($params=array(1,10,'rcount')){return self::_commonGivenQuery('B', 'table', false, $params);} + static function commonGiven($params=array(1,10,'alpha')) {return self::_commonGivenQuery('B', 'nolist', false, $params);} + static function commonGivenTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('B', 'nolist', true, $params);} + static function commonGivenList($params=array(1,10,'alpha')) {return self::_commonGivenQuery('B', 'list', false, $params);} + static function commonGivenListTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('B', 'list', true, $params);} + static function commonGivenTable($params=array(1,10,'rcount')) {return self::_commonGivenQuery('B', 'table', false, $params);} - static function commonGivenFemale($params=array(1,10,'alpha')){return self::_commonGivenQuery('F', 'nolist', false, $params);} - static function commonGivenFemaleTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('F', 'nolist', true, $params);} - static function commonGivenFemaleList($params=array(1,10,'alpha')){return self::_commonGivenQuery('F', 'list', false, $params);} - static function commonGivenFemaleListTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('F', 'list', true, $params);} - static function commonGivenFemaleTable($params=array(1,10,'rcount')){return self::_commonGivenQuery('F', 'table', false, $params);} + static function commonGivenFemale($params=array(1,10,'alpha')) {return self::_commonGivenQuery('F', 'nolist', false, $params);} + static function commonGivenFemaleTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('F', 'nolist', true, $params);} + static function commonGivenFemaleList($params=array(1,10,'alpha')) {return self::_commonGivenQuery('F', 'list', false, $params);} + static function commonGivenFemaleListTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('F', 'list', true, $params);} + static function commonGivenFemaleTable($params=array(1,10,'rcount')) {return self::_commonGivenQuery('F', 'table', false, $params);} - static function commonGivenMale($params=array(1,10,'alpha')){return self::_commonGivenQuery('M', 'nolist', false, $params);} - static function commonGivenMaleTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('M', 'nolist', true, $params);} - static function commonGivenMaleList($params=array(1,10,'alpha')){return self::_commonGivenQuery('M', 'list', false, $params);} - static function commonGivenMaleListTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('M', 'list', true, $params);} - static function commonGivenMaleTable($params=array(1,10,'rcount')){return self::_commonGivenQuery('M', 'table', false, $params);} + static function commonGivenMale($params=array(1,10,'alpha')) {return self::_commonGivenQuery('M', 'nolist', false, $params);} + static function commonGivenMaleTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('M', 'nolist', true, $params);} + static function commonGivenMaleList($params=array(1,10,'alpha')) {return self::_commonGivenQuery('M', 'list', false, $params);} + static function commonGivenMaleListTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('M', 'list', true, $params);} + static function commonGivenMaleTable($params=array(1,10,'rcount')) {return self::_commonGivenQuery('M', 'table', false, $params);} - static function commonGivenUnknown($params=array(1,10,'alpha')){return self::_commonGivenQuery('U', 'nolist', false, $params);} - static function commonGivenUnknownTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('U', 'nolist', true, $params);} - static function commonGivenUnknownList($params=array(1,10,'alpha')){return self::_commonGivenQuery('U', 'list', false, $params);} - static function commonGivenUnknownListTotals($params=array(1,10,'rcount')){return self::_commonGivenQuery('U', 'list', true, $params);} - static function commonGivenUnknownTable($params=array(1,10,'rcount')){return self::_commonGivenQuery('U', 'table', false, $params);} + static function commonGivenUnknown($params=array(1,10,'alpha')) {return self::_commonGivenQuery('U', 'nolist', false, $params);} + static function commonGivenUnknownTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('U', 'nolist', true, $params);} + static function commonGivenUnknownList($params=array(1,10,'alpha')) {return self::_commonGivenQuery('U', 'list', false, $params);} + static function commonGivenUnknownListTotals($params=array(1,10,'rcount')) {return self::_commonGivenQuery('U', 'list', true, $params);} + static function commonGivenUnknownTable($params=array(1,10,'rcount')) {return self::_commonGivenQuery('U', 'table', false, $params);} function chartCommonGiven($params=null) { global $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_S_CHART_X, $WT_STATS_S_CHART_Y; if ($params === null) {$params = array();} - if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);}else{$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} - if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);}else{$color_from = $WT_STATS_CHART_COLOR1;} - if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);}else{$color_to = $WT_STATS_CHART_COLOR2;} - if (isset($params[3]) && $params[3] != '') {$threshold = strtolower($params[3]);}else{$threshold = get_gedcom_setting($this->_ged_id, 'COMMON_NAMES_THRESHOLD');} - if (isset($params[4]) && $params[4] != '') {$maxtoshow = strtolower($params[4]);}else{$maxtoshow = 7;} + if (isset($params[0]) && $params[0] != '') {$size = strtolower($params[0]);} else {$size = $WT_STATS_S_CHART_X."x".$WT_STATS_S_CHART_Y;} + if (isset($params[1]) && $params[1] != '') {$color_from = strtolower($params[1]);} else {$color_from = $WT_STATS_CHART_COLOR1;} + if (isset($params[2]) && $params[2] != '') {$color_to = strtolower($params[2]);} else {$color_to = $WT_STATS_CHART_COLOR2;} + if (isset($params[3]) && $params[3] != '') {$threshold = strtolower($params[3]);} else {$threshold = get_gedcom_setting($this->_ged_id, 'COMMON_NAMES_THRESHOLD');} + if (isset($params[4]) && $params[4] != '') {$maxtoshow = strtolower($params[4]);} else {$maxtoshow = 7;} $sizes = explode('x', $size); $tot_indi = $this->totalIndividuals(); $given = self::_commonGivenQuery('B', 'chart'); @@ -3601,11 +3601,11 @@ class stats { $visible = 0; $x = get_logged_in_users(); foreach ($x as $user_id=>$user_name) { - if (WT_USER_IS_ADMIN || get_user_setting($user_id, 'visibleonline')) {$visible++;}else{$anon++;} + if (WT_USER_IS_ADMIN || get_user_setting($user_id, 'visibleonline')) {$visible++;} else {$anon++;} } if ($type == 'anon') {return $anon;} elseif ($type == 'visible') {return $visible;} - else{return $visible + $anon;} + else {return $visible + $anon;} } static function usersLoggedIn() {return self::_usersLoggedIn('nolist');} @@ -3636,24 +3636,24 @@ class stats { case 'fullname': return getUserFullName($user_id); case 'regdate': - if(is_array($params) && isset($params[0]) && $params[0] != ''){$datestamp = $params[0];}else{$datestamp = $DATE_FORMAT;} + if (is_array($params) && isset($params[0]) && $params[0] != '') {$datestamp = $params[0];} else {$datestamp = $DATE_FORMAT;} return timestamp_to_gedcom_date(get_user_setting($user_id, 'reg_timestamp'))->Display(false, $datestamp); case 'regtime': - if(is_array($params) && isset($params[0]) && $params[0] != ''){$datestamp = $params[0];}else{$datestamp = str_replace('%', '', $TIME_FORMAT);} + if (is_array($params) && isset($params[0]) && $params[0] != '') {$datestamp = $params[0];} else {$datestamp = str_replace('%', '', $TIME_FORMAT);} return date($datestamp, get_user_setting($user_id, 'reg_timestamp')); case 'loggedin': - if(is_array($params) && isset($params[0]) && $params[0] != ''){$yes = $params[0];}else{$yes = i18n::translate('Yes');} - if(is_array($params) && isset($params[1]) && $params[1] != ''){$no = $params[1];}else{$no = i18n::translate('No');} + if (is_array($params) && isset($params[0]) && $params[0] != '') {$yes = $params[0];} else {$yes = i18n::translate('Yes');} + if (is_array($params) && isset($params[1]) && $params[1] != '') {$no = $params[1];} else {$no = i18n::translate('No');} return WT_DB::prepare("SELECT 1 FROM `##session` WHERE user_id=? LIMIT 1")->execute(array($user_id))->fetchOne() ? $yes : $no; } } - static function latestUserId(){return self::_getLatestUserData('userid');} - static function latestUserName(){return self::_getLatestUserData('username');} - static function latestUserFullName(){return self::_getLatestUserData('fullname');} - static function latestUserRegDate($params=null){return self::_getLatestUserData('regdate', $params);} - static function latestUserRegTime($params=null){return self::_getLatestUserData('regtime', $params);} - static function latestUserLoggedin($params=null){return self::_getLatestUserData('loggedin', $params);} + static function latestUserId() {return self::_getLatestUserData('userid');} + static function latestUserName() {return self::_getLatestUserData('username');} + static function latestUserFullName() {return self::_getLatestUserData('fullname');} + static function latestUserRegDate($params=null) {return self::_getLatestUserData('regdate', $params);} + static function latestUserRegTime($params=null) {return self::_getLatestUserData('regtime', $params);} + static function latestUserLoggedin($params=null) {return self::_getLatestUserData('loggedin', $params);} /////////////////////////////////////////////////////////////////////////////// // Contact // @@ -3764,11 +3764,11 @@ class stats { return ob_get_clean(); } - static function gedcomFavorites(){return self::_getFavorites(true);} - static function userFavorites(){return self::_getFavorites(false);} + static function gedcomFavorites() {return self::_getFavorites(true);} + static function userFavorites() {return self::_getFavorites(false);} - static function totalGedcomFavorites(){return count(gedcom_favorites_WT_Module::getUserFavorites(WT_GEDCOM));} - static function totalUserFavorites(){return count(user_favorites_WT_Module::getUserFavorites(WT_USER_NAME));} + static function totalGedcomFavorites() {return count(gedcom_favorites_WT_Module::getUserFavorites(WT_GEDCOM));} + static function totalUserFavorites() {return count(user_favorites_WT_Module::getUserFavorites(WT_USER_NAME));} /////////////////////////////////////////////////////////////////////////////// // Other blocks // @@ -3777,8 +3777,8 @@ class stats { static function callBlock($params=null) { global $ctype; - if ($params === null){return '';} - if (isset($params[0]) && $params[0] != ''){$block = $params[0];}else{return '';} + if ($params === null) {return '';} + if (isset($params[0]) && $params[0] != '') {$block = $params[0];} else {return '';} $all_blocks=array(); foreach (WT_Module::getActiveBlocks() as $name=>$active_block) { if ($ctype=='user' && $active_block->isUserBlock() || $ctype=='gedcom' && $active_block->isGedcomBlock()) { @@ -3792,7 +3792,7 @@ class stats { $cfg = array(); foreach ($params as $config) { $bits = explode('=', $config); - if(count($bits) < 2){continue;} + if (count($bits) < 2) {continue;} $v = array_shift($bits); $cfg[$v] = join('=', $bits); } @@ -3802,7 +3802,7 @@ class stats { return $content; } - function totalUserMessages(){return count(getUserMessages(WT_USER_NAME));} - function totalUserJournal(){ return count(getUserNews(WT_USER_ID));} - function totalGedcomNews(){ return count(getUserNews(WT_GEDCOM));} + function totalUserMessages() {return count(getUserMessages(WT_USER_NAME));} + function totalUserJournal() { return count(getUserNews(WT_USER_ID));} + function totalGedcomNews() { return count(getUserNews(WT_GEDCOM));} } diff --git a/includes/classes/class_treenav.php b/includes/classes/class_treenav.php index 1d383d6b5b..4e2363ae25 100644 --- a/includes/classes/class_treenav.php +++ b/includes/classes/class_treenav.php @@ -81,7 +81,7 @@ class TreeNav { $this->drawViewport($rootid, $w, $h); $output = ob_get_clean(); $lines = preg_split("/\r?\n/", $output); - foreach($lines as $line) + foreach ($lines as $line) echo "document.writeln('".str_replace("'", "\\'", $line)."');"; exit; } @@ -265,7 +265,7 @@ class TreeNav { } else { $fams = $person->getSpouseFamilies(); - foreach($fams as $fam) { + foreach ($fams as $fam) { $families[] = $fam; } } @@ -273,7 +273,7 @@ class TreeNav { else { if ($this->allSpouses) { $fams = $person->getSpouseFamilies(); - foreach($fams as $fam) { + foreach ($fams as $fam) { $families[] = $fam; } } @@ -320,7 +320,7 @@ class TreeNav { </div> <br /> <span class="name1"><?php - foreach($families as $family) { + foreach ($families as $family) { if (!empty($family)) $spouse = $family->getSpouse($person); if (!empty($spouse)) { $name = $spouse->getFullName(); @@ -376,7 +376,7 @@ class TreeNav { function drawChildren(&$family, $gen=2) { if (!empty($family) && $gen>0) { $children = $family->getChildren(); - foreach($children as $ci=>$child) { + foreach ($children as $ci=>$child) { $fam = null; $this->drawPerson($child, $gen-1, -1, $fam); } @@ -391,10 +391,10 @@ class TreeNav { function drawAllChildren(&$person, $gen=2) { if (!empty($person) && $gen>0) { $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { $children = $family->getChildren(); $indichilds = array(); - foreach($children as $ci=>$child) { + foreach ($children as $ci=>$child) { if (!in_array($child, $indichilds)) { $fam = null; $this->drawPersonAllSpouses($child, $gen-1, -1); @@ -468,7 +468,7 @@ class TreeNav { $fams = $person->getSpouseFamilies(); $fams = array_reverse($fams); //-- find the last spouse family that has a known spouse - foreach($fams as $family) { + foreach ($fams as $family) { if (!empty($family)) $spouse = $family->getSpouse($person); if (!empty($spouse)) { $mcfamily = $spouse->getPrimaryChildFamily(); @@ -511,7 +511,7 @@ class TreeNav { ?><br /> <?php $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { $spouse = $family->getSpouse($person); if (!is_null($spouse)) { $name = $spouse->getFullName(); @@ -545,7 +545,7 @@ class TreeNav { </tr> <?php $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { $spouse = $family->getSpouse($person); $mother = null; if ($spouse!=null) { diff --git a/includes/controllers/advancedsearch_ctrl.php b/includes/controllers/advancedsearch_ctrl.php index 9637d2fbab..5f3a189927 100644 --- a/includes/controllers/advancedsearch_ctrl.php +++ b/includes/controllers/advancedsearch_ctrl.php @@ -139,7 +139,7 @@ class AdvancedSearchController extends SearchController { $newvalues = array(); $newplus = array(); $rels = array(); - foreach($this->fields as $j=>$field) { + foreach ($this->fields as $j=>$field) { if (strpos($this->fields[$j], "FAMC:HUSB:NAME")===0 || strpos($this->fields[$j], "FAMC:WIFE:NAME")===0) { $rels[$this->fields[$j]] = $this->values[$j]; continue; @@ -152,7 +152,7 @@ class AdvancedSearchController extends SearchController { $this->fields = $newfields; $this->values = $newvalues; $this->plusminus = $newplus; - foreach($rels as $field=>$value) { + foreach ($rels as $field=>$value) { $this->fields[] = $field; $this->values[] = $value; } @@ -178,7 +178,7 @@ class AdvancedSearchController extends SearchController { $sqltables = " FROM `##".$table."`"; $sqlwhere = " WHERE ".$prefix."_file=".WT_GED_ID; $keepfields = $this->fields; - for($i=0; $i<$fct; $i++) { + for ($i=0; $i<$fct; $i++) { $field = $this->fields[$i]; if (empty($field)) continue; $value=''; @@ -324,7 +324,7 @@ class AdvancedSearchController extends SearchController { } //-- alter the fields and recurse to generate a subquery for spouse/parent fields $oldfields = $this->fields; - for($j=0; $j<$fct; $j++) { + for ($j=0; $j<$fct; $j++) { //-- if it doesn't start with FAMS or FAMC then remove that field if (preg_match("/^".$parts[0].":/", $this->fields[$j])==0) { $this->fields[$j]=''; @@ -336,7 +336,7 @@ class AdvancedSearchController extends SearchController { $sqlwhere .= " AND ROW(FAMS.f_id, FAMS.f_file) IN (".$subsql.")"; $this->fields = $oldfields; //-- remove all of the fam fields so they don't show up again - for($j=0; $j<$fct; $j++) { + for ($j=0; $j<$fct; $j++) { //-- if it does start with FAMS or FAMC then remove that field if (preg_match("/^".$parts[0].":/", $this->fields[$j])>0) { $this->fields[$j]=''; @@ -351,7 +351,7 @@ class AdvancedSearchController extends SearchController { } //-- alter the fields and recurse to generate a subquery for spouse/parent fields $oldfields = $this->fields; - for($j=0; $j<$fct; $j++) { + for ($j=0; $j<$fct; $j++) { //-- if it doesn't start with FAMS or FAMC then remove that field if (preg_match("/^".$parts[0].":/", $this->fields[$j])==0) { $this->fields[$j]=''; @@ -363,7 +363,7 @@ class AdvancedSearchController extends SearchController { $sqlwhere .= " AND ROW(FAMC.f_id, FAMC.f_file) IN (".$subsql.")"; $this->fields = $oldfields; //-- remove all of the fam fields so they don't show up again - for($j=0; $j<$fct; $j++) { + for ($j=0; $j<$fct; $j++) { //-- if it does start with FAMS or FAMC then remove that field if (preg_match("/^".$parts[0].":/", $this->fields[$j])>0) { $this->fields[$j]=''; @@ -378,7 +378,7 @@ class AdvancedSearchController extends SearchController { } //-- alter the fields and recurse to generate a subquery for spouse/parent fields $oldfields = $this->fields; - for($j=0; $j<$fct; $j++) { + for ($j=0; $j<$fct; $j++) { //-- if it doesn't start with FAMS or FAMC then remove that field if (preg_match("/^".$parts[0].":/", $this->fields[$j])==0) { $this->fields[$j]=''; @@ -390,7 +390,7 @@ class AdvancedSearchController extends SearchController { if ($parts[0]=='WIFE') $sqlwhere .= " AND ROW(f_wife, f_file) IN (".$subsql.")"; $this->fields = $oldfields; //-- remove all of the fam fields so they don't show up again - for($j=0; $j<$fct; $j++) { + for ($j=0; $j<$fct; $j++) { //-- if it does start with HUSB or WIFE then remove that field if (preg_match("/^".$parts[0].":/", $this->fields[$j])>0) { $this->fields[$j]=''; @@ -403,7 +403,7 @@ class AdvancedSearchController extends SearchController { $ct = count($parts); $liketmp=''; - for($j=0; $j<$ct; $j++) { + for ($j=0; $j<$ct; $j++) { $liketmp.= "%".($j+1)." ".$parts[$j]." %"; //if ($j<$ct-1) { //$sqlwhere .= "%"; @@ -418,7 +418,7 @@ class AdvancedSearchController extends SearchController { //echo $sql; if ($justSql) return $sql; $rows=WT_DB::prepare($sql)->fetchAll(PDO::FETCH_ASSOC); - foreach ($rows as $row){ + foreach ($rows as $row) { $row['xref']=$row['i_id']; $row['ged_id']=$row['i_file']; $row['type'] = 'INDI'; diff --git a/includes/controllers/ancestry_ctrl.php b/includes/controllers/ancestry_ctrl.php index ee3a4960e8..d0de373820 100644 --- a/includes/controllers/ancestry_ctrl.php +++ b/includes/controllers/ancestry_ctrl.php @@ -140,7 +140,7 @@ class AncestryController extends BaseController { $parents = false; $famrec = ""; $famid = ""; - foreach($famids as $famid=>$family) { + foreach ($famids as $famid=>$family) { if (!is_null($family)) { $famrec = $family->getGedcomRecord(); $parents = find_parents_in_record($famrec); diff --git a/includes/controllers/descendancy_ctrl.php b/includes/controllers/descendancy_ctrl.php index 353014206c..a3de123406 100644 --- a/includes/controllers/descendancy_ctrl.php +++ b/includes/controllers/descendancy_ctrl.php @@ -128,7 +128,7 @@ class DescendancyController extends BaseController { if (is_null($person)) return; $families = $person->getSpouseFamilies(); if ($depth<2) return; - foreach($families as $famid => $family) { + foreach ($families as $famid => $family) { print_sosa_family($family->getXref(), "", -1, $label, $person->getXref(), $gpid, $personcount); $personcount++; $children = $family->getChildren(); @@ -164,7 +164,7 @@ function print_child_descendancy(&$person, $depth) { echo "<td> </td>"; echo "<td>"; $sfamids = $person->getChildFamilies(); - foreach($sfamids as $famid => $family) { + foreach ($sfamids as $famid => $family) { $parents = find_parents($famid); if ($parents) { $parid=$parents["HUSB"]; @@ -250,7 +250,7 @@ function print_family_descendancy(&$person, &$family, $depth) { echo "<td> </td>"; echo "<td>"; $sfamids = find_family_ids($id); - foreach($sfamids as $indexval => $sfamid) { + foreach ($sfamids as $indexval => $sfamid) { $parents = find_parents($sfamid); if ($parents) { $parid=$parents["HUSB"]; diff --git a/includes/controllers/family_ctrl.php b/includes/controllers/family_ctrl.php index 92c573848a..c3e39f4bbb 100644 --- a/includes/controllers/family_ctrl.php +++ b/includes/controllers/family_ctrl.php @@ -75,10 +75,10 @@ class FamilyController extends BaseController { } } //-- if no record was found create a default empty one - if (find_updated_record($this->famid, WT_GED_ID)!==null){ + if (find_updated_record($this->famid, WT_GED_ID)!==null) { $this->famrec = "0 @".$this->famid."@ FAM\n"; $this->family = new Family($this->famrec); - } else if (!$this->family){ + } else if (!$this->family) { return false; } } @@ -256,7 +256,7 @@ class FamilyController extends BaseController { // Produce the submenus in localized name order - foreach($menuList as $menuType => $menuName) { + foreach ($menuList as $menuType => $menuName) { switch ($menuType) { case "parentTimeLine": // charts / parents_timeline diff --git a/includes/controllers/hourglass_ctrl.php b/includes/controllers/hourglass_ctrl.php index c2c8ce782a..cb7f78df8b 100644 --- a/includes/controllers/hourglass_ctrl.php +++ b/includes/controllers/hourglass_ctrl.php @@ -135,7 +135,7 @@ class HourglassController extends BaseController { $families = $person->getChildFamilies(); //-- calculate how tall the lines should be $lh = ($bhalfheight+3) * pow(2, ($this->generations-$count-1)); - foreach($families as $famid => $family) { + foreach ($families as $famid => $family) { echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"empty-cells: show;\">"; $parents = find_parents($famid); $height="100%"; @@ -220,16 +220,16 @@ class HourglassController extends BaseController { $children = array(); if ($count < $this->dgenerations) { //-- put all of the children in a common array - foreach($families as $famid => $family) { + foreach ($families as $famid => $family) { $famNum ++; $chs = $family->getChildren(); - foreach($chs as $c=>$child) $children[] = $child; + foreach ($chs as $c=>$child) $children[] = $child; } $ct = count($children); if ($ct>0) { echo "<table style=\"position: relative; top: auto; text-align: $tablealign;\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"; - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { if (($i>0)&&($i<$ct-1)) $rowspan=1; /* @var $person2 Person */ $person2 = $children[$i]; @@ -273,18 +273,18 @@ class HourglassController extends BaseController { if ($count==$this->dgenerations) { $numkids = 1; $tbwidth = $bwidth+16; - for($j=$count; $j<$this->dgenerations; $j++) { + for ($j=$count; $j<$this->dgenerations; $j++) { echo "<div style=\"width: ".($tbwidth)."px;\"><br /></div></td><td width=\"$bwidth\">"; } $kcount = 0; - foreach($families as $famid=>$family) $kcount+=$family->getNumberOfChildren(); + foreach ($families as $famid=>$family) $kcount+=$family->getNumberOfChildren(); if ($kcount==0) { echo "<div style=\"width: ".($this->arrwidth)."px;\"><br /></div></td><td width=\"$bwidth\">"; } else { echo "<div style=\"width: ".($this->arrwidth)."px;\"><a href=\"$pid\" onclick=\"return ChangeDis('td_".$pid."','".$pid."','".$this->show_full."','".$this->show_spouse."','".$this->box_width."')\"><img src=\"".$WT_IMAGES["larrow"]."\" border=\"0\" alt=\"\" /></a></div>"; //-- move the arrow up to line up with the correct box if ($this->show_spouse) { - foreach($families as $famid => $family) { + foreach ($families as $famid => $family) { /* @var $family Family */ if (!is_null($family)) { $spouse = $family->getSpouse($person); @@ -304,7 +304,7 @@ class HourglassController extends BaseController { //----- Print the spouse if ($this->show_spouse) { - foreach($families as $famid => $family) { + foreach ($families as $famid => $family) { /* @var $family Family */ if (!is_null($family)) { $spouse = $family->getSpouse($person); @@ -337,7 +337,7 @@ class HourglassController extends BaseController { //-- make sure there is more than 1 child in the family with parents $cfamids = $person->getChildFamilies(); $num=0; - foreach($cfamids as $famid=>$family) { + foreach ($cfamids as $famid=>$family) { if (!is_null($family)) { $num += $family->getNumberOfChildren(); } @@ -352,7 +352,7 @@ class HourglassController extends BaseController { echo "<div id=\"childbox\" dir=\"".$TEXT_DIRECTION."\" style=\"width:".$bwidth."px; height:".$bheight."px; visibility: hidden;\">"; echo "<table class=\"person_box\"><tr><td>"; - foreach($famids as $famid=>$family) { + foreach ($famids as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); if (!empty($spouse)) { @@ -369,7 +369,7 @@ class HourglassController extends BaseController { } $children = $family->getChildren(); - foreach($children as $id=>$child) { + foreach ($children as $id=>$child) { $cid = $child->getXref(); echo " <a href=\"hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; $name = $child->getFullName(); @@ -388,9 +388,9 @@ class HourglassController extends BaseController { echo "<img src=\"".$WT_IMAGES["rarrow"]."\" border=\"0\" alt=\"\" /> "; //-- print the siblings - foreach($cfamids as $famid=>$family) { + foreach ($cfamids as $famid=>$family) { if (!is_null($family)) { - if(!is_null($family->getHusband()) || !is_null($family->getWife())) { + if (!is_null($family->getHusband()) || !is_null($family->getWife())) { echo "<span class=\"name1\"><br />".i18n::translate('Parents')."<br /></span>"; $husb = $family->getHusband(); if (!empty($husb)) { @@ -421,7 +421,7 @@ class HourglassController extends BaseController { $num = $family->getNumberOfChildren(); if ($num>2) echo "<span class=\"name1\"><br />".i18n::translate('Siblings')."<br /></span>"; if ($num==2) echo "<span class=\"name1\"><br />".i18n::translate('Sibling')."<br /></span>"; - foreach($children as $id=>$child) { + foreach ($children as $id=>$child) { $cid = $child->getXref(); if ($cid!=$pid) { echo " <a href=\"hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; @@ -463,9 +463,9 @@ class HourglassController extends BaseController { $famids = $person->getSpouseFamilies(); if ($person->getNumberOfChildren()==0) return $depth-1; $maxdc = $depth; - foreach($famids as $famid => $family){ + foreach ($famids as $famid => $family) { $ct = preg_match_all("/1 CHIL @(.*)@/", $family->getGedcomRecord(), $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $chil = trim($match[$i][1]); $dc = $this->max_descendency_generations($chil, $depth+1); if ($dc >= $this->generations) return $dc; @@ -529,7 +529,7 @@ class HourglassController extends BaseController { function sizeLines() { var vlines; vlines = document.getElementsByName("tvertline"); - for(i=0; i < vlines.length; i++) { + for (i=0; i < vlines.length; i++) { var pid = vlines[i].id.substr(vlines[i].id.indexOf("_")+1); var hline = document.getElementById("table_"+pid); var hline2 = document.getElementById("table2_"+pid); @@ -538,7 +538,7 @@ class HourglassController extends BaseController { } vlines = document.getElementsByName("bvertline"); - for(i=0; i < vlines.length; i++) { + for (i=0; i < vlines.length; i++) { var pid = vlines[i].id.substr(vlines[i].id.indexOf("_")+1); var hline = document.getElementById("table_"+pid); var hline2 = document.getElementById("table2_"+pid); @@ -547,7 +547,7 @@ class HourglassController extends BaseController { vlines = document.getElementsByName("pvline"); //alert(vlines[0].parentNode.parentNode.parentNode); - for(i=0; i < vlines.length; i++) { + for (i=0; i < vlines.length; i++) { //vlines[i].parentNode.style.height="50%"; vlines[i].style.height=(vlines[i].parentNode.offsetHeight/2)+'px'; } diff --git a/includes/controllers/individual_ctrl.php b/includes/controllers/individual_ctrl.php index 8200b445f0..43dd2b676e 100644 --- a/includes/controllers/individual_ctrl.php +++ b/includes/controllers/individual_ctrl.php @@ -93,10 +93,10 @@ class IndividualController extends BaseController { $this->default_tab=get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB'); } - if (find_person_record($this->pid, WT_GED_ID) || find_updated_record($this->pid, WT_GED_ID)!==null){ + if (find_person_record($this->pid, WT_GED_ID) || find_updated_record($this->pid, WT_GED_ID)!==null) { $this->indi = new Person($gedrec, false); $this->indi->ged_id=WT_GED_ID; // This record is from a file - } else if (!$this->indi){ + } else if (!$this->indi) { return false; } @@ -197,7 +197,7 @@ class IndividualController extends BaseController { // Initialise tabs $this->tabs = WT_Module::getActiveTabs(); - foreach($this->tabs as $mod) { + foreach ($this->tabs as $mod) { $mod->setController($this); if ($mod->hasTabContent()) { if (empty($this->default_tab)) { @@ -384,7 +384,7 @@ class IndividualController extends BaseController { echo '</dl>'; echo '</div>'; $ct = preg_match_all('/\n2 (\w+) (.*)/', $factrec, $nmatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { echo '<div>'; $fact = trim($nmatch[$i][1]); if (($fact!="SOUR")&&($fact!="NOTE")&&($fact!="GIVN")&&($fact!="SURN")&&($fact!="SPFX")) { @@ -678,7 +678,7 @@ class IndividualController extends BaseController { $labels["sister"] = i18n::translate('Sister'); $labels["brother"] = i18n::translate('Brother'); } - if ($type=="step"){ + if ($type=="step") { $labels["parent"] = i18n::translate('Step-Parent'); $labels["mother"] = i18n::translate('Step-Mother'); $labels["father"] = i18n::translate('Step-Father'); @@ -733,7 +733,7 @@ class IndividualController extends BaseController { //-- step families : set the label for the common parent if ($type=="step") { $fams = $this->indi->getChildFamilies(); - foreach($fams as $key=>$fam) { + foreach ($fams as $key=>$fam) { if ($fam->hasParent($husb)) $labels["father"] = i18n::translate('Father'); if ($fam->hasParent($wife)) $labels["mother"] = i18n::translate('Mother'); } @@ -801,11 +801,11 @@ class IndividualController extends BaseController { $merged_children = array(); $new_children = $newfamily->getChildren(); $num = count($children); - for($i=0; $i<$num; $i++) { + for ($i=0; $i<$num; $i++) { $child = $children[$i]; if (!is_null($child)) { $found = false; - foreach($new_children as $key=>$newchild) { + foreach ($new_children as $key=>$newchild) { if (!is_null($newchild)) { if ($child->equals($newchild)) { $found = true; @@ -817,10 +817,10 @@ class IndividualController extends BaseController { else $merged_children[] = $child; } } - foreach($new_children as $key=>$newchild) { + foreach ($new_children as $key=>$newchild) { if (!is_null($newchild)) { $found = false; - foreach($children as $key1=>$child) { + foreach ($children as $key1=>$child) { if (!is_null($child)) { if ($child->equals($newchild)) { $found = true; @@ -836,7 +836,7 @@ class IndividualController extends BaseController { } //-- set the labels for the children $num = count($children); - for($i=0; $i<$num; $i++) { + for ($i=0; $i<$num; $i++) { if (!is_null($children[$i])) { $label = $labels["sibling"]; $sex = $children[$i]->getSex(); @@ -860,7 +860,7 @@ class IndividualController extends BaseController { } } $num = count($newchildren); - for($i=0; $i<$num; $i++) { + for ($i=0; $i<$num; $i++) { $label = $labels["sibling"]; $sex = $newchildren[$i]->getSex(); if ($sex=="F") { @@ -877,7 +877,7 @@ class IndividualController extends BaseController { $newchildren[$i]->setLabel($label); } $num = count($delchildren); - for($i=0; $i<$num; $i++) { + for ($i=0; $i<$num; $i++) { $label = $labels["sibling"]; $sex = $delchildren[$i]->getSex(); if ($sex=="F") { diff --git a/includes/controllers/lifespan_ctrl.php b/includes/controllers/lifespan_ctrl.php index 2f52a9b301..8ab83cd62c 100644 --- a/includes/controllers/lifespan_ctrl.php +++ b/includes/controllers/lifespan_ctrl.php @@ -116,7 +116,7 @@ class LifespanController extends BaseController { } //-- gets the immediate family for the individual being added if the include immediate family checkbox is checked. - if (safe_GET('addFamily', 'yes')=='yes'){ + if (safe_GET('addFamily', 'yes')=='yes') { if (isset($newpid)) $this->addFamily($newpid); } @@ -204,7 +204,7 @@ class LifespanController extends BaseController { $this->timelineMaxYear=max($this->timelineMaxYear, $ddate->gregorianYear() ? $ddate->gregorianYear() : date('Y')); } - if($this->timelineMaxYear > $this->currentYear){ + if ($this->timelineMaxYear > $this->currentYear) { $this->timelineMaxYear = $this->currentYear; } @@ -229,31 +229,31 @@ class LifespanController extends BaseController { $this->pids[] = $newpid; $families = $person->getSpouseFamilies(); //-- foreach gets the spouse and children of the individual. - foreach($families as $famID => $family){ - if($newpid != $family->getHusbId()) { + foreach ($families as $famID => $family) { + if ($newpid != $family->getHusbId()) { if ($gen>0) $this->pids[] = addFamily($family->getHusbId(), $gen-1); else $this->pids[] = $family->getHusbId(); } - if($newpid != $family->getWifeId()) { + if ($newpid != $family->getWifeId()) { if ($gen>0) $this->pids[] = addFamily($family->getWifeId(), $gen-1); else $this->pids[] = $family->getWifeId(); } $children = $family->getChildren(); - foreach($children as $childID => $child){ + foreach ($children as $childID => $child) { if ($gen>0) $this->pids[] = addFamily($child->getXref(), $gen-1); else $this->pids[] = $child->getXref(); } } $families = $person->getChildFamilies(); //-- foreach gets the father, mother and sibblings of the individual. - foreach($families as $famID => $family){ + foreach ($families as $famID => $family) { if ($gen>0) $this->pids[] = addFamily($family->getHusbId(), $gen-1); else $this->pids[] = $family->getHusbId(); if ($gen>0) $this->pids[] = addFamily($family->getWifeId(), $gen-1); else $this->pids[] = $family->getWifeId(); $children = $family->getChildren(); - foreach($children as $childID => $child){ - if($newpid != $child->getXref()) { + foreach ($children as $childID => $child) { + if ($newpid != $child->getXref()) { if ($gen>0) $this->pids[] = addFamily($child->getXref(), $gen-1); else $this->pids[] = $child->getXref(); } @@ -269,7 +269,7 @@ class LifespanController extends BaseController { case 1 : //rounds beginning year $this->birthMod = ($year % 5); $year = $year - ($this->birthMod); - if($temp == $year){ + if ($temp == $year) { $this->modTest = 0; } else $this->modTest = 1; @@ -277,7 +277,7 @@ class LifespanController extends BaseController { case 2 : //rounds end year $this->deathMod = ($year % 5); //Only executed if the year needs to be modified - if($this->deathMod > 0) { + if ($this->deathMod > 0) { $this->endMod = (5 - ($this->deathMod)); } else { @@ -319,7 +319,7 @@ class LifespanController extends BaseController { $rows = array(); $modFix = 0; - if($this->modTest == 1){ + if ($this->modTest == 1) { $modFix = (9 * $this->birthMod); } //base case @@ -329,7 +329,7 @@ class LifespanController extends BaseController { foreach ($ar as $key => $value) { //Creates appropriate color scheme to show relationships $this->currentsex = $value->getSex(); - if ($this->currentsex == "M"){ + if ($this->currentsex == "M") { $this->Mcolorindex++; if (!isset($this->malecolorR[$this->Mcolorindex])) $this->Mcolorindex=0; $this->malecolorR[$this->Mcolorindex]; @@ -338,16 +338,16 @@ class LifespanController extends BaseController { $this->malecolorG[$this->Mcolorindex]; $red = dechex($this->malecolorR[$this->Mcolorindex]); $green =dechex($this->malecolorR[$this->Mcolorindex]); - if(strlen($red)<2){ + if (strlen($red)<2) { $red = "0".$red; } - if(strlen($green)<2){ + if (strlen($green)<2) { $green = "0".$green; } $this->color = "#".$red.$green.dechex($this->malecolorB); } - else if($this->currentsex == "F"){ + else if ($this->currentsex == "F") { $this->Fcolorindex++; if (!isset($this->femalecolorG[$this->Fcolorindex])) $this->Fcolorindex = 0; $this->femalecolorG[$this->Fcolorindex]; @@ -356,7 +356,7 @@ class LifespanController extends BaseController { $this->femalecolorB[$this->Fcolorindex]; $this->color = "#".dechex($this->femalecolorR).dechex($this->femalecolorG[$this->Fcolorindex]).dechex($this->femalecolorB[$this->Fcolorindex]); } - else{ + else { $this->color = $this->colors[$this->colorindex]; } @@ -400,7 +400,7 @@ class LifespanController extends BaseController { $Y = $top; $Z = $zindex; $ready = false; - while(!$ready) { + while (!$ready) { if (!isset($rows[$Y])) { $ready = true; $rows[$Y]["x1"] = $startPos; @@ -437,7 +437,7 @@ class LifespanController extends BaseController { $eventinformation = Array(); $eventspacing = Array(); - foreach($unparsedEvents as $index=>$val) { + foreach ($unparsedEvents as $index=>$val) { $date = $val->getDate(); if (!empty($date)) { $fact = $val->getTag(); @@ -466,7 +466,7 @@ class LifespanController extends BaseController { $ddate=$value->getEstimatedDeathDate(); if ($width > ($minlength +110)) { echo "<div id=\"bar_", $value->getXref(), "\" style=\"position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">"; - foreach($eventinformation as $evtwidth=>$val){ + foreach ($eventinformation as $evtwidth=>$val) { echo "<div style=\"position:absolute; left:", $evtwidth, ";\"><a class=\"showit\" href=\"#\" style=\"top:-2px; font-size:10px;\"><b>"; $text = explode("-fact, ", $val); $fact = $text[0]; @@ -494,7 +494,7 @@ class LifespanController extends BaseController { } else { if ($width > $minlength +5) { echo "<div style=\"text-align: left; position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">"; - foreach($eventinformation as $evtwidth=>$val){ + foreach ($eventinformation as $evtwidth=>$val) { echo "<div style=\"position:absolute; left:".$evtwidth." \"><a class=\"showit\" href=\"#\" style=\"top:-2px; font-size:10px;\"><b>"; $text = explode("-fact,", $val); $fact = $text[0]; @@ -526,7 +526,7 @@ class LifespanController extends BaseController { echo "<a class=\"showit\" href=\"".$value->getHtmlUrl()."\"><b>"; echo abbreviate_fact('BIRT'); echo "</b><span>".$value->getSexImage().$indiName."<br/>".translate_fact('BIRT')." ".strip_tags($bdate->Display(false))." ".PrintReady($value->getBirthPlace())."<br/>"; - foreach($eventinformation as $evtwidth=>$val){ + foreach ($eventinformation as $evtwidth=>$val) { $text = explode("-fact,", $val); $val = $text[1]; echo $val."<br />"; diff --git a/includes/controllers/media_ctrl.php b/includes/controllers/media_ctrl.php index a860df4fb6..beaa2679b1 100644 --- a/includes/controllers/media_ctrl.php +++ b/includes/controllers/media_ctrl.php @@ -68,10 +68,10 @@ class MediaController extends BaseController{ } //Checks to see if the File Name ($filename) exists - if (!empty($filename)){ + if (!empty($filename)) { //If the File Name ($filename) is set, then it will call the method to get the Media ID ($this->mid) from the File Name ($filename) $this->mid = get_media_id_from_file($filename); - if (!$this->mid){ + if (!$this->mid) { //This will set the Media ID to be false if the File given doesn't match to anything in the database $this->mid = false; // create a very basic gedcom record for this file so that the functions of the media object will work @@ -81,7 +81,7 @@ class MediaController extends BaseController{ } //checks to see if the Media ID ($this->mid) is set. If the Media ID isn't set then there isn't any information avaliable for that picture the picture doesn't exist. - if ($this->mid){ + if ($this->mid) { //This creates a Media Object from the getInstance method of the Media Class. It takes the Media ID ($this->mid) and creates the object. $this->mediaobject = Media::getInstance($this->mid); //This sets the controller ID to be the Media ID @@ -337,9 +337,9 @@ class MediaController extends BaseController{ else $newfacts[] = new Event("1 TYPE ".i18n::translate('Other')); //-- loop through new facts and add them to the list if they are any changes //-- compare new and old facts of the Personal Fact and Details tab 1 - for($i=0; $i<count($facts); $i++) { + for ($i=0; $i<count($facts); $i++) { $found=false; - foreach($newfacts as $indexval => $newfact) { + foreach ($newfacts as $indexval => $newfact) { if (trim($newfact->gedcomRecord)==trim($facts[$i]->gedcomRecord)) { $found=true; break; @@ -349,9 +349,9 @@ class MediaController extends BaseController{ $facts[$i]->gedcomRecord.="\nWT_OLD\n"; } } - foreach($newfacts as $indexval => $newfact) { + foreach ($newfacts as $indexval => $newfact) { $found=false; - foreach($facts as $indexval => $fact) { + foreach ($facts as $indexval => $fact) { if (trim($fact->gedcomRecord)==trim($newfact->gedcomRecord)) { $found=true; break; diff --git a/includes/controllers/pedigree_ctrl.php b/includes/controllers/pedigree_ctrl.php index 8e4af5c92f..19d5bcdd96 100644 --- a/includes/controllers/pedigree_ctrl.php +++ b/includes/controllers/pedigree_ctrl.php @@ -118,7 +118,7 @@ class PedigreeController extends BaseController { $this->treesize = pow(2, (int)($this->PEDIGREE_GENERATIONS))-1; //-- ancestry_array puts everyone at $i+1 - for($i=0; $i<$this->treesize; $i++) { + for ($i=0; $i<$this->treesize; $i++) { $this->treeid[$i] = $this->treeid[$i+1]; } @@ -157,7 +157,7 @@ class PedigreeController extends BaseController { if ($this->treesize<3) $this->treesize=3; // -- loop through all of id's in the array starting at the last and working to the first //-- calculation the box positions - for($i=($this->treesize-1); $i>=0; $i--) { + for ($i=($this->treesize-1); $i>=0; $i--) { // -- check to see if we have moved to the next generation if ($i < floor($this->treesize / (pow(2, $this->curgen)))) { $this->curgen++; @@ -191,13 +191,13 @@ class PedigreeController extends BaseController { if ($i%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * ($this->curgen-1)); else $this->yoffset=$this->yoffset + (($boxspacing/2) * ($this->curgen-1)); $pgen = $this->curgen; - while($parent>0) { + while ($parent>0) { if ($parent%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * $pgen); else $this->yoffset=$this->yoffset + (($boxspacing/2) * $pgen); $pgen++; if ($pgen>3) { $temp=0; - for($j=1; $j<($pgen-2); $j++) $temp += (pow(2, $j)-1); + for ($j=1; $j<($pgen-2); $j++) $temp += (pow(2, $j)-1); if ($parent%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * $temp); else $this->yoffset=$this->yoffset + (($boxspacing/2) * $temp); } @@ -205,7 +205,7 @@ class PedigreeController extends BaseController { } if ($this->curgen>3) { $temp=0; - for($j=1; $j<($this->curgen-2); $j++) $temp += (pow(2, $j)-1); + for ($j=1; $j<($this->curgen-2); $j++) $temp += (pow(2, $j)-1); if ($i%2 == 0) $this->yoffset=$this->yoffset - (($boxspacing/2) * $temp); else $this->yoffset=$this->yoffset + (($boxspacing/2) * $temp); } @@ -238,7 +238,7 @@ class PedigreeController extends BaseController { //-- calculate the smallest yoffset and adjust the tree to that offset $minyoffset = 0; - for($i=0; $i<count($this->treeid); $i++) { + for ($i=0; $i<count($this->treeid); $i++) { if ($SHOW_EMPTY_BOXES || !empty($treeid[$i])) { if (!empty($offsetarray[$i])) { if (($minyoffset==0)||($minyoffset>$this->offsetarray[$i]["y"])) $minyoffset = $this->offsetarray[$i]["y"]; @@ -287,7 +287,7 @@ class PedigreeController extends BaseController { if (empty($treeid[$index])) { $pgen=$curgen; $genoffset=0; - while($pgen<=$this->PEDIGREE_GENERATIONS) { + while ($pgen<=$this->PEDIGREE_GENERATIONS) { $genoffset += pow(2, ($this->PEDIGREE_GENERATIONS-$pgen)); $pgen++; } diff --git a/includes/controllers/search_ctrl.php b/includes/controllers/search_ctrl.php index dda24feffa..a9a20e0e0f 100644 --- a/includes/controllers/search_ctrl.php +++ b/includes/controllers/search_ctrl.php @@ -127,10 +127,10 @@ class SearchController extends BaseController { if (isset ($_REQUEST["replace"])) { $this->replace = $_REQUEST["replace"]; - if(isset($_REQUEST["replaceNames"])) $this->replaceNames = true; - if(isset($_REQUEST["replacePlaces"])) $this->replacePlaces = true; - if(isset($_REQUEST["replacePlacesWord"])) $this->replacePlacesWord = true; - if(isset($_REQUEST["replaceAll"])) $this->replaceAll = true; + if (isset($_REQUEST["replaceNames"])) $this->replaceNames = true; + if (isset($_REQUEST["replacePlaces"])) $this->replacePlaces = true; + if (isset($_REQUEST["replacePlacesWord"])) $this->replacePlacesWord = true; + if (isset($_REQUEST["replaceAll"])) $this->replaceAll = true; } // Aquire all the variables values from the $_REQUEST @@ -316,9 +316,9 @@ class SearchController extends BaseController { foreach ($varNames as $key => $varName) { if (isset ($_REQUEST[$varName])) { - if($varName == "action") - if($_REQUEST[$varName] == "replace") - if(!WT_USER_CAN_ACCEPT) + if ($varName == "action") + if ($_REQUEST[$varName] == "replace") + if (!WT_USER_CAN_ACCEPT) { $this->action = "general"; continue; @@ -491,47 +491,47 @@ class SearchController extends BaseController { $adv_name_tags = preg_split("/[\s,;: ]+/", $ADVANCED_NAME_FACTS); $name_tags = array_unique(array_merge($STANDARD_NAME_FACTS, $adv_name_tags)); $name_tags[] = "_MARNM"; - foreach($this->myindilist as $id=>$individual) { + foreach ($this->myindilist as $id=>$individual) { $indirec=find_gedcom_record($individual->getXref(), WT_GED_ID, true); $oldRecord = $indirec; $newRecord = $indirec; - if($this->replaceAll) { + if ($this->replaceAll) { $newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord); } else { - if($this->replaceNames) { - foreach($name_tags as $f=>$tag) { + if ($this->replaceNames) { + foreach ($name_tags as $f=>$tag) { $newRecord = preg_replace("~(\d) ".$tag." (.*)".$oldquery."(.*)~i", "$1 ".$tag." $2".$this->replace."$3", $newRecord); } } - if($this->replacePlaces) { + if ($this->replacePlaces) { if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord); else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord); } } //-- if the record changed replace the record otherwise remove it from the search results - if($newRecord != $oldRecord) { + if ($newRecord != $oldRecord) { replace_gedrec($individual->getXref(), WT_GED_ID, $newRecord); } else { unset($this->myindilist[$id]); } } - foreach($this->myfamlist as $id=>$family) { + foreach ($this->myfamlist as $id=>$family) { $indirec=find_gedcom_record($family->getXref(), WT_GED_ID, true); $oldRecord = $indirec; $newRecord = $indirec; - if($this->replaceAll) { + if ($this->replaceAll) { $newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord); } else { - if($this->replacePlaces) { + if ($this->replacePlaces) { if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord); else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord); } } //-- if the record changed replace the record otherwise remove it from the search results - if($newRecord != $oldRecord) { + if ($newRecord != $oldRecord) { replace_gedrec($family->getXref(), WT_GED_ID, $newRecord); } else { unset($this->myfamlist[$id]); @@ -546,17 +546,17 @@ class SearchController extends BaseController { if ($this->replaceAll) { $newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord); } else { - if($this->replaceNames) { + if ($this->replaceNames) { $newRecord = preg_replace("~(\d) TITL (.*)".$oldquery."(.*)~i", "$1 TITL $2".$this->replace."$3", $newRecord); $newRecord = preg_replace("~(\d) ABBR (.*)".$oldquery."(.*)~i", "$1 ABBR $2".$this->replace."$3", $newRecord); } - if($this->replacePlaces) { + if ($this->replacePlaces) { if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord); else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord); } } //-- if the record changed replace the record otherwise remove it from the search results - if($newRecord != $oldRecord) { + if ($newRecord != $oldRecord) { replace_gedrec($source->getXref(), WT_GED_ID, $newRecord); } else { unset($this->mysourcelist[$id]); @@ -572,7 +572,7 @@ class SearchController extends BaseController { $newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord); } //-- if the record changed replace the record otherwise remove it from the search results - if($newRecord != $oldRecord) { + if ($newRecord != $oldRecord) { replace_gedrec($note->getXref(), WT_GED_ID, $newRecord); } else { unset($this->mynotelist[$id]); @@ -1016,7 +1016,7 @@ class SearchController extends BaseController { } } $tempURL .= "&resultsPageNum={$pageNum}"; - foreach($this->sgeds as $i=>$key) { + foreach ($this->sgeds as $i=>$key) { $str = str_replace(array (".", "-", " "), array ("_", "_", "_"), $key); $tempURL .= "&{$str}=yes"; } diff --git a/includes/controllers/timeline_ctrl.php b/includes/controllers/timeline_ctrl.php index dbb73b7299..57f39435ab 100644 --- a/includes/controllers/timeline_ctrl.php +++ b/includes/controllers/timeline_ctrl.php @@ -84,7 +84,7 @@ class TimelineController extends BaseController { $remove = safe_GET_xref('remove'); //-- cleanup user input $newpids = array(); - foreach($this->pids as $key=>$value) { + foreach ($this->pids as $key=>$value) { if ($value!=$remove) { $newpids[] = $value; $person = Person::getInstance($value); @@ -94,7 +94,7 @@ class TimelineController extends BaseController { $this->pids = $newpids; $this->pidlinks = ""; /* @var $indi Person */ - foreach($this->people as $p=>$indi) { + foreach ($this->people as $p=>$indi) { if (!is_null($indi) && $indi->canDisplayDetails()) { //-- setup string of valid pids for links $this->pidlinks .= "pids[]=".$indi->getXref()."&"; @@ -110,7 +110,7 @@ class TimelineController extends BaseController { } // find all the fact information $indi->add_family_facts(false); - foreach($indi->getIndiFacts() as $event) { + foreach ($indi->getIndiFacts() as $event) { //-- get the fact type $fact = $event->getTag(); if (!in_array($fact, $this->nonfacts)) { @@ -148,7 +148,7 @@ class TimelineController extends BaseController { */ function checkPrivacy() { $printed = false; - for($i=0; $i<count($this->people); $i++) { + for ($i=0; $i<count($this->people); $i++) { if (!is_null($this->people[$i])) { if (!$this->people[$i]->canDisplayDetails()) { if ($this->people[$i]->canDisplayName()) { @@ -198,7 +198,7 @@ class TimelineController extends BaseController { $i=1; $j=0; $tyoffset = 0; - while(isset($placements[$place])) { + while (isset($placements[$place])) { if ($i==$j) { $tyoffset = $this->bheight * $i; $i++; @@ -234,7 +234,7 @@ class TimelineController extends BaseController { $husbid=$family->getHusbId(); $wifeid=$family->getWifeId(); //-- Retrieve husband and wife age - for($p=0; $p<count($this->pids); $p++) { + for ($p=0; $p<count($this->pids); $p++) { if ($this->pids[$p]==$husbid) { $husb=$family->getHusband(); if (is_null($husb)) $husb = new Person(''); @@ -269,7 +269,7 @@ class TimelineController extends BaseController { if ($place!=null) { if ($desc!=null) echo " - "; $plevels = explode(',', $place); - for($plevel=0; $plevel<$SHOW_PEDIGREE_PLACES; $plevel++) { + for ($plevel=0; $plevel<$SHOW_PEDIGREE_PLACES; $plevel++) { if (!empty($plevels[$plevel])) { if ($plevel>0) echo ", "; echo PrintReady($plevels[$plevel]); @@ -280,7 +280,7 @@ class TimelineController extends BaseController { //-- print spouse name for marriage events $spouse = Person::getInstance($event->getSpouseId()); if ($spouse) { - for($p=0; $p<count($this->pids); $p++) { + for ($p=0; $p<count($this->pids); $p++) { if ($this->pids[$p]==$spouse->getXref()) break; } if ($p==count($this->pids)) $p = $event->temp; diff --git a/includes/family_nav.php b/includes/family_nav.php index 40881edad2..067b041314 100644 --- a/includes/family_nav.php +++ b/includes/family_nav.php @@ -52,7 +52,7 @@ $show_full="1"; // Gets current clicked tab to set $tabno ----------- if (isset($_COOKIE['lastclick'])) { $tabno=$_COOKIE['lastclick']-1; -}else{ +} else { $tabno=0; } @@ -72,7 +72,7 @@ if (isset($_COOKIE['lastclick'])) { $families = $this->indi->getChildFamilies(); //-- parent families ------------------------------------------------------------- - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $label = $this->indi->getChildFamilyLabel($family); $people = $this->buildFamilyList($family, "parents"); $styleadd = ""; @@ -91,7 +91,7 @@ if (isset($_COOKIE['lastclick'])) { $menu = new Menu(" " . $people["husb"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($people["husb"]->getXref(), 2, 0, $personcount++); @@ -99,8 +99,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap"> @@ -122,7 +122,7 @@ if (isset($_COOKIE['lastclick'])) { $menu = new Menu(" " . $people["wife"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($people["wife"]->getXref(), 2, 0, $personcount++); @@ -130,8 +130,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>"> @@ -151,13 +151,13 @@ if (isset($_COOKIE['lastclick'])) { if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { - if ($pid == $child->getXref() ){ - }else{ + foreach ($people["children"] as $key=>$child) { + if ($pid == $child->getXref()) { + } else { $menu = new Menu($child->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($child->getXref(), 2, 0, $personcount++); @@ -165,8 +165,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); } - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> @@ -184,7 +184,7 @@ if (isset($_COOKIE['lastclick'])) { if ($pid == $child->getXref()) { echo PrintReady($child->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; - }else{ + } else { echo "<a href=\"".$child->getHtmlUrl()."&tab={$tabno}"."\">"; echo PrintReady($child->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; @@ -200,10 +200,10 @@ if (isset($_COOKIE['lastclick'])) { } //-- step families ---------------------------------------------------------------- - foreach($this->indi->getStepFamilies() as $famid=>$family) { + foreach ($this->indi->getStepFamilies() as $famid=>$family) { $label = $this->indi->getStepFamilyLabel($family); $people = $this->buildFamilyList($family, "step"); - if ($people){ + if ($people) { echo "<tr><td><br /></td><td></td></tr>"; } $styleadd = ""; @@ -225,12 +225,12 @@ if (isset($_COOKIE['lastclick'])) { $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { $menu->addLabel(" " . i18n::translate('Step-Father')); - }else{ + } else { $menu->addLabel(" " . $people["husb"]->getLabel()); } if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($people["husb"]->getXref(), 2, 0, $personcount++); @@ -238,8 +238,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> @@ -265,12 +265,12 @@ if (isset($_COOKIE['lastclick'])) { $menu = new Menu(); if ($people["wife"]->getLabel() == ".") { $menu->addLabel(" " . i18n::translate('Step-Mother')); - }else{ + } else { $menu->addLabel(" " . $people["wife"]->getLabel()); } if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($people["wife"]->getXref(), 2, 0, $personcount++); @@ -278,8 +278,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap"> @@ -300,11 +300,11 @@ if (isset($_COOKIE['lastclick'])) { $styleadd = ""; if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { $menu = new Menu($child->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($child->getXref(), 2, 0, $personcount++); @@ -312,8 +312,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap"> @@ -336,7 +336,7 @@ if (isset($_COOKIE['lastclick'])) { //-- spouse and children -------------------------------------------------- $families = $this->indi->getSpouseFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { echo "<tr><td><br /></td><td></td></tr>"; ?> <tr> @@ -352,17 +352,17 @@ if (isset($_COOKIE['lastclick'])) { //$personcount = 0; $people = $this->buildFamilyList($family, "spouse"); - if ($this->indi->equals($people["husb"])){ + if ($this->indi->equals($people["husb"])) { $spousetag = 'WIFE'; - }else{ + } else { $spousetag = 'HUSB'; } $styleadd = ""; - if ( isset($people["husb"]) && $spousetag == 'HUSB' ) { + if (isset($people["husb"]) && $spousetag == 'HUSB') { $menu = new Menu(" " . $people["husb"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($people["husb"]->getXref(), 2, 0, $personcount++); @@ -370,8 +370,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap"> @@ -382,7 +382,7 @@ if (isset($_COOKIE['lastclick'])) { if ($pid == $people["husb"]->getXref()) { echo PrintReady($people["husb"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; - }else{ + } else { echo "<a href=\"".$people["husb"]->getHtmlUrl()."&tab={$tabno}"."\">"; echo PrintReady($people["husb"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; @@ -394,11 +394,11 @@ if (isset($_COOKIE['lastclick'])) { <?php } - if ( isset($people["wife"]) && $spousetag == 'WIFE') { + if (isset($people["wife"]) && $spousetag == 'WIFE') { $menu = new Menu(" " . $people["wife"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($people["wife"]->getXref(), 2, 0, $personcount++); @@ -406,8 +406,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap"> @@ -418,7 +418,7 @@ if (isset($_COOKIE['lastclick'])) { if ($pid == $people["wife"]->getXref()) { echo PrintReady($people["wife"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; - }else{ + } else { echo "<a href=\"".$people["wife"]->getHtmlUrl()."&tab={$tabno}"."\">"; echo PrintReady($people["wife"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; @@ -432,11 +432,11 @@ if (isset($_COOKIE['lastclick'])) { $styleadd = ""; if (isset($people["children"])) { - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { $menu = new Menu(" " . $child->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); - }else{ + } else { $menu->addClass("", "", "submenu flyoutrtl"); } $slabel = "</a>".print_pedigree_person_nav($child->getXref(), 2, 0, $personcount++); @@ -444,8 +444,8 @@ if (isset($_COOKIE['lastclick'])) { $submenu = new Menu($slabel); $menu->addSubmenu($submenu); - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap"> @@ -533,7 +533,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { //-- parent families -------------------------------------- $fams = $person->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($person); @@ -570,7 +570,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { //-- step families ----------------------------------------- $fams = $person->getStepFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($person); $wife = $family->getWife($person); @@ -579,7 +579,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { $num = count($children); if ($natdad == "yes") { - }else{ + } else { // Husband ----------------------- if ($husb || $num>0) { if ($husb) { @@ -593,7 +593,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { } if ($natmom == "yes") { - }else{ + } else { // Wife ---------------------------- if ($wife || $num>0) { if ($wife) { @@ -610,7 +610,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { // Spouse Families -------------------------------------- @var $family Family $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); $children = $family->getChildren(); @@ -629,7 +629,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { } $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; // Children ------------------------------ @var $child Person - foreach($children as $c=>$child) { + foreach ($children as $c=>$child) { if ($child) { $persons="Yes"; $spouselinks .= "<li>"; diff --git a/includes/functions/functions_charts.php b/includes/functions/functions_charts.php index 7f22cf2bdc..1340a192ad 100644 --- a/includes/functions/functions_charts.php +++ b/includes/functions/functions_charts.php @@ -152,7 +152,7 @@ function print_family_parents($famid, $sosa = 0, $label="", $parid="", $gparid=" echo "<td rowspan=\"2\"><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\" /></td><td rowspan=\"2\"><img src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"" . ($pbheight) . "\" alt=\"\" /></td>"; echo "<td><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\" /></td><td>"; $hparents = false; - foreach($hfams as $hfamid=>$hfamily) { + foreach ($hfams as $hfamid=>$hfamily) { if (!is_null($hfamily)) { $hparents = find_parents_in_record($hfamily->getGedcomRecord()); $upfamid = $hfamid; @@ -225,7 +225,7 @@ function print_family_parents($famid, $sosa = 0, $label="", $parid="", $gparid=" echo "<td rowspan=\"2\"><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\" /></td><td rowspan=\"2\"><img src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"" . ($pbheight) . "\" alt=\"\" /></td>"; echo "<td><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\" /></td><td>"; $j = 0; - foreach($hfams as $hfamid=>$hfamily) { + foreach ($hfams as $hfamid=>$hfamily) { if (!is_null($hfamily)) { $hparents = find_parents_in_record($hfamily->getGedcomRecord()); $upfamid = $hfamid; @@ -314,17 +314,17 @@ function print_family_children($famid, $childid = "", $sosa = 0, $label="", $per $ct = preg_match_all("/1 CHIL @(.*)@/", $newrec, $match, PREG_SET_ORDER); if ($ct > 0) { $oldchil = array(); - for($i = 0; $i < $ct; $i++) { + for ($i = 0; $i < $ct; $i++) { if (!in_array($match[$i][1], $children)) $newchildren[] = $match[$i][1]; else $oldchil[] = $match[$i][1]; } - foreach($children as $indexval => $chil) { + foreach ($children as $indexval => $chil) { if (!in_array($chil, $oldchil)) $oldchildren[] = $chil; } //-- if there are no old or new children then the children were reordered if ((count($newchildren)==0)&&(count($oldchildren)==0)) { $children = array(); - for($i = 0; $i < $ct; $i++) { + for ($i = 0; $i < $ct; $i++) { $children[] = $match[$i][1]; } } @@ -333,7 +333,7 @@ function print_family_children($famid, $childid = "", $sosa = 0, $label="", $per } $nchi=1; if ((count($children) > 0) || (count($newchildren) > 0) || (count($oldchildren) > 0)) { - foreach($children as $indexval => $chil) { + foreach ($children as $indexval => $chil) { if (!in_array($chil, $oldchildren)) { echo "<tr>"; if ($sosa != 0) { @@ -411,14 +411,14 @@ function print_family_children($famid, $childid = "", $sosa = 0, $label="", $per echo "</tr>"; } } - foreach($newchildren as $indexval => $chil) { + foreach ($newchildren as $indexval => $chil) { echo "<tr >"; echo "<td valign=\"top\" class=\"facts_valueblue\" style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\">"; print_pedigree_person($chil, 1, 0, $personcount); $personcount++; echo "</td></tr>"; } - foreach($oldchildren as $indexval => $chil) { + foreach ($oldchildren as $indexval => $chil) { echo "<tr >"; echo "<td valign=\"top\" class=\"facts_valuered\" style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\">"; print_pedigree_person($chil, 1, 0, $personcount); @@ -487,7 +487,7 @@ function print_family_facts(&$family, $sosa = 0) { } // do not print otheritems for sosa if ($sosa == 0) { - foreach($indifacts as $key => $value) { + foreach ($indifacts as $key => $value) { $fact = $value->getTag(); // -- handle special source fact case if ($fact == "SOUR") { @@ -644,7 +644,7 @@ function ancestry_array($rootid, $maxgen=0) { $treeid[0] = ""; $treeid[1] = $rootid; // -- fill in the id array - for($i = 1; $i < ($treesize / 2); $i++) { + for ($i = 1; $i < ($treesize / 2); $i++) { $treeid[($i * 2)] = false; // -- father $treeid[($i * 2) + 1] = false; // -- mother if (!empty($treeid[$i])) { diff --git a/includes/functions/functions_db.php b/includes/functions/functions_db.php index f6d5c12420..361d351c05 100644 --- a/includes/functions/functions_db.php +++ b/includes/functions/functions_db.php @@ -1653,7 +1653,7 @@ function get_top_surnames($ged_id, $min, $max) { /** * get a list of remote servers */ -function get_server_list($ged_id=WT_GED_ID){ +function get_server_list($ged_id=WT_GED_ID) { $sitelist = array(); $rows=WT_DB::prepare("SELECT s_id, s_name, s_gedcom, s_file FROM `##sources` WHERE s_file=? AND s_dbid=? ORDER BY s_name") diff --git a/includes/functions/functions_edit.php b/includes/functions/functions_edit.php index b7e77d3ea3..e6024b9123 100644 --- a/includes/functions/functions_edit.php +++ b/includes/functions/functions_edit.php @@ -304,7 +304,7 @@ function replace_gedrec($gid, $ged_id, $gedrec, $chan=true) { if (isset($pgv_private_records[$gid])) { $privatedata = trim(get_last_private_data($gid)); $subs = get_all_subrecords("\n".$privatedata, '', false, false); - foreach($subs as $s=>$sub) { + foreach ($subs as $s=>$sub) { if (strstr($gedrec, $sub)===false) $gedrec = trim($gedrec)."\n".$sub; } unset($pgv_private_records[$gid]); @@ -441,7 +441,7 @@ function check_gedcom($gedrec, $chan=true) { //-- remove any empty lines $lines = explode("\n", $gedrec); $newrec = ''; - foreach($lines as $ind=>$line) { + foreach ($lines as $ind=>$line) { //-- remove any whitespace $line = trim($line); if (!empty($line)) $newrec .= $line."\n"; @@ -467,12 +467,12 @@ function remove_subrecord($oldrecord, $tag, $gid='', $num=0) { $n = 0; $matchstr = $tag; if (!empty($gid)) $matchstr .= " @".$gid."@"; - for($i=0; $i<count($gedlines); $i++) { + for ($i=0; $i<count($gedlines); $i++) { if (preg_match("/".$matchstr."/", $gedlines[$i])>0) { if ($num==-1 || $n==$num) { $glevel = $gedlines[$i]{0}; $i++; - while((isset($gedlines[$i]))&&(strlen($gedlines[$i])<4 || $gedlines[$i]{0}>$glevel)) $i++; + while ((isset($gedlines[$i]))&&(strlen($gedlines[$i])<4 || $gedlines[$i]{0}>$glevel)) $i++; $i--; } else $n++; @@ -494,7 +494,7 @@ function remove_subline($oldrecord, $linenum) { $newrec = ''; $gedlines = explode("\n", $oldrecord); - for($i=0; $i<$linenum; $i++) { + for ($i=0; $i<$linenum; $i++) { if (trim($gedlines[$i])!='') $newrec .= $gedlines[$i]."\n"; } if (isset($gedlines[$linenum])) { @@ -503,8 +503,8 @@ function remove_subline($oldrecord, $linenum) { $i++; if ($i<count($gedlines)) { //-- don't put empty lines in the record - while((isset($gedlines[$i]))&&(strlen($gedlines[$i])<4 || $gedlines[$i]{0}>$glevel)) $i++; - while($i<count($gedlines)) { + while ((isset($gedlines[$i]))&&(strlen($gedlines[$i])<4 || $gedlines[$i]{0}>$glevel)) $i++; + while ($i<count($gedlines)) { if (trim($gedlines[$i])!='') $newrec .= $gedlines[$i]."\n"; $i++; } @@ -759,12 +759,12 @@ function print_indi_form($nextaction, $famid, $linenum='', $namerec='', $famtag= do { if (!isset($name_fields[$type]) && !isset($adv_name_fields[$type])) { $text = ''; - for($j=2; $j<count($fields); $j++) { + for ($j=2; $j<count($fields); $j++) { if ($j>2) $text .= ' '; $text .= $fields[$j]; } $iscont = false; - while(($i+1<count($gedlines))&&(preg_match("/".($level+1)." (CON[CT]) ?(.*)/", $gedlines[$i+1], $cmatch)>0)) { + while (($i+1<count($gedlines))&&(preg_match("/".($level+1)." (CON[CT]) ?(.*)/", $gedlines[$i+1], $cmatch)>0)) { $iscont=true; if ($cmatch[1]=="CONT") $text.="\n"; if ($WORD_WRAPPED_NOTES) $text .= ' '; @@ -1338,7 +1338,7 @@ function add_simple_tag($tag, $upperlevel='', $label='', $readOnly='', $noClose= if (in_array($fact, $subnamefacts) || $fact=="LATI" || $fact=="LONG") { echo "<td class=\"optionbox $TEXT_DIRECTION wrap width25\">"; - }else{ + } else { echo "<td class=\"descriptionbox $TEXT_DIRECTION wrap width25\">"; } @@ -1350,13 +1350,13 @@ function add_simple_tag($tag, $upperlevel='', $label='', $readOnly='', $noClose= // tag name if (!empty($label)) { - if ($label=="Note" && $islink){ + if ($label=="Note" && $islink) { echo i18n::translate('Shared note'); } else { echo $label; } } else { - if ($fact=="NOTE" && $islink){ + if ($fact=="NOTE" && $islink) { echo translate_fact('SHARED_NOTE'); /* if (file_exists(WT_ROOT.'modules/GEDFact_assistant/_CENS/census_1_ctrl.php') && $pid && $label=="GEDFact Assistant") { @@ -1374,16 +1374,16 @@ function add_simple_tag($tag, $upperlevel='', $label='', $readOnly='', $noClose= // If using GEDFact-assistant window if ($action=="addnewnote_assisted") { // Do not print on GEDFact Assistant window - }else{ + } else { if (!in_array($fact, $emptyfacts)) { if ($fact=="DATE") { echo help_link('def_gedcom_date'); } elseif ($fact=="FORM" && $upperlevel!='OBJE') { echo help_link('FORM'); - } elseif ($fact=="NOTE" && $islink){ + } elseif ($fact=="NOTE" && $islink) { if (file_exists(WT_ROOT.'modules/GEDFact_assistant/_CENS/census_1_ctrl.php') && $pid && $label=="GEDFact Assistant") { echo help_link('edit_add_GEDFact_ASSISTED'); - }else{ + } else { echo help_link('edit_add_SHARED_NOTE'); } } else { @@ -1546,7 +1546,7 @@ function add_simple_tag($tag, $upperlevel='', $label='', $readOnly='', $noClose= // If using GEDFact-assistant window if ($action=="addnewnote_assisted") { echo "<input type=\"text\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", PrintReady(htmlspecialchars($value)), "\" style=\"width:4.1em;\" dir=\"ltr\""; - }else{ + } else { echo "<input type=\"text\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", PrintReady(htmlspecialchars($value)), "\" size=\"", $cols, "\" dir=\"ltr\""; } echo " class=\"{$fact}\""; @@ -2129,7 +2129,7 @@ function handle_updates($newged, $levelOverride="no") { if ($levelOverride=="no" || count($glevels)==0) $levelAdjust = 0; else $levelAdjust = $levelOverride - $glevels[0]; - for($j=0; $j<count($glevels); $j++) { + for ($j=0; $j<count($glevels); $j++) { // Look for empty SOUR reference with non-empty sub-records. // This can happen when the SOUR entry is deleted but its sub-records @@ -2138,7 +2138,7 @@ function handle_updates($newged, $levelOverride="no") { if ($tag[$j]=="SOUR" && ($text[$j]=="@@" || $text[$j]=='')) { $text[$j] = ''; $k = $j+1; - while(($k<count($glevels))&&($glevels[$k]>$glevels[$j])) { + while (($k<count($glevels))&&($glevels[$k]>$glevels[$j])) { $text[$k] = ''; $k++; } @@ -2152,7 +2152,7 @@ function handle_updates($newged, $levelOverride="no") { //-- this section checks if they have subrecords $k=$j+1; $pass=false; - while(($k<count($glevels))&&($glevels[$k]>$glevels[$j])) { + while (($k<count($glevels))&&($glevels[$k]>$glevels[$j])) { if ($text[$k]!='') { if (($tag[$j]!="OBJE")||($tag[$k]=="FILE")) { $pass=true; @@ -2243,7 +2243,7 @@ function unlinkMedia($linktoid, $linenum, $mediaid, $level=1, $chan=true) { //-- $linenum comes as an OBJE and the $mediaid to delete should be set if (!is_numeric($linenum)) { $newged = remove_subrecord($gedrec, $linenum, $mediaid); - }else{ + } else { $newged = remove_subline($gedrec, $linenum); } replace_gedrec($linktoid, WT_GED_ID, $newged, $chan); @@ -2370,12 +2370,12 @@ function create_edit_form($gedrec, $linenum, $level0type) { $label=implode(':', array_slice($stack, 1, $level)); $text = ''; - for($j=2; $j<count($fields); $j++) { + for ($j=2; $j<count($fields); $j++) { if ($j>2) $text .= ' '; $text .= $fields[$j]; } $text = rtrim($text); - while(($i+1<count($gedlines))&&(preg_match("/".($level+1)." CONT ?(.*)/", $gedlines[$i+1], $cmatch)>0)) { + while (($i+1<count($gedlines))&&(preg_match("/".($level+1)." CONT ?(.*)/", $gedlines[$i+1], $cmatch)>0)) { $text.="\n".$cmatch[1]; $i++; } @@ -2383,7 +2383,7 @@ function create_edit_form($gedrec, $linenum, $level0type) { if ($type=="SOUR") { $inSource = true; $levelSource = $level; - } elseif ($levelSource>=$level){ + } elseif ($levelSource>=$level) { $inSource = false; } @@ -2554,14 +2554,14 @@ function delete_person($pid, $gedrec='') { if (!empty($gedrec)) { $success = true; $ct = preg_match_all("/1 FAM. @(.*)@/", $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $famid = $match[$i][1]; $famrec = find_gedcom_record($famid, WT_GED_ID, true); if (!empty($famrec)) { $lines = explode("\n", $famrec); $newfamrec = ''; $lastlevel = -1; - foreach($lines as $indexval => $line) { + foreach ($lines as $indexval => $line) { $ct = preg_match("/^(\d+)/", $line, $levelmatch); if ($ct>0) $level = $levelmatch[1]; else $level = 1; @@ -2577,7 +2577,7 @@ function delete_person($pid, $gedrec='') { if ($pt<2) { for ($j=0; $j<$pt; $j++) { $xref = $pmatch[$j][1]; - if($xref!=$pid) { + if ($xref!=$pid) { $indirec = find_gedcom_record($xref, WT_GED_ID, true); $indirec = preg_replace("/1.*@$famid@.*/", '', $indirec); if (WT_DEBUG) { @@ -2608,7 +2608,7 @@ function delete_family($pid, $gedrec='') { if (!empty($gedrec)) { $success = true; $ct = preg_match_all("/1 (\w+) @(.*)@/", $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $type = $match[$i][1]; $id = $match[$i][2]; if (WT_DEBUG) { @@ -2619,7 +2619,7 @@ function delete_family($pid, $gedrec='') { $lines = explode("\n", $indirec); $newindirec = ''; $lastlevel = -1; - foreach($lines as $indexval => $line) { + foreach ($lines as $indexval => $line) { $lct = preg_match("/^(\d+)/", $line, $levelmatch); if ($lct>0) $level = $levelmatch[1]; else $level = 1; diff --git a/includes/functions/functions_mail.php b/includes/functions/functions_mail.php index ac682987a6..41d3fecee6 100644 --- a/includes/functions/functions_mail.php +++ b/includes/functions/functions_mail.php @@ -130,7 +130,7 @@ function webtreesMail($to, $from, $subject, $message) { $mail_object = new PHPMailer(); $mail_object->IsSMTP(); $mail_object->SetLanguage(WT_LOCALE, WT_ROOT.'library/phpmailer/language/'); - if ( $SMTP_AUTH && ( $SMTP_AUTH_USER && $SMTP_AUTH_PASS ) ) { + if ($SMTP_AUTH && $SMTP_AUTH_USER && $SMTP_AUTH_PASS) { $mail_object->SMTPAuth = $SMTP_AUTH; $mail_object->Username = $SMTP_AUTH_USER; $mail_object->Password = $SMTP_AUTH_PASS; @@ -161,25 +161,25 @@ function webtreesMail($to, $from, $subject, $message) { $mail_object->FromName = $SMTP_FROM_NAME; } $mail_object->AddAddress($to); - } else if (!empty($from_name)){ + } else if (!empty($from_name)) { $mail_object->FromName = $from_name; } else { $mail_object->FromName = $mail_object->AddAddress($to); } $mail_object->Subject = hex4email( $subject, 'UTF-8'); $mail_object->ContentType = $mailFormatText; - if ( $mailFormat != "multipart" ) { + if ($mailFormat!="multipart") { $mail_object->ContentType = $mailFormatText . '; format="flowed"'; $mail_object->CharSet = 'UTF-8'; $mail_object->Encoding = '8bit'; } - if ( $mailFormat == "html" || $mailFormat == "multipart" ) { + if ($mailFormat == "html" || $mailFormat == "multipart") { $mail_object->AddCustomHeader( 'Mime-Version: 1.0' ); $mail_object->IsHTML(true); } $mail_object->Body = $message; // attempt to send mail - if ( ! $mail_object->Send() ) { + if (!$mail_object->Send()) { echo i18n::translate('Message was not sent'), '<br />'; echo /* I18N: %s is an error message */ i18n::translate('Mailer error: %s', $mail_object->ErrorInfo), '<br />'; return false; diff --git a/includes/functions/functions_media_reorder.php b/includes/functions/functions_media_reorder.php index bbf9e43d3e..db033f1cad 100644 --- a/includes/functions/functions_media_reorder.php +++ b/includes/functions/functions_media_reorder.php @@ -126,7 +126,7 @@ function media_reorder_row($rtype, $rowm, $pid) { echo "</table>"; if (!isset($j)) { $j=0; - }else{ + } else { $j=$j; } $media_data = $rowm['m_media']; diff --git a/includes/functions/functions_mediadb.php b/includes/functions/functions_mediadb.php index 7565d86adc..a2aeaca64b 100644 --- a/includes/functions/functions_mediadb.php +++ b/includes/functions/functions_mediadb.php @@ -206,7 +206,7 @@ function get_medialist($currentdir = false, $directory = "", $linkonly = false, foreach ($rows as $row) { $fileName = check_media_depth($row->m_file, "NOTRUNC", "QUIET"); $isExternal = isFileExternal($fileName); - if ( $isExternal && (!$MEDIA_EXTERNAL || !$includeExternal) ) { + if ($isExternal && (!$MEDIA_EXTERNAL || !$includeExternal)) { continue; } if ($isExternal || !$currentdir || $directory == dirname($fileName) . "/") { @@ -885,7 +885,7 @@ function process_uploadMedia_form() { echo "<table class=\"list_table $TEXT_DIRECTION width100\">"; echo "<tr><td class=\"messagebox wrap\">"; - for($i=1; $i<6; $i++) { + for ($i=1; $i<6; $i++) { if (!empty($_FILES['mediafile'.$i]["name"]) || !empty($_FILES['thumbnail'.$i]["name"])) { $folderName = trim(trim(safe_POST('folder'.$i, WT_REGEX_NOSCRIPT)), '/'); // Validate and correct folder names @@ -1041,7 +1041,7 @@ function show_mediaUpload_form($URL='media.php', $showthumb=false) { echo '</td></tr>'; // Print 5 forms for uploading images - for($i=1; $i<6; $i++) { + for ($i=1; $i<6; $i++) { echo '<tr><td class="descriptionbox ', $TEXT_DIRECTION, ' wrap width25">'; echo i18n::translate('Media file to upload'), help_link('upload_media_file'); echo '</td>'; @@ -1606,14 +1606,14 @@ function PrintMediaLinks($links, $size = "small") { return true; } -function get_media_id_from_file($filename){ +function get_media_id_from_file($filename) { return WT_DB::prepare("SELECT m_media FROM `##media` WHERE m_file LIKE ?") ->execute(array("%{$filename}")) ->fetchOne(); } //returns an array of rows from the database containing the Person ID's for the people associated with this picture -function get_media_relations($mid){ +function get_media_relations($mid) { global $medialist; //-- check in the medialist cache first @@ -1676,7 +1676,7 @@ function picture_clip($person_id, $image_id, $filename, $thumbDir) return ""; } -function cropImage($image, $dest_image, $left, $top, $right, $bottom){ //$image is the string location of the original image, $dest_image is the string file location of the new image, $fx is the..., $fy is the... +function cropImage($image, $dest_image, $left, $top, $right, $bottom) { //$image is the string location of the original image, $dest_image is the string file location of the new image, $fx is the..., $fy is the... global $THUMBNAIL_WIDTH; $ims = @getimagesize($image); $cwidth = ($ims[0]-$right)-$left; @@ -1734,8 +1734,8 @@ function media_exists($filename) { if (empty($filename)) { return false; } if (isFileExternal($filename)) { return 1; } $filename = filename_decode($filename); - if ( file_exists($filename) ) { return 2; } - if ( $USE_MEDIA_FIREWALL && file_exists(get_media_firewall_path($filename)) ) { return 3; } + if (file_exists($filename)) { return 2; } + if ($USE_MEDIA_FIREWALL && file_exists(get_media_firewall_path($filename))) { return 3; } return false; } @@ -1751,12 +1751,12 @@ function media_filesize($filename) { // returns path to file on server function get_server_filename($filename) { global $USE_MEDIA_FIREWALL; - if (file_exists($filename)){ + if (file_exists($filename)) { return($filename); } if ($USE_MEDIA_FIREWALL) { $protectedfilename = get_media_firewall_path($filename); - if (file_exists($protectedfilename)){ + if (file_exists($protectedfilename)) { return($protectedfilename); } } @@ -1783,13 +1783,13 @@ function get_media_standard_path($path) { // recursively make directories // taken from http://us3.php.net/manual/en/function.mkdir.php#60861 function mkdirs($dir, $mode = WT_PERM_EXE, $recursive = true) { - if( is_null($dir) || $dir === "" ){ + if (is_null($dir) || $dir==="") { return FALSE; } - if( is_dir($dir) || $dir === "/" ){ + if (is_dir($dir) || $dir==="/") { return TRUE; } - if( mkdirs(dirname($dir), $mode, $recursive) ){ + if (mkdirs(dirname($dir), $mode, $recursive)) { return mkdir($dir, $mode); } return FALSE; @@ -1920,7 +1920,7 @@ function generate_thumbnail($filename, $thumbnail) { if ($fp = @fopen(filename_decode($filename), "rb")) { if ($fp===false) return false; $conts = ""; - while(!feof($fp)) { + while (!feof($fp)) { $conts .= fread($fp, 4098); } fclose($fp); diff --git a/includes/functions/functions_name.php b/includes/functions/functions_name.php index c368439767..fdaa4235f2 100644 --- a/includes/functions/functions_name.php +++ b/includes/functions/functions_name.php @@ -75,7 +75,7 @@ function get_common_surnames($min) { * @param string $lastname The name to strip * @return string The updated name */ -function strip_prefix($lastname){ +function strip_prefix($lastname) { $name = preg_replace(array('/ [jJsS][rR]\.?,/', '/ I+,/', '/^([a-z]{1,4}[\. \_\-\(\[])+/'), array(',',',',''), $lastname); $name = trim($name); if ($name=='') return $lastname; @@ -93,7 +93,7 @@ function check_NN($names) { $fullname = ''; - if (!is_array($names)){ + if (!is_array($names)) { $script = utf8_script($names); $NN = $UNKNOWN_NN[$script]; $names = preg_replace(array('~ /~','~/,~','~/~'), array(' ', ',', ' '), $names); @@ -106,10 +106,10 @@ function check_NN($names) { $names = preg_replace('/([^ ]+)\*/', '<span class="starredname">$1</span>', $names); return $names; } - if (count($names) == 2 && stristr($names[0], '@N.N') && stristr($names[1], '@N.N')){ + if (count($names) == 2 && stristr($names[0], '@N.N') && stristr($names[1], '@N.N')) { $fullname = i18n::translate('(unknown)'). ' + '. i18n::translate('(unknown)'); } else { - for($i=0; $i<count($names); $i++) { + for ($i=0; $i<count($names); $i++) { $script = utf8_script($names[$i]); $unknown = false; if (stristr($names[$i], '@N.N')) { @@ -169,7 +169,7 @@ function DMSoundex($name) { // Apply special transformation rules to the input string $name = utf8_strtoupper($name); - foreach($transformNameTable as $transformRule) { + foreach ($transformNameTable as $transformRule) { $name = str_replace($transformRule[0], $transformRule[1], $name); } @@ -218,13 +218,13 @@ function DMSoundex($name) { while ($state < count($soundTableEntry)) { if ($soundTableEntry[$state] == '') { // empty means 'ignore this sound in this state' - foreach($workingResult as $workingEntry) { + foreach ($workingResult as $workingEntry) { $tempEntry = $workingEntry; $tempEntry[count($tempEntry)-1] .= '!'; // Prevent false 'doubles' $partialResult[] = $tempEntry; } } else { - foreach($workingResult as $workingEntry) { + foreach ($workingResult as $workingEntry) { if ($soundTableEntry[$state] !== $workingEntry[count($workingEntry)-1]) { // Incoming sound isn't a duplicate of the previous sound $workingEntry[] = $soundTableEntry[$state]; diff --git a/includes/functions/functions_places.php b/includes/functions/functions_places.php index 814dece2d4..1f72dda7b5 100644 --- a/includes/functions/functions_places.php +++ b/includes/functions/functions_places.php @@ -148,7 +148,7 @@ function setup_place_subfields($element_id) { pdir='places/'+ctry+'/'; // select current country in the list sel=document.getElementsByName(place_tag+'_PLAC_CTRY_select')[0]; - for(i=0;i<sel.length;++i) if (sel.options[i].value==ctry) sel.options[i].selected=true; + for (i=0;i<sel.length;++i) if (sel.options[i].value==ctry) sel.options[i].selected=true; // refresh country flag var img=document.getElementsByName(place_tag+'_PLAC_CTRY_flag')[0]; var ctryFlag = 'places/flags/'+ctry+'.gif'; @@ -382,7 +382,7 @@ function get_place_short($gedcom_place) { $gedcom_place = trim($gedcom_place, " ,"); $exp = explode(",", $gedcom_place); $place = ""; - for($i=0; $i<$SHOW_LIST_PLACES && $i<count($exp); $i++) { + for ($i=0; $i<$SHOW_LIST_PLACES && $i<count($exp); $i++) { if ($i>0) $place .= ", "; $place.=trim($exp[$i]); } diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php index a62fe6c2d0..59ca6b4f02 100644 --- a/includes/functions/functions_print.php +++ b/includes/functions/functions_print.php @@ -137,7 +137,7 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { $fams = $person->getSpouseFamilies(); /* @var $family Family */ - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); @@ -153,7 +153,7 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { } } /* @var $child Person */ - foreach($children as $c=>$child) { + foreach ($children as $c=>$child) { $personlinks .= " <a href=\"".$child->getHtmlUrl()."\" $mouseAction1>"; if ($child->canDisplayName()) $personlinks .= PrintReady($child->getFullName()); else $personlinks .= i18n::translate('Private'); @@ -297,7 +297,7 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { $indirec = $person->getGedcomRecord(); $cssfacts = array("BIRT", "CHR", "DEAT", "BURI", "CREM", "ADOP", "BAPM", "BARM", "BASM", "BLES", "CHRA", "CONF", "FCOM", "ORDN", "NATU", "EMIG", "IMMI", "CENS", "PROB", "WILL", "GRAD", "RETI", "CAST", "DSCR", "EDUC", "IDNO", "NATI", "NCHI", "NMR", "OCCU", "PROP", "RELI", "RESI", "SSN", "TITL", "BAPL", "CONL", "ENDL", "SLGC", "_MILI"); - foreach($cssfacts as $indexval => $fact) { + foreach ($cssfacts as $indexval => $fact) { if (strpos($indirec, "1 $fact")!==false) $classfacts .= " $fact"; } if ($PEDIGREE_SHOW_GENDER) @@ -792,7 +792,7 @@ function print_favorite_selector($option=0) { $menu->addSubMenu($submenu); } - foreach($userfavs as $key=>$favorite) { + foreach ($userfavs as $key=>$favorite) { $GEDCOM = $favorite["file"]; $submenu = new Menu(); if ($favorite["type"]=="URL" && !empty($favorite["url"])) { @@ -819,7 +819,7 @@ function print_favorite_selector($option=0) { $submenu = new Menu("<strong>".i18n::translate('This GEDCOM\'s Favorites')."</strong>", "#", "right"); $submenu->addClass("favsubmenuitem", "favsubmenuitem_hover"); $menu->addSubMenu($submenu); - foreach($gedcomfavs as $key=>$favorite) { + foreach ($gedcomfavs as $key=>$favorite) { $GEDCOM = $favorite["file"]; $submenu = new Menu(); if ($favorite["type"]=="URL" && !empty($favorite["url"])) { @@ -853,7 +853,7 @@ function print_favorite_selector($option=0) { if ($gid!='') { echo "<option value=\"add\">- ", i18n::translate('Add to My Favorites'), " -</option>"; } - foreach($userfavs as $key=>$favorite) { + foreach ($userfavs as $key=>$favorite) { $GEDCOM = $favorite["file"]; if ($favorite["type"]=="URL" && !empty($favorite["url"])) { echo "<option value=\"", $favorite["url"], "\">", PrintReady($favorite["title"]); @@ -891,7 +891,7 @@ function print_favorite_selector($option=0) { } if (count($gedcomfavs)>0) { echo "<optgroup label=\"", i18n::translate('This GEDCOM\'s Favorites'), "\">"; - foreach($gedcomfavs as $key=>$favorite) { + foreach ($gedcomfavs as $key=>$favorite) { if ($favorite["type"]=="URL" && !empty($favorite["url"])) { echo "<option value=\"", $favorite["url"], "\">", PrintReady($favorite["title"]); echo "</option>"; @@ -944,7 +944,7 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false, $return=false } else { $text = get_cont($nlevel, $nrec); } - } else{ + } else { $text .= get_cont($nlevel, $nrec); } $text = str_replace("~~", "<br />", $text); @@ -982,7 +982,7 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false, $return=false // Check if Shared Note ----------------------------- if (preg_match('/^0 @'.WT_REGEX_XREF.'@ NOTE/', $nrec)) { $data .= i18n::translate('Shared note').": </span> "; - }else{ + } else { $data .= i18n::translate('Note').": </span>"; } } @@ -1005,7 +1005,7 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false, $return=false if (!$return) { echo $data; return true; - }else{ + } else { return $data; } @@ -1027,7 +1027,7 @@ function print_fact_notes($factrec, $level, $textOnly=false, $return=false) { $data = ""; $nlevel = $level+1; $ct = preg_match_all("/$level NOTE(.*)/", $factrec, $match, PREG_SET_ORDER); - for($j=0; $j<$ct; $j++) { + for ($j=0; $j<$ct; $j++) { $spos1 = strpos($factrec, $match[$j][0]); $spos2 = strpos($factrec."\n$level", "\n$level", $spos1+1); if (!$spos2) $spos2 = strlen($factrec); @@ -1062,7 +1062,7 @@ function print_fact_notes($factrec, $level, $textOnly=false, $return=false) { } } /* - if($closeSpan){ + if ($closeSpan) { if ($j==$ct-1 || $textOnly==false) { $data .= "</span>"; } else { @@ -1235,7 +1235,7 @@ function PrintReady($text, $InHeaders=false, $trim=true) { $queries = explode(" ", $query); $newtext = $text; $hasallhits = true; - foreach($queries as $index=>$query1) { + foreach ($queries as $index=>$query1) { $query1esc=preg_quote($query1, '/'); if (@preg_match("/(".$query1esc.")/i", $text)) { // Use @ as user-supplied query might be invalid. $newtext = preg_replace("/(".$query1esc.")/i", "\x01$1\x02", $newtext); @@ -1254,7 +1254,7 @@ function PrintReady($text, $InHeaders=false, $trim=true) { $queries = explode(" ", $firstname); $newtext = $text; $hasallhits = true; - foreach($queries as $index=>$query1) { + foreach ($queries as $index=>$query1) { $query1esc=preg_quote($query1, '/'); if (preg_match("/(".$query1esc.")/i", $text)) { $newtext = preg_replace("/(".$query1esc.")/i", "\x01$1\x02", $newtext); @@ -1273,7 +1273,7 @@ function PrintReady($text, $InHeaders=false, $trim=true) { $queries = explode(" ", $lastname); $newtext = $text; $hasallhits = true; - foreach($queries as $index=>$query1) { + foreach ($queries as $index=>$query1) { $query1esc=preg_quote($query1, '/'); if (preg_match("/(".$query1esc.")/i", $text)) { $newtext = preg_replace("/(".$query1esc.")/i", "\x01$1\x02", $newtext); @@ -1292,7 +1292,7 @@ function PrintReady($text, $InHeaders=false, $trim=true) { $queries = explode(" ", $place); $newtext = $text; $hasallhits = true; - foreach($queries as $index=>$query1) { + foreach ($queries as $index=>$query1) { $query1esc=preg_quote($query1, '/'); if (preg_match("/(".$query1esc.")/i", $text)) { $newtext = preg_replace("/(".$query1esc.")/i", "\x01$1\x02", $newtext); @@ -1311,7 +1311,7 @@ function PrintReady($text, $InHeaders=false, $trim=true) { $queries = explode(" ", $year); $newtext = $text; $hasallhits = true; - foreach($queries as $index=>$query1) { + foreach ($queries as $index=>$query1) { $query1=preg_quote($query1, '/'); if (preg_match("/(".$query1.")/i", $text)) { $newtext = preg_replace("/(".$query1.")/i", "\x01$1\x02", $newtext); @@ -1716,7 +1716,7 @@ function format_fact_place(&$eventObj, $anchor=false, $sub=false, $lds=false) { // reverse the array so that we get the top level first $levels = array_reverse($levels); $tempURL = "placelist.php?action=show&"; - foreach($levels as $pindex=>$ppart) { + foreach ($levels as $pindex=>$ppart) { $tempURL .= "parent[{$pindex}]=".rawurlencode($ppart).'&'; } $tempURL .= 'level='.count($levels); @@ -1830,7 +1830,7 @@ function format_first_major_fact($key, $majorfacts = array("BIRT", "CHR", "BAPM" * If the fact already exists in the second array, delete it from the first one. */ function CheckFactUnique($uniquefacts, $recfacts, $type) { - foreach($recfacts as $indexval => $factarray) { + foreach ($recfacts as $indexval => $factarray) { $fact=false; if (is_object($factarray)) { /* @var $factarray Event */ @@ -1865,7 +1865,7 @@ function print_add_new_fact($id, $usedfacts, $type) { // -- Add from clipboard if (!empty($_SESSION["clipboard"])) { $newRow = true; - foreach(array_reverse($_SESSION["clipboard"], true) as $key=>$fact) { + foreach (array_reverse($_SESSION["clipboard"], true) as $key=>$fact) { if ($fact["type"]==$type || $fact["type"]=='all') { if ($newRow) { $newRow = false; @@ -1938,13 +1938,13 @@ function print_add_new_fact($id, $usedfacts, $type) { echo "<td class=\"optionbox wrap ", $TEXT_DIRECTION, "\">"; echo "<form method=\"get\" name=\"newfactform\" action=\"\" onsubmit=\"return false;\">"; echo "<select id=\"newfact\" name=\"newfact\">"; - foreach($translated_addfacts as $fact=>$fact_name) { + foreach ($translated_addfacts as $fact=>$fact_name) { echo '<option value="', $fact, '">', i18n::translate('%1$s [%2$s]', $fact_name, $fact), '</option>'; } if (($type == "INDI") || ($type == "FAM")) echo "<option value=\"EVEN\">", i18n::translate('Custom Event'), " [EVEN]</option>"; echo "</select>"; echo " <input type=\"button\" value=\"", i18n::translate('Add'), "\" onclick=\"add_record('$id', 'newfact');\" /> "; - foreach($quickfacts as $fact) echo " <small><a href='javascript://$fact' onclick=\"add_new_record('$id', '$fact');return false;\">", translate_fact($fact), "</a></small> "; + foreach ($quickfacts as $fact) echo " <small><a href='javascript://$fact' onclick=\"add_new_record('$id', '$fact');return false;\">", translate_fact($fact), "</a></small> "; echo "</form>"; echo "</td></tr>"; } @@ -2148,7 +2148,7 @@ function get_lds_glance($indirec) { else $text .= "_"; $found = false; $ct = preg_match_all("/1 FAMS @(.*)@/", $indirec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $famrec = find_family_record($match[$i][1], $ged_id); if ($famrec) { $ord = get_sub_record(1, "1 SLGS", $famrec); diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php index b287458f91..c2388f788a 100644 --- a/includes/functions/functions_print_facts.php +++ b/includes/functions/functions_print_facts.php @@ -379,7 +379,7 @@ function print_fact(&$eventObj, $noedit=false) { "TIME", "TYPE", "WWW", "_EMAIL", "_WT_USER", "URL", "AGE", "_WTS", "_WTFS"); $ct = preg_match_all("/\n2 (\w+) (.*)/", $factrec, $match, PREG_SET_ORDER); if ($ct>0) echo "<br />"; - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $factref = $match[$i][1]; if (!in_array($factref, $special_facts)) { $label = translate_fact($fact.':'.$factref, $label_person); @@ -462,7 +462,7 @@ function print_fact_sources($factrec, $level, $return=false) { // -- Systems not using source records [ 1046971 ] $ct = preg_match_all("/$level SOUR (.*)/", $factrec, $match, PREG_SET_ORDER); - for($j=0; $j<$ct; $j++) { + for ($j=0; $j<$ct; $j++) { if (strpos($match[$j][1], "@")===false) { $srec = get_sub_record($level, "$level SOUR ", $factrec, $j+1); $srec = substr($srec, 6); // remove "2 SOUR" @@ -474,7 +474,7 @@ function print_fact_sources($factrec, $level, $return=false) { // -- find source for each fact $ct = preg_match_all("/$level SOUR @(.*)@/", $factrec, $match, PREG_SET_ORDER); $spos2 = 0; - for($j=0; $j<$ct; $j++) { + for ($j=0; $j<$ct; $j++) { $sid = $match[$j][1]; if (canDisplayRecord(WT_GED_ID, find_source_record($sid, WT_GED_ID))) { $spos1 = strpos($factrec, "$level SOUR @".$sid."@", $spos2); @@ -612,12 +612,12 @@ function print_media_links($factrec, $level, $pid='') { echo "</a>"; } echo "</td><td>"; - if(empty($SEARCH_SPIDER)) { + if (empty($SEARCH_SPIDER)) { echo "<a href=\"mediaviewer.php?mid={$media_id}\">"; } if ($TEXT_DIRECTION=="rtl" && !hasRTLText($mediaTitle)) echo "<i>" , getLRM() , PrintReady($mediaTitle), "</i>"; else echo "<i>", PrintReady($mediaTitle), "</i><br />"; - if(empty($SEARCH_SPIDER)) { + if (empty($SEARCH_SPIDER)) { echo "</a>"; } // NOTE: echo the notes of the media @@ -625,7 +625,7 @@ function print_media_links($factrec, $level, $pid='') { // NOTE: echo the format of the media if (!empty($row["m_ext"])) { echo "<br /><span class=\"label\">", translate_fact('FORM'), ": </span> <span class=\"field\">", $row["m_ext"], "</span>"; - if($imgsize[2]!==false) { + if ($imgsize[2]!==false) { echo "<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">" , $imgsize[0] , ($TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM() . " ") : " x ") , $imgsize[1] , "</span>"; } } @@ -664,7 +664,7 @@ function print_media_links($factrec, $level, $pid='') { $ct = preg_match("/WT_FAMILY_ID: (.*)/", $factrec, $match); if ($ct>0) { $famid = trim($match[1]); - if(empty($SEARCH_SPIDER)) { + if (empty($SEARCH_SPIDER)) { echo "<a href=\"family.php?famid={$famid}\">", i18n::translate('View Family'); echo "</a>"; } @@ -696,7 +696,7 @@ function print_address_structure($factrec, $level) { $nlevel = $level+1; $ct = preg_match_all("/$level ADDR(.*)/", $factrec, $omatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $arec = get_sub_record($level, "$level ADDR", $factrec, $i+1); $resultText = ""; if ($level>1) $resultText .= "<span class=\"label\">".translate_fact('ADDR').": </span><br /><div class=\"indent\">"; @@ -766,7 +766,7 @@ function print_address_structure($factrec, $level) { $resultText .= "<table>"; $ct = preg_match_all("/$level PHON (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; $resultText .= "<td><span class=\"label\"><b>".translate_fact('PHON').": </b></span></td><td><span class=\"field\">"; $resultText .= getLRM() . $omatch[$i][1] . getLRM(); @@ -775,7 +775,7 @@ function print_address_structure($factrec, $level) { } $ct = preg_match_all("/$level FAX (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; $resultText .= "<td><span class=\"label\"><b>".translate_fact('FAX').": </b></span></td><td><span class=\"field\">"; $resultText .= getLRM() . $omatch[$i][1] . getLRM(); @@ -784,7 +784,7 @@ function print_address_structure($factrec, $level) { } $ct = preg_match_all("/$level EMAIL (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; $resultText .= "<td><span class=\"label\"><b>".translate_fact('EMAIL').": </b></span></td><td><span class=\"field\">"; $resultText .= "<a href=\"mailto:".$omatch[$i][1]."\">".$omatch[$i][1]."</a>"; @@ -793,7 +793,7 @@ function print_address_structure($factrec, $level) { } $ct = preg_match_all("/$level (WWW|URL) (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; $resultText .= "<td><span class=\"label\"><b>".translate_fact($omatch[$i][1]).": </b></span></td><td><span class=\"field\">"; $resultText .= "<a href=\"".$omatch[$i][2]."\" target=\"_blank\">".$omatch[$i][2]."</a>"; @@ -818,7 +818,7 @@ function print_main_sources($factrec, $level, $pid, $linenum, $noedit=false) { // -- find source for each fact $ct = preg_match_all("/$level SOUR @(.*)@/", $factrec, $match, PREG_SET_ORDER); $spos2 = 0; - for($j=0; $j<$ct; $j++) { + for ($j=0; $j<$ct; $j++) { $sid = $match[$j][1]; $spos1 = strpos($factrec, "$level SOUR @".$sid."@", $spos2); $spos2 = strpos($factrec, "\n$level", $spos1); @@ -925,7 +925,7 @@ function printSourceStructure($textSOUR) { $date=new GedcomDate($textSOUR['DATE']); $html.='<div class="indent"><span class="label">'.translate_fact('DATA:DATE').':</span> <span class="field">'.$date->Display(false).'</span></div>'; } - foreach($textSOUR['TEXT'] as $text) { + foreach ($textSOUR['TEXT'] as $text) { $html.='<div class="indent"><span class="label">'.translate_fact('TEXT').':</span> <span class="field">'.PrintReady(expand_urls($text)).'</span></div>'; } } @@ -1007,7 +1007,7 @@ function print_main_notes($factrec, $level, $pid, $linenum, $noedit=false) { if (strpos($factrec, "WT_OLD")!==false) $styleadd="change_old"; $nlevel = $level+1; $ct = preg_match_all("/$level NOTE(.*)/", $factrec, $match, PREG_SET_ORDER); - for($j=0; $j<$ct; $j++) { + for ($j=0; $j<$ct; $j++) { $nrec = get_sub_record($level, "$level NOTE", $factrec, $j+1); if (!canDisplayFact($pid, $ged_id, $factrec)) return false; $nt = preg_match("/\d NOTE @(.*)@/", $match[$j][0], $nmatch); @@ -1062,7 +1062,7 @@ function print_main_notes($factrec, $level, $pid, $linenum, $noedit=false) { } else { echo translate_fact($factname, $parent); } - } else if ($factname != "NOTE"){ + } else if ($factname != "NOTE") { // Note is already printed echo translate_fact($factname, $parent); } @@ -1087,7 +1087,7 @@ function print_main_notes($factrec, $level, $pid, $linenum, $noedit=false) { $centitl = str_replace("~~", "", trim($n1match[1])); $centitl = str_replace("<br />", "", $centitl); $centitl = "<a href=\"note.php?nid=$nid\">".$centitl."</a>"; - }else{ + } else { $text = preg_replace("/~~/", "<br />", trim($n1match[1])); } } @@ -1095,9 +1095,9 @@ function print_main_notes($factrec, $level, $pid, $linenum, $noedit=false) { $text = expand_urls($text); $text = PrintReady($text)." <br />"; // If Census assistant installed, and if Formatted Shared Note (using pipe "|" as delimiter) ------- - if ( strstr($text, "|") && file_exists(WT_ROOT.'modules/GEDFact_assistant/_CENS/census_note_decode.php') ) { + if (strstr($text, "|") && file_exists(WT_ROOT.'modules/GEDFact_assistant/_CENS/census_note_decode.php')) { require WT_ROOT.'modules/GEDFact_assistant/_CENS/census_note_decode.php'; - }else{ + } else { $text = $centitl."".$text; } } @@ -1142,7 +1142,7 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { //-- find all of the related ids if ($related) { $ct = preg_match_all("/1 FAMS @(.*)@/", $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $ids[] = trim($match[$i][1]); } } @@ -1152,7 +1152,7 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { if ($level>0) $sort_regexp = "/".$level." _WT_OBJE_SORT @(.*)@/"; else $sort_regexp = "/_WT_OBJE_SORT @(.*)@/"; $sort_ct = preg_match_all($sort_regexp, $gedrec, $sort_match, PREG_SET_ORDER); - for($i=0; $i<$sort_ct; $i++) { + for ($i=0; $i<$sort_ct; $i++) { if (!isset($sort_current_objes[$sort_match[$i][1]])) $sort_current_objes[$sort_match[$i][1]] = 1; else $sort_current_objes[$sort_match[$i][1]]++; $sort_obje_links[$sort_match[$i][1]][] = $sort_match[$i][0]; @@ -1172,7 +1172,7 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { if ($level>0) $regexp = "/".$level." OBJE @(.*)@/"; else $regexp = "/OBJE @(.*)@/"; $ct = preg_match_all($regexp, $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { if (!isset($current_objes[$match[$i][1]])) $current_objes[$match[$i][1]] = 1; else $current_objes[$match[$i][1]]++; $obje_links[$match[$i][1]][] = $match[$i][0]; @@ -1184,7 +1184,7 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { $sqlmm .= "mm_gid IN ("; $vars=array(); $i=0; - foreach($ids as $key=>$id) { + foreach ($ids as $key=>$id) { if ($i>0) $sqlmm .= ", "; $sqlmm .= "?"; $vars[]=$id; @@ -1201,7 +1201,7 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { // LBox --- media sort ------------------------------------- if ($sort_ct>0) { $sqlmm .= $orderbylist; - }else{ + } else { $sqlmm .= " ORDER BY mm_gid DESC "; } // --------------------------------------------------------------- @@ -1265,7 +1265,7 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { } } } - foreach($rows as $rtype => $rowm) { + foreach ($rows as $rtype => $rowm) { $res = print_main_media_row($rtype, $rowm, $pid); $media_found = $media_found || $res; $foundObjs[$rowm['m_media']]=true; @@ -1276,8 +1276,8 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) { //-- objects are removed from the $current_objes list as they are printed //-- any objects left in the list are new objects recently added to the gedcom //-- but not yet accepted into the database. We will print them too. - foreach($current_objes as $media_id=>$value) { - while($value>0) { + foreach ($current_objes as $media_id=>$value) { + while ($value>0) { $objSubrec = array_pop($obje_links[$media_id]); //-- check if we need to get the object from a remote location $ct = preg_match("/(.*):(.*)/", $media_id, $match); @@ -1410,7 +1410,7 @@ function print_main_media_row($rtype, $rowm, $pid) { echo ' alt="', PrintReady(htmlspecialchars($name)), '" title="', PrintReady(htmlspecialchars($name)), '" /></a>'; } - if(empty($SEARCH_SPIDER)) { + if (empty($SEARCH_SPIDER)) { echo "<a href=\"mediaviewer.php?mid={$rowm['m_media']}\">"; } if ($TEXT_DIRECTION=="rtl" && !hasRTLText($mediaTitle)) { @@ -1425,14 +1425,14 @@ function print_main_media_row($rtype, $rowm, $pid) { if (empty($addtitle)) $addtitle = get_gedcom_value("TITL:ROMN", 1, $rowm["m_gedrec"]); if (!empty($addtitle)) echo "<br />", PrintReady(htmlspecialchars($addtitle)); echo "</i>"; - if(empty($SEARCH_SPIDER)) { + if (empty($SEARCH_SPIDER)) { echo "</a>"; } // NOTE: echo the format of the media if (!empty($rowm["m_ext"])) { echo "<br /><span class=\"label\">", translate_fact('FORM'), ": </span> <span class=\"field\">", $rowm["m_ext"], "</span>"; - if(isset($imgsize) and $imgsize[2]!==false) { + if (isset($imgsize) and $imgsize[2]!==false) { echo "<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imgsize[0], $TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM(). " ") : " x ", $imgsize[1], "</span>"; } } @@ -1475,7 +1475,7 @@ function print_main_media_row($rtype, $rowm, $pid) { } echo "</a>"; } - if(empty($SEARCH_SPIDER)) { + if (empty($SEARCH_SPIDER)) { if ($spouse) echo " - "; $famid = $rowm['mm_gid']; echo "<a href=\"family.php?famid={$famid}\">", i18n::translate('View Family'); diff --git a/includes/functions/functions_print_lists.php b/includes/functions/functions_print_lists.php index 950f652367..82de3892b7 100644 --- a/includes/functions/functions_print_lists.php +++ b/includes/functions/functions_print_lists.php @@ -134,7 +134,7 @@ function print_indi_table($datalist, $legend="", $option="") { $d100y=new GedcomDate(date('Y')-100); // 100 years ago $dateY = date("Y"); $unique_indis=array(); // Don't double-count indis with multiple names. - foreach($datalist as $key => $value) { + foreach ($datalist as $key => $value) { if (is_object($value)) { // Array of objects $person=$value; } elseif (!is_array($value)) { // Array of IDs @@ -503,7 +503,7 @@ function print_fam_table($datalist, $legend="", $option="") { $hidden = 0; $num = 0; $d100y=new GedcomDate(date('Y')-100); // 100 years ago - foreach($datalist as $key => $value) { + foreach ($datalist as $key => $value) { if (is_object($value)) { // Array of objects $family=$value; } elseif (!is_array($value)) { // Array of IDs @@ -1492,7 +1492,7 @@ function print_events_table($startjd, $endjd, $events='BIRT MARR DEAT', $only_li uasort($filtered_events, 'event_sort_name'); } - foreach($filtered_events as $value) { + foreach ($filtered_events as $value) { $return .= "<tr>"; //-- Record name(s) $name = $value['name']; @@ -1647,7 +1647,7 @@ function print_events_list($startjd, $endjd, $events='BIRT MARR DEAT', $only_liv uasort($filtered_events, 'event_sort_name'); } - foreach($filtered_events as $value) { + foreach ($filtered_events as $value) { $return .= "<a href=\"".$value['url']."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($value['name'])."</a>".$value['sex']; $return .= "<br /><div class=\"indent\">"; $return .= translate_fact($value['fact']).' - '.$value['date']->Display(true); diff --git a/includes/functions/functions_rtl.php b/includes/functions/functions_rtl.php index 35c33a86dd..69346a4461 100644 --- a/includes/functions/functions_rtl.php +++ b/includes/functions/functions_rtl.php @@ -49,11 +49,11 @@ $numberPrefix = '+-'; // Treat these like numbers when at beginning or end of nu $numberPunctuation = '- ,.:/'; // Treat these like numbers when inside numeric strings $punctuation = ',.:;?!'; -function getLRM(){ +function getLRM() { return "‎"; } -function getRLM(){ +function getRLM() { return "‏"; } @@ -338,7 +338,7 @@ function spanLTRRTL($inputText, $direction='BOTH', $class='') { $result .= $waitingText; $waitingText = ''; - foreach($openParDirection as $index => $value) { + foreach ($openParDirection as $index => $value) { // Since we now know the proper direction, remember it for all waiting opening parentheses if ($value == '?') { $openParDirection[$index] = $currentState; @@ -1080,7 +1080,7 @@ function bidi_text($text) { //מספר מזהה (SSN) $found = false; - foreach($RTLOrd as $indexval => $ord) { + foreach ($RTLOrd as $indexval => $ord) { if (strpos($text, chr($ord))!==false) $found=true; } if (!$found) return $text; @@ -1091,7 +1091,7 @@ function bidi_text($text) { $temp = ""; $state = 0; $p = 0; - for($i=0; $i<strlen($text); $i++) { + for ($i=0; $i<strlen($text); $i++) { $letter = $text{$i}; //print $letter.ord($letter).","; //-- handle Hebrew chars @@ -1151,7 +1151,7 @@ function bidi_text($text) { //-- loop through and check if parenthesis are correct... if parenthesis were broken by //-- rtl text then they need to be reversed - for($i=0; $i<count($parts); $i++) { + for ($i=0; $i<count($parts); $i++) { $bef = ""; $aft = ""; $wt = preg_match("/^(\s*).*(\s*)$/", $parts[$i], $match); diff --git a/includes/functions/functions_tools.php b/includes/functions/functions_tools.php index dd8b1336e2..7f4d97edae 100644 --- a/includes/functions/functions_tools.php +++ b/includes/functions/functions_tools.php @@ -51,7 +51,7 @@ function need_place_cleanup() //$ct = preg_match("/SOUR.+(Family Tree Maker|FTW)/", $fcontents); //if ($ct==0) return false; $ct = preg_match_all ("/^1 (CAST|DSCR|IDNO|NATI|NCHI|NMR|OCCU|PROP|RELI|SSN|TITL|_FA1|_FA2|_FA3|_FA4|_FA5|_FA6)(\s*)$[\s]+(^2 TYPE(.*)[\s]+)?(^2 DATE(.*)[\s]+)?^2 PLAC (.*)$/m",$fcontents,$matches, PREG_SET_ORDER); - if($ct>0) + if ($ct>0) return $matches[0]; return false; } @@ -81,12 +81,12 @@ function fixreplaceval($val1,$val7,$val3,$val5) $val = "1 ".$val1." ".trim($val7)."\n"; //trim off trailing spaces $val3 = rtrim($val3); - if(!empty($val3)) + if (!empty($val3)) $val = $val.$val3; //trim off trailing spaces $val5 = rtrim($val5); - if(!empty($val5)) + if (!empty($val5)) { $val = $val.$val5; } @@ -110,25 +110,25 @@ function need_date_cleanup() { global $fcontents; $ct = preg_match_all ("/\n\d DATE[^\d]+(\d\d\d\d)[\/\\\\\-\.](\d\d)[\/\\\\\-\.](\d\d)/",$fcontents,$matches, PREG_SET_ORDER); - if($ct>0) { + if ($ct>0) { return $matches[0]; } else { $ct = preg_match_all ("/\n\d DATE[^\d]+(\d\d)[\/\\\\\-\.](\d\d)[\/\\\\\-\.](\d\d\d\d)/",$fcontents,$matches, PREG_SET_ORDER); - if($ct>0) { + if ($ct>0) { // The user needs to choose between DMY and MDY $matches[0]["choose"] = true; return $matches[0]; } else { $ct = preg_match_all ("/\n\d DATE ([^\d]+) [0-9]{1,2}, (\d\d\d\d)/",$fcontents,$matches, PREG_SET_ORDER); - if($ct>0) { + if ($ct>0) { return $matches[0]; } else { $ct = preg_match_all("/\n\d DATE (\d\d)[^\s]([^\d]+)[^\s](\d\d\d\d)/", $fcontents, $matches, PREG_SET_ORDER); - if($ct>0) { + if ($ct>0) { return $matches[0]; } else { if (preg_match_all("/^\d DATE (BET|FROM) \d\d? (AND|TO) \d\d? \w\w\w \d\d\d\d/m", $fcontents, $matches, PREG_SET_ORDER)) { @@ -143,18 +143,18 @@ function need_date_cleanup() function changemonth($monval) { - if($monval=="01") return "JAN"; - elseif($monval=="02") return "FEB"; - elseif($monval=="03") return "MAR"; - elseif($monval=="04") return "APR"; - elseif($monval=="05") return "MAY"; - elseif($monval=="06") return "JUN"; - elseif($monval=="07") return "JUL"; - elseif($monval=="08") return "AUG"; - elseif($monval=="09") return "SEP"; - elseif($monval=="10") return "OCT"; - elseif($monval=="11") return "NOV"; - elseif($monval=="12") return "DEC"; + if ($monval=="01") return "JAN"; + elseif ($monval=="02") return "FEB"; + elseif ($monval=="03") return "MAR"; + elseif ($monval=="04") return "APR"; + elseif ($monval=="05") return "MAY"; + elseif ($monval=="06") return "JUN"; + elseif ($monval=="07") return "JUL"; + elseif ($monval=="08") return "AUG"; + elseif ($monval=="09") return "SEP"; + elseif ($monval=="10") return "OCT"; + elseif ($monval=="11") return "NOV"; + elseif ($monval=="12") return "DEC"; return $monval; } @@ -213,12 +213,12 @@ function xref_change($tag="RIN") //-- find all of the XREFS in the file $ct = preg_match_all("/0 @(.*)@ INDI/", $fcontents, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $xref = trim($match[$i][1]); $indirec = find_gedcom_record($xref, $ged_id, true); if ($indirec) { $rt = preg_match("/1 NAME (.*)/", $indirec, $rmatch); - if($rt>0) + if ($rt>0) { $name = trim($rmatch[1])." (".$xref.")"; $name = str_replace("/","",$name); diff --git a/includes/media_reorder.php b/includes/media_reorder.php index f7d37a32ad..9b37238244 100644 --- a/includes/media_reorder.php +++ b/includes/media_reorder.php @@ -69,7 +69,7 @@ require_once WT_ROOT.'includes/functions/functions_print_facts.php'; $ids = array($pid); if ($related) { $ct = preg_match_all("/1 FAMS @(.*)@/", $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $ids[] = trim($match[$i][1]); } } @@ -162,7 +162,7 @@ require_once WT_ROOT.'includes/functions/functions_print_facts.php'; $rows = array(); $rows['normal'] = $rowm; if (isset($current_objes[$rowm['m_media']])) $current_objes[$rowm['m_media']]--; - foreach($rows as $rtype => $rowm) { + foreach ($rows as $rtype => $rowm) { $res = media_reorder_row($rtype, $rowm, $pid); $media_found = $media_found || $res; $foundObjs[$rowm['m_media']] = true; diff --git a/includes/media_reorder_count.php b/includes/media_reorder_count.php index e6484a43b0..62c5b78f13 100644 --- a/includes/media_reorder_count.php +++ b/includes/media_reorder_count.php @@ -42,7 +42,7 @@ $gedrec = find_gedcom_record($pid, WT_GED_ID); $level=0; $regexp = "/OBJE @(.*)@/"; $ct_indi = preg_match_all($regexp, $gedrec, $match, PREG_SET_ORDER); -for($i=0; $i<$ct_indi; $i++) { +for ($i=0; $i<$ct_indi; $i++) { if (!isset($current_objes[$match[$i][1]])) $current_objes[$match[$i][1]] = 1; else $current_objes[$match[$i][1]]++; $obje_links[$match[$i][1]][] = $match[$i][0]; @@ -54,7 +54,7 @@ if ($ct>0) { $related=true; if ($related) { $ct = preg_match_all("/1 FAMS @(.*)@/", $gedrec, $match, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $ids[] = trim($match[$i][1]); } } @@ -64,7 +64,7 @@ if ($ct>0) { $sqlmm .= "mm_gid IN ("; $vars=array(); $i=0; - foreach($ids as $key=>$id) { + foreach ($ids as $key=>$id) { if ($i>0) $sqlmm .= ","; $sqlmm .= "?"; $vars[]=$id; @@ -79,7 +79,7 @@ if ($ct>0) { // Get related media item count $ct_db = count($rows); //else if indi not related -}else{ +} else { // Get related media item count $ct_db = 0; } @@ -87,7 +87,7 @@ if ($ct>0) { // Gedcom media count -------------------------------- if (isset($current_objes)) { $ct_objs = count($current_objes); -}else{ +} else { $ct_objs = 0; } //Total Media count diff --git a/includes/session_spider.php b/includes/session_spider.php index c8c335f1ac..3d3384522c 100644 --- a/includes/session_spider.php +++ b/includes/session_spider.php @@ -49,11 +49,11 @@ function gen_spider_session_name($bot_name, $bot_language) { $outname = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $bot_limit = strlen($bot_name); - if($bot_limit > 27) { + if ($bot_limit > 27) { $bot_limit = 27; } - for($x=0; $x < $bot_limit; $x++) { - if(preg_match('/^[a-zA-Z0-9]+$/', $bot_name{$x})) { + for ($x=0; $x < $bot_limit; $x++) { + if (preg_match('/^[a-zA-Z0-9]+$/', $bot_name{$x})) { $outname{$x+2} = strtoupper($bot_name{$x}); } elseif ($bot_name{$x} == '.') { $outname{$x+2} = 'd'; @@ -213,8 +213,8 @@ $spider_name = ' // If you want to disable spider detection, set real to true here. $real = false; -if($ua != "") { - foreach($real_browsers as $browser_check) { +if ($ua != "") { + foreach ($real_browsers as $browser_check) { if (strpos($ua, $browser_check)!==false) { $real = true; break; @@ -239,7 +239,7 @@ else { $real = true; } -if(!$real) { +if (!$real) { $bot_name = $ua; // strip out several common strings that clutter the User Agent. $bot_name = preg_replace("/Mozilla\/... \(compatible;/i", "", $bot_name); @@ -252,15 +252,15 @@ if(!$real) { $y = 0; $valid_char = false; $bot_limit = strlen($bot_name); - for($x=0; $x < $bot_limit; $x++) { - if(preg_match('/^[a-zA-Z]+$/', $bot_name{$x})) { + for ($x=0; $x < $bot_limit; $x++) { + if (preg_match('/^[a-zA-Z]+$/', $bot_name{$x})) { $spider_name{$y} = $bot_name{$x}; $valid_char = true; $y++; if ($y > 70) break; } else if ($bot_name{$x} == ' ') { - if($valid_char) { + if ($valid_char) { $spider_name{$y} = ' '; $valid_char = false; $y++; @@ -268,7 +268,7 @@ if(!$real) { } } else if ($bot_name{$x} == '.') { - if($valid_char) { + if ($valid_char) { $spider_name{$y} = '.'; $valid_char = true; $y++; @@ -300,7 +300,7 @@ if(!$real) { if ($y > 70) break; } else { // Compress consecutive invalids down to one space char. - if($valid_char) { + if ($valid_char) { $spider_name{$y} = ' '; $valid_char = false; $y++; @@ -339,10 +339,10 @@ try { // Initial installation? Site Down? Fail silently. } -if((empty($SEARCH_SPIDER)) && (!empty($_SESSION['last_spider_name']))) // user following a search engine listing in, +if ((empty($SEARCH_SPIDER)) && (!empty($_SESSION['last_spider_name']))) // user following a search engine listing in, Zend_Session::regenerateId(); -if(!empty($SEARCH_SPIDER)) { +if (!empty($SEARCH_SPIDER)) { $spidertime = time(); $spiderdate = date("d.m.Y", $spidertime); // Do we need to log this spider access? @@ -355,7 +355,7 @@ if(!empty($SEARCH_SPIDER)) { break; } } - if(isset($_SESSION['spider_count'])) + if (isset($_SESSION['spider_count'])) $spidercount = $_SESSION['spider_count'] + 1; else { $spidercount = 1; @@ -365,8 +365,8 @@ if(!empty($SEARCH_SPIDER)) { AddToLog("New search engine encountered: ->".$outstr."<- UA>{$ua}< >{$_SERVER["REQUEST_URI"]}<", 'auth'); } } - if(isset($_SESSION['last_spider_date'])) { - if($spiderdate != $_SESSION['last_spider_date']) { + if (isset($_SESSION['last_spider_date'])) { + if ($spiderdate != $_SESSION['last_spider_date']) { //adds a message to the log that a new spider session is starting if ($logSpider) { require_once WT_ROOT.'includes/authentication.php'; // -- Loaded early so AddToLog works @@ -378,10 +378,10 @@ if(!empty($SEARCH_SPIDER)) { } $_SESSION['last_spider_date'] = $spiderdate; $_SESSION['spider_count'] = $spidercount; - if(isset($_SERVER['REMOTE_ADDR'])) + if (isset($_SERVER['REMOTE_ADDR'])) $_SESSION['last_spider_ip'] = $_SERVER['REMOTE_ADDR']; $_SESSION['last_spider_name'] = $SEARCH_SPIDER; - if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $_SESSION['last_spider_lang'] = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $_SESSION['wt_user'] = ""; // Don't allow search engine into user/admin mode. diff --git a/index_edit.php b/index_edit.php index e8bff176ff..8fea0321ca 100644 --- a/index_edit.php +++ b/index_edit.php @@ -245,13 +245,13 @@ if ($action=="configure") { function select_options() { section_select = document.getElementById('main_select'); if (section_select) { - for(i=0; i<section_select.length; i++) { + for (i=0; i<section_select.length; i++) { section_select.options[i].selected=true; } } section_select = document.getElementById('right_select'); if (section_select) { - for(i=0; i<section_select.length; i++) { + for (i=0; i<section_select.length; i++) { section_select.options[i].selected=true; } } @@ -299,7 +299,7 @@ if ($action=="configure") { } } - function save_form(){ + function save_form() { document.config_setup.submit(); } //--> @@ -345,7 +345,7 @@ if ($action=="configure") { // NOTE: Row 2 column 2: Left (Main) block list echo "<td class=\"optionbox\" dir=\"".$TEXT_DIRECTION."\">\n"; echo "<select multiple=\"multiple\" id=\"main_select\" name=\"main[]\" size=\"10\" onchange=\"show_description('main_select');\">\n"; - foreach($blocks['main'] as $block_id=>$block_name) { + foreach ($blocks['main'] as $block_id=>$block_name) { echo "<option value=\"$block_id\">".$all_blocks[$block_name]->getTitle()."</option>\n"; } echo "</select>\n"; @@ -364,7 +364,7 @@ if ($action=="configure") { // Row 2 column 4: Middle (Available) block list echo "<td class=\"optionbox\" dir=\"".$TEXT_DIRECTION."\">"; echo "<select id=\"available_select\" name=\"available[]\" size=\"10\" onchange=\"show_description('available_select');\">\n"; - foreach($all_blocks as $block_name=>$block) { + foreach ($all_blocks as $block_name=>$block) { echo "<option value=\"$block_name\">".$block->getTitle()."</option>\n"; } echo "</select>\n"; @@ -382,7 +382,7 @@ if ($action=="configure") { // NOTE: Row 2 column 6: Right block list echo "<td class=\"optionbox\" dir=\"".$TEXT_DIRECTION."\">"; echo "<select multiple=\"multiple\" id=\"right_select\" name=\"right[]\" size=\"10\" onchange=\"show_description('right_select');\">\n"; - foreach($blocks['side'] as $block_id=>$block_name) { + foreach ($blocks['side'] as $block_id=>$block_name) { echo "<option value=\"$block_id\">".$all_blocks[$block_name]->getTitle()."</option>\n"; } echo "</select>\n"; diff --git a/individual.php b/individual.php index 346b8978dc..71f75f99b2 100644 --- a/individual.php +++ b/individual.php @@ -51,7 +51,7 @@ Zend_Session::writeClose(); print_header($controller->getPageTitle()); -if (!$controller->indi){ +if (!$controller->indi) { echo "<b>", i18n::translate('Unable to find record with ID'), "</b><br /><br />"; print_footer(); exit; @@ -74,7 +74,7 @@ function show_gedcom_record(shownew) { var recwin = window.open("gedrecord.php?pid=<?php echo $controller->pid; ?>"+fromfile, "_blank", "top=50,left=50,width=600,height=400,scrollbars=1,scrollable=1,resizable=1"); } <?php if (WT_USER_CAN_EDIT) { ?> -function open_link_remote(pid){ +function open_link_remote(pid) { window.open("addremotelink.php?pid="+pid, "_blank", "top=50,left=50,width=600,height=500,scrollbars=1,scrollable=1,resizable=1"); return false; } @@ -87,7 +87,7 @@ function showchanges() { var tabCache = new Array(); var pinned = false; -jQuery(document).ready(function(){ +jQuery(document).ready(function() { // TODO: change images directory when the common images will be deleted. jQuery('#tabs').tabs({ spinner: '<img src=\"images/loading.gif\" height=\"18\" border=\"0\" alt=\"\" />' }); jQuery("#tabs").tabs({ cache: true }); @@ -191,7 +191,7 @@ jQuery(document).ready(function(){ </div> <div id="hitcounter" class="clearfloat"> <?php - if($SHOW_COUNTER && (empty($SEARCH_SPIDER))) { + if ($SHOW_COUNTER && (empty($SEARCH_SPIDER))) { //print indi counter only if displaying a non-private person require WT_ROOT.'includes/hitcount.php'; echo i18n::translate('Hit Count:'), " ", $hitCount; @@ -279,7 +279,7 @@ echo '}'; echo WT_JS_END; if ($SEARCH_SPIDER) { - if($SHOW_SPIDER_TAGLINE) + if ($SHOW_SPIDER_TAGLINE) echo i18n::translate('Search Engine Spider Detected'), ": ", $SEARCH_SPIDER; echo "</div></body></html>"; } else { diff --git a/js/treenav.js b/js/treenav.js index 1fa56d71d8..34aafd3371 100644 --- a/js/treenav.js +++ b/js/treenav.js @@ -17,7 +17,7 @@ function getElementsByNameIE(tag, name) { var els = new Array(); var temps = document.getElementsByTagName(tag); j = 0; - for(i=0; i<temps.length; i++) { + for (i=0; i<temps.length; i++) { if (temps[i].name==name) { els[j] = temps[i]; j++; @@ -76,13 +76,13 @@ function NavTree(outerId, innerId, name, xref) { var vlines; if (browser.isIE) vlines = getElementsByNameIE("img", "vertline"); else vlines = document.getElementsByName("vertline"); - for(i=0; i<vlines.length; i++) { + for (i=0; i<vlines.length; i++) { id = vlines[i].id.substr(vlines[i].id.indexOf("_")+1); outerParent = document.getElementById("ch_"+id); children = outerParent.childNodes; tables = new Array(); k=0; - for(j=0; j<children.length; j++) { + for (j=0; j<children.length; j++) { if (children[j].tagName=='TABLE') { tables[k] = children[j]; k++; @@ -104,7 +104,7 @@ function NavTree(outerId, innerId, name, xref) { //-- parent lines if (browser.isIE) vlines = getElementsByNameIE("img", "pvertline"); else vlines = document.getElementsByName("pvertline"); - for(i=0; i<vlines.length; i++) { + for (i=0; i<vlines.length; i++) { ids = vlines[i].id.split("_"); var y1 = 0; var y2 = 0; @@ -276,7 +276,7 @@ function NavTree(outerId, innerId, name, xref) { this.zoomIn = function() { boxes = this.innerPort.getElementsByTagName("div"); - for(i=0; i<boxes.length; i++) { + for (i=0; i<boxes.length; i++) { child = boxes[i]; child.style.width = (parseInt(child.style.width) + 18)+'px'; child.style.fontSize = (parseInt(child.style.fontSize)+1)+'px'; @@ -290,7 +290,7 @@ function NavTree(outerId, innerId, name, xref) { this.zoomOut = function() { boxes = this.innerPort.getElementsByTagName("div"); - for(i=0; i<boxes.length; i++) { + for (i=0; i<boxes.length; i++) { child = boxes[i]; child.style.width = (parseInt(child.style.width) - 18)+'px'; child.style.fontSize = (parseInt(child.style.fontSize)-1)+'px'; @@ -304,7 +304,7 @@ function NavTree(outerId, innerId, name, xref) { this.zoomImgs = function(child) { imgs = child.getElementsByTagName("img"); - for(j=0; j<imgs.length; j++) { + for (j=0; j<imgs.length; j++) { if (this.zoom<-1) imgs[j].style.display = 'none'; else { imgs[j].style.display = 'inline'; @@ -326,7 +326,7 @@ function NavTree(outerId, innerId, name, xref) { //-- prevent the wait from staying on forever window.setTimeout(this.name+".restoreCursor()", 2000); this.loading.style.display = "block"; - for(i=0; i<chil.length; i++) { + for (i=0; i<chil.length; i++) { if (chil[i] && chil[i].onclick) { cell = chil[i]; y = findPosY(cell); @@ -353,7 +353,7 @@ function NavTree(outerId, innerId, name, xref) { //-- prevent the wait from staying on forever window.setTimeout(this.name+".restoreCursor()", 2000); this.loading.style.display = "block"; - for(i=0; i<children.length; i++) { + for (i=0; i<children.length; i++) { if (children[i] && children[i].onclick) { cell = children[i]; x = findPosX(cell); diff --git a/js/webtrees.js b/js/webtrees.js index 5f58afdfcd..529b5fcca4 100644 --- a/js/webtrees.js +++ b/js/webtrees.js @@ -70,7 +70,7 @@ function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; - for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); + for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } @@ -754,7 +754,7 @@ function evalAjaxJavascript(text, parentElement) { regex = new RegExp("\\ssrc=\".*\"", "gi"); results = scripttag.match(regex); if (results) { - for(i=0; i<results.length; i++) { + for (i=0; i<results.length; i++) { src = results[i].substring(results[i].indexOf("\"")+1, results[i].indexOf("\"", 6)); src = src.replace(/&/gi, "&"); jselement.src = src; @@ -898,7 +898,7 @@ function show_submenu(elementid, parentid, dir) { //-- make sure the submenu is the size of the largest child var maxwidth = 0; var count = element.childNodes.length; - for(var i=0; i<count; i++) { + for (var i=0; i<count; i++) { var child = element.childNodes[i]; if (child.offsetWidth > maxwidth+5) maxwidth = child.offsetWidth; } @@ -1159,14 +1159,14 @@ var monthLabels = new Array(); function cal_generateSelectorContent(dateFieldId, dateDivId, date) { var content = '<table border="1"><tr>'; content += '<td><select name="'+dateFieldId+'_daySelect" id="'+dateFieldId+'_daySelect" onchange="return cal_updateCalendar(\''+dateFieldId+'\', \''+dateDivId+'\');">'; - for(i=1; i<32; i++) { + for (i=1; i<32; i++) { content += '<option value="'+i+'"'; if (date.getDate()==i) content += ' selected="selected"'; content += '>'+i+'</option>'; } content += '</select></td>'; content += '<td><select name="'+dateFieldId+'_monSelect" id="'+dateFieldId+'_monSelect" onchange="return cal_updateCalendar(\''+dateFieldId+'\', \''+dateDivId+'\');">'; - for(i=1; i<13; i++) { + for (i=1; i<13; i++) { content += '<option value="'+i+'"'; if (date.getMonth()+1==i) content += ' selected="selected"'; content += '>'+monthLabels[i]+'</option>'; @@ -1177,7 +1177,7 @@ var monthLabels = new Array(); content += '<table width="100%">'; content += '<tr>'; j = weekStart; - for(i=0; i<7; i++) { + for (i=0; i<7; i++) { content += '<td '; content += 'class="descriptionbox"'; content += '>'; @@ -1195,9 +1195,9 @@ var monthLabels = new Array(); tdate = tdate.getTime() - (day*daymilli) + (daymilli/2); tdate = new Date(tdate); - for(j=0; j<6; j++) { + for (j=0; j<6; j++) { content += '<tr>'; - for(i=0; i<7; i++) { + for (i=0; i<7; i++) { content += '<td '; if (tdate.getMonth()==date.getMonth()) { if (tdate.getDate()==date.getDate()) content += 'class="descriptionbox"'; diff --git a/lifespan.php b/lifespan.php index 8948240110..8446b0c6b9 100644 --- a/lifespan.php +++ b/lifespan.php @@ -102,21 +102,21 @@ function scroll(move) myouterDiv = document.getElementById("outerDiv"); //compares the direction the timeline is moving and how far it can move in each direction. - if(move == "left" && ((maxX+topInnerDiv.offsetLeft+350) > (myouterDiv.offsetLeft+myouterDiv.offsetWidth))){ + if (move == "left" && ((maxX+topInnerDiv.offsetLeft+350) > (myouterDiv.offsetLeft+myouterDiv.offsetWidth))) { left = (innerDiv.offsetLeft - offSetNum)+"px"; innerDiv.style.left = left; topInnerDiv.style.left = left; } - else if(move == "right" && topInnerDiv.offsetLeft < (-10)){ + else if (move == "right" && topInnerDiv.offsetLeft < (-10)) { right = (innerDiv.offsetLeft + offSetNum)+"px"; innerDiv.style.left = right; topInnerDiv.style.left = right; } - else if(move == "up" && innerDiv.offsetTop > maxY){ + else if (move == "up" && innerDiv.offsetTop > maxY) { up = (innerDiv.offsetTop - offSetNum)+"px"; innerDiv.style.top = up; } - else if(move == "down" && innerDiv.offsetTop < -60){ + else if (move == "down" && innerDiv.offsetTop < -60) { down = (innerDiv.offsetTop + offSetNum)+"px"; innerDiv.style.top = down; } @@ -134,17 +134,17 @@ function startZoom(move) zoom(move); } -function zoom(move){ - if (move == "increase" && numOfIncrease < 5){ +function zoom(move) { + if (move == "increase" && numOfIncrease < 5) { increase = zoomfactor + 10; numOfIncrease += 1; temp = document.getElementById("inner"); - for(i=0; i<temp.childNodes.length; i++) { + for (i=0; i<temp.childNodes.length; i++) { - if(temp.childNodes[i].tagName=="DIV") { + if (temp.childNodes[i].tagName=="DIV") { width = temp.childNodes[i].offsetWidth; height = temp.childNodes[i].offsetHeight; left = temp.childNodes[i].offsetLeft; @@ -155,7 +155,7 @@ function zoom(move){ left = left * 1.1; font = font + 0.2; - if(temp.childNodes[i].offsetTop <= 65){ + if (temp.childNodes[i].offsetTop <= 65) { top = top; } else { @@ -170,12 +170,12 @@ function zoom(move){ } } } - else if(move == "decrease" && numOfIncrease > 0){ + else if (move == "decrease" && numOfIncrease > 0) { decrease = zoomfactor - 10; numOfIncrease -= 1; - for(i=0; i<temp.childNodes.length; i++) { - if(temp.childNodes[i].tagName=="DIV") { + for (i=0; i<temp.childNodes.length; i++) { + if (temp.childNodes[i].tagName=="DIV") { width = temp.childNodes[i].offsetWidth; height = temp.childNodes[i].offsetHeight; left = temp.childNodes[i].offsetLeft; @@ -186,7 +186,7 @@ function zoom(move){ left = left * 0.9; font = font - 0.2; - if(temp.childNodes[i].offsetTop <= 65){ + if (temp.childNodes[i].offsetTop <= 65) { top = top; } else { @@ -202,13 +202,13 @@ function zoom(move){ } } } -function reset(){ - if(numOfIncrease >= 5){ +function reset() { + if (numOfIncrease >= 5) { temp = document.getElementById("inner"); - for(i=0; i<temp.childNodes.length; i++) { + for (i=0; i<temp.childNodes.length; i++) { - if(temp.childNodes[i].tagName=="DIV") { + if (temp.childNodes[i].tagName=="DIV") { width = temp.childNodes[i].offsetWidth; height = temp.childNodes[i].offsetHeight; left = temp.childNodes[i].offsetLeft; @@ -218,12 +218,12 @@ function reset(){ numOfIncrease = 0; zoomfactor = 10; } - else if(numOfDecrease >= 5){ + else if (numOfDecrease >= 5) { temp = document.getElementById("inner"); - for(i=0; i<temp.childNodes.length; i++) { + for (i=0; i<temp.childNodes.length; i++) { - if(temp.childNodes[i].tagName=="DIV") { + if (temp.childNodes[i].tagName=="DIV") { width = temp.childNodes[i].offsetWidth; height = temp.childNodes[i].offsetHeight; left = temp.childNodes[i].offsetLeft; @@ -273,8 +273,8 @@ var oldMx = 0; msY = e.pageY; } // catch possible negative values in NS4 - if (msX < 0){msX = 0;} - if (msY < 0){msY = 0;} + if (msX < 0) {msX = 0;} + if (msY < 0) {msY = 0;} if (movei1!="") { //ileft = parseInt(movei1.style.left); //itop = parseInt(movei2.style.top); @@ -362,7 +362,7 @@ var oldMx = 0; <script language="JavaScript" type="text/javascript"> <!-- var maxY = 80-<?php echo $maxY; ?>; // Sets the boundaries for how far the timeline can move in the up direction -var maxX = <?php if(!isset($maxX)) $maxX = 0; echo $maxX; ?>; // Sets the boundaries for how far the timeline can move in the left direction +var maxX = <?php if (!isset($maxX)) $maxX = 0; echo $maxX; ?>; // Sets the boundaries for how far the timeline can move in the left direction //--> </script> @@ -149,7 +149,7 @@ if ($type=="full") { echo "<div class=\"center\">"; echo "<table class=\"center width60 ltr\"><tr><td>"; -switch ($WELCOME_TEXT_AUTH_MODE){ +switch ($WELCOME_TEXT_AUTH_MODE) { case 1: echo i18n::translate('<center><b>Welcome to this Genealogy website</b></center><br />Access to this site is permitted to every visitor who has a user account.<br /><br />If you have a user account, you can login on this page. If you don\'t have a user account, you can apply for one by clicking on the appropriate link below.<br /><br />After verifying your application, the site administrator will activate your account. You will receive an email when your application has been approved.'); break; @@ -79,11 +79,11 @@ function move_file($src, $dest) { // sometimes thumbnail files are set to something like "images/media.gif", this ensures we do not move them // check to make sure the src file is in the standard or protected media directories - if (preg_match("'^($MEDIA_FIREWALL_ROOTDIR)?$MEDIA_DIRECTORY'", $src)==0){ + if (preg_match("'^($MEDIA_FIREWALL_ROOTDIR)?$MEDIA_DIRECTORY'", $src)==0) { return false; } // check to make sure the dest file is in the standard or protected media directories - if (preg_match("'^($MEDIA_FIREWALL_ROOTDIR)?$MEDIA_DIRECTORY'", $dest)==0){ + if (preg_match("'^($MEDIA_FIREWALL_ROOTDIR)?$MEDIA_DIRECTORY'", $dest)==0) { return false; } @@ -95,7 +95,7 @@ function move_file($src, $dest) { return false; } } - if(!rename($src, $dest)) { + if (!rename($src, $dest)) { echo "<div class=\"error\">".i18n::translate('Media file could not be moved.')." [".$src."]</div>"; return false; } @@ -163,7 +163,7 @@ function move_files($path, $protect) { */ function set_perms($path) { global $MEDIA_FIREWALL_ROOTDIR, $MEDIA_DIRECTORY, $starttime; - if (preg_match("'^($MEDIA_FIREWALL_ROOTDIR)?$MEDIA_DIRECTORY'", $path."/")==0){ + if (preg_match("'^($MEDIA_FIREWALL_ROOTDIR)?$MEDIA_DIRECTORY'", $path."/")==0) { return false; } $timelimit=get_site_setting('MAX_EXECUTION_TIME'); @@ -228,10 +228,10 @@ if ($showthumb) $thumbget = "&showthumb=true"; //-- prevent script from accessing an area outside of the media directory //-- and keep level consistency -if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)){ +if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)) { $directory = $MEDIA_DIRECTORY; $level = 0; -} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){ +} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0) { $directory = $MEDIA_DIRECTORY; $level = 0; } @@ -610,7 +610,7 @@ if (check_media_structure()) { $k=0; $i=count($rlevels)-1; $j=count($mlevels)-1; - while($i>=0 && $j>=0) { + while ($i>=0 && $j>=0) { if ($rlevels[$i] != $mlevels[$j]) { $match = false; break; @@ -669,12 +669,12 @@ if (check_media_structure()) { } //-- loop through all of the found xrefs and delete any references to them - foreach($xrefs as $ind=>$xref) { + foreach ($xrefs as $ind=>$xref) { // Remove references to media file from gedcom and database // Check for XREF if ($xref != "") { $links = get_media_relations($xref); - foreach($links as $pid=>$type) { + foreach ($links as $pid=>$type) { $gedrec = find_gedcom_record($pid, WT_GED_ID, true); $gedrec = remove_subrecord($gedrec, "OBJE", $xref, -1); replace_gedrec($pid, WT_GED_ID, $gedrec); @@ -701,7 +701,7 @@ if (check_media_structure()) { if ($finalResult && !$removeObject && $objerec!="") { $xref = get_new_xref("OBJE"); $objerec = preg_replace("/0 @.*@ OBJE/", "0 @".$xref."@ OBJE", $objerec); - if(append_gedrec($objerec, WT_GED_ID)) { + if (append_gedrec($objerec, WT_GED_ID)) { echo i18n::translate('Record %s successfully added to GEDCOM.', $xref); } else { $finalResult = false; @@ -801,7 +801,7 @@ if (check_media_structure()) { if ($MEDIA_DIRECTORY_LEVELS > 0) { $folders = get_media_folders(); echo "<span dir=\"ltr\"><select name=\"directory\">"; - foreach($folders as $f) { + foreach ($folders as $f) { echo "<option value=\"".$f."\""; if ($directory==$f) echo " selected=\"selected\""; echo ">{$f}</option>"; @@ -810,7 +810,7 @@ if (check_media_structure()) { } else echo "<input name=\"directory\" type=\"hidden\" value=\"ALL\" />"; // Text field for filter ?> - <input type="text" name="filter" value="<?php if($filter) echo $filter; ?>" /><br /><input type="submit" name="search" value="<?php echo i18n::translate('Filter'); ?>" onclick="this.form.subclick.value=this.name" /> <input type="submit" name="all" value="<?php echo i18n::translate('Display all'); ?>" onclick="this.form.subclick.value=this.name" /></td> + <input type="text" name="filter" value="<?php if ($filter) echo $filter; ?>" /><br /><input type="submit" name="search" value="<?php echo i18n::translate('Filter'); ?>" onclick="this.form.subclick.value=this.name" /> <input type="submit" name="all" value="<?php echo i18n::translate('Display all'); ?>" onclick="this.form.subclick.value=this.name" /></td> <!-- // NOTE: Row 2 right: Add media --> <td class="descriptionbox wrap width25" <?php echo $legendAlign; ?>><?php echo i18n::translate('Add media'), help_link('add_media'); ?></td> @@ -838,7 +838,7 @@ if (check_media_structure()) { </form> <script type="text/javascript"> //<![CDATA[ -jQuery(document).ready(function(){ +jQuery(document).ready(function() { // Table pageing jQuery("#media_table") .tablesorter({ @@ -877,7 +877,7 @@ jQuery(document).ready(function(){ // Show link to previous folder $levels = explode('/', $directory); $pdir = ''; - for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i].'/'; + for ($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i].'/'; if ($pdir != '') { $uplink = "<a href=\"media.php?directory={$pdir}&amp;sortby={$sortby}&amp;level=".($level-1).$thumbget."\">"; if ($TEXT_DIRECTION=="rtl") $uplink .= getLRM(); @@ -976,7 +976,7 @@ jQuery(document).ready(function(){ echo "<br />"; } - if ( !$USE_MEDIA_FIREWALL && is_dir($MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY) ) { + if (!$USE_MEDIA_FIREWALL && is_dir($MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY)) { if ($protected_files > $standard_files) { echo '<div class="error">'; echo i18n::translate('The media Firewall is DISABLED but your media may still be located in the Protected Media Directory').'<br />'; diff --git a/mediafirewall.php b/mediafirewall.php index 4507dda521..4cf854910a 100644 --- a/mediafirewall.php +++ b/mediafirewall.php @@ -57,7 +57,7 @@ $debug_verboseLogging = 0; // set to 1 for extra logging details function sendErrorAndExit($type, $line1, $line2 = false) { // line2 contains the information that only an admin/editor should see, such as the full path to a file - if(!WT_USER_CAN_EDIT) { + if (!WT_USER_CAN_EDIT) { $line2 = false; } @@ -82,7 +82,7 @@ function sendErrorAndExit($type, $line1, $line2 = false) { } $type = isImageTypeSupported($type); - if ( $type ){ + if ($type) { // width of image is based on the number of characters $width = ($numchars+1) * 6.5; $height = 60; @@ -500,7 +500,7 @@ if (!$debug_watermark) { header('Content-Disposition: inline; filename="'.basename($serverFilename).'"'); } -if ( $generatewatermark ) { +if ($generatewatermark) { // generate the watermarked image $imCreateFunc = 'imagecreatefrom'.$type; $im = @$imCreateFunc($serverFilename); @@ -512,7 +512,7 @@ if ( $generatewatermark ) { $imSendFunc = 'image'.$type; // save the image, if preferences allow - if ( ($isThumb && $SAVE_WATERMARK_THUMB) || (!$isThumb && $SAVE_WATERMARK_IMAGE) ) { + if (($isThumb && $SAVE_WATERMARK_THUMB) || (!$isThumb && $SAVE_WATERMARK_IMAGE)) { // make sure the directory exists if (!is_dir(dirname($watermarkfile))) { mkdirs(dirname($watermarkfile)); @@ -539,7 +539,7 @@ if ( $generatewatermark ) { // pass the image through without manipulating it -if ( $usewatermark ) { +if ($usewatermark) { // the stored watermarked image is good, lets use it $serverFilename = $watermarkfile; } diff --git a/medialist.php b/medialist.php index 255cc35a6f..db9888fadd 100644 --- a/medialist.php +++ b/medialist.php @@ -167,7 +167,7 @@ if ($build == "yes") { $medialist=get_medialist($currentdironly, $folder, true, false, $showExternal, $exclude_links); //-- remove all private media objects - foreach($medialist as $key => $media) { + foreach ($medialist as $key => $media) { echo " "; // Display when user has Edit rights or when object belongs to current GEDCOM $disp = WT_USER_CAN_EDIT || $media["GEDFILE"]==WT_GED_ID; @@ -222,7 +222,7 @@ $_SESSION['Medialist'] = $medialist; } $folders = array_merge(array("ALL"), get_media_folders()); echo "<span dir=\"ltr\"><select name=\"folder\">"; - foreach($folders as $f) { + foreach ($folders as $f) { echo "<option value=\"", $f, "\""; if ($folder==$f) echo " selected=\"selected\""; echo ">"; @@ -361,7 +361,7 @@ if ($action=="filter" && (!empty($filtered_medialist))) { $temp_filter = $filter_type; if ($filter_type == $or) { if ((strlen($filter1) > 1) && (strlen($filter2)) > 1) { - foreach($filtered_medialist as $key => $media) { + foreach ($filtered_medialist as $key => $media) { if (!filterMedia($media, $filter1, "http") && !filterMedia($media, $filter2, "http")) unset($filtered_medialist[$key]); } @@ -372,7 +372,7 @@ if ($action=="filter" && (!empty($filtered_medialist))) { if ($filter_type == $and) { if ((strlen($filter1) > 1) || (strlen($filter2)) > 1) { - foreach($filtered_medialist as $key => $media) { + foreach ($filtered_medialist as $key => $media) { if (!filterMedia($media, $filter1, "http")) unset($filtered_medialist[$key]); if (!filterMedia($media, $filter2, "http")) unset($filtered_medialist[$key]); } @@ -593,7 +593,7 @@ Plus other Media Options - MediaViewer page') . "\" />"; } // -- new naming structure --------- - if ($sortby == 'title'){ + if ($sortby == 'title') { $name_disp1 = $name; $name_disp2 = basename($media['FILE']); if ($isExternal) $name_disp2 = "URL"; diff --git a/mediaviewer.php b/mediaviewer.php index 87e752b0b2..afa6179964 100644 --- a/mediaviewer.php +++ b/mediaviewer.php @@ -49,7 +49,7 @@ $filename = $controller->getLocalFilename(); print_header($controller->getPageTitle()); -if (!$controller->mediaobject){ +if (!$controller->mediaobject) { echo "<b>", i18n::translate('Unable to find record with ID'), "</b><br /><br />"; print_footer(); exit; @@ -127,7 +127,7 @@ if (WT_USE_LIGHTBOX) { <table class="facts_table<?php echo $TEXT_DIRECTION=='ltr'?'':'_rtl'; ?>"> <?php $facts = $controller->getFacts($SHOW_MEDIA_FILENAME); - foreach($facts as $f=>$factrec) { + foreach ($facts as $f=>$factrec) { print_fact($factrec); } ?> @@ -174,7 +174,7 @@ if (WT_USE_LIGHTBOX) { <!-- // javascript function to open the lightbox view -function lightboxView(){ +function lightboxView() { // var string = "<?php echo $tmb; ?>"; // alert(string); // document.write(string); @@ -183,7 +183,7 @@ function lightboxView(){ } // javascript function to open the original imageviewer.php page -function openImageView(){ +function openImageView() { window.open("imageview.php?filename=<?php echo urlencode($filename); ?>", "Image View"); return false; } diff --git a/message.php b/message.php index 6707b38a20..89406cb68b 100644 --- a/message.php +++ b/message.php @@ -118,7 +118,7 @@ if (($action=="send")&&(isset($_SESSION["good_to_send"]))&&($_SESSION["good_to_s } } $i = 0; - foreach($toarray as $indexval => $to) { + foreach ($toarray as $indexval => $to) { $message = array(); $message["to"]=$to; $message["from"]=$from; @@ -133,7 +133,7 @@ if (($action=="send")&&(isset($_SESSION["good_to_send"]))&&($_SESSION["good_to_s $message["method"] = $method; $message["url"] = $url.'&ged='.$GEDCOM; if ($i>0) $message["no_from"] = true; - if (addMessage($message)){ + if (addMessage($message)) { $to_user_id=get_user_id($to); if ($to_user_id) { echo i18n::translate('Message successfully sent to %s', "<b>".getUserFullName($to_user_id)."</b>"); @@ -192,13 +192,13 @@ if ($action=="compose") { echo i18n::translate('This user prefers to receive messages in %s', Zend_Locale::getTranslation(get_user_setting($to_user_id, 'language'), 'language', WT_LOCALE))."</td></tr>"; } - if (!WT_USER_ID){ + if (!WT_USER_ID) { echo "<tr><td valign=\"top\" width=\"15%\" align=\"right\">".i18n::translate('Your Name:')."</td>"; echo "<td><input type=\"text\" name=\"from_name\" size=\"40\" value=\"$from_name\" /></td></tr><tr><td valign=\"top\" align=\"right\">".i18n::translate('Email Address:')."</td><td><input type=\"text\" name=\"from_email\" size=\"40\" value=\"$from_email\" /><br />".i18n::translate('Please provide your email address so that we may contact you in response to this message. If you do not provide your email address we will not be able to respond to your inquiry. Your email address will not be used in any other way besides responding to this inquiry.')."<br /><br /></td></tr>"; } echo "<tr><td align=\"right\">".i18n::translate('Subject:')."</td>"; echo "<td>"; - if (WT_USER_ID){ + if (WT_USER_ID) { echo "<input type=\"hidden\" name=\"from\" value=\"".WT_USER_NAME."\" />"; } echo "<input type=\"hidden\" name=\"action\" value=\"send\" />"; diff --git a/module_admin.php b/module_admin.php index d65bbb612c..1798d94be9 100644 --- a/module_admin.php +++ b/module_admin.php @@ -220,7 +220,7 @@ print_header(i18n::translate('Module administration')); }); } - jQuery(document).ready(function(){ + jQuery(document).ready(function() { //-- tabs jQuery("#tabs").tabs(); @@ -386,7 +386,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledMenus() as $module) { ?> + foreach (WT_Module::getInstalledMenus() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="menuorder-<?php echo $module->getName(); ?>" /> @@ -433,7 +433,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledTabs() as $module) { ?> + foreach (WT_Module::getInstalledTabs() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="taborder-<?php echo $module->getName(); ?>" /> @@ -480,7 +480,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledSidebars() as $module) { ?> + foreach (WT_Module::getInstalledSidebars() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="sidebarorder-<?php echo $module->getName(); ?>" /> @@ -526,7 +526,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledBlocks() as $module) { ?> + foreach (WT_Module::getInstalledBlocks() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value_wrap"> @@ -566,7 +566,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledCharts() as $module) { ?> + foreach (WT_Module::getInstalledCharts() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value_wrap"> @@ -606,7 +606,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledReports() as $module) { ?> + foreach (WT_Module::getInstalledReports() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value_wrap"> @@ -646,7 +646,7 @@ print_header(i18n::translate('Module administration')); <tbody> <?php $order = 1; - foreach(WT_Module::getInstalledThemes() as $module) { ?> + foreach (WT_Module::getInstalledThemes() as $module) { ?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle(); ?></td> <td class="list_value_wrap"> diff --git a/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php b/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php index 3d64058351..7f6fee23fa 100644 --- a/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php +++ b/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php @@ -64,9 +64,9 @@ if (!empty($NOTE)) { $newlines = preg_split("/\r?\n/", $NOTE, -1); for ($k=0; $k<count($newlines); $k++) { - if ( $k==0 && count($newlines)>1) { + if ($k==0 && count($newlines)>1) { $newgedrec = "0 @XREF@ NOTE $newlines[$k]\n"; - }else if ( $k==0 ) { + } else if ($k==0) { $newgedrec = "0 @XREF@ NOTE $newlines[$k]\n1 CONT\n"; } else { $newgedrec .= "1 CONT $newlines[$k]\n"; @@ -85,7 +85,7 @@ if (!empty($PUBL)) { $newlines = preg_split("/\r?\n/", $PUBL, -1, PREG_SPLIT_NO_EMPTY); foreach ($newlines as $k=>$line) { - if ( $k==0 ) { + if ($k==0) { $newgedrec .= "1 PUBL $line\n"; } else { $newgedrec .= "2 CONT $line\n"; diff --git a/modules/GEDFact_assistant/_CENS/census_1_ctrl.php b/modules/GEDFact_assistant/_CENS/census_1_ctrl.php index 8accc67fba..19a87ecdd4 100644 --- a/modules/GEDFact_assistant/_CENS/census_1_ctrl.php +++ b/modules/GEDFact_assistant/_CENS/census_1_ctrl.php @@ -50,8 +50,8 @@ $married=-1; $person=Person::getInstance($pid); // var_dump($person->getAllNames()); $nam = $person->getAllNames(); -if (PrintReady($person->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($person->getDeathYear()); } -if (PrintReady($person->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($person->getBirthYear()); } +if (PrintReady($person->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($person->getDeathYear()); } +if (PrintReady($person->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($person->getBirthYear()); } $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln); $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln); diff --git a/modules/GEDFact_assistant/_CENS/census_2_source_input.php b/modules/GEDFact_assistant/_CENS/census_2_source_input.php index 173dd28edf..43b8e9d24a 100644 --- a/modules/GEDFact_assistant/_CENS/census_2_source_input.php +++ b/modules/GEDFact_assistant/_CENS/census_2_source_input.php @@ -233,9 +233,9 @@ global $TEXT_DIRECTION; var cendate = getCenDate(cenyear); // Get Married Date from Input Fields and re-calculate Marital Condition ============ var tbl = document.getElementById('tblSample'); - for(var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header + for (var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header var tr = tbl.rows[i]; - for(var j=2; j<tr.cells.length; j++){ + for (var j=2; j<tr.cells.length; j++) { if (j!=4 && j!=15) { // 4 and 15 are the marital condition columns (fields) // therefore miss out all cols except these marital condition cols @@ -316,7 +316,7 @@ global $TEXT_DIRECTION; if (yrsmarr == 0) { yrsmarr = "<1"; } - }else{ + } else { yrsmarr = "-"; agemarr = "-"; marrcond = "S"; @@ -349,9 +349,9 @@ global $TEXT_DIRECTION; var cendate = getCenDate(cenyear); // Get Children born Array from Input Fields and re-calculate Born Alive Died Condition ============ var tbl = document.getElementById('tblSample'); - for(var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header + for (var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header var tr = tbl.rows[i]; - for(var j=2; j<tr.cells.length; j++){ + for (var j=2; j<tr.cells.length; j++) { if (j!=73) { // 73 is the Chil born array column // therefore miss out all cols except this column's cells @@ -425,15 +425,15 @@ global $TEXT_DIRECTION; // Get Age from Input Fields and re-calculate ======================================= var tbl = document.getElementById('tblSample'); - for(var i=1; i<tbl.rows.length; i++){ // start at i=1 because we need to avoid header + for (var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header var tr = tbl.rows[i]; - for(var j=2; j<tr.cells.length; j++){ + for (var j=2; j<tr.cells.length; j++) { if (j!=7 && j!=12) { // miss out all cols except age cols continue; - }else if (tr.cells[j].childNodes[0].value=="") { + } else if (tr.cells[j].childNodes[0].value=="") { tr.cells[j].childNodes[0].value=null - }else{ + } else { // Calculate Birth Year ======================================= var bage = (tr.cells[68].childNodes[0].value); // If valid Julian date used, then use this instead ----------- @@ -503,7 +503,7 @@ global $TEXT_DIRECTION; tr.cells[2].childNodes[0].style.background = '#ffffff'; tr.cells[7].childNodes[0].style.background = '#ffffff'; tr.cells[12].childNodes[0].style.background = '#ffffff'; - }else{ + } else { // alert(tr.cells[2].childNodes[0].value+" - Not Born Yet"); tr.cells[2].childNodes[0].style.background = '#ffaaaa'; tr.cells[7].childNodes[0].style.background = '#ffaaaa'; @@ -679,7 +679,7 @@ global $TEXT_DIRECTION; flip_42 = ""; flip_50 = ""; flip_63 = ""; - }else + } else if (cenyear=="1901") { flip_3 = ""; flip_4 = ""; @@ -690,7 +690,7 @@ global $TEXT_DIRECTION; flip_42 = ""; flip_50 = ""; flip_63 = ""; - }else + } else if (cenyear=="1891") { flip_3 = ""; flip_4 = ""; @@ -702,7 +702,7 @@ global $TEXT_DIRECTION; flip_43 = ""; flip_50 = ""; flip_63 = ""; - }else + } else if (cenyear=="1881" || cenyear=="1871" || cenyear=="1861" || cenyear=="1851") { flip_3 = ""; flip_4 = ""; @@ -711,7 +711,7 @@ global $TEXT_DIRECTION; flip_35 = ""; flip_50 = ""; flip_63 = ""; - }else + } else if (cenyear=="1841") { flip_7 = ""; flip_9 = ""; @@ -742,7 +742,7 @@ global $TEXT_DIRECTION; flip_62 = ""; flip_65 = ""; flip_66 = ""; - }else + } else if (cenyear=="1920") { flip_3 = ""; flip_5 = ""; @@ -762,7 +762,7 @@ global $TEXT_DIRECTION; flip_60 = ""; flip_61 = ""; flip_62 = ""; - }else + } else if (cenyear=="1910") { flip_3 = ""; flip_9 = ""; @@ -789,7 +789,7 @@ global $TEXT_DIRECTION; flip_49 = ""; flip_65 = ""; flip_67 = ""; - }else + } else if (cenyear=="1900") { flip_3 = ""; flip_8 = ""; @@ -812,7 +812,7 @@ global $TEXT_DIRECTION; flip_46 = ""; flip_48 = ""; flip_49 = ""; - }else + } else if (cenyear=="1890") { flip_3 = ""; flip_8 = ""; @@ -835,7 +835,7 @@ global $TEXT_DIRECTION; flip_46 = ""; flip_48 = ""; flip_64 = ""; - }else + } else if (cenyear=="1880") { flip_8 = ""; flip_9 = ""; @@ -853,7 +853,7 @@ global $TEXT_DIRECTION; flip_51 = ""; flip_54= ""; flip_55 = ""; - }else + } else if (cenyear=="1870" ) { flip_7 = ""; flip_9 = ""; @@ -866,7 +866,7 @@ global $TEXT_DIRECTION; flip_26 = ""; flip_47 = ""; flip_63 = ""; - }else + } else if (cenyear=="1860" || cenyear=="1850") { flip_7 = ""; flip_9 = ""; @@ -1013,7 +1013,7 @@ global $TEXT_DIRECTION; <div class="cens_sour_year"> <span><?php echo i18n::translate('Year'); ?><br /></span> <select style = "background:#ffaaaa;"; - onchange = "if( this.options[this.selectedIndex].value!='') { + onchange = "if (this.options[this.selectedIndex].value!='') { changeYear(this.options[this.selectedIndex].value); }" id="censYear" name="censYear"> diff --git a/modules/GEDFact_assistant/_CENS/census_3_find.php b/modules/GEDFact_assistant/_CENS/census_3_find.php index 204989e92d..76605179e0 100644 --- a/modules/GEDFact_assistant/_CENS/census_3_find.php +++ b/modules/GEDFact_assistant/_CENS/census_3_find.php @@ -62,8 +62,8 @@ function getPreselectedTags(&$preselDefault, &$preselCustom) { $all = strlen($qs) ? explode(',', strtoupper($qs)) : array(); $preselDefault = array(); $preselCustom = array(); - foreach($all as $one) { - if(array_key_exists($one, $FACTS)) { + foreach ($all as $one) { + if (array_key_exists($one, $FACTS)) { $preselDefault[] = $one; } else { $preselCustom[] = $one; @@ -95,10 +95,10 @@ $thumbdir = stripcslashes(preg_replace($srch, $repl, $directory)); //-- prevent script from accessing an area outside of the media directory //-- and keep level consistency -if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)){ +if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)) { $directory = $MEDIA_DIRECTORY; $level = 0; -} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){ +} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0) { $directory = $MEDIA_DIRECTORY; $level = 0; } @@ -161,7 +161,7 @@ echo WT_JS_START; } function pasteid(id, name, thumb) { - if(thumb) { + if (thumb) { window.opener.<?php echo $callback; ?>(id, name, thumb); <?php if (!$multiple) echo "window.close();"; ?> } else { @@ -173,7 +173,7 @@ echo WT_JS_START; if (id.match("I")=="I") { var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links¬eid=newnote&pid='+id, 'win01', 'top=50, left=600, width=420, height=650, resizable=1, scrollbars=1'); if (window.focus) {win01.focus();} - }else if (id.match("F")=="F") { + } else if (id.match("F")=="F") { // TODO --- alert('Opening Navigator with family id entered will come later'); } */ @@ -329,7 +329,7 @@ if ($type == "media" && $MULTI_MEDIA) { echo "</td></tr>"; echo "<tr><td class=\"list_label width10\" wstyle=\"padding: 5px;\">"; echo "<input type=\"checkbox\" name=\"showthumb\" value=\"true\""; - if( $showthumb) echo "checked=\"checked\""; + if ($showthumb) echo "checked=\"checked\""; echo "onclick=\"javascript: this.form.submit();\" />", i18n::translate('Show thumbnails'); echo help_link('show_thumb'); echo "</td></tr>"; @@ -437,7 +437,7 @@ if ($type == "specialchar") { echo "<select id=\"language_filter\" name=\"language_filter\" onchange=\"submit();\">"; echo "<option value=\"\">", i18n::translate('Change language'), "</option>"; $language_options = ""; - foreach($specialchar_languages as $key=>$value) { + foreach ($specialchar_languages as $key=>$value) { $language_options.= "<option value=\"$key\">$value</option>"; } $language_options = str_replace("\"$language_filter\"", "\"$language_filter\" selected", $language_options); @@ -473,7 +473,7 @@ if ($type == "facts") { var row=document.createElement("tr"),cell,o; row.appendChild(cell=document.createElement("td")); o=null; - if(document.all) { + if (document.all) { //Old IEs handle the creation of a checkbox already checked, as far as I know, only in this way try { o=document.createElement("<input type='checkbox' id='tag"+this._counter+"' "+(this.selected?"checked='checked'":"")+" />"); @@ -481,11 +481,11 @@ if ($type == "facts") { o=null; } } - if(!o) { + if (!o) { o=document.createElement("input"); o.setAttribute("id","tag"+this._counter); o.setAttribute("type","checkbox"); - if(this.selected) o.setAttribute("checked", "checked"); + if (this.selected) o.setAttribute("checked", "checked"); } o.DefaultTag=this; o.ParentRow=row; @@ -514,10 +514,10 @@ if ($type == "facts") { ,_timer:null ,clear:function() { var n=TheList.childNodes.length; - while(n) TheList.removeChild(TheList.childNodes[--n]); + while (n) TheList.removeChild(TheList.childNodes[--n]); } ,_clearTimer:function() { - if(this._timer!=null) { + if (this._timer!=null) { clearTimeout(this._timer); this._timer=null; } @@ -529,39 +529,39 @@ if ($type == "facts") { ,refreshNow:function(force) { this._clearTimer(); var s=document.getElementById("tbxFilter").value.toLowerCase().replace(/\s+/g," ").replace(/^ | $/g,""),k; - if(force||(typeof(this._curFilter)!="string")||(this._curFilter!=s)) { + if (force||(typeof(this._curFilter)!="string")||(this._curFilter!=s)) { this._curFilter=s; this.clear(); - for(k=0;k<DefaultTags.length;k++) { - if(DefaultTags[k].LowerName.indexOf(this._curFilter)>=0) DefaultTags[k].view(); + for (k=0;k<DefaultTags.length;k++) { + if (DefaultTags[k].LowerName.indexOf(this._curFilter)>=0) DefaultTags[k].view(); } } } ,recount:function() { var k,n=0; - for(k=0;k<DefaultTags.length;k++) - if(DefaultTags[k].selected) + for (k=0;k<DefaultTags.length;k++) + if (DefaultTags[k].selected) n++; document.getElementById("layCurSelectedCount").innerHTML=n.toString(); } ,showSelected:function() { this._clearTimer(); this.clear(); - for(var k=0;k<DefaultTags.length;k++) { - if(DefaultTags[k].selected) + for (var k=0;k<DefaultTags.length;k++) { + if (DefaultTags[k].selected) DefaultTags[k].view(); } } }; function initPickFact() { - var n,i,j,tmp,preselectedDefaultTags="\x01<?php foreach($preselDefault as $p) echo addslashes($p), '\\x01'; ?>"; + var n,i,j,tmp,preselectedDefaultTags="\x01<?php foreach ($preselDefault as $p) echo addslashes($p), '\\x01'; ?>"; DefaultTags=[<?php $firstFact=TRUE; - foreach($FACTS as $factId => $factName) { + foreach ($FACTS as $factId => $factName) { if (preg_match('/^_?[A-Z0-9]+$/', $factId, $matches)) { - if($firstFact) $firstFact=FALSE; + if ($firstFact) $firstFact=FALSE; else echo ','; echo 'new DefaultTag("'.addslashes($factId).'","'.addslashes($factName).'",preselectedDefaultTags.indexOf("\\x01'.addslashes($factId).'\\x01")>=0)'; } @@ -569,9 +569,9 @@ if ($type == "facts") { ?>]; //Sort defined tags alphabetically by name n=DefaultTags.length - for(i=0;i<(n-1);i++) { - for(j=(i+1);j<n;j++) { - if(DefaultTags[i].LowerName>DefaultTags[j].LowerName) { + for (i=0;i<(n-1);i++) { + for (j=(i+1);j<n;j++) { + if (DefaultTags[i].LowerName>DefaultTags[j].LowerName) { tmp=DefaultTags[i]; DefaultTags[i]=DefaultTags[j]; DefaultTags[j]=tmp; @@ -589,13 +589,13 @@ if ($type == "facts") { } function DoOK() { var result=[],k,linearResult,custom; - for(k=0;k<DefaultTags.length;k++) { - if(DefaultTags[k].selected) result.push(DefaultTags[k].Id); + for (k=0;k<DefaultTags.length;k++) { + if (DefaultTags[k].selected) result.push(DefaultTags[k].Id); } linearResult="\x01"+result.join("\x01")+"\x01"; custom=document.getElementById("tbxCustom").value.toUpperCase().replace(/\s/g,"").split(","); - for(k=0;k<custom.length;k++) { - if(linearResult.indexOf("\x01"+custom[k]+"\x01")<0) { + for (k=0;k<custom.length;k++) { + if (linearResult.indexOf("\x01"+custom[k]+"\x01")<0) { linearResult+=custom[k]+"\x01"; result.push(custom[k]); } @@ -630,7 +630,7 @@ if ($type == "facts") { <td><td></tbody></table> <table id="tabAction"><tbody><tr> - <td><button id="btnOk" disabled="disabled" onclick="if(!this.disabled)DoOK();"><?php echo i18n::translate('Accept'); ?></button></td> + <td><button id="btnOk" disabled="disabled" onclick="if (!this.disabled)DoOK();"><?php echo i18n::translate('Accept'); ?></button></td> <td><button onclick="window.close();return false"><?php echo i18n::translate('Cancel'); ?></button></td> <tr></tbody></table> <?php @@ -656,7 +656,7 @@ if ($action=="filter") { if ($myindilist) { echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; usort($myindilist, array('GedcomRecord', 'Compare')); - foreach($myindilist as $indi ) { + foreach ($myindilist as $indi ) { // echo $indi->format_list('li', true); $nam = $indi->getAllNames(); @@ -679,7 +679,7 @@ if ($action=="filter") { //-- Build Indi Parents Family to get FBP and MBP ----------- $families = $indi->getChildFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { if (!is_null($family)) { $father = $family->getHusband(); $mother = $family->getWife(); @@ -696,7 +696,7 @@ if ($action=="filter") { //-- Build Indi Spouse Family to get marriage Date ---------- $families = $indi->getSpouseFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $marrdate = $family->getMarriageDate(); $marrdate = ($marrdate->minJD()+$marrdate->maxJD())/2; // Julian $children = $family->getChildren(); @@ -785,7 +785,7 @@ if ($action=="filter") { $curged = $GEDCOM; echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; usort($myfamlist, array('GedcomRecord', 'Compare')); - foreach($myfamlist as $family) { + foreach ($myfamlist as $family) { echo $family->format_list('li', true); } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total families'), ' ', count($myfamlist), '</tr></td>'; @@ -808,10 +808,10 @@ if ($action=="filter") { if ($level>0) { $levels = explode("/", $directory); $pdir = ""; - for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/"; + for ($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/"; $levels = explode("/", $thumbdir); $pthumb = ""; - for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; + for ($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; $uplink = "<a href=\"find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; } @@ -830,7 +830,7 @@ if ($action=="filter") { // display the directory list if (count($dirs) || $level) { sort($dirs); - if ($level){ + if ($level) { echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">"; echo $uplink, "</td></tr>"; } @@ -873,7 +873,7 @@ if ($action=="filter") { if ($chooseType=="media" && empty($media["XREF"])) $isvalid = false; // skip unlinked media files } if ($isvalid) { - if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0){ + if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0) { $imgsize = findImageSize($media["FILE"]); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; @@ -901,7 +901,7 @@ if ($action=="filter") { if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo "<br />"; } - if (!$embed){ + if (!$embed) { echo "<a href=\"javascript:;\" onclick=\"pasteid('", addslashes($media["FILE"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- "; } else echo "<a href=\"javascript:;\" onclick=\"pasteid('", $media["XREF"], "', '", addslashes($media["TITL"]), "', '", addslashes($media["THUMB"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- "; @@ -962,7 +962,7 @@ if ($action=="filter") { $levels = array_reverse($levels); // -- reverse the array so that we get the top level first $placetext = ""; $j=0; - foreach($levels as $indexval => $level) { + foreach ($levels as $indexval => $level) { if ($j>0) $placetext .= ", "; $placetext .= trim($level); $j++; @@ -971,7 +971,7 @@ if ($action=="filter") { } uasort($revplacelist, "utf8_strcasecmp"); echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; - foreach($revplacelist as $place) { + foreach ($revplacelist as $place) { echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", str_replace(array("'", '"'), array("\'", '"'), $place), "');\">", PrintReady($place), "</a></li>"; } echo "</ul></td></tr>"; @@ -1059,7 +1059,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($lcspecialchars as $key=>$value) { + foreach ($lcspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; @@ -1073,7 +1073,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($ucspecialchars as $key=>$value) { + foreach ($ucspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; @@ -1087,7 +1087,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($otherspecialchars as $key=>$value) { + foreach ($otherspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; diff --git a/modules/GEDFact_assistant/_CENS/census_3_search_add.php b/modules/GEDFact_assistant/_CENS/census_3_search_add.php index 2f673ae64e..d7c1d54434 100644 --- a/modules/GEDFact_assistant/_CENS/census_3_search_add.php +++ b/modules/GEDFact_assistant/_CENS/census_3_search_add.php @@ -52,7 +52,7 @@ if (!defined('WT_WEBTREES')) { txt = findInput.value; if (txt=="") { alert("<?php echo i18n::translate('You must enter a name'); ?>"); - }else{ + } else { var win02 = window.open( "module.php?mod=GEDFact_assistant&mod_action=_CENS/census_3_find&callback=paste_id&action=filter&type=indi&multiple=&filter="+txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, HEIGHT=400, WIDTH=450 "); if (window.focus) {win02.focus();} @@ -114,7 +114,7 @@ if (!defined('WT_WEBTREES')) { //-- Build Parents Family -------------------------------------- $personcount=0; $families = $this->indi->getChildFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $label = $this->indi->getChildFamilyLabel($family); $people = $this->buildFamilyList($family, "parents"); $marrdate = $family->getMarriageDate(); @@ -142,7 +142,7 @@ if (!defined('WT_WEBTREES')) { //-- Parents Husbands Parents -------------------------------------- $gparent=Person::getInstance($people["husb"]->getXref()); $fams = $gparent->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $phusb = $family->getHusband($gparent); $pwife = $family->getWife($gparent); @@ -189,16 +189,16 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($people["husb"]->canDisplayDetails()) ) { + if (($people["husb"]->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo PrintReady($people["husb"]->getXref()) ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($fulmn)){ + if (isset($fulmn)) { echo addslashes($fulln); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php @@ -206,9 +206,9 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo PrintReady($people["husb"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0){ + if ($married>=0) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -266,7 +266,7 @@ if (!defined('WT_WEBTREES')) { //-- Parents Wifes Parent Family --------------------------- $gparent=Person::getInstance($people["wife"]->getXref()); $fams = $gparent->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $phusb = $family->getHusband($gparent); $pwife = $family->getWife($gparent); @@ -285,7 +285,7 @@ if (!defined('WT_WEBTREES')) { $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available - if (isset($people["husb"])){ + if (isset($people["husb"])) { $husbnams = $people["husb"]->getAllNames(); if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { // if Husband or his name is not known then use wifes birth name @@ -323,16 +323,16 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($people["wife"]->canDisplayDetails()) ) { + if (($people["wife"]->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo $people["wife"]->getXref() ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($fulmn)){ + if (isset($fulmn)) { echo addslashes($fulmn); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php @@ -340,9 +340,9 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo PrintReady($people["wife"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])){ + if ($married>=0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -399,7 +399,7 @@ if (!defined('WT_WEBTREES')) { //-- Parent's Children's Details -------------------------------------- $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { // Get Child's Children's Name DOB DOD ---- $chBLDarray=Array(); @@ -473,22 +473,22 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($child->canDisplayDetails()) ) { + if (($child->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo $child->getXref(); // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($chfulmn)){ + if (isset($chfulmn)) { echo addslashes($chfulmn); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php if ($child->getXref()==$pid) { echo "Head"; // label = Head - }else{ + } else { echo PrintReady($child->getLabel()); // label = Relationship } ?>", "<?php @@ -557,10 +557,10 @@ if (!defined('WT_WEBTREES')) { //-- Step families --------------------------------------------------------- //-- Build step families --------------------------------------------------- - foreach($this->indi->getStepFamilies() as $famid=>$family) { + foreach ($this->indi->getStepFamilies() as $famid=>$family) { $label = $this->indi->getStepFamilyLabel($family); $people = $this->buildFamilyList($family, "step"); - if ($people){ + if ($people) { echo "<tr><td><br /></td><td></td></tr>"; } $marrdate = $family->getMarriageDate(); @@ -589,7 +589,7 @@ if (!defined('WT_WEBTREES')) { //-- Step Husbands Parent Family -------------------------------------- $gparent=Person::getInstance($people["husb"]->getXref()); $fams = $gparent->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $phusb = $family->getHusband($gparent); $pwife = $family->getWife($gparent); @@ -614,15 +614,15 @@ if (!defined('WT_WEBTREES')) { $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { $menu->addLabel(i18n::translate('Step-Father')); - }else{ + } else { $menu->addLabel($people["husb"]->getLabel()); } $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $people["husb"]->getLabel(), $censyear); $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> <td align="left" class="linkcell optionbox"> @@ -642,30 +642,30 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($people["husb"]->canDisplayDetails()) ) { + if (($people["husb"]->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo PrintReady($people["husb"]->getXref()); // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($fulmn)){ + if (isset($fulmn)) { echo addslashes($fulln); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php if ($people["husb"]->getLabel() == ".") { echo PrintReady(i18n::translate('Step-Father')); // label = Relationship - }else{ + } else { echo PrintReady($people["husb"]->getLabel()); // label = Relationship } ?>", "<?php echo PrintReady($people["husb"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0){ + if ($married>=0) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -725,7 +725,7 @@ if (!defined('WT_WEBTREES')) { //-- Step Wifes Parent Family -------------------------------------- $gparent=Person::getInstance($people["wife"]->getXref()); $fams = $gparent->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $phusb = $family->getHusband($gparent); $pwife = $family->getWife($gparent); @@ -744,7 +744,7 @@ if (!defined('WT_WEBTREES')) { $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available - if (isset($people["husb"])){ + if (isset($people["husb"])) { $husbnams = $people["husb"]->getAllNames(); if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { // if Husband or his name is not known then use wifes birth name @@ -761,15 +761,15 @@ if (!defined('WT_WEBTREES')) { $menu = new Menu(); if ($people["wife"]->getLabel() == ".") { $menu->addLabel(i18n::translate('Step-Mother')); - }else{ + } else { $menu->addLabel($people["wife"]->getLabel()); } $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $people["wife"]->getLabel(), $censyear); $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td align="left" class="linkcell optionbox"> @@ -789,30 +789,30 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($people["wife"]->canDisplayDetails()) ) { + if (($people["wife"]->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo PrintReady($people["wife"]->getXref()) ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($fulmn)){ + if (isset($fulmn)) { echo addslashes($fulmn); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php if ($people["wife"]->getLabel() == ".") { echo PrintReady(i18n::translate('Step-Mother')); // label = Relationship - }else{ + } else { echo PrintReady($people["wife"]->getLabel()); // label = Relationship } ?>", "<?php echo PrintReady($people["wife"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])){ + if ($married>=0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -868,7 +868,7 @@ if (!defined('WT_WEBTREES')) { $styleadd = ""; if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { // Get Child's Children $chBLDarray=Array(); @@ -905,8 +905,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $spouselinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> <td align="left" class="linkcell optionbox"> @@ -926,16 +926,16 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($child->canDisplayDetails()) ) { + if (($child->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo PrintReady($child->getXref()) ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($chfulmn)){ + if (isset($chfulmn)) { echo addslashes($chfulmn); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php @@ -1001,11 +1001,11 @@ if (!defined('WT_WEBTREES')) { //-- Build Spouse Family --------------------------------------------------- $families = $this->indi->getSpouseFamilies(); //$personcount = 0; - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $people = $this->buildFamilyList($family, "spouse"); if ($this->indi->equals($people["husb"])) { $spousetag = 'WIFE'; - }else{ + } else { $spousetag = 'HUSB'; } $marrdate = $family->getMarriageDate(); @@ -1027,12 +1027,12 @@ if (!defined('WT_WEBTREES')) { } //-- Spouse Husband --------------------------------------------------- - if ( isset($people["husb"])) { + if (isset($people["husb"])) { //-- Spouse Husbands Parents -------------------------------------- $gparent=Person::getInstance($people["husb"]->getXref()); $fams = $gparent->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $phusb = $family->getHusband($gparent); $pwife = $family->getWife($gparent); @@ -1059,8 +1059,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr class="fact_value"> <td align="left" nowrap="nowrap" class="linkcell optionbox<?php echo $styleadd; ?>"> @@ -1086,30 +1086,30 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($people["husb"]->canDisplayDetails()) ) { + if (($people["husb"]->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo $people["husb"]->getXref() ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($fulmn)){ + if (isset($fulmn)) { echo addslashes($fulln); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php if ($people["husb"]->getXref()==$pid) { echo "Head"; // label = Relationship - }else{ + } else { echo $people["husb"]->getLabel(); // label = Relationship } ?>", "<?php echo PrintReady($people["husb"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0){ + if ($married>=0) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -1167,7 +1167,7 @@ if (!defined('WT_WEBTREES')) { //-- Spouse Wifes Parents -------------------------------------- $gparent=Person::getInstance($people["wife"]->getXref()); $fams = $gparent->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($gparent); $wife = $family->getWife($gparent); @@ -1187,7 +1187,7 @@ if (!defined('WT_WEBTREES')) { $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available - if (isset($people["husb"])){ + if (isset($people["husb"])) { $husbnams = $people["husb"]->getAllNames(); if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { // if Husband or his name is not known then use wifes birth name @@ -1206,8 +1206,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td align="left" nowrap="nowrap" class="linkcell optionbox<?php echo $styleadd; ?>"> @@ -1233,30 +1233,30 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($people["wife"]->canDisplayDetails()) ) { + if (($people["wife"]->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo $people["wife"]->getXref() ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($fulmn)){ + if (isset($fulmn)) { echo addslashes($fulmn); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php if ($people["wife"]->getXref()==$pid) { echo "Head"; // label = Head - }else{ + } else { echo PrintReady($people["wife"]->getLabel()); // label = Relationship } ?>", "<?php echo PrintReady($people["wife"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])){ + if ($married>=0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -1308,7 +1308,7 @@ if (!defined('WT_WEBTREES')) { } // Spouse Children - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { // Get Spouse child's marriage status $married=""; @@ -1373,16 +1373,16 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" nowrap="nowrap"> <font size=1> <?php - if ( ($child->canDisplayDetails()) ) { + if (($child->canDisplayDetails())) { ?> <a href='javaScript:insertRowToTable("<?php echo $child->getXref() ; // pid = PID ?>", "<?php echo addslashes($fulln); // nam = Full Name ?>", "<?php - if (isset($chfulmn)){ + if (isset($chfulmn)) { echo addslashes($chfulmn); // mnam = Full Married Name - }else{ + } else { echo addslashes($fulln); // mnam = Full Name } ?>", "<?php @@ -1515,7 +1515,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; $step_parentlinks .= "<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - }else{ + } else { $spouselinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; $parentlinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; @@ -1530,7 +1530,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- Parent families -------------------------------------- $fams = $person->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { $marrdate = $family->getMarriageDate(); $married = GedcomDate::Compare($censdate, $marrdate); @@ -1561,14 +1561,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($husb || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($husb) { //-- Parent Husbands Parents ---------------------- $gparent=Person::getInstance($husb->getXref()); $parfams = $gparent->getChildFamilies(); - foreach($parfams as $famid=>$pfamily) { + foreach ($parfams as $famid=>$pfamily) { if (!is_null($pfamily)) { $phusb = $pfamily->getHusband($gparent); $pwife = $pfamily->getWife($gparent); @@ -1580,7 +1580,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $person_parent="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$husb->getXref(); - }else{ + } else { $title = $husb->getXref()." :".i18n::translate('Individual information'); } $tmp=$husb->getXref(); @@ -1599,14 +1599,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable("; $parentlinks .= "'".PrintReady($husb->getXref())."',"; // pid = PID $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name - if (isset($fulmn)){ + if (isset($fulmn)) { $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Married Name } else { $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name } if ($currpid=="Wife" || $currpid=="Husband") { $parentlinks .= "'Father in Law',"; // label = 1st Gen Male Relationship - }else{ + } else { $parentlinks .= "'Grand-Father',"; // label = 2st Gen Male Relationship } $parentlinks .= "'".PrintReady($husb->getSex())."',"; // sex = Gender @@ -1642,7 +1642,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= ");\">"; $parentlinks .= PrintReady($husb->getFullName()); // Full Name (Link) $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } $natdad = "yes"; @@ -1653,14 +1653,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($wife || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($wife) { //-- Parent Wifes Parents ---------------------- $gparent=Person::getInstance($wife->getXref()); $parfams = $gparent->getChildFamilies(); - foreach($parfams as $famid=>$pfamily) { + foreach ($parfams as $famid=>$pfamily) { if (!is_null($pfamily)) { $pwhusb = $pfamily->getHusband($gparent); $pwwife = $pfamily->getWife($gparent); @@ -1687,7 +1687,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $husbnam = null; // Get wifes married name if available - if (isset($husb)){ + if (isset($husb)) { $husbnams = $husb->getAllNames(); if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { // Husband or his name is not known @@ -1704,7 +1704,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable("; $parentlinks .= "'".PrintReady($wife->getXref())."',"; // pid = PID $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name - if (isset($fulmn)){ + if (isset($fulmn)) { $parentlinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name } else { $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name @@ -1747,7 +1747,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= ");\">"; $parentlinks .= PrintReady($wife->getFullName()); // Full Name (Link) $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } $natmom = "yes"; @@ -1758,7 +1758,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- Step families ----------------------------------------- $fams = $person->getStepFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { $marrdate = $family->getMarriageDate(); $married = GedcomDate::Compare($censdate, $marrdate); if (!is_null($family)) { @@ -1786,18 +1786,18 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- Step Husband -------------------------------------- if ($natdad == "yes") { - }else{ - if ( ($husb || $num>0) && $husb->getLabel() != "." ) { + } else { + if (($husb || $num>0) && $husb->getLabel() != ".") { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($husb) { //-- Step Husbands Parents ----------------------------- $gparent=Person::getInstance($husb->getXref()); $parfams = $gparent->getChildFamilies(); - foreach($parfams as $famid=>$pfamily) { + foreach ($parfams as $famid=>$pfamily) { if (!is_null($pfamily)) { $phusb = $pfamily->getHusband($gparent); $pwife = $pfamily->getWife($gparent); @@ -1809,7 +1809,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $person_step="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$husb->getXref(); - }else{ + } else { $title = $husb->getXref()." :".i18n::translate('Individual information'); } $tmp=$husb->getXref(); @@ -1829,14 +1829,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable("; $parentlinks .= "'".PrintReady($husb->getXref())."',"; // pid = PID $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name - if (isset($fulmn)){ + if (isset($fulmn)) { $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Married Name } else { $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name } if ($currpid=="Wife" || $currpid=="Husband") { $parentlinks .= "'Step Father-in-Law',"; // label = 1st Gen Male Relationship - }else{ + } else { $parentlinks .= "'Step Grand-Father',"; // label = 2st Gen Male Relationship } $parentlinks .= "'".PrintReady($husb->getSex())."',"; // sex = Gender @@ -1872,7 +1872,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= ");\">"; $parentlinks .= PrintReady($husb->getFullName()); // Full Name (Link) $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } } @@ -1881,18 +1881,18 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- Step Wife ---------------------------------------- if ($natmom == "yes") { - }else{ + } else { if ($wife || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($wife) { //-- Step Wifes Parents --------------------------- $gparent=Person::getInstance($wife->getXref()); $parfams = $gparent->getChildFamilies(); - foreach($parfams as $famid=>$pfamily) { + foreach ($parfams as $famid=>$pfamily) { if (!is_null($pfamily)) { $pwhusb = $pfamily->getHusband($gparent); $pwwife = $pfamily->getWife($gparent); @@ -1904,7 +1904,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $person_step="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$wife->getXref(); - }else{ + } else { $title = $wife->getXref()." :".i18n::translate('Individual information'); } $tmp=$wife->getXref(); @@ -1920,7 +1920,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $husbnam = null; // Get wifes married name if available - if (isset($husb)){ + if (isset($husb)) { $husbnams = $husb->getAllNames(); if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { // Husband or his name is not known @@ -1937,7 +1937,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable("; $parentlinks .= "'".PrintReady($wife->getXref())."',"; // pid = PID $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name - if (isset($fulmn)){ + if (isset($fulmn)) { $parentlinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name } else { $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name @@ -1980,7 +1980,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= ");\">"; $parentlinks .= PrintReady($wife->getFullName()); // Full Name (Link) $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } } @@ -1991,7 +1991,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", // Spouse Families ------------------------------------------ $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); $children = $family->getChildren(); @@ -2020,7 +2020,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($spouse || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($spouse) { @@ -2028,7 +2028,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- Spouse Parents ----------------------------- $gparent=Person::getInstance($spouse->getXref()); $spousefams = $gparent->getChildFamilies(); - foreach($spousefams as $famid=>$pfamily) { + foreach ($spousefams as $famid=>$pfamily) { if (!is_null($pfamily)) { $phusb = $pfamily->getHusband($gparent); $pwife = $pfamily->getWife($gparent); @@ -2040,7 +2040,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- Spouse Details ----------------------------- if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$spouse->getXref(); - }else{ + } else { $title = $spouse->getXref()." :".i18n::translate('Individual information'); } $tmp=$spouse->getXref(); @@ -2065,7 +2065,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "<a href=\"javascript:insertRowToTable("; $spouselinks .= "'".PrintReady($spouse->getXref())."',"; // pid = PID $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name - if (isset($fulmn)){ + if (isset($fulmn)) { $spouselinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name } else { $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name @@ -2073,7 +2073,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($currpid=="Son" || $currpid=="Daughter") { if ($spouse->getSex()=="M") { $spouselinks .= "'Son in Law',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Daughter in Law',"; // label = Female Relationship } } else { @@ -2116,7 +2116,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= ");\">"; $spouselinks .= PrintReady($spouse->getFullName()); // Full Name (Link) $spouselinks .= "</a>"; - }else{ + } else { $spouselinks .= i18n::translate('Private'); } $spouselinks .= "</a>"; @@ -2128,7 +2128,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", // Children ------------------------------------- $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; - foreach($children as $c=>$child) { + foreach ($children as $c=>$child) { $cpid = $child->getXref(); if ($child) { $persons="Yes"; @@ -2137,7 +2137,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $gparent=Person::getInstance($child->getXref()); $fams = $gparent->getChildFamilies(); $chfams = $gparent->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($gparent); $wife = $family->getWife($gparent); @@ -2204,7 +2204,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "<a href=\"javascript:insertRowToTable("; $spouselinks .= "'".PrintReady($child->getXref())."',"; // pid = PID $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name - if (isset($chfulmn)){ + if (isset($chfulmn)) { $spouselinks .= "'".addslashes(strip_tags($chfulmn))."',"; // mnam = Full Married Name } else { $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name @@ -2212,13 +2212,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($currpid=="Son" || $currpid=="Daughter") { if ($child->getSex()=="M") { $spouselinks .= "'Grand-Son',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Grand-Daughter',"; // label = Female Relationship } - }else{ + } else { if ($child->getSex()=="M") { $spouselinks .= "'Nephew',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Niece',"; // label = Female Relationship } } @@ -2232,7 +2232,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "'".(($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth if ($child->getbirthyear()>=1) { $spouselinks .= "'".PrintReady($censyear-$child->getbirthyear())."',"; // age = Census Year - Year of Birth - }else{ + } else { $spouselinks .= "''".","; // age = Undefined } $spouselinks .= "'".(($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death @@ -2258,7 +2258,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= PrintReady($child->getFullName()); // Full Name (Link) $spouselinks .= "</a>"; $spouselinks .= "</li>"; - }else{ + } else { $spouselinks .= i18n::translate('Private'); } } @@ -2268,19 +2268,19 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", } if ($persons != "Yes") { $spouselinks .= "(" . i18n::translate('none') . ")</td></tr></table>"; - }else{ + } else { $spouselinks .= "</td></tr></table>"; } if ($person_parent != "Yes") { $parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; - }else{ + } else { $parentlinks .= "</td></tr></table>"; } if ($person_step != "Yes") { $step_parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; - }else{ + } else { $step_parentlinks .= "</td></tr></table>"; } } diff --git a/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php b/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php index 83bd117b72..b8d5e5f991 100644 --- a/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php +++ b/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php @@ -188,7 +188,7 @@ function preview() { var tbl = document.getElementById('tblSample'); - for(var i=0; i<tbl.rows.length; i++){ + for (var i=0; i<tbl.rows.length; i++) { var tr = tbl.rows[i]; var strRow = ''; @@ -197,10 +197,10 @@ function preview() { // --------------------------------------------- // Extract Indi id's from created list -------------------------------------- - for(var y=1; y<tr.cells.length-3; y++) { - if ( y>=2 && y<=73) { + for (var y=1; y<tr.cells.length-3; y++) { + if (y>=2 && y<=73) { continue; - }else{ + } else { if (i!=0) { // pidList += '\'' + (pidList==''?'':' ') + tr.cells[1].childNodes[0].value + '\''; pidList += (pidList==''?'':' ') + tr.cells[1].childNodes[0].value; @@ -212,65 +212,65 @@ function preview() { if (NoteCtry.value=="UK") { // UK 1911 or 1921 or 1931 =============== if (NoteYear.value=="1911" || NoteYear.value=="1921" || NoteYear.value=="1931") { - for(var j=2; j<tr.cells.length-3; j++) { + for (var j=2; j<tr.cells.length-3; j++) { if (j==5 || j==6 || j==8 || (j>=10 && j<=15) || (j>=20 && j<=34) || j==36 || (j>=39 && j<=41) || (j>=43 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } } // UK 1901 =============== } else if (NoteYear.value=="1901") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( j==5 || j==6 || j==8 || (j>=10 && j<=34) || j==36 || j==37 || (j>=39 && j<=41) || (j>=43 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if (j==5 || j==6 || j==8 || (j>=10 && j<=34) || j==36 || j==37 || (j>=39 && j<=41) || (j>=43 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } } // UK 1891 =============== } else if (NoteYear.value=="1891") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( j==5 || j==6 || j==8 || (j>=10 && j<=34) || (j>=36 && j<=38) || j==41 || j==42 || (j>=44 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if (j==5 || j==6 || j==8 || (j>=10 && j<=34) || (j>=36 && j<=38) || j==41 || j==42 || (j>=44 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } } // UK 1951-1881 ============ } else if (NoteYear.value=="1851" || NoteYear.value=="1861" || NoteYear.value=="1871" || NoteYear.value=="1881") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( j==5 || j==6 || j==8 || (j>=10 && j<=34) || (j>=36 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if (j==5 || j==6 || j==8 || (j>=10 && j<=34) || (j>=36 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } } // UK 1841 =============== } else if (NoteYear.value=="1841") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=3 && j<=6) || j==8 || (j>=10 && j<=34) || (j>=36 && j<=51) || (j>=54 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=3 && j<=6) || j==8 || (j>=10 && j<=34) || (j>=36 && j<=51) || (j>=54 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -280,13 +280,13 @@ function preview() { } else if (NoteCtry.value=="USA") { // USA 1930 =============== if (NoteYear.value=="1930") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( j==4 || j==5 || j==7 || j==8 || j==11 || j==13 || j==14 || (j>=16 && j<=19) || (j>=21 && j<=45) || (j>=47 && j<=50) || j==52 || j==53 || j==63 || j==64 || j>=67 && j<=73 ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if (j==4 || j==5 || j==7 || j==8 || j==11 || j==13 || j==14 || (j>=16 && j<=19) || (j>=21 && j<=45) || (j>=47 && j<=50) || j==52 || j==53 || j==63 || j==64 || j>=67 && j<=73) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -295,13 +295,13 @@ function preview() { // USA 1920 =============== else if (NoteYear.value=="1920") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( j==4 || (j>=6 && j<=8) || j==11 || j==13 || j==14 || (j>=16 && j<=30) || (j>=34 && j<=45) || (j>=47 && j<=50) || j==52 || j==53 || j==57 || j==58 || (j>=63 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if (j==4 || (j>=6 && j<=8) || j==11 || j==13 || j==14 || (j>=16 && j<=30) || (j>=34 && j<=45) || (j>=47 && j<=50) || j==52 || j==53 || j==57 || j==58 || (j>=63 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -310,13 +310,13 @@ function preview() { // USA 1910 =============== else if (NoteYear.value=="1910") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=4 && j<=8) || j==11 || j==13 || j==14 || (j>=19 && j<=26) || j==30 || j==33 || j==36 || (j>=39 && j<=42) || j==45 || j==47 || j==48 || (j>=50 && j<=64) || j==66 || j>=68 && j<=73 ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=4 && j<=8) || j==11 || j==13 || j==14 || (j>=19 && j<=26) || j==30 || j==33 || j==36 || (j>=39 && j<=42) || j==45 || j==47 || j==48 || (j>=50 && j<=64) || j==66 || j>=68 && j<=73) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -324,13 +324,13 @@ function preview() { } // USA 1900 =============== else if (NoteYear.value=="1900") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=4 && j<=7) || j==10 || j==13 || j==14 || (j>=19 && j<=26) || j==33 || j==34 || (j>=36 && j<=44) || j==47 || (j>=50 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=4 && j<=7) || j==10 || j==13 || j==14 || (j>=19 && j<=26) || j==33 || j==34 || (j>=36 && j<=44) || j==47 || (j>=50 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -338,13 +338,13 @@ function preview() { } // USA 1890 =============== else if (NoteYear.value=="1890") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=4 && j<=7) || j==10 || j==11 || j==13 || j==14 || (j>=19 && j<=26) || j==31 || j==33 || j==34 || j==36 || j==37 || j==39 || j==40 || (j>=42 && j<=45) || j==47 || (j>=49 && j<=63) || (j>=65 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=4 && j<=7) || j==10 || j==11 || j==13 || j==14 || (j>=19 && j<=26) || j==31 || j==33 || j==34 || j==36 || j==37 || j==39 || j==40 || (j>=42 && j<=45) || j==47 || (j>=49 && j<=63) || (j>=65 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -352,13 +352,13 @@ function preview() { } // USA 1880 =============== else if (NoteYear.value=="1880") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=3 && j<=7) || j==10 || j==11 || (j>=17 && j<=34) || (j>=37 && j<=44) || (j>=40 && j<=42) || j==46 || j==49 || j==50 || j==52 || j==53 || (j>=56 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=3 && j<=7) || j==10 || j==11 || (j>=17 && j<=34) || (j>=37 && j<=44) || (j>=40 && j<=42) || j==46 || j==49 || j==50 || j==52 || j==53 || (j>=56 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -366,13 +366,13 @@ function preview() { } // USA 1870 =============== else if (NoteYear.value=="1870") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=3 && j<=6) || j==8 || (j>=11 && j<=20) || (j>=27 && j<=46) || (j>=48 && j<=62) || (j>=64 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=3 && j<=6) || j==8 || (j>=11 && j<=20) || (j>=27 && j<=46) || (j>=48 && j<=62) || (j>=64 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } @@ -380,20 +380,20 @@ function preview() { } // USA 1860 or 1850 =============== else if (NoteYear.value=="1860" || NoteYear.value=="1850") { - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # - if ( (j>=3 && j<=6) || j==8 || (j>=11 && j<=20) || j==24 || j==25 || (j>=27 && j<=46) || (j>=48 && j<=62) || (j>=64 && j<=73) ) { + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + if ((j>=3 && j<=6) || j==8 || (j>=11 && j<=20) || j==24 || j==25 || (j>=27 && j<=46) || (j>=48 && j<=62) || (j>=64 && j<=73)) { continue; - }else{ + } else { if (i==0) { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id; - }else{ + } else { strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value; } } } } - }else{ + } else { // Other country stuff } @@ -403,15 +403,15 @@ function preview() { } // Reset/Check the Pink Highlighting of the Name field and Age fields for any person not born ------------------ - for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # + for (var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item # if (i==0) { // Do nothing as this is the header row. - }else{ + } else { if (tr.cells[7].childNodes[0].value != "-" || tr.cells[12].childNodes[0].value != "-") { tr.cells[2].childNodes[0].style.background = '#ffffff'; tr.cells[7].childNodes[0].style.background = '#ffffff'; tr.cells[12].childNodes[0].style.background = '#ffffff'; - }else{ + } else { // alert(tr.cells[2].childNodes[0].value+" - Not Born Yet"); tr.cells[2].childNodes[0].style.background = '#ffaaaa'; tr.cells[7].childNodes[0].style.background = '#ffaaaa'; @@ -592,7 +592,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d var cyear = document.getElementById('censYear').value; if (cyear!="choose") { cyear=cyear; - }else{ + } else { alert ("You must choose a Census year first") return; } @@ -686,7 +686,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d birthpl = '-'; } else if (birthpl[0]!="England" && birthpl[0]!="Scotland" && birthpl[0]!="Wales" && birthpl[0]!="Northern Ireland" && birthpl[0]!="UK") { birthpl = birthpl[0]+", "+birthpl[1]; - }else { + } else { birthpl = birthpl[1]+", "+birthpl[2]; } @@ -782,13 +782,13 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d // Check if Census year filled in ------------- if (cyear!="choose") { cyear=cyear; - }else{ + } else { alert ("You must choose a Census year first") return; } var diffage=(1901-cyear); age=(age2-diffage); - }else{ + } else { age="-"; } @@ -797,7 +797,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d // **A** Define Cells =============================================== var cell_ = new Array(73); - for(var i=0; i<=73; i++){ + for (var i=0; i<=73; i++) { cell_[i] = row.insertCell(i); cell_[i].setAttribute('id', 'col_'+i); cell_[i].setAttribute('name', 'col_'+i); @@ -806,7 +806,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d if (iteration == 0) { var cell_tdel = row.insertCell(74); // text Del var cell_tra = row.insertCell(75); // text Radio - }else{ + } else { var cell_del = row.insertCell(74); // Onclick = Delete Row cell_del.setAttribute('align', 'center'); var cell_ra = row.insertCell(75); // Radio button used for inserting a row, rather than adding at end of table) @@ -820,7 +820,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d // **B** SHOW/HIDE Header Cell elements =============================== // ---- Basic Hidden Columns (miss out 0,1,2 and >68) - for(var i=3; i<=69; i++){ + for (var i=3; i<=69; i++) { cell_[i].style.display = "none"; } @@ -1490,7 +1490,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d txt_itemNo2.setAttribute('type', 'text'); txt_itemNo2.style.fontSize="10px"; - }else{ + } else { // **D** Define Cell Elements ======================================= var txtcolor = "#0000FF"; @@ -1499,21 +1499,21 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d var txt_itemNo = document.createElement('div'); // txt_itemNo.style.display="none"; // 1. Indi ID ------------------------------------------------------- - if ( pid == ''){ + if (pid=='') { var txtcolor = "#000000"; // This adds a checkbox for adding an indi id .... to be implemented later var txtInp_pid = document.createElement('input'); txtInp_pid.setAttribute('type', 'checkbox'); - if (txtInp_pid.checked!=''){ + if (txtInp_pid.checked!='') { txtInp_pid.setAttribute('value', 'no'); - }else{ + } else { txtInp_pid.setAttribute('value', 'add'); } // ------------------------------------------------------------------------- txtInp_pid.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_1'); txtInp_pid.setAttribute('size', '1'); txtInp_pid.style.fontSize="11px"; - }else{ + } else { var txtInp_pid = document.createElement('input'); //txtInp_pid.style.border='0px'; txtInp_pid.style.background='#bbddff'; @@ -2375,7 +2375,7 @@ function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, d if (iteration == 0) { cell_tdel.appendChild(txtInp_tdel); // Text Del cell_tra.appendChild(txtInp_tra); // Text Ins - }else{ + } else { cell_del.appendChild(btnEl); // Onclick = Delete Row cell_ra.appendChild(raEl); // Radio button used for inserting a row, rather than adding at end of table) } diff --git a/modules/GEDFact_assistant/_CENS/js/date.js b/modules/GEDFact_assistant/_CENS/js/date.js index acaf5c02b7..af9188da69 100644 --- a/modules/GEDFact_assistant/_CENS/js/date.js +++ b/modules/GEDFact_assistant/_CENS/js/date.js @@ -184,35 +184,35 @@ Date.parseString = function(val, format) { } else if (token=="MM"||token=="M") { month=this.getInt(val,i_val,token.length,2); - if(month==null||(month<1)||(month>12)){ + if (month==null||(month<1)||(month>12)){ return null; } i_val+=month.length; } else if (token=="dd"||token=="d") { date=this.getInt(val,i_val,token.length,2); - if(date==null||(date<1)||(date>31)){ + if (date==null||(date<1)||(date>31)){ return null; } i_val+=date.length; } else if (token=="hh"||token=="h") { hh=this.getInt(val,i_val,token.length,2); - if(hh==null||(hh<1)||(hh>12)){ + if (hh==null||(hh<1)||(hh>12)){ return null; } i_val+=hh.length; } else if (token=="HH"||token=="H") { hh=this.getInt(val,i_val,token.length,2); - if(hh==null||(hh<0)||(hh>23)){ + if (hh==null||(hh<0)||(hh>23)){ return null; } i_val+=hh.length; } else if (token=="KK"||token=="K") { hh=this.getInt(val,i_val,token.length,2); - if(hh==null||(hh<0)||(hh>11)){ + if (hh==null||(hh<0)||(hh>11)){ return null; } i_val+=hh.length; @@ -220,7 +220,7 @@ Date.parseString = function(val, format) { } else if (token=="kk"||token=="k") { hh=this.getInt(val,i_val,token.length,2); - if(hh==null||(hh<1)||(hh>24)){ + if (hh==null||(hh<1)||(hh>24)){ return null; } i_val+=hh.length; @@ -228,14 +228,14 @@ Date.parseString = function(val, format) { } else if (token=="mm"||token=="m") { mm=this.getInt(val,i_val,token.length,2); - if(mm==null||(mm<0)||(mm>59)){ + if (mm==null||(mm<0)||(mm>59)){ return null; } i_val+=mm.length; } else if (token=="ss"||token=="s") { ss=this.getInt(val,i_val,token.length,2); - if(ss==null||(ss<0)||(ss>59)){ + if (ss==null||(ss<0)||(ss>59)){ return null; } i_val+=ss.length; @@ -268,7 +268,7 @@ Date.parseString = function(val, format) { // Is date valid for month? if (month==2) { // Check for leap year - if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year + if (( (year%4==0)&&(year%100 != 0) ) || (year%400==0)) { // leap year if (date > 29){ return null; } diff --git a/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php index a4d515195d..16dcd1b92d 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php +++ b/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php @@ -56,7 +56,7 @@ if (empty($linktoid) || empty($linkto)) { } if (WT_USER_IS_ADMIN) { print_simple_header(i18n::translate('Link media')." ".$toitems); -}else{ +} else { print_simple_header(i18n::translate('Administration')); echo i18n::translate('Unable to authenticate user.'); } @@ -100,7 +100,7 @@ if ($action == "choose" && $paramok) { function blankwin() { if (document.getElementById('gid').value == "" || document.getElementById('gid').value.length<=1) { alert(id_empty); - }else{ + } else { var iid = document.getElementById('gid').value; //var winblank = window.open('module.php?mod=GEDFact_assistant&mod_action=_MEDIA/media_query_3a&iid='+iid, 'winblank', 'top=100, left=200, width=400, height=20, toolbar=0, directories=0, location=0, status=0, menubar=0, resizable=1, scrollbars=1'); var winblank = window.open('modules/GEDFact_assistant/_MEDIA/media_query_3a.php?iid='+iid, 'winblank', 'top=100, left=200, width=400, height=20, toolbar=0, directories=0, location=0, status=0, menubar=0, resizable=1, scrollbars=1'); @@ -245,7 +245,7 @@ if ($action == "choose" && $paramok) { } } echo '<br />'; - }else{ + } else { // echo nothing and do nothing } @@ -265,9 +265,9 @@ if ($action == "choose" && $paramok) { echo '<br />'; } echo '<br />'; - }else if ($more_links==",") { + } else if ($more_links==",") { // echo nothing and do nothing - }else{ + } else { //echo $mediaid, $pgv_lang["media_now_linked to"], '(', $gid, ')<br />'; //linkMedia($mediaid, $gid); } diff --git a/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php b/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php index fa41ea5e81..ecf70fc218 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php +++ b/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php @@ -54,14 +54,14 @@ if ($pid=="") { echo "<br /><br />"; echo "<b><font color=\"red\">YOU MUST enter a Base individual ID to be able to \"ADD\" Individual Links</font></b>"; echo "<br /><br />"; -}else{ +} else { $person=Person::getInstance($pid); // var_dump($person->getAllNames()); $nam = $person->getAllNames(); - if (PrintReady($person->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($person->getDeathYear()); } - if (PrintReady($person->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($person->getBirthYear()); } - if ($married>=0 && isset($nam[1])){ + if (PrintReady($person->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($person->getDeathYear()); } + if (PrintReady($person->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($person->getBirthYear()); } + if ($married>=0 && isset($nam[1])) { $wholename = rtrim($nam[1]['fullNN']); } else { $wholename = rtrim($nam[0]['fullNN']); diff --git a/modules/GEDFact_assistant/_MEDIA/media_3_find.php b/modules/GEDFact_assistant/_MEDIA/media_3_find.php index 393c37a02a..d88676f656 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_3_find.php +++ b/modules/GEDFact_assistant/_MEDIA/media_3_find.php @@ -76,10 +76,10 @@ $thumbdir = stripcslashes(preg_replace($srch, $repl, $directory)); //-- prevent script from accessing an area outside of the media directory //-- and keep level consistency -if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)){ +if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)) { $directory = $MEDIA_DIRECTORY; $level = 0; -} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){ +} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0) { $directory = $MEDIA_DIRECTORY; $level = 0; } @@ -138,7 +138,7 @@ echo WT_JS_START; } function pasteid(id, name, thumb) { - if(thumb) { + if (thumb) { window.opener.<?php echo $callback; ?>(id, name, thumb); <?php if (!$multiple) echo "window.close();"; ?> } else { @@ -150,7 +150,7 @@ echo WT_JS_START; if (id.match("I")=="I") { var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links¬eid=newnote&pid='+id, 'win01', 'top=50, left=600, width=420, height=650, resizable=1, scrollbars=1'); if (window.focus) {win01.focus();} - }else if (id.match("F")=="F") { + } else if (id.match("F")=="F") { // TODO --- alert('Opening Navigator with family id entered will come later'); } */ @@ -302,7 +302,7 @@ if ($type == "media" && $MULTI_MEDIA) { echo "</td></tr>"; echo "<tr><td class=\"list_label width10\" wstyle=\"padding: 5px;\">"; echo "<input type=\"checkbox\" name=\"showthumb\" value=\"true\""; - if( $showthumb) echo "checked=\"checked\""; + if ($showthumb) echo "checked=\"checked\""; echo "onclick=\"javascript: this.form.submit();\" />", i18n::translate('Show thumbnails'); echo help_link('show_thumb'); echo "</td></tr>"; @@ -410,7 +410,7 @@ if ($type == "specialchar") { echo "<select id=\"language_filter\" name=\"language_filter\" onchange=\"submit();\">"; echo "<option value=\"\">", i18n::translate('Change language'), "</option>"; $language_options = ""; - foreach($specialchar_languages as $key=>$value) { + foreach ($specialchar_languages as $key=>$value) { $language_options.= "<option value=\"$key\">$value</option>"; } $language_options = str_replace("\"$language_filter\"", "\"$language_filter\" selected", $language_options); @@ -438,7 +438,7 @@ if ($action=="filter") { if ($myindilist) { echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; usort($myindilist, array('GedcomRecord', 'Compare')); - foreach($myindilist as $indi) { + foreach ($myindilist as $indi) { //echo $indi->format_list('li', true); $nam = htmlspecialchars($indi->getFullName()); echo "<li><a href=\"javascript:;\" onclick=\"pasterow( @@ -483,7 +483,7 @@ if ($action=="filter") { $curged = $GEDCOM; echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; usort($myfamlist, array('GedcomRecord', 'Compare')); - foreach($myfamlist as $family) { + foreach ($myfamlist as $family) { echo $family->format_list('li', true); } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total families'), ' ', count($myfamlist), '</tr></td>'; @@ -506,10 +506,10 @@ if ($action=="filter") { if ($level>0) { $levels = explode("/", $directory); $pdir = ""; - for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/"; + for ($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/"; $levels = explode("/", $thumbdir); $pthumb = ""; - for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; + for ($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; $uplink = "<a href=\"find.php?directory=".rawurlencode($pdir)."&thumbdir=".rawurlencode($pthumb)."&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; } @@ -528,7 +528,7 @@ if ($action=="filter") { // display the directory list if (count($dirs) || $level) { sort($dirs); - if ($level){ + if ($level) { echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">"; echo $uplink, "</td></tr>"; } @@ -571,7 +571,7 @@ if ($action=="filter") { if ($chooseType=="media" && empty($media["XREF"])) $isvalid = false; // skip unlinked media files } if ($isvalid) { - if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0){ + if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0) { $imgsize = findImageSize($media["FILE"]); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; @@ -599,7 +599,7 @@ if ($action=="filter") { if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo "<br />"; } - if (!$embed){ + if (!$embed) { echo "<a href=\"javascript:;\" onclick=\"pasteid('", addslashes($media["FILE"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- "; } else echo "<a href=\"javascript:;\" onclick=\"pasteid('", $media["XREF"], "','", addslashes($media["TITL"]), "','", addslashes($media["THUMB"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- "; @@ -660,7 +660,7 @@ if ($action=="filter") { $levels = array_reverse($levels); // -- reverse the array so that we get the top level first $placetext = ""; $j=0; - foreach($levels as $indexval => $level) { + foreach ($levels as $indexval => $level) { if ($j>0) $placetext .= ", "; $placetext .= trim($level); $j++; @@ -669,7 +669,7 @@ if ($action=="filter") { } uasort($revplacelist, "utf8_strcasecmp"); echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; - foreach($revplacelist as $place) { + foreach ($revplacelist as $place) { echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", str_replace(array("'", '"'), array("\'", '"'), $place), "');\">", PrintReady($place), "</a></li>"; } echo "</ul></td></tr>"; @@ -757,7 +757,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($lcspecialchars as $key=>$value) { + foreach ($lcspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; @@ -771,7 +771,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($ucspecialchars as $key=>$value) { + foreach ($ucspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; @@ -785,7 +785,7 @@ if ($action=="filter") { if ($magnify) { echo '<span class="largechars">'; } - foreach($otherspecialchars as $key=>$value) { + foreach ($otherspecialchars as $key=>$value) { $value = str_replace("'", "\'", $value); echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">"; echo $key; diff --git a/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php b/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php index 7463067b47..c08ecd0b5a 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php +++ b/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php @@ -52,7 +52,7 @@ if (!defined('WT_WEBTREES')) { txt = findInput.value; if (txt=="") { alert(enter_name); - }else{ + } else { var win02 = window.open( //"module.php?mod=GEDFact_assistant&mod_action=_MEDIA/media_3_find&callback=paste_id&action=filter&type=indi&multiple=&filter="+txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, HEIGHT=600, WIDTH=450 "); "modules/GEDFact_assistant/_MEDIA/media_3_find.php?callback=paste_id&action=filter&type=indi&multiple=&filter="+txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, HEIGHT=600, WIDTH=450 "); @@ -113,7 +113,7 @@ if (!defined('WT_WEBTREES')) { //-- Build Parent Family --------------------------------------------------- $personcount=0; $families = $this->indi->getChildFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $label = $this->indi->getChildFamilyLabel($family); $people = $this->buildFamilyList($family, "parents"); $marrdate = $family->getMarriageDate(); @@ -158,7 +158,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($people["husb"]->canDisplayDetails()) ) { + if (($people["husb"]->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo PrintReady($people["husb"]->getXref()) ; // pid = PID @@ -170,9 +170,9 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo PrintReady($people["husb"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0){ + if ($married>=0) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -209,7 +209,7 @@ if (!defined('WT_WEBTREES')) { if (isset($nam[1])) { $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; - }else{ + } else { $fulmn = $fulln; $marn = $surn; } @@ -239,14 +239,14 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($people["wife"]->canDisplayDetails()) ) { + if (($people["wife"]->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo $people["wife"]->getXref() ; // pid = PID ?>", "<?php - // if ($married>=0 && isset($nam[1])){ + // if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // nam = Married Name - // }else{ + // } else { //echo PrintReady($people["wife"]->getFullName()); // nam = Name echo PrintReady($fulln); // } @@ -255,9 +255,9 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo PrintReady($people["wife"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])){ + if ($married>=0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -272,7 +272,7 @@ if (!defined('WT_WEBTREES')) { echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth ?>");'> <?php - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // Full Married Name //} else { echo PrintReady($people["wife"]->getFullName()); // Full Name @@ -292,7 +292,7 @@ if (!defined('WT_WEBTREES')) { if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { // Get child's marriage status $married=""; foreach ($child->getSpouseFamilies() as $childfamily) { @@ -343,21 +343,21 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($child->canDisplayDetails()) ) { + if (($child->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo $child->getXref() ; // pid = PID ?>", "<?php - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // nam = Married Name - //}else{ + //} else { //echo PrintReady($child->getFullName()); // nam = Full Name echo PrintReady($fulln); //} ?>", "<?php if ($child->getXref()==$pid) { echo "Head"; // label = Head - }else{ + } else { echo PrintReady($child->getLabel()); // label = Relationship } ?>", "<?php @@ -381,7 +381,7 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth ?>");'><?php - // if ($married>=0 && isset($nam[1])){ + // if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // Full Married Name // } else { echo PrintReady($child->getFullName()); // Full Name @@ -404,10 +404,10 @@ if (!defined('WT_WEBTREES')) { } //-- Build step families ---------------------------------------------------------------- - foreach($this->indi->getStepFamilies() as $famid=>$family) { + foreach ($this->indi->getStepFamilies() as $famid=>$family) { $label = $this->indi->getStepFamilyLabel($family); $people = $this->buildFamilyList($family, "step"); - if ($people){ + if ($people) { echo "<tr><td><br /></td><td></td></tr>"; } $marrdate = $family->getMarriageDate(); @@ -428,7 +428,7 @@ if (!defined('WT_WEBTREES')) { $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { $menu->addLabel(" " . i18n::translate('Step-Father')); - }else{ + } else { $menu->addLabel(" " . $people["husb"]->getLabel()); } //$menu->addClass("", "", "submenu"); @@ -436,8 +436,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> <td width=75 align="left" class="optionbox"> @@ -457,7 +457,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($people["husb"]->canDisplayDetails()) ) { + if (($people["husb"]->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo PrintReady($people["husb"]->getXref()) ; // pid = PID @@ -467,15 +467,15 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php if ($people["husb"]->getLabel() == ".") { echo PrintReady(i18n::translate('Step-Father')); // label = Relationship - }else{ + } else { echo PrintReady($people["husb"]->getLabel()); // label = Relationship } ?>", "<?php echo PrintReady($people["husb"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0){ + if ($married>=0) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -519,7 +519,7 @@ if (!defined('WT_WEBTREES')) { $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { $menu->addLabel(" " . i18n::translate('Step-Mother')); - }else{ + } else { $menu->addLabel(" " . $people["wife"]->getLabel()); } //$menu->addClass("", "", "submenu"); @@ -527,8 +527,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td width=75 align="left" class="optionbox"> @@ -548,29 +548,29 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($people["wife"]->canDisplayDetails()) ) { + if (($people["wife"]->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo PrintReady($people["wife"]->getXref()) ; // pid = PID ?>", "<?php - // if ($married>=0 && isset($nam[1])){ + // if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // nam = Married Name - // }else{ + // } else { //echo PrintReady($people["wife"]->getFullName()); // nam = Full Name echo PrintReady($fulln); // } ?>", "<?php if ($people["wife"]->getLabel() == ".") { echo PrintReady(i18n::translate('Step-Mother')); // label = Relationship - }else{ + } else { echo PrintReady($people["wife"]->getLabel()); // label = Relationship } ?>", "<?php echo PrintReady($people["wife"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])){ + if ($married>=0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -585,7 +585,7 @@ if (!defined('WT_WEBTREES')) { echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth ?>");'> <?php - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // Full Married Name //} else { echo PrintReady($people["wife"]->getFullName()); // Full Name @@ -607,7 +607,7 @@ if (!defined('WT_WEBTREES')) { $styleadd = ""; if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { $nam = $child->getAllNames(); $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; $givn = rtrim($nam[0]['givn'],'*'); @@ -621,8 +621,8 @@ if (!defined('WT_WEBTREES')) { $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $spouselinks; $submenu = new Menu($slabel); - $menu->addSubMenu($submenu); if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + $menu->addSubMenu($submenu); if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> <td width=75 align="left" class="optionbox"> @@ -642,7 +642,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($child->canDisplayDetails()) ) { + if (($child->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo PrintReady($child->getXref()) ; // pid = PID @@ -688,17 +688,17 @@ if (!defined('WT_WEBTREES')) { //-- Build Spouse Family --------------------------------------------------- $families = $this->indi->getSpouseFamilies(); //$personcount = 0; - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $people = $this->buildFamilyList($family, "spouse"); if ($this->indi->equals($people["husb"])) { $spousetag = 'WIFE'; - }else{ + } else { $spousetag = 'HUSB'; } $marrdate = $family->getMarriageDate(); // Husband ------------------- - if ( isset($people["husb"])) { + if (isset($people["husb"])) { $married = GedcomDate::Compare($censdate, $marrdate); $nam = $people["husb"]->getAllNames(); $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; @@ -714,8 +714,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr class="fact_value"> <td width=75 align="left" class="optionbox"> @@ -741,7 +741,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" > <font size=1> <?php - if ( ($people["husb"]->canDisplayDetails()) ) { + if (($people["husb"]->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo $people["husb"]->getXref() ; // pid = PID @@ -751,15 +751,15 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php if ($people["husb"]->getXref()==$pid) { echo "Head"; // label = Relationship - }else{ + } else { echo $people["husb"]->getLabel(); // label = Relationship } ?>", "<?php echo PrintReady($people["husb"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0){ + if ($married>=0) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -790,7 +790,7 @@ if (!defined('WT_WEBTREES')) { // Wife ------------------- - //if ( isset($people["wife"]) && $spousetag == 'WIFE') { + //if (isset($people["wife"]) && $spousetag == 'WIFE') { if (isset($people["wife"])) { $married = GedcomDate::Compare($censdate, $marrdate); $nam = $people["wife"]->getAllNames(); @@ -800,7 +800,7 @@ if (!defined('WT_WEBTREES')) { if (isset($nam[1])) { $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; - }else{ + } else { $fulmn = $fulln; $marn = $surn; } @@ -810,8 +810,8 @@ if (!defined('WT_WEBTREES')) { $slabel .= $parentlinks; $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td width=75 align="left" class="optionbox"> @@ -837,29 +837,29 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($people["wife"]->canDisplayDetails()) ) { + if (($people["wife"]->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo $people["wife"]->getXref() ; // pid = PID ?>", "<?php - // if ($married>=0 && isset($nam[1])){ + // if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // nam = Full Married Name - // }else{ + // } else { //echo PrintReady($people["wife"]->getFullName()); // nam = Full Name echo PrintReady($fulln); // } ?>", "<?php if ($people["wife"]->getXref()==$pid) { echo "Head"; // label = Head - }else{ + } else { echo PrintReady($people["wife"]->getLabel()); // label = Relationship } ?>", "<?php echo PrintReady($people["wife"]->getSex()); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])){ + if ($married>=0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) - }else{ + } else { echo "S"; // cond = Condition (Single) } ?>", "<?php @@ -874,7 +874,7 @@ if (!defined('WT_WEBTREES')) { echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth ?>");'> <?php - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // Full Married Name //} else { echo PrintReady($people["wife"]->getFullName()); // Full Name @@ -892,7 +892,7 @@ if (!defined('WT_WEBTREES')) { } // Children - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { // Get child's marriage status $married=""; foreach ($child->getSpouseFamilies() as $childfamily) { @@ -906,7 +906,7 @@ if (!defined('WT_WEBTREES')) { if (isset($nam[1])) { $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; - }else{ + } else { $fulmn = $fulln; $marn = $surn; } @@ -935,14 +935,14 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - if ( ($child->canDisplayDetails()) ) { + if (($child->canDisplayDetails())) { ?> <a href='javaScript:opener.insertRowToTable("<?php echo $child->getXref() ; // pid = PID ?>", "<?php - // if ($married>0 && isset($nam[1])){ + // if ($married>0 && isset($nam[1])) { // echo PrintReady($fulmn); // nam = Full Married Name - // }else{ + // } else { // echo PrintReady($child->getFullName()); // nam = Full Name echo PrintReady($fulln); // nam = Full Name // } @@ -970,7 +970,7 @@ if (!defined('WT_WEBTREES')) { echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth ?>");'> <?php - // if ($married>=0 && isset($nam[1])){ + // if ($married>=0 && isset($nam[1])) { // echo PrintReady($fulmn); // Full Married Name // } else { echo PrintReady($child->getFullName()); // Full Name @@ -1050,7 +1050,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; $step_parentlinks .= "<table id=\"flyoutStepRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - }else{ + } else { $spouselinks .= "<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; $parentlinks .= "<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; @@ -1064,7 +1064,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- parent families -------------------------------------- $fams = $person->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($person); @@ -1078,14 +1078,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($husb || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($husb) { $person_parent="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$husb->getXref(); - }else{ + } else { $title = $husb->getXref()." :".i18n::translate('Individual information'); } $tmp=$husb->getXref(); @@ -1104,7 +1104,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "'".PrintReady($fulln)."', "; // nam = Name if ($currpid=="Wife" || $currpid=="Husband") { $parentlinks .= "'Father in Law', "; // label = 1st Gen Male Relationship - }else{ + } else { $parentlinks .= "'Grand-Father', "; // label = 2st Gen Male Relationship } $parentlinks .= "'".PrintReady($husb->getSex())."', "; // sex = Gender @@ -1112,7 +1112,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "'".PrintReady($husb->getbirthyear())."', "; // yob = Year of Birth if ($husb->getbirthyear()>=1) { $parentlinks .= "'".PrintReady($censyear-$husb->getbirthyear())."', "; // age = Census Year - Year of Birth - }else{ + } else { $parentlinks .= "''".", "; // age = Undefined } $parentlinks .= "'Y'".", "; // Y/M/D = Age in Years/Months/Days @@ -1122,7 +1122,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= PrintReady($husb->getFullName()); $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } $natdad = "yes"; @@ -1133,14 +1133,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($wife || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($wife) { $person_parent="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$wife->getXref(); - }else{ + } else { $title = $wife->getXref()." :".i18n::translate('Individual information'); } $tmp=$wife->getXref(); @@ -1159,7 +1159,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "'".PrintReady($wife->getXref())."',"; // pid = PID // $parentlinks .= "'".PrintReady($fulln)."',"; // nam = Name - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // $parentlinks .= "'".PrintReady($fulmn)."',"; // nam = Full Married Name //} else { $parentlinks .= "'".PrintReady($fulln)."',"; // nam = Full Name @@ -1167,7 +1167,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($currpid=="Wife" || $currpid=="Husband") { $parentlinks .= "'Mother in Law',"; // label = 1st Gen Female Relationship - }else{ + } else { $parentlinks .= "'Grand-Mother',"; // label = 2st Gen Female Relationship } $parentlinks .= "'".PrintReady($wife->getSex())."',"; // sex = Gender @@ -1175,7 +1175,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "'".PrintReady($wife->getbirthyear())."',"; // yob = Year of Birth if ($wife->getbirthyear()>=1) { $parentlinks .= "'".PrintReady($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth - }else{ + } else { $parentlinks .= "''".","; // age = Undefined } $parentlinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days @@ -1183,14 +1183,14 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "'".PrintReady($wife->getcensbirthplace())."'"; // birthpl = Birthplace //$parentlinks .= ");\"><div id='wifePar'>"; $parentlinks .= ");\">"; - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // $parentlinks .= $fulmn; // Full Married Name //} else { $parentlinks .= PrintReady($wife->getFullName()); // Full Name //} // $parentlinks .= "</div></a>"; $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } $parentlinks .= "<br />"; @@ -1202,7 +1202,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- step families ----------------------------------------- $fams = $person->getStepFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($person); $wife = $family->getWife($person); @@ -1212,19 +1212,19 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $marrdate = $family->getMarriageDate(); if ($natdad == "yes") { - }else{ + } else { // Husband ----------------------- - if ( ($husb || $num>0) && $husb->getLabel() != "." ) { + if (($husb || $num>0) && $husb->getLabel() != ".") { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($husb) { $person_step="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$husb->getXref(); - }else{ + } else { $title = $husb->getXref()." :".i18n::translate('Individual information'); } $tmp=$husb->getXref(); @@ -1242,7 +1242,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom={$GEDCOM}\">"; $parentlinks .= PrintReady($husb->getFullName()); $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } $parentlinks .= "<br />"; @@ -1251,19 +1251,19 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", } if ($natmom == "yes") { - }else{ + } else { // Wife ---------------------------- if ($wife || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($wife) { $person_step="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$wife->getXref(); - }else{ + } else { $title = $wife->getXref()." :".i18n::translate('Individual information'); } $tmp=$wife->getXref(); @@ -1280,7 +1280,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom={$GEDCOM}\">"; $parentlinks .= PrintReady($wife->getFullName()); $parentlinks .= "</a>"; - }else{ + } else { $parentlinks .= i18n::translate('Private'); } $parentlinks .= "<br />"; @@ -1292,7 +1292,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", // Spouse Families -------------------------------------- @var $family Family $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); $children = $family->getChildren(); @@ -1303,13 +1303,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($spouse || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($spouse) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$spouse->getXref(); - }else{ + } else { $title = $spouse->getXref()." :".i18n::translate('Individual information'); } $tmp=$spouse->getXref(); @@ -1326,7 +1326,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "<a href=\"javascript:opener.insertRowToTable("; $spouselinks .= "'".PrintReady($spouse->getXref())."',"; // pid = PID //$spouselinks .= "'".PrintReady($fulln)."',"; // nam = Name - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // $spouselinks .= "'".PrintReady($fulmn)."',"; // Full Married Name //} else { $spouselinks .= "'".PrintReady($spouse->getFullName())."',"; // Full Name @@ -1334,13 +1334,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($currpid=="Son" || $currpid=="Daughter") { if ($spouse->getSex()=="M") { $spouselinks .= "'Son in Law',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Daughter in Law',"; // label = Female Relationship } - }else{ + } else { if ($spouse->getSex()=="M") { $spouselinks .= "'Brother in Law',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Sister in Law',"; // label = Female Relationship } } @@ -1349,7 +1349,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "'".PrintReady($spouse->getbirthyear())."',"; // yob = Year of Birth if ($spouse->getbirthyear()>=1) { $spouselinks .= "'".PrintReady($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth - }else{ + } else { $spouselinks .= "''".","; // age = Undefined } $spouselinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days @@ -1357,13 +1357,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "'".PrintReady($spouse->getcensbirthplace())."'"; // birthpl = Birthplace $spouselinks .= ");\">"; // $spouselinks .= PrintReady($fulln); - //if ($married>=0 && isset($nam[1])){ + //if ($married>=0 && isset($nam[1])) { // $spouselinks .= "'".PrintReady($fulmn)."',"; // Full Married Name //} else { $spouselinks .= PrintReady($spouse->getFullName()); // Full Name //} $spouselinks .= "</a>"; - }else{ + } else { $spouselinks .= i18n::translate('Private'); } $spouselinks .= "</a>"; @@ -1376,7 +1376,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", // Children ------------------------------ @var $child Person $spouselinks .= "<div id='spouseFam'>"; $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; - foreach($children as $c=>$child) { + foreach ($children as $c=>$child) { $cpid = $child->getXref(); if ($child) { $persons="Yes"; @@ -1398,13 +1398,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($currpid=="Son" || $currpid=="Daughter") { if ($child->getSex()=="M") { $spouselinks .= "'Grand-Son',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Grand-Daughter',"; // label = Female Relationship } - }else{ + } else { if ($child->getSex()=="M") { $spouselinks .= "'Nephew',"; // label = Male Relationship - }else{ + } else { $spouselinks .= "'Niece',"; // label = Female Relationship } } @@ -1413,7 +1413,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= "'".PrintReady($child->getbirthyear())."',"; // yob = Year of Birth if ($child->getbirthyear()>=1) { $spouselinks .= "'".PrintReady($censyear-$child->getbirthyear())."',"; // age = Census Year - Year of Birth - }else{ + } else { $spouselinks .= "''".","; // age = Undefined } $spouselinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days @@ -1422,7 +1422,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= ");\">"; $spouselinks .= PrintReady($child->getFullName()); // Full Name $spouselinks .= "</a>"; - }else{ + } else { $spouselinks .= i18n::translate('Private'); } $spouselinks .= "</li>"; @@ -1435,19 +1435,19 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($persons != "Yes") { $spouselinks .= "(" . i18n::translate('none') . ")</td></tr></table>"; - }else{ + } else { $spouselinks .= "</td></tr></table>"; } if ($person_parent != "Yes") { $parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; - }else{ + } else { $parentlinks .= "</td></tr></table>"; } if ($person_step != "Yes") { $step_parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; - }else{ + } else { $step_parentlinks .= "</td></tr></table>"; } } diff --git a/modules/GEDFact_assistant/_MEDIA/media_5_input.js b/modules/GEDFact_assistant/_MEDIA/media_5_input.js index 81d4a11cf8..8e7544afde 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_5_input.js +++ b/modules/GEDFact_assistant/_MEDIA/media_5_input.js @@ -75,7 +75,7 @@ function insertRowToTable(pid, nam, head) for (var i=1; i<numrows; i++) { if (IE) { strRow += (strRow==''?'':', ') + links.rows[i].cells[1].innerText; - }else{ + } else { strRow += (strRow==''?'':', ') + links.rows[i].cells[1].textContent; } } @@ -84,7 +84,7 @@ function insertRowToTable(pid, nam, head) //Check if id exists in Links list ================================= if (strRow.match(pid+',')!= pid+',') { // alert('NO MATCH'); - }else{ + } else { rowToInsertAt = 'EXIST' ; } @@ -92,7 +92,7 @@ function insertRowToTable(pid, nam, head) for (var i=0; i<tbl.tBodies[0].rows.length; i++) { if (tbl.tBodies[0].rows[i].myRow.one.textContent==pid) { rowToInsertAt = 'EXIST' ; - }else + } else if (tbl.tBodies[0].rows[i].myRow && tbl.tBodies[0].rows[i].myRow.ra.getAttribute('type') == 'radio' && tbl.tBodies[0].rows[i].myRow.ra.checked) { rowToInsertAt = i; break; @@ -105,7 +105,7 @@ function insertRowToTable(pid, nam, head) //addRowToTable(rowToInsertAt, pid, nam, label, gend, cond, yob, age, YMD, occu, birthpl); addRowToTable(rowToInsertAt, pid, nam, head); reorderRows(tbl, rowToInsertAt); - }else{ + } else { alert(nam+' ('+pid+') - '+linkExists); } @@ -114,7 +114,7 @@ function insertRowToTable(pid, nam, head) function removeHTMLTags(htmlString) { - if(htmlString) { + if (htmlString) { var mydiv = document.createElement("div"); mydiv.innerHTML = htmlString; if (document.all) // IE Stuff @@ -164,15 +164,15 @@ function addRowToTable(num, pid, nam, head) // cell 1 - ID: var cell1 = row.insertCell(1); // cell1.setAttribute('align', 'left'); - if ( pid == ''){ + if (pid=='') { var txtInp1 = document.createElement('div'); txtInp1.setAttribute('type', 'checkbox'); - if (txtInp1.checked!=''){ + if (txtInp1.checked!='') { txtInp1.setAttribute('value', 'no'); - }else{ + } else { txtInp1.setAttribute('value', 'add'); } - }else{ + } else { var txtInp1 = document.createElement('div'); txtInp1.setAttribute('type', 'text'); txtInp1.innerHTML = pid; // Required for IE @@ -222,7 +222,7 @@ function addRowToTable(num, pid, nam, head) btn2El.setAttribute('title', ifamily); btn2El.onclick = function () {openFamNav(pid)}; cellbtn2.appendChild(btn2El); - }else if (pid.match("F")=="F" || pid.match("f")=="f") { + } else if (pid.match("F")=="F" || pid.match("f")=="f") { var btn2El = document.createElement('img'); btn2El.setAttribute('type', 'img'); btn2El.setAttribute('src', imageDir+'/buttons/family.gif'); @@ -230,7 +230,7 @@ function addRowToTable(num, pid, nam, head) btn2El.setAttribute('title', ifamily); btn2El.onclick = function () {openFamNav(head)}; cellbtn2.appendChild(btn2El); - }else{ + } else { // Show No Icon } diff --git a/modules/GEDFact_assistant/_MEDIA/media_5_input.php b/modules/GEDFact_assistant/_MEDIA/media_5_input.php index a5010d689f..0cde96136b 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_5_input.php +++ b/modules/GEDFact_assistant/_MEDIA/media_5_input.php @@ -34,7 +34,7 @@ <script> var txtcolor="#ffffff"; </script> -<?php }else{ ?> +<?php } else { ?> <script> var txtcolor="#000000"; </script> @@ -48,7 +48,7 @@ .classy1 { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: transparent; color: #ffffff; font-size: 10px; } --> </style> -<?php }else{ ?> +<?php } else { ?> <style type="text/css"> <!-- #addlinkQueue td, th { padding: 0.2em; } diff --git a/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php b/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php index f7439d9bfe..b80af838b0 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php +++ b/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php @@ -34,10 +34,10 @@ function parseAddLinks() { str = ""; var tbl = document.getElementById('addlinkQueue'); - for(var i=1; i<tbl.rows.length; i++){ // start at i=1 because we need to avoid header + for (var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header var tr = tbl.rows[i]; var strRow = ''; - for(var j=1; j<tr.cells.length; j++){ // Start at col 1 (j=1) + for (var j=1; j<tr.cells.length; j++) { // Start at col 1 (j=1) if (j>=2) { // dont show col 0 index // SHOW col 1 id @@ -45,10 +45,10 @@ function parseAddLinks() { // miss out col 3 relationship // miss out col 4 delete button continue; - }else{ + } else { if (IE) { strRow += (strRow==''?'':'') + tr.cells[j].childNodes[0].innerHTML; - }else{ + } else { strRow += (strRow==''?'':'') + tr.cells[j].childNodes[0].textContent; } } @@ -61,17 +61,17 @@ function parseAddLinks() { function parseRemLinks() { remstr = ""; var tbl = document.getElementById('existLinkTbl'); - for(var i=1; i<tbl.rows.length; i++){ // start at i=1 because we need to avoid header + for (var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header var remtr = tbl.rows[i]; var remstrRow = ''; - for(var j=1; j<remtr.cells.length; j++){ // Start at col 1 (j=1) + for (var j=1; j<remtr.cells.length; j++) { // Start at col 1 (j=1) if (j!=4 ) { // dont show col 0 index // miss out col 2 name // miss out col 3 keep radio button // choose col 4 remove radio button continue; - }else{ + } else { if (remtr.cells[j].childNodes[0].checked) { remstrRow += (remstrRow==''?'':'') + remtr.cells[j].childNodes[0].name + ', '; } @@ -99,7 +99,7 @@ function shiftlinks() { // alert('string = '+ str); if (str) { document.link.more_links.value = str; - }else{ + } else { // leave hidden input morelinks as "No Values" var inputField = document.getElementById('gid'); // alert(inputField.value) diff --git a/modules/GEDFact_assistant/_MEDIA/media_query_1a.php b/modules/GEDFact_assistant/_MEDIA/media_query_1a.php index 33a95c05ae..00cd4004e1 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_query_1a.php +++ b/modules/GEDFact_assistant/_MEDIA/media_query_1a.php @@ -70,7 +70,7 @@ if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) { $idrecord=Family::getInstance($link); if ($idrecord->getHusbId()) { $head=$idrecord->getHusbId(); - }else{ + } else { $head=$idrecord->getWifeId(); } } elseif ($record->getType()=='SOUR') { diff --git a/modules/GEDFact_assistant/_MEDIA/media_query_2a.php b/modules/GEDFact_assistant/_MEDIA/media_query_2a.php index a9678a94ad..ed9b1721a7 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_query_2a.php +++ b/modules/GEDFact_assistant/_MEDIA/media_query_2a.php @@ -44,7 +44,7 @@ if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) { // iid=document.getElementById('gid').value; if (document.getElementById('gid').value == "") { alert(id_empty); - }else{ + } else { addmedia_links(document.getElementById('gid'), document.getElementById('gid').value, iname ); return false; } @@ -56,7 +56,7 @@ if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) { id = id.toUpperCase(); winNav = window.open('edit_interface.php?action=addmedia_links¬eid=newnote&pid='+id, 'winNav', 'top=50,left=640,width=300,height=630,resizable=1,scrollbars=1'); if (window.focus) {winNav.focus();} - }else if (id.match("F")=="F") { + } else if (id.match("F")=="F") { id = id.toUpperCase(); // TODO --- alert('Opening Navigator with family id entered will come later'); } diff --git a/modules/GEDFact_assistant/_MEDIA/media_query_3a.php b/modules/GEDFact_assistant/_MEDIA/media_query_3a.php index 21f2546f2d..c22c3006e8 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_query_3a.php +++ b/modules/GEDFact_assistant/_MEDIA/media_query_3a.php @@ -43,7 +43,7 @@ if ($record) { $idrecord=Family::getInstance($iid2); if ($idrecord->getHusbId()) { $headjs=$idrecord->getHusbId(); - }else{ + } else { $headjs=$idrecord->getWifeId(); } } diff --git a/modules/clippings/clippings_ctrl.php b/modules/clippings/clippings_ctrl.php index 8db987f746..31cfe09121 100644 --- a/modules/clippings/clippings_ctrl.php +++ b/modules/clippings/clippings_ctrl.php @@ -356,7 +356,7 @@ class ClippingsController extends BaseController { AddToLog("deleted dummy user -> {$tempUserID} <-", 'auth'); } - if($this->IncludeMedia == "yes") + if ($this->IncludeMedia == "yes") { $this->media_list = $media; } @@ -380,7 +380,7 @@ class ClippingsController extends BaseController { $tempFileName = 'clipping'.rand().'.ged'; $fp = fopen($INDEX_DIRECTORY.$tempFileName, "wb"); - if($fp) + if ($fp) { flock($fp,LOCK_EX); fwrite($fp,$this->download_data); @@ -411,7 +411,7 @@ class ClippingsController extends BaseController { * Brings up the download dialog box and allows the user to download the file * based on the options he or she selected */ - function download_clipping(){ + function download_clipping() { if ($this->IncludeMedia == "yes" || $this->Zip == "yes") { header('Content-Type: application/zip'); header('Content-Disposition: attachment; filename="clipping.zip"'); diff --git a/modules/clippings/module.php b/modules/clippings/module.php index b6513fd44a..52b355b1f4 100644 --- a/modules/clippings/module.php +++ b/modules/clippings/module.php @@ -131,7 +131,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module $out .= '<script type="text/javascript"> <!-- jQuery(document).ready(function() { - jQuery(".add_cart, .remove_cart").live("click", function(){ + jQuery(".add_cart, .remove_cart").live("click", function() { jQuery("#sb_clippings_content").load(this.href); return false; }); diff --git a/modules/descendancy/module.php b/modules/descendancy/module.php index 7af9f18909..311930073f 100644 --- a/modules/descendancy/module.php +++ b/modules/descendancy/module.php @@ -84,9 +84,9 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { } } - jQuery(document).ready(function(){ - jQuery("#sb_desc_name").focus(function(){this.select();}); - jQuery("#sb_desc_name").blur(function(){if (this.value=="") this.value="'.i18n::translate('Search').'";}); + jQuery(document).ready(function() { + jQuery("#sb_desc_name").focus(function() {this.select();}); + jQuery("#sb_desc_name").blur(function() {if (this.value=="") this.value="'.i18n::translate('Search').'";}); var dtimerid = null; jQuery("#sb_desc_name").keyup(function(e) { if (dtimerid) window.clearTimeout(dtimerid); @@ -157,7 +157,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $out .= '<div class="desc_tree_div_visible">'; $out .= $this->loadSpouses($person->getXref()); $out .= '</div><script type="text/javascript">dloadedNames["'.$person->getXref().'"]=2;</script>'; - }else { + } else { $out .= '<div class="desc_tree_div">'; $out .= '</div>'; } @@ -219,7 +219,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $person = Person::getInstance($pid); if ($person->canDisplayDetails()) { $families = $person->getSpouseFamilies(); - foreach($families as $family) { + foreach ($families as $family) { $spouse = $family->getSpouse($person); if ($spouse) { $out .= $this->getFamilyLi($family, $spouse, $generations-1); @@ -237,7 +237,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $children = $family->getChildren(); if (count($children)>0) { $private = 0; - foreach($children as $child) { + foreach ($children as $child) { if ($child->canDisplayName()) $out .= $this->getPersonLi($child, $generations-1); else $private++; } diff --git a/modules/families/module.php b/modules/families/module.php index 68832a5c3c..d01b2137c9 100644 --- a/modules/families/module.php +++ b/modules/families/module.php @@ -86,9 +86,9 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { } } - jQuery(document).ready(function(){ - jQuery("#sb_fam_name").focus(function(){this.select();}); - jQuery("#sb_fam_name").blur(function(){if (this.value=="") this.value="'.i18n::translate('Search').'";}); + jQuery(document).ready(function() { + jQuery("#sb_fam_name").focus(function() {this.select();}); + jQuery("#sb_fam_name").blur(function() {if (this.value=="") this.value="'.i18n::translate('Search').'";}); var famtimerid = null; jQuery("#sb_fam_name").keyup(function(e) { if (famtimerid) window.clearTimeout(famtimerid); @@ -106,7 +106,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { jQuery.ajax({ url: "sidebar.php?sb_action=families&alpha="+alpha+"&surname="+surname, cache: false, - success: function(html){ + success: function(html) { jQuery("#sb_fam_"+surname+" div").html(html); jQuery("#sb_fam_"+surname+" div").show(); jQuery("#sb_fam_"+surname).css("list-style-image", "url('.$WT_IMAGES['minus'].')"); @@ -168,7 +168,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { global $SHOW_MARRIED_NAMES; $surns=get_indilist_surns('', $alpha, $SHOW_MARRIED_NAMES, true, WT_GED_ID); $out = '<ul>'; - foreach($surns as $surname=>$surns) { + foreach ($surns as $surname=>$surns) { $out .= '<li id="sb_fam_'.$surname.'" class="sb_fam_surname_li"><a href="'.$surname.'" title="'.$surname.'" alt="'.$alpha.'" class="sb_fam_surname">'.$surname.'</a>'; if (!empty($surname1) && $surname1==$surname) { $out .= '<div class="name_tree_div_visible">'; @@ -188,7 +188,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { $families=get_famlist_fams($surname, $alpha, '', $SHOW_MARRIED_NAMES, WT_GED_ID); $out = '<ul>'; $private_count = 0; - foreach($families as $family) { + foreach ($families as $family) { if ($family->canDisplayName()) { $out .= '<li><a href="'.$family->getHtmlUrl().'">'.$family->getFullName().' '; if ($family->canDisplayDetails()) { diff --git a/modules/family_nav/module.php b/modules/family_nav/module.php index af8e7058dd..9e76c5ba61 100644 --- a/modules/family_nav/module.php +++ b/modules/family_nav/module.php @@ -127,7 +127,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $families = $this->controller->indi->getChildFamilies(); //-- parent families ------------------------------------------------------------- - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $label = $this->controller->indi->getChildFamilyLabel($family); $people = $this->controller->buildFamilyList($family, "parents"); $styleadd = ""; @@ -147,7 +147,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { // $menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($people["husb"]->getXref(), 2, 0, $personcount++); @@ -155,8 +155,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -179,7 +179,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($people["wife"]->getXref(), 2, 0, $personcount++); @@ -187,8 +187,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -208,14 +208,14 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { - if ($pid == $child->getXref() ){ - }else{ + foreach ($people["children"] as $key=>$child) { + if ($pid == $child->getXref()) { + } else { $menu = new Menu(" " . $child->getLabel()); //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($child->getXref(), 2, 0, $personcount++); @@ -223,8 +223,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); } - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> @@ -242,7 +242,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { if ($pid == $child->getXref()) { echo "<span style=\"font: 12px tahoma, arial, helvetica, sans-serif;\">".PrintReady($child->getFullName())."</span>"; echo "<br /><span style=\"font:9px tahoma, arial, helvetica, sans-serif;\">" . $BirthYr . " - " . $DeathYr . "</span>"; - }else{ + } else { echo "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$child->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$child->getHtmlUrl()."');\">"; echo PrintReady($child->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; @@ -258,10 +258,10 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { } //-- step families ---------------------------------------------------------------- - foreach($this->controller->indi->getStepFamilies() as $famid=>$family) { + foreach ($this->controller->indi->getStepFamilies() as $famid=>$family) { $label = $this->controller->indi->getStepFamilyLabel($family); $people = $this->controller->buildFamilyList($family, "step"); - if ($people){ + if ($people) { echo "<tr><td><br /></td><td></td></tr>"; } $styleadd = ""; @@ -283,13 +283,13 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { $menu->addLabel(i18n::translate('Step-Father')); - }else{ + } else { $menu->addLabel($people["husb"]->getLabel()); } //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($people["husb"]->getXref(), 2, 0, $personcount++); @@ -297,8 +297,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> @@ -324,13 +324,13 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $menu = new Menu(); if ($people["wife"]->getLabel() == ".") { $menu->addLabel(i18n::translate('Step-Mother')); - }else{ + } else { $menu->addLabel($people["wife"]->getLabel()); } //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($people["wife"]->getXref(), 2, 0, $personcount++); @@ -338,8 +338,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -360,12 +360,12 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $styleadd = ""; if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { $menu = new Menu($child->getLabel()); //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($child->getXref(), 2, 0, $personcount++); @@ -373,8 +373,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -397,7 +397,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { //-- spouse and children -------------------------------------------------- $families = $this->controller->indi->getSpouseFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { echo "<tr><td><br /></td><td></td></tr>"; ?> <tr> @@ -413,18 +413,18 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { //$personcount = 0; $people = $this->controller->buildFamilyList($family, "spouse"); - if ($this->controller->indi->equals($people["husb"])){ + if ($this->controller->indi->equals($people["husb"])) { $spousetag = 'WIFE'; - }else{ + } else { $spousetag = 'HUSB'; } $styleadd = ""; - if ( isset($people["husb"]) && $spousetag == 'HUSB' ) { + if (isset($people["husb"]) && $spousetag == 'HUSB') { $menu = new Menu(" " . $people["husb"]->getLabel()); //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($people["husb"]->getXref(), 2, 0, $personcount++); @@ -432,8 +432,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); } - if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); } + if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["husb"]->getDeathYear()); } + if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["husb"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -444,7 +444,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { if ($pid == $people["husb"]->getXref()) { echo PrintReady($people["husb"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; - }else{ + } else { echo "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["husb"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['husb']->getHtmlUrl()."');\">"; echo PrintReady($people["husb"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; @@ -456,12 +456,12 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { <?php } - if ( isset($people["wife"]) && $spousetag == 'WIFE') { + if (isset($people["wife"]) && $spousetag == 'WIFE') { $menu = new Menu(" " . $people["wife"]->getLabel()); //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($people["wife"]->getXref(), 2, 0, $personcount++); @@ -469,8 +469,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubMenu($submenu); - if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); } - if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); } + if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($people["wife"]->getDeathYear()); } + if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($people["wife"]->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -481,7 +481,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { if ($pid == $people["wife"]->getXref()) { echo PrintReady($people["wife"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; - }else{ + } else { echo "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["wife"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['wife']->getHtmlUrl()."');\">"; echo PrintReady($people["wife"]->getFullName()); echo "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; @@ -495,12 +495,12 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $styleadd = ""; if (isset($people["children"])) { - foreach($people["children"] as $key=>$child) { + foreach ($people["children"] as $key=>$child) { $menu = new Menu(" " . $child->getLabel()); //$menu->addClass("", "", "submenu"); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout2"); - }else{ + } else { $menu->addClass("", "", "submenu flyout2rtl"); } $slabel = "</a>".$this->print_pedigree_person_nav($child->getXref(), 2, 0, $personcount++); @@ -508,8 +508,8 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $submenu = new Menu($slabel); $menu->addSubmenu($submenu); - if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); } - if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); } + if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; } else { $DeathYr = PrintReady($child->getDeathYear()); } + if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; } else { $BirthYr = PrintReady($child->getBirthYear()); } ?> <tr> <td class="facts_label<?php echo $styleadd; ?>" nowrap="nowrap" style="width:75px;"> @@ -592,7 +592,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { //-- parent families -------------------------------------- $fams = $person->getChildFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($person); @@ -605,14 +605,14 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($husb || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($husb) { $person_parent="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$husb->getXref(); - }else{ + } else { $title = $husb->getXref()." :".i18n::translate('Individual information'); } $parentlinks .= "<a id=\"phusb\" href=\"".$husb->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$husb->getHtmlUrl()."');\">"; @@ -627,14 +627,14 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($wife || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($wife) { $person_parent="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$wife->getXref(); - }else{ + } else { $title = $wife->getXref()." :".i18n::translate('Individual information'); } $parentlinks .= "<a id=\"pwife\" href=\"".$wife->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$wife->getHtmlUrl()."');\">"; @@ -649,7 +649,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { //-- step families ----------------------------------------- $fams = $person->getStepFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $husb = $family->getHusband($person); $wife = $family->getWife($person); @@ -658,19 +658,19 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { $num = count($children); if ($natdad == "yes") { - }else{ + } else { // Husband ----------------------- if ($husb || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($husb) { $person_step="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$husb->getXref(); - }else{ + } else { $title = $husb->getXref()." :".i18n::translate('Individual information'); } $parentlinks .= "<a id=\"shusb\" href=\"".$husb->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$husb->getHtmlUrl()."');\">"; @@ -682,19 +682,19 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { } if ($natmom == "yes") { - }else{ + } else { // Wife ---------------------------- if ($wife || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($wife) { $person_step="Yes"; if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$wife->getXref(); - }else{ + } else { $title = $wife->getXref()." :".i18n::translate('Individual information'); } $parentlinks .= "<a id=\"swife\" href=\"".$wife->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$wife->getHtmlUrl()."');\">"; @@ -709,7 +709,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { // Spouse Families -------------------------------------- @var $family Family $fams = $person->getSpouseFamilies(); - foreach($fams as $famid=>$family) { + foreach ($fams as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); $children = $family->getChildren(); @@ -719,13 +719,13 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($spouse || $num>0) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Family book chart').": ".$famid; - }else{ + } else { $title = $famid." :".i18n::translate('Family book chart'); } if ($spouse) { if ($TEXT_DIRECTION=="ltr") { $title = i18n::translate('Individual information').": ".$spouse->getXref(); - }else{ + } else { $title = $spouse->getXref()." :".i18n::translate('Individual information'); } $spouselinks .= "<a id=\"spouse\" href=\"".$spouse->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$spouse->getHtmlUrl()."');\">"; @@ -740,7 +740,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { // Children ------------------------------ @var $child Person $hasChildren = 'No'; - foreach($children as $c=>$child) { + foreach ($children as $c=>$child) { if ($child) { if ($hasChildren == 'No') { $hasChildren = 'Yes'; diff --git a/modules/faq/module.php b/modules/faq/module.php index 41bcade518..3c81a40dca 100644 --- a/modules/faq/module.php +++ b/modules/faq/module.php @@ -302,7 +302,7 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf echo '<h2 class="center">', i18n::translate('Frequently asked questions'), '</h2>'; // Instructions echo '<div class="faq_italic">', i18n::translate('Click on a title to go straight to it, or scroll down to read them all'); - if (WT_USER_GEDCOM_ADMIN){ + if (WT_USER_GEDCOM_ADMIN) { echo '<div style="float:right;">', '<a href="module.php?mod=faq&mod_action=config">', i18n::translate('Click here to Add, Edit, or Delete'), '</a>', '</div>'; @@ -312,7 +312,7 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf $row_count = 0; echo '<table class="faq">'; // List of titles - foreach($faqs as $id => $faq) { + foreach ($faqs as $id => $faq) { $header = get_block_setting($faq->block_id, 'header'); $faqbody = get_block_setting($faq->block_id, 'faqbody'); $languages=get_block_setting($faq->block_id, 'languages'); @@ -335,7 +335,7 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf echo '</table><hr>'; // Detailed entries echo '<table>'; - foreach($faqs as $id => $faq) { + foreach ($faqs as $id => $faq) { $header = get_block_setting($faq->block_id, 'header'); $faqbody = get_block_setting($faq->block_id, 'faqbody'); $languages=get_block_setting($faq->block_id, 'languages'); diff --git a/modules/gedcom_favorites/module.php b/modules/gedcom_favorites/module.php index 14b380ce00..5252fdb377 100644 --- a/modules/gedcom_favorites/module.php +++ b/modules/gedcom_favorites/module.php @@ -148,7 +148,7 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { <script type="text/javascript" src="js/jquery/jquery.ajaxQueue.js"></script> <script type="text/javascript"> jQuery.noConflict(); // @see http://docs.jquery.com/Using_jQuery_with_Other_Libraries/ - jQuery(document).ready(function($){ + jQuery(document).ready(function($) { $("input[name^=gid]").autocomplete("autocomplete.php", { extraParams: {field:"IFSRO"}, formatItem: function(row, i) { @@ -181,7 +181,7 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { } } else { $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center $TEXT_DIRECTION\">"; - foreach($userfavs as $key=>$favorite) { + foreach ($userfavs as $key=>$favorite) { if (isset($favorite["id"])) $key=$favorite["id"]; $removeFavourite = "<a class=\"font9\" href=\"index.php?ctype=$ctype&action=deletefav&fv_id={$key}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this item from your list of Favorites?')."');\">".i18n::translate('Remove')."</a><br />"; $content .= "<tr><td>"; diff --git a/modules/gedcom_news/module.php b/modules/gedcom_news/module.php index dc602d1c15..c53d349b58 100644 --- a/modules/gedcom_news/module.php +++ b/modules/gedcom_news/module.php @@ -97,19 +97,19 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block { $title.="<img class=\"adminicon\" src=\"".$WT_IMAGES["admin"]."\" width=\"15\" height=\"15\" border=\"0\" alt=\"".i18n::translate('Configure')."\" /></a>"; } $title .= i18n::translate('News'); - if(WT_USER_GEDCOM_ADMIN) { + if (WT_USER_GEDCOM_ADMIN) { $title .= help_link('index_gedcom_news_adm'); } else { $title .= help_link('index_gedcom_news'); } $content = ""; - if(count($usernews) == 0) + if (count($usernews) == 0) { $content .= i18n::translate('No News articles have been submitted.').'<br />'; } $c = 0; $td = time(); - foreach($usernews as $news) + foreach ($usernews as $news) { if ($limit=='count') { if ($c >= $flag) { @@ -134,7 +134,7 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block { } $content .= embed_globals($news["text"]); // Print Admin options for this News item - if(WT_USER_GEDCOM_ADMIN) { + if (WT_USER_GEDCOM_ADMIN) { $content .= "<hr size=\"1\" />" ."<a href=\"javascript:;\" onclick=\"editnews('".$news['id']."'); return false;\">".i18n::translate('Edit')."</a> | " ."<a href=\"index.php?action=deletenews&news_id=".$news['id']."&ctype={$ctype}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this News entry?')."');\">".i18n::translate('Delete')."</a><br />"; diff --git a/modules/gedcom_stats/module.php b/modules/gedcom_stats/module.php index 51ce08688b..6a7dd8ade6 100644 --- a/modules/gedcom_stats/module.php +++ b/modules/gedcom_stats/module.php @@ -131,7 +131,7 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { } if ($stat_users) { $content .= '<tr><td class="facts_label">'.i18n::translate('Total users').'</td><td class="facts_value"><div dir="rtl">'; - if (WT_USER_GEDCOM_ADMIN){ + if (WT_USER_GEDCOM_ADMIN) { $content .= '<a href="useradmin.php">'.$stats->totalUsers().'</a>'; } else { $content .= $stats->totalUsers(); @@ -152,14 +152,14 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { } if ($stat_last_birth) { $content .= '<tr><td class="facts_label">'.i18n::translate('Latest birth year').'</td><td class="facts_value"><div dir="rtl">'.$stats->lastBirthYear().'</div></td>'; - if (!$block){ + if (!$block) { $content .= '<td class="facts_value">'.$stats->lastBirth().'</td>'; } $content .= '</tr>'; } if ($stat_first_death) { $content .= '<tr><td class="facts_label">'.i18n::translate('Earliest death year').'</td><td class="facts_value"><div dir="rtl">'.$stats->firstDeathYear().'</div></td>'; - if (!$block){ + if (!$block) { $content .= '<td class="facts_value">'.$stats->firstDeath().'</td>'; } $content .= '</tr>'; @@ -167,14 +167,14 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { if ($stat_last_death) { $content .= '<tr><td class="facts_label">'.i18n::translate('Latest death year').'</td><td class="facts_value"><div dir="rtl">'.$stats->lastDeathYear().'</div> </td>'; - if (!$block){ + if (!$block) { $content .= '<td class="facts_value">'.$stats->lastDeath().'</td>'; } $content .='</tr>'; } if ($stat_long_life) { $content .= '<tr><td class="facts_label">'.i18n::translate('Person who lived the longest').'</td><td class="facts_value"><div dir="rtl">'.$stats->LongestLifeAge().'</div></td>'; - if (!$block){ + if (!$block) { $content .= '<td class="facts_value">'.$stats->LongestLife().'</td>'; } $content .= '</tr>'; @@ -214,7 +214,7 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { $content .= help_link('index_common_names'); $content .= '<br />'; $i=0; - foreach($surnames as $indexval => $surname) { + foreach ($surnames as $indexval => $surname) { if (stristr($surname['name'], '@N.N')===false) { if ($i>0) { $content .= ', '; diff --git a/modules/googlemap/flags.php b/modules/googlemap/flags.php index dc5a1631f4..01b3197c6e 100644 --- a/modules/googlemap/flags.php +++ b/modules/googlemap/flags.php @@ -60,7 +60,7 @@ while ($file = readdir($rep)) { closedir($rep); sort($country); -if($countrySelected == "Countries") { +if ($countrySelected == "Countries") { $flags = $country; } else { @@ -80,7 +80,7 @@ if ($action == "ChangeFlag") { <script type="text/javascript"> <!-- function edit_close() { -<?php if($_POST["selcountry"] == "Countries") { ?> +<?php if ($_POST["selcountry"] == "Countries") { ?> window.opener.document.editplaces.icon.value = "places/flags/<?php echo $flags[$_POST["FLAGS"]]; ?>.gif"; window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"places/flags/<?php echo $country[$_POST["FLAGS"]]; ?>.gif\"> <a href=\"javascript:;\" onclick=\"change_icon();return false;\"><?php echo i18n::translate('Change flag'); ?></a> <a href=\"javascript:;\" onclick=\"remove_icon();return false;\"><?php echo i18n::translate('Remove flag'); ?></a>"; <?php } else { ?> diff --git a/modules/googlemap/googlemap.php b/modules/googlemap/googlemap.php index 11e80143f0..6524d50662 100644 --- a/modules/googlemap/googlemap.php +++ b/modules/googlemap/googlemap.php @@ -38,19 +38,19 @@ if (!defined('WT_WEBTREES')) { global $SESSION_HIDE_GOOGLEMAP; $SESSION_HIDE_GOOGLEMAP = "empty"; if ((isset($_REQUEST["HIDE_GOOGLEMAP"])) && (empty($SEARCH_SPIDER))) { - if(stristr("true", $_REQUEST["HIDE_GOOGLEMAP"])) { + if (stristr("true", $_REQUEST["HIDE_GOOGLEMAP"])) { $SESSION_HIDE_GOOGLEMAP = "true"; } - if(stristr("false", $_REQUEST["HIDE_GOOGLEMAP"])) { + if (stristr("false", $_REQUEST["HIDE_GOOGLEMAP"])) { $SESSION_HIDE_GOOGLEMAP = "false"; } } // change the session values and store if needed. -if($SESSION_HIDE_GOOGLEMAP == "true") $_SESSION['hide_googlemap'] = true; -if($SESSION_HIDE_GOOGLEMAP == "false") $_SESSION['hide_googlemap'] = false; -if($SESSION_HIDE_GOOGLEMAP == "empty") { - if((isset($_SESSION['hide_googlemap'])) && ($_SESSION['hide_googlemap'] == true)) +if ($SESSION_HIDE_GOOGLEMAP == "true") $_SESSION['hide_googlemap'] = true; +if ($SESSION_HIDE_GOOGLEMAP == "false") $_SESSION['hide_googlemap'] = false; +if ($SESSION_HIDE_GOOGLEMAP == "empty") { + if ((isset($_SESSION['hide_googlemap'])) && ($_SESSION['hide_googlemap'] == true)) $SESSION_HIDE_GOOGLEMAP = "true"; else $SESSION_HIDE_GOOGLEMAP = "false"; @@ -66,7 +66,7 @@ function print_fact_place_map($factrec) { // reverse the array so that we get the top level first $levels = array_reverse($levels); $retStr .= "<a href=\"placelist.php?action=show&"; - foreach($levels as $pindex=>$ppart) { + foreach ($levels as $pindex=>$ppart) { // routine for replacing ampersands $ppart = preg_replace("/amp\%3B/", "", trim($ppart)); $retStr .= "parent[$pindex]=".PrintReady($ppart)."&"; @@ -91,7 +91,7 @@ function print_address_structure_map($factrec, $level) { $nlevel = $level+1; $ct = preg_match_all("/$level ADDR(.*)/", $factrec, $omatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $arec = get_sub_record($level, "$level ADDR", $factrec, $i+1); $resultText = ""; $cn = preg_match("/$nlevel _NAME (.*)/", $arec, $cmatch); @@ -142,25 +142,25 @@ function print_address_structure_map($factrec, $level) { } $resultText = "<table>"; $ct = preg_match_all("/$level PHON (.*)/", $factrec, $omatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr><td><span class=\"label\"><b>".translate_fact('PHON').": </b></span></td><td><span class=\"field\">"; $resultText .= getLRM() . $omatch[$i][1]. getLRM(); $resultText .= "</span></td></tr>"; } $ct = preg_match_all("/$level FAX (.*)/", $factrec, $omatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr><td><span class=\"label\"><b>".translate_fact('FAX').": </b></span></td><td><span class=\"field\">"; $resultText .= getLRM() . $omatch[$i][1] . getLRM(); $resultText .= "</span></td></tr>"; } $ct = preg_match_all("/$level EMAIL (.*)/", $factrec, $omatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr><td><span class=\"label\"><b>".translate_fact('EMAIL').": </b></span></td><td><span class=\"field\">"; $resultText .= "<a href=\"mailto:".$omatch[$i][1]."\">".$omatch[$i][1]."</a>"; $resultText .= "</span></td></tr>"; } $ct = preg_match_all("/$level (WWW|URL) (.*)/", $factrec, $omatch, PREG_SET_ORDER); - for($i=0; $i<$ct; $i++) { + for ($i=0; $i<$ct; $i++) { $resultText .= "<tr><td><span class=\"label\"><b>".translate_fact('URL').": </b></span></td><td><span class=\"field\">"; $resultText .= "<a href=\"".$omatch[$i][2]."\" target=\"_blank\">".$omatch[$i][2]."</a>"; $resultText .= "</span></td></tr>"; @@ -273,7 +273,7 @@ function get_lati_long_placelocation ($place) { $parent = explode (",", $place); $parent = array_reverse($parent); $place_id = 0; - for($i=0; $i<count($parent); $i++) { + for ($i=0; $i<count($parent); $i++) { $parent[$i] = trim($parent[$i]); if (empty($parent[$i])) $parent[$i]="unknown";// GoogleMap module uses "unknown" while GEDCOM uses , , $placelist = create_possible_place_names($parent[$i], $i+1); @@ -356,19 +356,19 @@ function create_indiv_buttons() { Map_type.prototype.refresh = function() { this.button1.className = 'non_active'; - if(this.map.getCurrentMapType() != G_NORMAL_MAP) + if (this.map.getCurrentMapType() != G_NORMAL_MAP) this.button2.className = 'non_active'; else this.button2.className = 'active'; - if(this.map.getCurrentMapType() != G_SATELLITE_MAP) + if (this.map.getCurrentMapType() != G_SATELLITE_MAP) this.button3.className = 'non_active'; else this.button3.className = 'active'; - if(this.map.getCurrentMapType() != G_HYBRID_MAP) + if (this.map.getCurrentMapType() != G_HYBRID_MAP) this.button4.className = 'non_active'; else this.button4.className = 'active'; - if(this.map.getCurrentMapType() != G_PHYSICAL_MAP) + if (this.map.getCurrentMapType() != G_PHYSICAL_MAP) this.button5.className = 'non_active'; else this.button5.className = 'active'; @@ -529,12 +529,12 @@ function build_indiv_map($indifacts, $famids) { // Add children to the list if (count($famids)>0) { $hparents=false; - for($f=0; $f<count($famids); $f++) { + for ($f=0; $f<count($famids); $f++) { if (!empty($famids[$f])) { $famrec = find_gedcom_record($famids[$f], WT_GED_ID, true); if ($famrec) { $num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch, PREG_SET_ORDER); - for($j=0; $j<$num; $j++) { + for ($j=0; $j<$num; $j++) { $person=Person::getInstance($smatch[$j][1]); if ($person->canDisplayDetails()) { $srec = find_person_record($smatch[$j][1], WT_GED_ID); @@ -619,7 +619,7 @@ function build_indiv_map($indifacts, $famids) { //echo "<script language=\"JavaScript\" type=\"text/javascript\">tabstyles[5]='tab_cell_inactive_empty'; document.getElementById('pagetab5').className='tab_cell_inactive_empty';</script>"; echo "</td></tr>"; echo "<script type=\"text/javascript\">"; - echo "function ResizeMap(){}</script>"; + echo "function ResizeMap() {}</script>"; if (WT_USER_IS_ADMIN) { echo "<tr><td align=\"center\" colspan=\"2\">"; echo "<a href=\"module.php?mod=googlemap&mod_action=editconfig\">", i18n::translate('Manage GoogleMap configuration'), "</a>"; @@ -649,7 +649,7 @@ function build_indiv_map($indifacts, $famids) { if ($markers[$j]["placed"] == "no") { $multimarker = -1; // Count nr of locations where the long/lati is identical - for($k=$j; $k<=$i; $k++) + for ($k=$j; $k<=$i; $k++) if (($markers[$j]["lati"] == $markers[$k]["lati"]) && ($markers[$j]["lng"] == $markers[$k]["lng"])) $multimarker = $multimarker + 1; @@ -703,13 +703,13 @@ function build_indiv_map($indifacts, $famids) { echo '<br /><a href=\"module.php?mod=googlemap&mod_action=places&display=inactive\">', i18n::translate('Edit geographic location'), '</a>'; echo "\");"; } - else if (!$GOOGLEMAP_COORD){ + else if (!$GOOGLEMAP_COORD) { echo "\");"; } else { echo "<br /><br />"; - if ($markers[$j]["lati"]>'0'){echo "N", str_replace('-', '', $markers[$j]["lati"]);}else{ echo str_replace('-', 'S', $markers[$j]["lati"]);} + if ($markers[$j]["lati"]>'0') {echo "N", str_replace('-', '', $markers[$j]["lati"]);} else { echo str_replace('-', 'S', $markers[$j]["lati"]);} echo ", "; - if ($markers[$j]["lng"]>'0'){echo "E", str_replace('-', '', $markers[$j]["lng"]);}else{ echo str_replace('-', 'W', $markers[$j]["lng"]);} + if ($markers[$j]["lng"]>'0') {echo "E", str_replace('-', '', $markers[$j]["lng"]);} else { echo str_replace('-', 'W', $markers[$j]["lng"]);} echo "\");"; } echo "});"; @@ -757,16 +757,16 @@ function build_indiv_map($indifacts, $famids) { $date=new GedcomDate($markers[$j]["date"]); echo "<br />", addslashes($date->Display(true)); } - if (!$GOOGLEMAP_COORD){ + if (!$GOOGLEMAP_COORD) { echo "\")"; } else { echo "<br /><br />"; - if ($markers[$j]["lati"]>='0'){echo "N", str_replace('-', '', $markers[$j]["lati"]);}else{ echo str_replace('-', 'S', $markers[$j]["lati"]);} + if ($markers[$j]["lati"]>='0') {echo "N", str_replace('-', '', $markers[$j]["lati"]);} else { echo str_replace('-', 'S', $markers[$j]["lati"]);} echo ", "; - if ($markers[$j]["lng"]>='0'){echo "E", str_replace('-', '', $markers[$j]["lng"]);}else{ echo str_replace('-', 'W', $markers[$j]["lng"]);} + if ($markers[$j]["lng"]>='0') {echo "E", str_replace('-', '', $markers[$j]["lng"]);} else { echo str_replace('-', 'W', $markers[$j]["lng"]);} echo "\")"; } - for($k=$j+1; $k<=$i; $k++) { + for ($k=$j+1; $k<=$i; $k++) { if (($markers[$j]["lati"] == $markers[$k]["lati"]) && ($markers[$j]["lng"] == $markers[$k]["lng"])) { $markers[$k]["placed"] = "yes"; $markers[$k]["index"] = $indexcounter; @@ -823,13 +823,13 @@ function build_indiv_map($indifacts, $famids) { $date=new GedcomDate($markers[$k]["date"]); echo "<br />", addslashes($date->Display(true)); } - if (!$GOOGLEMAP_COORD){ + if (!$GOOGLEMAP_COORD) { echo "\")"; } else { echo "<br /><br />"; - if ($markers[$j]["lati"]>='0'){echo "N", str_replace('-', '', $markers[$j]["lati"]);}else{ echo str_replace('-', 'S', $markers[$j]["lati"]);} + if ($markers[$j]["lati"]>='0') {echo "N", str_replace('-', '', $markers[$j]["lati"]);} else { echo str_replace('-', 'S', $markers[$j]["lati"]);} echo ", "; - if ($markers[$j]["lng"]>='0'){echo "E", str_replace('-', '', $markers[$j]["lng"]);}else{ echo str_replace('-', 'W', $markers[$j]["lng"]);} + if ($markers[$j]["lng"]>='0') {echo "E", str_replace('-', '', $markers[$j]["lng"]);} else { echo str_replace('-', 'W', $markers[$j]["lng"]);} echo "\")"; } } @@ -850,7 +850,7 @@ function build_indiv_map($indifacts, $famids) { } </script> <?php echo "<div style=\"overflow: auto; overflow-x: hidden; overflow-y: auto; height: {$GOOGLEMAP_YSIZE}px;\"><table class=\"facts_table\">"; - foreach($markers as $marker) { + foreach ($markers as $marker) { echo "<tr><td class=\"facts_label\">"; echo "<a href=\"javascript:highlight({$marker["index"]}, {$marker["tabindex"]})\">{$marker["fact"]}</a></td>"; echo "<td class=\"{$marker['class']}\" style=\"white-space: normal\">"; diff --git a/modules/googlemap/module.php b/modules/googlemap/module.php index 0ba5b2c226..77c951bcf0 100644 --- a/modules/googlemap/module.php +++ b/modules/googlemap/module.php @@ -121,7 +121,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } else { $tNew = str_replace(array("&HIDE_GOOGLEMAP=true", "&HIDE_GOOGLEMAP=false", "action=ajax&module=".$this->getName()."&"), "", $_SERVER["REQUEST_URI"]); $tNew = str_replace("&", "&", $tNew); - if($SESSION_HIDE_GOOGLEMAP=="true") { + if ($SESSION_HIDE_GOOGLEMAP=="true") { echo " <span class=\"font9\"><a href=\"".$tNew."&HIDE_GOOGLEMAP=false#".$this->getName()."\">"; echo "<img src=\"".$WT_IMAGES["plus"]."\" border=\"0\" width=\"11\" height=\"11\" alt=\"".i18n::translate('Activate')."\" title=\"".i18n::translate('Activate')."\" />"; echo " ".i18n::translate('Activate')."</a></span>"; @@ -138,9 +138,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo "</td></tr>"; echo "</table><br />"; echo "<script type=\"text/javascript\">"; - echo "function ResizeMap (){}</script>"; + echo "function ResizeMap () {}</script>"; } else { - if($SESSION_HIDE_GOOGLEMAP=="false") { + if ($SESSION_HIDE_GOOGLEMAP=="false") { echo "<table width=\"100%\" border=\"0\" class=\"facts_table\">"; echo "<tr><td valign=\"top\">"; echo "<div id=\"googlemap_left\">"; diff --git a/modules/googlemap/pedigree_map.php b/modules/googlemap/pedigree_map.php index a22ff13575..4fb5ae33b3 100644 --- a/modules/googlemap/pedigree_map.php +++ b/modules/googlemap/pedigree_map.php @@ -272,7 +272,7 @@ echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">"; echo " <tr>"; echo " <td valign=\"top\">"; // print summary statistics -if (isset($curgen)){ +if (isset($curgen)) { $total=pow(2,$curgen)-1; $miss=$total-$count-$priv; echo i18n::plural( @@ -530,11 +530,11 @@ pm_map.addControl(mini); function wheelevent(e) { - if (true){//document.getElementById("prevent").checked - if (!e){ + if (true) {//document.getElementById("prevent").checked + if (!e) { e = window.event } - if (e.preventDefault){ + if (e.preventDefault) { e.preventDefault() } e.returnValue = false; @@ -606,7 +606,7 @@ for ($i=0; $i<($controller->treesize); $i++) { addslashes($bdate->Display(false))."<br />".$bplace; $latlongval[$i] = get_lati_long_placelocation($person->getBirthPlace()); - if ($latlongval[$i] != NULL){ + if ($latlongval[$i] != NULL) { $lat[$i] = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlongval[$i]["lati"]); $lon[$i] = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlongval[$i]["long"]); if (!($lat[$i] == NULL && $lon[$i] == NULL) && !($lat[$i] == 0 && $lon[$i] == 0)) { diff --git a/modules/googlemap/placecheck.php b/modules/googlemap/placecheck.php index 156d137740..771a1b63e7 100644 --- a/modules/googlemap/placecheck.php +++ b/modules/googlemap/placecheck.php @@ -116,7 +116,7 @@ echo "<strong>", i18n::translate('List filtering options'), "</strong>", help_li echo "</td></tr><tr><td class='descriptionbox'>"; echo i18n::translate('Include fully matched places: '), help_link('PLACECHECK_MATCH','googlemap'); echo "</td><td class='optionbox'><input type=\"checkbox\" name=\"matching\" value=\"active\""; -if($matching==1) { +if ($matching==1) { echo " checked=\"checked\""; } echo "></td></tr>"; @@ -241,7 +241,7 @@ case 'go': $parts=count($levels); $levels=array_reverse($levels); $placestr.="<a href=\"placelist.php?action=show&"; - foreach($levels as $pindex=>$ppart) { + foreach ($levels as $pindex=>$ppart) { $ppart=urlencode(trim($ppart)); $placestr.="parent[$pindex]=".$ppart."&"; } @@ -294,14 +294,14 @@ case 'go': } } $plac[$z]="<td class='facts_value'>".$placestr2."</td>\n"; - if ($row['pl_lati']=='0'){ + if ($row['pl_lati']=='0') { $lati[$z]="<td class='facts_value error'><strong>".$row['pl_lati']."</strong></td>"; } else if ($row['pl_lati']!='') { $lati[$z]="<td class='facts_value'>".$row['pl_lati']."</td>"; } else { $lati[$z]="<td class='facts_value error' align='center'><strong>X</strong></td>";$matched[$x]++; } - if ($row['pl_long']=='0'){ + if ($row['pl_long']=='0') { $long[$z]="<td class='facts_value error'><strong>".$row['pl_long']."</strong></td>"; } else if ($row['pl_long']!='') { $long[$z]="<td class='facts_value'>".$row['pl_long']."</td>"; diff --git a/modules/googlemap/placehierarchy.php b/modules/googlemap/placehierarchy.php index 922439ec0d..3e187e251d 100644 --- a/modules/googlemap/placehierarchy.php +++ b/modules/googlemap/placehierarchy.php @@ -88,7 +88,7 @@ function get_placeid($place) { $par = array_reverse($par); $place_id = 0; if (check_exist_table()) { - for($i=0; $i<count($par); $i++) { + for ($i=0; $i<count($par); $i++) { $par[$i] = trim($par[$i]); if (empty($par[$i])) $par[$i]="unknown"; $placelist = create_possible_place_names($par[$i], $i+1); @@ -110,7 +110,7 @@ function get_p_id($place) { $par = explode (",", $place); $par = array_reverse($par); $place_id = 0; - for($i=0; $i<count($par); $i++) { + for ($i=0; $i<count($par); $i++) { $par[$i] = trim($par[$i]); $placelist = create_possible_place_names($par[$i], $i+1); foreach ($placelist as $key => $placename) { @@ -234,7 +234,7 @@ function print_how_many_people($level, $parent) { echo "<br /><br />", i18n::translate('Individuals'), ": ", $place_count_indi, ", ", i18n::translate('Families'), ": ", $place_count_fam; } -function print_gm_markers($place2, $level, $parent, $levelm, $linklevels, $placelevels, $lastlevel=false){ +function print_gm_markers($place2, $level, $parent, $levelm, $linklevels, $placelevels, $lastlevel=false) { global $GOOGLEMAP_COORD, $GOOGLEMAP_PH_MARKER, $GM_DISP_SHORT_PLACE, $GM_DISP_COUNT; if (($place2['lati'] == NULL) || ($place2['long'] == NULL) || (($place2['lati'] == "0") && ($place2['long'] == "0"))) { echo "var icon_type = new GIcon();\n"; @@ -356,7 +356,7 @@ function print_gm_markers($place2, $level, $parent, $levelm, $linklevels, $place } } else { $placename = $place2['place'].$placelevels; - if ($place2['place'] == "Unknown"){ + if ($place2['place'] == "Unknown") { if (!$GM_DISP_SHORT_PLACE) { echo PrintReady(addslashes(i18n::translate('unknown').$placelevels)); } else { @@ -381,7 +381,7 @@ function print_gm_markers($place2, $level, $parent, $levelm, $linklevels, $place } $temp=PrintReady(addslashes($place2['place'])); $temp=str_replace(array('‎', '‏'), array(WT_UTF8_LRM, WT_UTF8_RLM), $temp); - if (!$GOOGLEMAP_COORD){ + if (!$GOOGLEMAP_COORD) { echo "<br /><br /></div></td>\", icon_type, \"", $temp, "\");\n"; } else { echo "<br /><br />", $place2['lati'], ", ", $place2['long'], "</div></td>\", icon_type, \"", $temp, "\");\n"; @@ -422,22 +422,22 @@ function map_scripts($numfound, $level, $parent, $linklevels, $placelevels, $pla Map_type.prototype.refresh = function() { this.button1.className = 'non_active'; - if(this.place_map.getCurrentMapType() != G_NORMAL_MAP) { + if (this.place_map.getCurrentMapType() != G_NORMAL_MAP) { this.button2.className = 'non_active'; } else { this.button2.className = 'active'; } - if(this.place_map.getCurrentMapType() != G_SATELLITE_MAP) { + if (this.place_map.getCurrentMapType() != G_SATELLITE_MAP) { this.button3.className = 'non_active'; } else { this.button3.className = 'active'; } - if(this.place_map.getCurrentMapType() != G_HYBRID_MAP) { + if (this.place_map.getCurrentMapType() != G_HYBRID_MAP) { this.button4.className = 'non_active'; } else { this.button4.className = 'active'; } - if(this.place_map.getCurrentMapType() != G_PHYSICAL_MAP) { + if (this.place_map.getCurrentMapType() != G_PHYSICAL_MAP) { this.button5.className = 'non_active'; } else { this.button5.className = 'active'; @@ -521,19 +521,19 @@ function map_scripts($numfound, $level, $parent, $linklevels, $placelevels, $pla if (isset($levelo[0])) $levelo[0]=0; $numls = count($parent)-1; $levelo=check_were_am_i($numls, $levelm); - if ($numfound<2 && ($level==1 || !(isset($levelo[($level-1)])))){ + if ($numfound<2 && ($level==1 || !(isset($levelo[($level-1)])))) { echo "zoomlevel = place_map.getBoundsZoomLevel(bounds);\n"; echo " place_map.setCenter(new GLatLng(0, 0), zoomlevel+5);\n"; } - else if ($numfound<2 && !isset($levelo[($level-2)])){ + else if ($numfound<2 && !isset($levelo[($level-2)])) { echo "zoomlevel = place_map.getBoundsZoomLevel(bounds);\n"; echo " place_map.setCenter(new GLatLng(0, 0), zoomlevel+6);\n"; } - else if ($level==2){ + else if ($level==2) { echo "zoomlevel = place_map.getBoundsZoomLevel(bounds);\n"; echo " place_map.setCenter(new GLatLng(0, 0), zoomlevel+8);\n"; } - else if ($numfound<2 && $level>1){ + else if ($numfound<2 && $level>1) { echo "zoomlevel = place_map.getBoundsZoomLevel(bounds);\n"; echo " place_map.setCenter(new GLatLng(0, 0), zoomlevel+10);\n"; } @@ -595,7 +595,7 @@ function map_scripts($numfound, $level, $parent, $linklevels, $placelevels, $pla print_gm_markers($place2, $level, $parent, $levelm, $linklevels, $placelevels); } } - else if ($level>0){ //if unknown place display the upper level place + else if ($level>0) { //if unknown place display the upper level place $placelevels = ", ".i18n::translate('unknown').$placelevels; $linklevels .= "&parent[".$level."]="; $break = false; diff --git a/modules/googlemap/places.php b/modules/googlemap/places.php index 35034689c5..b7b1d6ab3c 100644 --- a/modules/googlemap/places.php +++ b/modules/googlemap/places.php @@ -266,7 +266,7 @@ if ($action=="ImportGedcom") { $parent=preg_split('/ *, */', $place["place"]); $parent=array_reverse($parent); $parent_id=0; - for($i=0; $i<count($parent); $i++) { + for ($i=0; $i<count($parent); $i++) { if (!isset($default_zoom_level[$i])) $default_zoom_level[$i]=$default_zoom_level[$i-1]; $escparent=$parent[$i]; @@ -326,7 +326,7 @@ if ($action=="ImportFile") { <td class="optionbox"> <select name="localfile"> <option></option> - <?php foreach($placefiles as $p=>$placefile) { ?> + <?php foreach ($placefiles as $p=>$placefile) { ?> <option value="<?php echo htmlspecialchars($placefile); ?>"><?php if (substr($placefile, 0, 1)=="/") echo substr($placefile, 1); else echo $placefile; ?></option> @@ -375,12 +375,12 @@ if ($action=="ImportFile2") { $placelist = array(); $j = 0; $maxLevel = 0; - foreach ($lines as $p => $placerec){ + foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); - if($fieldrec[0] > $maxLevel) $maxLevel = $fieldrec[0]; + if ($fieldrec[0] > $maxLevel) $maxLevel = $fieldrec[0]; } $fields = count($fieldrec); - foreach ($lines as $p => $placerec){ + foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); if (is_numeric($fieldrec[0]) && $fieldrec[0]<=$maxLevel) { $placelist[$j] = array(); @@ -441,7 +441,7 @@ if ($action=="ImportFile2") { $parent = explode(',', $place["place"]); $parent = array_reverse($parent); $parent_id=0; - for($i=0; $i<count($parent); $i++) { + for ($i=0; $i<count($parent); $i++) { $escparent=$parent[$i]; if ($escparent == "") { $escparent = "Unknown"; @@ -652,7 +652,7 @@ foreach ($placelist as $place) { echo i18n::translate('Export all locations to file'), "</a>"; echo help_link('PL_EXPORT_ALL_FILE','googlemap'); echo "</td></tr></table><br />"; -if(empty($SEARCH_SPIDER)) +if (empty($SEARCH_SPIDER)) print_footer(); else { echo i18n::translate('Search Engine Spider Detected'), ": ", $SEARCH_SPIDER; diff --git a/modules/googlemap/places_edit.php b/modules/googlemap/places_edit.php index be92f4c1fd..bc35dfa2b6 100644 --- a/modules/googlemap/places_edit.php +++ b/modules/googlemap/places_edit.php @@ -290,10 +290,10 @@ if ($action=="add") { longitude = longitude * -1; document.editplaces.NEW_PLACE_LONG.value = longitude; } - if(document.editplaces.LATI_CONTROL.value == "PL_S") { + if (document.editplaces.LATI_CONTROL.value == "PL_S") { latitude = latitude * -1; } - if(document.editplaces.LONG_CONTROL.value == "PL_W") { + if (document.editplaces.LONG_CONTROL.value == "PL_W") { longitude = longitude * -1; } @@ -336,19 +336,19 @@ if ($action=="add") { Map_type.prototype.refresh = function() { - if(this.map.getCurrentMapType() != G_NORMAL_MAP) + if (this.map.getCurrentMapType() != G_NORMAL_MAP) this.button1.className = 'non_active'; else this.button1.className = 'active'; - if(this.map.getCurrentMapType() != G_SATELLITE_MAP) + if (this.map.getCurrentMapType() != G_SATELLITE_MAP) this.button2.className = 'non_active'; else this.button2.className = 'active'; - if(this.map.getCurrentMapType() != G_HYBRID_MAP) + if (this.map.getCurrentMapType() != G_HYBRID_MAP) this.button3.className = 'non_active'; else this.button3.className = 'active'; - if(this.map.getCurrentMapType() != G_PHYSICAL_MAP) + if (this.map.getCurrentMapType() != G_PHYSICAL_MAP) this.button4.className = 'non_active'; else this.button4.className = 'active'; @@ -478,9 +478,9 @@ if ($action=="add") { GEvent.addListener(map, "moveend", function() { document.editplaces.NEW_ZOOM_FACTOR.value = map.getZoom(); }); -<?php if(($place_long == null) || ($place_lati == null)) { ?> +<?php if (($place_long == null) || ($place_lati == null)) { ?> map.setCenter(new GLatLng( <?php echo $parent_lati, ", ", $parent_long, "), ", $zoomfactor; ?>, G_NORMAL_MAP ); -<?php }else { ?> +<?php } else { ?> map.setCenter(new GLatLng( <?php echo $place_lati, ", ", $place_long, "), ", $zoomfactor; ?>, G_NORMAL_MAP ); <?php } ?> @@ -623,7 +623,7 @@ if ($action=="add") { if (!response || response.Status.code != 200) { alert("<?php echo i18n::translate('No places found'); ?>"); } else { - if(response.Placemark.length>0) { + if (response.Placemark.length>0) { for (i=0;i<response.Placemark.length;i++) { place = response.Placemark[i]; point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); @@ -719,17 +719,17 @@ if ($action=="add") { } ?> <td class="optionbox"> - <input type="radio" id="new_prec_0" name="NEW_PRECISION" onchange="updateMap();" <?php if($precision==$GOOGLEMAP_PRECISION_0) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_0; ?>" /> + <input type="radio" id="new_prec_0" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$GOOGLEMAP_PRECISION_0) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_0; ?>" /> <label for="new_prec_0"><?php echo i18n::translate('Country'); ?></label> - <input type="radio" id="new_prec_1" name="NEW_PRECISION" onchange="updateMap();" <?php if($precision==$GOOGLEMAP_PRECISION_1) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_1; ?>" /> + <input type="radio" id="new_prec_1" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$GOOGLEMAP_PRECISION_1) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_1; ?>" /> <label for="new_prec_1"><?php echo i18n::translate('State'); ?></label> - <input type="radio" id="new_prec_2" name="NEW_PRECISION" onchange="updateMap();" <?php if($precision==$GOOGLEMAP_PRECISION_2) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_2; ?>" /> + <input type="radio" id="new_prec_2" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$GOOGLEMAP_PRECISION_2) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_2; ?>" /> <label for="new_prec_2"><?php echo i18n::translate('City'); ?></label> - <input type="radio" id="new_prec_3" name="NEW_PRECISION" onchange="updateMap();" <?php if($precision==$GOOGLEMAP_PRECISION_3) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_3; ?>" /> + <input type="radio" id="new_prec_3" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$GOOGLEMAP_PRECISION_3) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_3; ?>" /> <label for="new_prec_3"><?php echo i18n::translate('Neighborhood'); ?></label> - <input type="radio" id="new_prec_4" name="NEW_PRECISION" onchange="updateMap();"<?php if($precision==$GOOGLEMAP_PRECISION_4) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_4; ?>" /> + <input type="radio" id="new_prec_4" name="NEW_PRECISION" onchange="updateMap();"<?php if ($precision==$GOOGLEMAP_PRECISION_4) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_4; ?>" /> <label for="new_prec_4"><?php echo i18n::translate('House'); ?></label> - <input type="radio" id="new_prec_5" name="NEW_PRECISION" onchange="updateMap();"<?php if($precision>$GOOGLEMAP_PRECISION_4) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_5; ?>" /> + <input type="radio" id="new_prec_5" name="NEW_PRECISION" onchange="updateMap();"<?php if ($precision>$GOOGLEMAP_PRECISION_4) echo "checked=\"checked\""; ?> value="<?php echo $GOOGLEMAP_PRECISION_5; ?>" /> <label for="new_prec_5"><?php echo i18n::translate('Max'); ?></label> </td> </tr> diff --git a/modules/googlemap/wt_googlemap.js b/modules/googlemap/wt_googlemap.js index e1baf28dba..ea6bac0ac6 100644 --- a/modules/googlemap/wt_googlemap.js +++ b/modules/googlemap/wt_googlemap.js @@ -53,7 +53,7 @@ clat = (Boundaries.getNorthEast().lat() + Boundaries.getSouthWest().lat())/2; clng = (Boundaries.getNorthEast().lng() + Boundaries.getSouthWest().lng())/2; zoomlevel = map.getBoundsZoomLevel(Boundaries); - for(i = 0; ((i < 10) && (zoomlevel == 1)); i++) { + for (i = 0; ((i < 10) && (zoomlevel == 1)); i++) { zoomlevel = map.getBoundsZoomLevel(Boundaries); } zoomlevel = zoomlevel-1; @@ -98,4 +98,4 @@ ResizeMap(); // Our info window content } - }
\ No newline at end of file + } diff --git a/modules/html/module.php b/modules/html/module.php index 7f55c4d15d..01413b788b 100644 --- a/modules/html/module.php +++ b/modules/html/module.php @@ -98,7 +98,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { */ list($new_tags, $new_values) = $stats->getTags("{$title_tmp} {$html}"); // Title - if (strstr($title_tmp, '#')){$title_tmp = str_replace($new_tags, $new_values, $title_tmp);} + if (strstr($title_tmp, '#')) {$title_tmp = str_replace($new_tags, $new_values, $title_tmp);} // Content $html = str_replace($new_tags, $new_values, $html); @@ -322,7 +322,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { echo "<select name=\"template\" onchange=\"document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;\">"; } echo "<option value=\"".htmlspecialchars($html)."\">".i18n::translate('Custom')."</option>"; - foreach($templates as $title=>$template) + foreach ($templates as $title=>$template) { echo "<option value=\"".htmlspecialchars($template)."\">{$title}</option>"; } @@ -333,10 +333,10 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { // gedcom $gedcoms = get_all_gedcoms(); $gedcom=get_block_setting($block_id, 'gedcom'); - if(count($gedcoms) > 1) + if (count($gedcoms) > 1) { - if($gedcom == '__current__'){$sel_current = ' selected="selected"';}else{$sel_current = '';} - if($gedcom == '__default__'){$sel_default = ' selected="selected"';}else{$sel_default = '';} + if ($gedcom == '__current__') {$sel_current = ' selected="selected"';} else {$sel_current = '';} + if ($gedcom == '__default__') {$sel_default = ' selected="selected"';} else {$sel_default = '';} echo "<tr><td class=\"descriptionbox wrap width33\">" .i18n::translate('Family Tree') .help_link('index_htmlplus_gedcom') @@ -345,9 +345,9 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { ."<option value=\"__current__\"{$sel_current}>".i18n::translate('Current')."</option>" ."<option value=\"__default__\"{$sel_default}>".i18n::translate('Default')."</option>" ; - foreach($gedcoms as $ged_id=>$ged_name) + foreach ($gedcoms as $ged_id=>$ged_name) { - if($ged_name == $gedcom){$sel = ' selected="selected"';}else{$sel = '';} + if ($ged_name == $gedcom) {$sel = ' selected="selected"';} else {$sel = '';} echo "<option value=\"{$ged_name}\"{$sel}>".PrintReady(get_gedcom_setting($ged_id, 'title'))."</option>"; } echo "</select>" diff --git a/modules/individuals/module.php b/modules/individuals/module.php index c5f66e4200..7cf9703c8f 100644 --- a/modules/individuals/module.php +++ b/modules/individuals/module.php @@ -87,9 +87,9 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { } } - jQuery(document).ready(function(){ - jQuery("#sb_indi_name").focus(function(){this.select();}); - jQuery("#sb_indi_name").blur(function(){if (this.value=="") this.value="'.i18n::translate('Search').'";}); + jQuery(document).ready(function() { + jQuery("#sb_indi_name").focus(function() {this.select();}); + jQuery("#sb_indi_name").blur(function() {if (this.value=="") this.value="'.i18n::translate('Search').'";}); var timerid = null; jQuery("#sb_indi_name").keyup(function(e) { if (timerid) window.clearTimeout(timerid); @@ -107,7 +107,7 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { jQuery.ajax({ url: "sidebar.php?sb_action=individuals&alpha="+alpha+"&surname="+surname, cache: false, - success: function(html){ + success: function(html) { jQuery("#sb_indi_"+surname+" div").html(html); jQuery("#sb_indi_"+surname+" div").show(); jQuery("#sb_indi_"+surname).css("list-style-image", "url('.$WT_IMAGES['minus'].')"); @@ -169,7 +169,7 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { global $SHOW_MARRIED_NAMES; $surns=get_indilist_surns('', $alpha, $SHOW_MARRIED_NAMES, false, WT_GED_ID); $out = '<ul>'; - foreach($surns as $surname=>$surns) { + foreach ($surns as $surname=>$surns) { $out .= '<li id="sb_indi_'.$surname.'" class="sb_indi_surname_li"><a href="'.$surname.'" title="'.$surname.'" alt="'.$alpha.'" class="sb_indi_surname">'.$surname.'</a>'; if (!empty($surname1) && $surname1==$surname) { $out .= '<div class="name_tree_div_visible">'; @@ -189,7 +189,7 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { $indis=get_indilist_indis($surname, $alpha, '', $SHOW_MARRIED_NAMES, false, WT_GED_ID); $out = '<ul>'; $private_count = 0; - foreach($indis as $person) { + foreach ($indis as $person) { if ($person->canDisplayName()) { $out .= '<li><a href="'.$person->getHtmlUrl().'">'.$person->getSexImage().' '.$person->getListName().' '; if ($person->canDisplayDetails()) { diff --git a/modules/lightbox/album.php b/modules/lightbox/album.php index 52ea855ac9..18ee57316e 100644 --- a/modules/lightbox/album.php +++ b/modules/lightbox/album.php @@ -65,12 +65,12 @@ function cut_html($string) if (isset($edit)) { $edit=$edit; -}else{ +} else { $edit=1; - } +} // Used when sorting media on album tab page =============================================== -if ($reorder==1 ){ +if ($reorder==1) { $sort_i=0; // Used in sorting on lightbox_print_media_row.php page diff --git a/modules/lightbox/functions/lb_call_js.php b/modules/lightbox/functions/lb_call_js.php index 6d913511ab..23c92b250d 100644 --- a/modules/lightbox/functions/lb_call_js.php +++ b/modules/lightbox/functions/lb_call_js.php @@ -63,14 +63,14 @@ global $tabno, $LB_MUSIC_FILE, $LB_SS_SPEED, $LB_TRANSITION, $TEXT_DIRECTION; <?php if ($TEXT_DIRECTION=="rtl") { ?> var CB_Alignm = "<?php echo "right"; ?>"; // Notes RTL Tooltip Balloon Text align var CB_ImgNotes2 = "<?php echo i18n::translate('Notes'); ?>"; // Notes RTL Tooltip for Full Image - <?php }else{ ?> + <?php } else { ?> var CB_Alignm = "<?php echo "left"; ?>"; // Notes LTR Tooltip Balloon Text align var CB_ImgNotes2 = "<?php echo i18n::translate('Notes'); ?>"; // Notes LTR Tooltip for Full Image <?php } ?> <?php if ($LB_MUSIC_FILE == "") { ?> var myMusic = null; - <?php }else{ ?> + <?php } else { ?> var myMusic = '<?php echo $LB_MUSIC_FILE; ?>'; // The music file <?php } ?> var CB_SlShowTime = '<?php echo $LB_SS_SPEED; ?>'; // Slide show timer @@ -87,7 +87,7 @@ global $tabno, $LB_MUSIC_FILE, $LB_SS_SPEED, $LB_TRANSITION, $TEXT_DIRECTION; <link href ="modules/lightbox/css/album_page_RTL.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> -<?php }else{ ?> +<?php } else { ?> <script src="modules/lightbox/js/Sound.js" type="text/javascript"></script> <script src="modules/lightbox/js/clearbox.js" type="text/javascript"></script> @@ -97,7 +97,7 @@ global $tabno, $LB_MUSIC_FILE, $LB_SS_SPEED, $LB_TRANSITION, $TEXT_DIRECTION; <script src="modules/lightbox/js/tip_centerwindow.js" type="text/javascript"></script> <?php if ($TEXT_DIRECTION=="rtl") { ?> <script src="modules/lightbox/js/tip_balloon_RTL.js" type="text/javascript"></script> - <?php }else{ ?> + <?php } else { ?> <script src="modules/lightbox/js/tip_balloon.js" type="text/javascript"></script> <?php } ?> diff --git a/modules/lightbox/functions/lb_head.php b/modules/lightbox/functions/lb_head.php index 8dba6856c2..e42e05a2c7 100644 --- a/modules/lightbox/functions/lb_head.php +++ b/modules/lightbox/functions/lb_head.php @@ -76,11 +76,11 @@ $reorder=safe_get('reorder', '1', '0'); require_once WT_ROOT.'includes/media_reorder_count.php'; // If in re-order mode do not show header links, but instead, show drag and drop title. - if (isset($reorder) && $reorder==1){ + if (isset($reorder) && $reorder==1) { echo "<center><b>", i18n::translate('Drag-and-drop thumbnails to re-order media items'), "</b></center>" ; echo "<br />"; - }else{ + } else { //Show Lightbox-Album header Links //echo "<br />"; echo '<table border="0" width="75%"><tr>'; @@ -100,14 +100,14 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; echo "</a>"; echo "</td>"; // echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "text") { + } else if ($LB_AL_HEAD_LINKS == "text") { echo "<td class=\"width15 center wrap\" valign=\"top\">"; echo "<a href=\"javascript:goto_config_lightbox()\">"; echo "" . i18n::translate('Lightbox-Album Configuration') . " "; echo "</a>"; echo "</td>"; // echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "icon") { + } else if ($LB_AL_HEAD_LINKS == "icon") { echo " "; echo "<a href=\"javascript:goto_config_lightbox()\">"; echo "<img src=\"modules/lightbox/images/image_edit.gif\" class=\"icon\" title=\"".i18n::translate('Lightbox-Album Configuration')."\" alt=\"".i18n::translate('Lightbox-Album Configuration')."\" />" ; @@ -125,14 +125,14 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; echo " </a> "; echo "</td>"; //echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "text") { + } else if ($LB_AL_HEAD_LINKS == "text") { echo "<td class=\"width15 center wrap\" valign=\"top\">"; echo "<a href=\"javascript: album_add()\"> "; echo "" . i18n::translate('Add a new Media Object') . " "; echo " </a> "; echo "</td>"; //echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "icon") { + } else if ($LB_AL_HEAD_LINKS == "icon") { echo " "; echo "<a href=\"javascript: album_add()\"> "; echo "<img src=\"modules/lightbox/images/image_add.gif\" class=\"icon\" title=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" alt=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" />" ; @@ -150,19 +150,19 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; echo " </a> "; echo "</td>"; // echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "text") { + } else if ($LB_AL_HEAD_LINKS == "text") { echo "<td class=\"width15 center wrap\" valign=\"top\">"; echo "<a href=\"javascript: album_link()\"> "; echo "" . i18n::translate('Link to an existing Media Object') . " "; echo " </a> "; echo "</td>"; // echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "icon") { + } else if ($LB_AL_HEAD_LINKS == "icon") { echo " "; echo "<a href=\"javascript: album_link()\">"; echo "<img src=\"modules/lightbox/images/image_link.gif\" class=\"icon\" title=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" alt=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" />" ; echo "</a> "; - }else{ + } else { } } /* @@ -177,14 +177,14 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; echo "</td>"; // echo "<input type=\"hidden\" name=\"reorder\" value=\"1\" />"; //echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "text") { + } else if ($LB_AL_HEAD_LINKS == "text") { echo "<td class=\"width15 center wrap\" valign=\"top\">"; echo "<a href=\"".WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1\">" ; echo "" . i18n::translate('Re-order media') . " "; echo '</a>'; echo "</td>"; //echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "icon") { + } else if ($LB_AL_HEAD_LINKS == "icon") { echo " "; echo "<a href=\"".WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1\">" ; echo "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media')."\" alt=\"".i18n::translate('Re-order media')."\" />" ; @@ -205,7 +205,7 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; echo '</a>'; echo "</td>"; //echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "text") { + } else if ($LB_AL_HEAD_LINKS == "text") { echo "<td class=\"width15 center wrap\" valign=\"top\">"; echo "<a href=\"javascript: reorder_media()\">" ; // echo "" . i18n::translate('Re-order media (window)') . " "; @@ -213,7 +213,7 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; echo '</a>'; echo "</td>"; //echo "<td width=\"5%\"> </td>"; - }else if ($LB_AL_HEAD_LINKS == "icon") { + } else if ($LB_AL_HEAD_LINKS == "icon") { echo " "; echo "<a href=\"javascript: reorder_media()\">" ; echo "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media (window)')."\" alt=\"".i18n::translate('Re-order media (window)')."\" /><br />" ; diff --git a/modules/lightbox/functions/lb_indi_doors_0.php b/modules/lightbox/functions/lb_indi_doors_0.php index 71b3c62547..216d0c1f8e 100644 --- a/modules/lightbox/functions/lb_indi_doors_0.php +++ b/modules/lightbox/functions/lb_indi_doors_0.php @@ -40,12 +40,12 @@ if (!defined('WT_WEBTREES')) { <dd id="door2"><a href="javascript:;" onclick="tabswitch(2); return false;" ><?php echo i18n::translate('Notes'); ?></a></dd> <dd id="door3"><a href="javascript:;" onclick="tabswitch(3); return false;" ><?php echo i18n::translate('Sources'); ?></a></dd> <?php - if ($MULTI_MEDIA){ + if ($MULTI_MEDIA) { if (!file_exists("modules/googlemap/defaultconfig.php")) { ?> <?php if (file_exists("modules/lightbox/album.php") ) { ?> <dd id="door8"><a href="javascript:;" onclick="tabswitch(8); return false;" ><?php echo i18n::translate('Album'); ?></a></dd> <?php } - }elseif (file_exists("modules/googlemap/defaultconfig.php")) { ?> + } elseif (file_exists("modules/googlemap/defaultconfig.php")) { ?> <?php if (file_exists("modules/lightbox/album.php") ) { ?> <dd id="door9"><a href="javascript:;" onclick="tabswitch(9); return false;" ><?php echo i18n::translate('Album'); ?></a></dd> <?php } diff --git a/modules/lightbox/functions/lb_indi_doors_1.php b/modules/lightbox/functions/lb_indi_doors_1.php index 0f17b0b28b..5793805b76 100644 --- a/modules/lightbox/functions/lb_indi_doors_1.php +++ b/modules/lightbox/functions/lb_indi_doors_1.php @@ -41,13 +41,13 @@ if (!defined('WT_WEBTREES')) { <dd id="door3"><a href="javascript:;" onclick="tabswitch(3); return false;" ><?php echo i18n::translate('Sources'); ?></a></dd> <?php - if ($MULTI_MEDIA){ + if ($MULTI_MEDIA) { if (!file_exists("modules/googlemap/defaultconfig.php")) { ?> <?php if (file_exists("modules/lightbox/album.php") ) { ?> <dd id="door4"><a href="javascript:;" onclick="tabswitch(4); return false;" ><?php echo i18n::translate('Media'); ?></a></dd> <dd id="door8"><a href="javascript:;" onclick="tabswitch(8); return false;" ><?php echo i18n::translate('Album'); ?></a></dd> <?php } - }elseif (file_exists("modules/googlemap/defaultconfig.php")) { ?> + } elseif (file_exists("modules/googlemap/defaultconfig.php")) { ?> <?php if (file_exists("modules/lightbox/album.php") ) { ?> <dd id="door4"><a href="javascript:;" onclick="tabswitch(4); return false;" ><?php echo i18n::translate('Media'); ?></a></dd> <dd id="door9"><a href="javascript:;" onclick="tabswitch(9); return false;" ><?php echo i18n::translate('Album'); ?></a></dd> diff --git a/modules/lightbox/functions/lb_indi_tabs_0.php b/modules/lightbox/functions/lb_indi_tabs_0.php index f7b46cd587..873169438f 100644 --- a/modules/lightbox/functions/lb_indi_tabs_0.php +++ b/modules/lightbox/functions/lb_indi_tabs_0.php @@ -37,13 +37,13 @@ if (!defined('WT_WEBTREES')) { if (file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','lightbox2','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false,false); -<?php }else if (file_exists("modules/googlemap/defaultconfig.php") && !file_exists("modules/lightbox/album.php")) { ?> +<?php } else if (file_exists("modules/googlemap/defaultconfig.php") && !file_exists("modules/lightbox/album.php")) { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); -<?php }else if (!file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> +<?php } else if (!file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','lightbox2','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); -<?php }else{ ?> +<?php } else { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false); <?php } ?> diff --git a/modules/lightbox/functions/lb_indi_tabs_1.php b/modules/lightbox/functions/lb_indi_tabs_1.php index f7b46cd587..873169438f 100644 --- a/modules/lightbox/functions/lb_indi_tabs_1.php +++ b/modules/lightbox/functions/lb_indi_tabs_1.php @@ -37,13 +37,13 @@ if (!defined('WT_WEBTREES')) { if (file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','lightbox2','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false,false); -<?php }else if (file_exists("modules/googlemap/defaultconfig.php") && !file_exists("modules/lightbox/album.php")) { ?> +<?php } else if (file_exists("modules/googlemap/defaultconfig.php") && !file_exists("modules/lightbox/album.php")) { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); -<?php }else if (!file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> +<?php } else if (!file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','lightbox2','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); -<?php }else{ ?> +<?php } else { ?> var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','spare'); var loadedTabs = new Array(false,false,false,false,false,false,false,false,false); <?php } ?> diff --git a/modules/lightbox/functions/lightbox_print_media_row.php b/modules/lightbox/functions/lightbox_print_media_row.php index 0d829bdc5d..a27e3a29e4 100644 --- a/modules/lightbox/functions/lightbox_print_media_row.php +++ b/modules/lightbox/functions/lightbox_print_media_row.php @@ -94,9 +94,9 @@ function lightbox_print_media_row($rtype, $rowm, $pid) { // Else If reorder media has NOT been clicked // Highlight Album Thumbnails - Changed=new (blue), Changed=old (red), Changed=no (none) - } else if ($rtype=='new'){ + } else if ($rtype=='new') { echo "<li class=\"li_new\">"; - } else if ($rtype=='old'){ + } else if ($rtype=='old') { echo "<li class=\"li_old\">"; } else { echo "<li class=\"li_norm\">"; diff --git a/modules/lightbox/js/Sound.js b/modules/lightbox/js/Sound.js index cb33573964..2d65d036a1 100644 --- a/modules/lightbox/js/Sound.js +++ b/modules/lightbox/js/Sound.js @@ -15,19 +15,19 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND function Sound(options) { this.options = options; - if(this.options == undefined) this.options = new Object(); + if (this.options == undefined) this.options = new Object(); - if(!this.options.swfLocation) { + if (!this.options.swfLocation) { this.options.swfLocation = "js/SoundBridge.swf"; } - if(Sound.id_count == undefined) { + if (Sound.id_count == undefined) { Sound.id_count = 1; } else { Sound.id_count ++; } - if(Sound.instances == undefined) { + if (Sound.instances == undefined) { Sound.instances = new Object(); } @@ -59,7 +59,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND this.so.addParam("allowScriptAccess", "always"); */ - if( document.getElementById('__sound_flash__') == undefined) { + if ( document.getElementById('__sound_flash__') == undefined) { var element = document.createElement("div"); element.id = "__sound_flash__"; document.body.appendChild(element); @@ -164,8 +164,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND } Sound.trace = function(value, isJavascript) { - if(document.getElementById('sound_tracer') != undefined) { - if(isJavascript == undefined || isJavascript == true) { + if (document.getElementById('sound_tracer') != undefined) { + if (isJavascript == undefined || isJavascript == true) { document.getElementById('sound_tracer').value += 'Javascript: ' + value + '\n'; } else { document.getElementById('sound_tracer').value += value + '\n'; @@ -194,4 +194,4 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND } return Sound.__thisMovie(object_id).proxyMethods(functionname, justArgs); - }
\ No newline at end of file + } diff --git a/modules/lightbox/js/clearbox.js b/modules/lightbox/js/clearbox.js index 7a83db1a62..a1e90db5fb 100644 --- a/modules/lightbox/js/clearbox.js +++ b/modules/lightbox/js/clearbox.js @@ -359,8 +359,8 @@ */ var CB_Scripts = document.getElementsByTagName('script'); - for(i=0;i<CB_Scripts.length;i++){ - if(CB_Scripts[i].src.match('clearbox.js')!=null){ + for (i=0;i<CB_Scripts.length;i++){ + if (CB_Scripts[i].src.match('clearbox.js')!=null){ var CB_jsdir=CB_Scripts[i].src.substring(0,CB_Scripts[i].src.length-11); } } diff --git a/modules/lightbox/js/clsource_music.js b/modules/lightbox/js/clsource_music.js index 05da626321..3f4720e0e7 100644 --- a/modules/lightbox/js/clsource_music.js +++ b/modules/lightbox/js/clsource_music.js @@ -286,11 +286,11 @@ var CB_Close_Win = CB_Close_Win; Player.prototype.onTimerEvent = function() { var isDurationOk = false - if(!this.paused) { + if (!this.paused) { var position = this.sound.getPosition(); - if(!position) position = 0; + if (!position) position = 0; - if(position != this.position && position != 0) { + if (position != this.position && position != 0) { this.onPlaying(); } else { this.onBuffering(); @@ -300,25 +300,25 @@ var CB_Close_Win = CB_Close_Win; var duration = 0; duration = this.sound.getDuration(); - if(!duration) duration = 0; - if(duration == this.duration && duration != 0) { + if (!duration) duration = 0; + if (duration == this.duration && duration != 0) { isDurationOk = true; } this.duration = duration; var progress = position/duration; - if(isDurationOk) { + if (isDurationOk) { this.setProgressBar(progress); } var isBytesTotalOk = false; var bytesTotal = this.sound.getBytesTotal(); - if(bytesTotal == this.bytesTotal) { + if (bytesTotal == this.bytesTotal) { isBytesTotalOk = true; } this.bytesTotal = bytesTotal; - if(isBytesTotalOk) { + if (isBytesTotalOk) { var loaded = this.sound.getBytesLoaded()/bytesTotal; this.setLoadedBar(loaded); } @@ -338,11 +338,11 @@ var CB_Close_Win = CB_Close_Win; } Player.prototype.setProgressBar = function(progress) { - if(!progress) progress = 0; + if (!progress) progress = 0; } Player.prototype.setLoadedBar = function(loaded) { - if(!loaded) loaded = 0; + if (!loaded) loaded = 0; } Player.prototype.onPlaying = function() { @@ -357,7 +357,7 @@ var CB_Close_Win = CB_Close_Win; } Player.prototype.onSoundComplete = function() { - if(!this.paused) { + if (!this.paused) { if (loopMusic) { this.onForward(); } @@ -417,9 +417,9 @@ var CB_Close_Win = CB_Close_Win; } Player.prototype.play = function() { - if(this.paused) { + if (this.paused) { this.paused = false; - if(this.stoped) { + if (this.stoped) { this.sound.loadSound(this.track, true); } this.sound.start(this.position/1000, 1); @@ -1720,7 +1720,7 @@ var CB_Close_Win = CB_Close_Win; for (i = 1; i < CB_Gallery.length; i++) { CB_preThumbs = new Image; CB_preThumbs.src = CB_Gallery[i][2]; - a += "<a href=\"javascript:void(0)\" onclick=\"if(CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + i + ")\"><img style=\"border: 0; left: " + c + "px;\" \" src=\"" + CB_Gallery[i][2] + "\" height=\"50\" class=\"CB_ThumbsImg\" alt=\"\" /></a>"; + a += "<a href=\"javascript:void(0)\" onclick=\"if (CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + i + ")\"><img style=\"border: 0; left: " + c + "px;\" \" src=\"" + CB_Gallery[i][2] + "\" height=\"50\" class=\"CB_ThumbsImg\" alt=\"\" /></a>"; c += Math.round(CB_preThumbs.width / CB_preThumbs.height * 50) + b; } CB_Thm2.style.width = CB_AllThumbsWidth + "px"; @@ -1847,7 +1847,7 @@ var CB_Close_Win = CB_Close_Win; } if (CB_TextNav == "be") { var a = CB_Txt.innerHTML; - CB_Txt.innerHTML = "<a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"if(CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + (CB_ActImgId - 1) + ")\" alt=\"<\">" + CB_NavTextPrv + "</a> " + a; + CB_Txt.innerHTML = "<a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"if (CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + (CB_ActImgId - 1) + ")\" alt=\"<\">" + CB_NavTextPrv + "</a> " + a; } CB_Prv.style.display = "block"; if (slideshowMusic == null) { @@ -1868,7 +1868,7 @@ var CB_Close_Win = CB_Close_Win; PreloadNxt.src = CB_Gallery[CB_ActImgId + 1][0]; } if (CB_TextNav == "be") { - CB_Txt.innerHTML += " <a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"if(CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + (CB_ActImgId + 1) + ")\" alt=\">\">" + CB_NavTextNxt + "</a>"; + CB_Txt.innerHTML += " <a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"if (CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + (CB_ActImgId + 1) + ")\" alt=\">\">" + CB_NavTextNxt + "</a>"; } CB_Nxt.style.display = "block"; CB_Nxt.onclick = function () { @@ -2139,7 +2139,7 @@ dragDrop = { startDrag: function (obj) { if (dragDrop.draggedObject) dragDrop.releaseElement(); - if(IE){ + if (IE){ dragDrop.startX = (obj.offsetLeft+(CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); dragDrop.startY = ((obj.offsetTop-document.documentElement.scrollTop)+(CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); }else{ @@ -2240,4 +2240,4 @@ function removeEventSimple(obj,evt,fn) { obj.detachEvent('on'+evt,fn); } -// --------------------------------------------------------------------------------------
\ No newline at end of file +// -------------------------------------------------------------------------------------- diff --git a/modules/lightbox/lb_editconfig.php b/modules/lightbox/lb_editconfig.php index 8943bb709e..74d18e6aea 100644 --- a/modules/lightbox/lb_editconfig.php +++ b/modules/lightbox/lb_editconfig.php @@ -206,9 +206,9 @@ if ($action=='update' && !isset($security_user)) { <input type="reset" value="<?php echo i18n::translate('Reset'); ?>" /> - <?php if ($pid){ ?> + <?php if ($pid) { ?> <INPUT TYPE="button" VALUE="<?php echo i18n::translate('Return to Album page'); ?>" onclick="javascript:window.location='individual.php?pid=<?php echo $pid; ?>&gedcom=<?php echo $GEDCOM; ?>&tab=lightbox'" /> - <?php }else{ ?> + <?php } else { ?> <INPUT TYPE="button" VALUE="<?php echo i18n::translate('Return to Admin Page'); ?>" onclick="javascript:window.location='module_admin.php'" /> <?php } ?> diff --git a/modules/lightbox/module.php b/modules/lightbox/module.php index b957437fe8..dfb8cbecfc 100644 --- a/modules/lightbox/module.php +++ b/modules/lightbox/module.php @@ -94,7 +94,7 @@ class lightbox_WT_Module extends WT_Module implements WT_Module_Config, WT_Modul print_privacy_error(); echo "</td></tr>"; echo "</table>"; - }else{ + } else { if (file_exists("modules/lightbox/album.php")) { include_once('modules/lightbox/album.php'); } diff --git a/modules/random_media/module.php b/modules/random_media/module.php index 615adf8139..ef307dc04b 100644 --- a/modules/random_media/module.php +++ b/modules/random_media/module.php @@ -106,7 +106,7 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { $i=0; $disp = false; //-- try up to 40 times to get a media to display - while($i<40) { + while ($i<40) { $error = false; $value = array_rand($medialist); if (WT_DEBUG) { @@ -139,13 +139,13 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { if (WT_DEBUG && !$disp && !$error) {$error = true; echo "<span class=\"error\">".$medialist[$value]["XREF"]." failed Format or Type filters</span><br />"; } - if ($disp && count($links) != 0){ + if ($disp && count($links) != 0) { if ($disp && $filter!="all") { // Apply filter criteria $ct = preg_match("/0 (@.*@) OBJE/", $medialist[$value]["GEDCOM"], $match); $objectID = $match[1]; //-- we could probably use the database for this filter - foreach($links as $key=>$type) { + foreach ($links as $key=>$type) { $gedrec = find_gedcom_record($key, WT_GED_ID); $ct2 = preg_match("/(\d) OBJE {$objectID}/", $gedrec, $match2); if ($ct2>0) { @@ -267,7 +267,7 @@ function openPic(filename, width, height) { // $content .= " ><a href=\"javascript:;\" onclick=\"return openImage('".$medialist[$value]["FILE"]."', $imgwidth, $imgheight);\">"; // $content .= "><a href=\"" . $medialist[$value]["FILE"] . "\" rel=\"clearbox[general_4]\" title=\"" . $mediaid . "\">"; $content .= " ><a href=\"mediaviewer.php?mid=".$mediaid."\">"; - }else + } else // --------------------------------------------------------------------------------------------- diff --git a/modules/relatives/module.php b/modules/relatives/module.php index 910d619643..cc1adb6c3c 100644 --- a/modules/relatives/module.php +++ b/modules/relatives/module.php @@ -210,7 +210,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { $html=''; $levels = explode(',', $place); $tempURL = "placelist.php?action=show&"; - foreach(array_reverse($levels) as $pindex=>$ppart) { + foreach (array_reverse($levels) as $pindex=>$ppart) { $tempURL .= "parent[{$pindex}]=".rawurlencode($ppart).'&'; } $tempURL .= 'level='.count($levels); @@ -271,7 +271,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { $elderdate = $family->getMarriageDate(); $key=0; - foreach($people["children"] as $child) { + foreach ($people["children"] as $child) { $label = $child->getLabel(); $styleadd = ""; ?> @@ -287,7 +287,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { $elderdate = $child->getBirthDate(); ++$key; } - foreach($people["newchildren"] as $child) { + foreach ($people["newchildren"] as $child) { $label = $child->getLabel(); $styleadd = "blue"; ?> @@ -303,7 +303,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { $elderdate = $child->getBirthDate(); ++$key; } - foreach($people["delchildren"] as $child) { + foreach ($people["delchildren"] as $child) { $label = $child->getLabel(); $styleadd = "red"; ?> @@ -390,7 +390,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { } } //-- parent families - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $people = $this->controller->buildFamilyList($family, "parents"); $this->printFamilyHeader($famid, $this->controller->indi->getChildFamilyLabel($family)); ?> @@ -404,7 +404,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { } //-- step families - foreach($this->controller->indi->getStepFamilies() as $famid=>$family) { + foreach ($this->controller->indi->getStepFamilies() as $famid=>$family) { $people = $this->controller->buildFamilyList($family, "step"); $this->printFamilyHeader($famid, $this->controller->indi->getStepFamilyLabel($family)); ?> @@ -419,7 +419,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { //-- spouses and children $families = $this->controller->indi->getSpouseFamilies(); - foreach($families as $famid=>$family) { + foreach ($families as $famid=>$family) { $people = $this->controller->buildFamilyList($family, "spouse"); $this->printFamilyHeader($famid, $this->controller->indi->getSpouseFamilyLabel($family)); ?> diff --git a/modules/sitemap/index.php b/modules/sitemap/index.php index cf86e242e8..f66276f450 100644 --- a/modules/sitemap/index.php +++ b/modules/sitemap/index.php @@ -152,7 +152,7 @@ if ($action=="sendFiles") { } if (isset($fam_lists)) { - foreach(get_indilist_salpha($SHOW_MARRIED_NAMES, true, $index) as $letter=>$count) { + foreach (get_indilist_salpha($SHOW_MARRIED_NAMES, true, $index) as $letter=>$count) { if ($letter!='@') { echo " <url>\n"; echo " <loc>", WT_SERVER_NAME, WT_SCRIPT_PATH, "famlist.php?alpha=", urlencode($letter), "&ged=", urlencode($gedcom_name), "</loc>\n"; @@ -195,7 +195,7 @@ if ($action=="sendIndex") { if (isset($filenames)) { - foreach($filenames as $ged_index=>$ged_name) { + foreach ($filenames as $ged_index=>$ged_name) { $xml_name = str_ireplace(".ged",".xml", $ged_name); echo " <sitemap>\n"; echo " <loc>", WT_SERVER_NAME, WT_SCRIPT_PATH, "SM_", $xml_name, "</loc>\n"; @@ -246,7 +246,7 @@ if ($action=="generate") { } if ($filecounter > 1) { echo "<tr><td class=\"optionbox\"><a href=\"module.php?mod=sitemap&mod_action=index&action=sendIndex"; - foreach(get_all_gedcoms() as $ged_id=>$gedcom) { + foreach (get_all_gedcoms() as $ged_id=>$gedcom) { if (isset($_POST["GEDCOM_{$ged_id}"])) { echo "&filenames[", $ged_id, "]=", $gedcom; } diff --git a/modules/user_blog/module.php b/modules/user_blog/module.php index 9d887ea782..0d8ba12da8 100644 --- a/modules/user_blog/module.php +++ b/modules/user_blog/module.php @@ -79,7 +79,7 @@ class user_blog_WT_Module extends WT_Module implements WT_Module_Block { if (count($usernews)==0) { $content .= i18n::translate('You have not created any Journal items.').' '; } - foreach($usernews as $key=>$news) { + foreach ($usernews as $key=>$news) { $day = date("j", $news["date"]); $mon = date("M", $news["date"]); $year = date("Y", $news["date"]); diff --git a/modules/user_favorites/module.php b/modules/user_favorites/module.php index 0e9dc49a76..726a91b8ba 100644 --- a/modules/user_favorites/module.php +++ b/modules/user_favorites/module.php @@ -148,7 +148,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block { <script type="text/javascript" src="js/jquery/jquery.ajaxQueue.js"></script> <script type="text/javascript"> jQuery.noConflict(); // @see http://docs.jquery.com/Using_jQuery_with_Other_Libraries/ - jQuery(document).ready(function($){ + jQuery(document).ready(function($) { $("input[name^=gid]").autocomplete("autocomplete.php", { extraParams: {field:"IFSRO"}, formatItem: function(row, i) { @@ -179,7 +179,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block { $mygedcom = $GEDCOM; $current_gedcom = $GEDCOM; $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center $TEXT_DIRECTION\">"; - foreach($userfavs as $key=>$favorite) { + foreach ($userfavs as $key=>$favorite) { if (isset($favorite["id"])) $key=$favorite["id"]; $removeFavourite = "<a class=\"font9\" href=\"index.php?ctype={$ctype}&action=deletefav&fv_id={$key}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this item from your list of Favorites?')."');\">".i18n::translate('Remove')."</a><br />"; $current_gedcom = $GEDCOM; diff --git a/modules/user_messages/module.php b/modules/user_messages/module.php index f2be92d461..0b6772614d 100644 --- a/modules/user_messages/module.php +++ b/modules/user_messages/module.php @@ -107,7 +107,7 @@ class user_messages_WT_Module extends WT_Module implements WT_Module_Block { <!-- function select_all() { '; - foreach($usermessages as $key=>$message) { + foreach ($usermessages as $key=>$message) { if (isset($message["id"])) $key = $message["id"]; $content .= ' var cb = document.getElementById("cb_message'.$key.'"); @@ -130,7 +130,7 @@ class user_messages_WT_Module extends WT_Module implements WT_Module_Block { $content .= "<td class=\"list_label\">".i18n::translate('Date Sent:')."</td>"; $content .= "<td class=\"list_label\">".i18n::translate('Email Address:')."</td>"; $content .= "</tr>"; - foreach($usermessages as $key=>$message) { + foreach ($usermessages as $key=>$message) { if (isset($message["id"])) $key = $message["id"]; $content .= "<tr>"; $content .= "<td class=\"list_value_wrap\"><input type=\"checkbox\" id=\"cb_message$key\" name=\"message_id[]\" value=\"$key\" /></td>"; @@ -51,7 +51,7 @@ if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; } -if (!$controller->note){ +if (!$controller->note) { echo "<b>", i18n::translate('Unable to find record with ID'), "</b><br /><br />"; print_footer(); exit; @@ -93,7 +93,7 @@ echo '<tr class="', $TEXT_DIRECTION, '"><td><table class="width100">'; $nt = preg_match("/0 @$controller->nid@ NOTE(.*)/", $noterec, $n1match); if ($nt==1) { $note = print_note_record("<br />".$n1match[1], 1, $noterec, false, true, true); -}else{ +} else { $note = "No Text"; } echo '<tr><td align="left" class="descriptionbox ', $TEXT_DIRECTION, '">'; diff --git a/pedigree.php b/pedigree.php index aa42339d1e..e71a5584a5 100644 --- a/pedigree.php +++ b/pedigree.php @@ -156,7 +156,7 @@ $prevyoffset = 0; // -- used to track the y position of the previous box $maxyoffset = 0; $linesize = 3; if (!isset($brborder)) $brborder = 1; // Avoid errors from old custom themes -for($i=($controller->treesize-1); $i>=0; $i--) { +for ($i=($controller->treesize-1); $i>=0; $i--) { // -- check to see if we have moved to the next generation if ($i < floor($controller->treesize / (pow(2, $curgen)))) { $curgen++; @@ -342,11 +342,11 @@ if ($controller->rootPerson->canDisplayDetails()) { else echo "ltr\" style=\"position:absolute; left:"; echo $xoffset, "px; top:", $yoffset, "px; width:", $controller->pbwidth, "px; height:", $controller->pbheight, "px; visibility: hidden;\">"; echo "<table class=\"person_box\"><tr><td>"; - foreach($famids as $ind=>$family) { + foreach ($famids as $ind=>$family) { if ($family!=null) { $husb = $family->getHusbId(); $wife = $family->getWifeId(); - if($controller->rootid!=$husb) $spid=$family->getHusband(); + if ($controller->rootid!=$husb) $spid=$family->getHusband(); else $spid=$family->getWife(); if (!empty($spid)) { echo "<a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$spid->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; @@ -361,7 +361,7 @@ if ($controller->rootPerson->canDisplayDetails()) { } $children = $family->getChildren(); - foreach($children as $ind2=>$child) { + foreach ($children as $ind2=>$child) { echo " <a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; if ($child->canDisplayName()) { $name = $child->getFullName(); @@ -375,12 +375,12 @@ if ($controller->rootPerson->canDisplayDetails()) { } } //-- echo the siblings - foreach($cfamids as $ind=>$family) { + foreach ($cfamids as $ind=>$family) { if ($family!=null) { $children = $family->getChildren(); if (count($children)>2) echo '<span class="name1"><br />', i18n::translate('Siblings'), '<br /></span>'; if (count($children)==2) echo '<span class="name1"><br />', i18n::translate('Sibling'), '<br /></span>'; - foreach($children as $ind2=>$child) { + foreach ($children as $ind2=>$child) { if (!$controller->rootPerson->equals($child) && !is_null($child)) { echo " <a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; if ($child->canDisplayName()) { diff --git a/pgv_to_wt.php b/pgv_to_wt.php index 8cd0e22f3a..fd3005a788 100644 --- a/pgv_to_wt.php +++ b/pgv_to_wt.php @@ -1005,7 +1005,7 @@ WT_DB::prepare( //////////////////////////////////////////////////////////////////////////////// try { - if ($DBNAME.$TBLPREFIX.'placelocation'){ + if ($DBNAME.$TBLPREFIX.'placelocation') { echo '<p>pgv_placelocation => wt_placelocation ...</p>'; ob_flush(); flush(); usleep(50000); WT_DB::exec( "CREATE TABLE IF NOT EXISTS `##placelocation` (". diff --git a/placelist.php b/placelist.php index 5d38d325e0..cf9b105dc8 100644 --- a/placelist.php +++ b/placelist.php @@ -41,7 +41,7 @@ if (file_exists(WT_ROOT.'modules/googlemap/placehierarchy.php')) { } function case_in_array($value, $array) { - foreach($array as $key=>$val) { + foreach ($array as $key=>$val) { if (strcasecmp($value, $val)==0) return true; } return false; @@ -104,7 +104,7 @@ if ($display=="hierarchy") { $tempparent = array_reverse($parent); if (count($tempparent)>0) $squery = "&query=".urlencode($tempparent[0]); else $squery=""; - for($i=1; $i<$level; $i++) { + for ($i=1; $i<$level; $i++) { $squery.=", ".urlencode($tempparent[$i]); } @@ -127,12 +127,12 @@ if ($display=="hierarchy") { echo "<a href=\"?level=0\">"; if ($numls>=0 && (($TEXT_DIRECTION=="ltr" && hasRtLText($parent[$numls])) || ($TEXT_DIRECTION=="rtl" && !hasRtLText($parent[$numls])))) echo i18n::translate('Top Level'), ", "; echo "</a>"; - for($i=$numls; $i>=0; $i--) { + for ($i=$numls; $i>=0; $i--) { echo "<a href=\"?level=", ($i+1); for ($j=0; $j<=$i; $j++) { $levels = explode(', ', trim($parent[$j])); // Routine for replacing ampersands - foreach($levels as $pindex=>$ppart) { + foreach ($levels as $pindex=>$ppart) { $ppart = rawurlencode($ppart); $ppart = preg_replace("/amp\%3B/", "", trim($ppart)); echo "&parent[$j]=", $ppart; @@ -280,7 +280,7 @@ if ($display=="hierarchy") { $placelevels=""; $place_names=array(); } - for($j=0; $j<$level; $j++) { + for ($j=0; $j<$level; $j++) { $linklevels .= "&parent[$j]=".urlencode($parent[$j]); if ($use_googlemap) { if (trim($parent[$j])=="") { @@ -330,7 +330,7 @@ if ($display=="hierarchy") { else echo PrintReady($value); if ($use_googlemap) $place_names[$i]=trim($value); echo "</a></li>\n"; - if ($ct1 > 20){ + if ($ct1 > 20) { if ($i == floor($ct1 / 3)) { echo "\n\t\t</ul></td>\n\t\t<td class=\"list_value\"><ul>"; } @@ -342,7 +342,7 @@ if ($display=="hierarchy") { } $i++; } - if ($i>0){ + if ($i>0) { echo "\n\t\t</ul></td></tr>"; if (($action!="show")&&($level>0)) { echo "<tr>\n\t\t<td class=\"list_label\" "; @@ -362,7 +362,7 @@ if ($display=="hierarchy") { } echo " style=\"text-align: center;\">"; echo "<a href=\"?action=show&level=", $level, ""; - foreach($parent as $key=>$value) { + foreach ($parent as $key=>$value) { echo "&parent[", $key, "]=", urlencode(trim($value)); } echo "\"><span class=\"formField\">"; @@ -434,12 +434,12 @@ if ($display=="list") { echo help_link('ppp_placelist'); echo "</td></tr><tr><td class=\"list_value_wrap\"><ul>"; $i=0; - foreach($placelist as $indexval => $revplace) { + foreach ($placelist as $indexval => $revplace) { $linklevels = ""; $levels = explode(',', $revplace); // -- split the place into comma seperated values $level=0; $revplace = ""; - foreach($levels as $indexval => $place) { + foreach ($levels as $indexval => $place) { $place = trim($place); $linklevels .= "&parent[$level]=".urlencode($place); $level++; @@ -455,7 +455,7 @@ if ($display=="list") { echo " type=\"square\"><a href=\"?action=show&display=hierarchy&level=", $level, $linklevels, "\">"; echo PrintReady($revplace), "</a></li>\n"; $i++; - if ($ct > 20){ + if ($ct > 20) { if ($i == floor($ct / 3)) echo "\n\t\t</ul></td>\n\t\t<td class=\"list_value_wrap\"><ul>"; if ($i == floor(($ct / 3) * 2)) echo "\n\t\t</ul></td>\n\t\t<td class=\"list_value_wrap\"><ul>"; } diff --git a/relationship.php b/relationship.php index be500cce52..95ac6a9efb 100644 --- a/relationship.php +++ b/relationship.php @@ -204,10 +204,10 @@ function paste_id(value) { $path_to_find--; $check_node=$node; } - foreach($_SESSION["relationships"] as $indexval => $node) { + foreach ($_SESSION["relationships"] as $indexval => $node) { if ($i==0) echo i18n::translate('Show path').": </td><td class=\"list_value\" style=\"padding: 3px;\">"; if ($i>0) echo " | "; - if ($i==$path_to_find){ + if ($i==$path_to_find) { echo "<span class=\"error\" style=\"valign: middle\">".($i+1)."</span>"; $new_path=false; } @@ -330,7 +330,7 @@ if ((!empty($pid1))&&(!empty($pid2))) { $dmin=0; $dmax=0; $depth=0; - foreach($node["path"] as $index=>$pid) { + foreach ($node["path"] as $index=>$pid) { if ($node["relations"][$index]=="father" || $node["relations"][$index]=="mother" || $node["relations"][$index]=="parent") { $depth++; @@ -357,7 +357,7 @@ if ((!empty($pid1))&&(!empty($pid2))) { $rArrow = $WT_IMAGES["larrow"]; $lArrow = $WT_IMAGES["rarrow"]; } - foreach($node["path"] as $index=>$pid) { + foreach ($node["path"] as $index=>$pid) { echo "<!-- Node:{$index} -->"; $linex = $xoffset; $liney = $yoffset; @@ -51,7 +51,7 @@ if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; } -if (!$controller->repository){ +if (!$controller->repository) { echo "<b>", i18n::translate('Unable to find record with ID'), "</b><br /><br />"; print_footer(); exit; diff --git a/reportengine.php b/reportengine.php index 172d06288d..08c5da94ee 100644 --- a/reportengine.php +++ b/reportengine.php @@ -46,7 +46,7 @@ function get_tag_values($tag) { $indexes = $tags[$tag]; $vals = array(); - foreach($indexes as $i) { + foreach ($indexes as $i) { $vals[] = $values[$i]; } return $vals; @@ -88,7 +88,7 @@ if (isset($_REQUEST["type"])) { //-- setup the arrays $newvars = array(); -foreach($vars as $name=>$var) { +foreach ($vars as $name=>$var) { $newvars[$name]["id"] = $var; if (!empty($type[$name]) && (($type[$name]=="INDI") || ($type[$name]=="FAM") || ($type[$name]=="SOUR"))) { $gedcom = find_gedcom_record($var, WT_GED_ID); @@ -114,7 +114,7 @@ foreach($vars as $name=>$var) { $vars = $newvars; unset($newvars); -foreach($varnames as $indexval => $name) { +foreach ($varnames as $indexval => $name) { if (!isset($vars[$name])) { $vars[$name]["id"] = ""; } @@ -146,7 +146,7 @@ if ($action=="choose") { echo "<tr><td class=\"topbottombar\" colspan=\"2\">", i18n::translate('Choose a report to run'), "</td></tr>"; echo "<tr><td class=\"descriptionbox wrap width33 vmiddle\">", i18n::translate('Select report'), "</td>"; echo "<td class=\"optionbox\"><select onchange=\"this.form.submit();\" name=\"report\">\n"; - foreach($reports as $file=>$report) { + foreach ($reports as $file=>$report) { if ($report["access"] >= WT_USER_ACCESS_LEVEL) { echo "<option value=\"", $file, "\">", $report, "</option>\n"; } @@ -215,7 +215,7 @@ elseif ($action=="setup") { if (!isset($report_array["inputs"])) { $report_array["inputs"] = array(); } - foreach($report_array["inputs"] as $indexval => $input) { + foreach ($report_array["inputs"] as $indexval => $input) { if ($input["name"] == "sources" || $input["name"] != "sources") { if ($input["name"] != "photos" || $MULTI_MEDIA) { // url forced default value ? @@ -281,7 +281,7 @@ elseif ($action=="setup") { if ($input["type"]=="select") { echo "<select name=\"vars[", $input["name"], "]\" id=\"", $input["name"], "_var\">\n"; $options = preg_split("/[|]+/", $input["options"]); - foreach($options as $indexval => $option) { + foreach ($options as $indexval => $option) { $opt = explode('=>', $option); list($value, $display)=$opt; if (substr($display, 0, 6)=='i18n::') { @@ -347,7 +347,7 @@ elseif ($action=="setup") { } //-- run the report elseif ($action=="run") { - if (strstr($report, "report_singlepage.xml")!==false){ + if (strstr($report, "report_singlepage.xml")!==false) { $DEBUG=false; $pedigree=new ReportPedigree(); exit; diff --git a/search.php b/search.php index 29592aa503..69d6bde5a7 100644 --- a/search.php +++ b/search.php @@ -69,7 +69,7 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; message = false; if (place.length >= 2) message = false; - if(message) { + if (message) { alert("<?php echo i18n::translate('Please enter more than one character'); ?>"); return false; } @@ -94,14 +94,14 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; } else if (action == "multisite") { - if(frm.subaction.value=='basic') + if (frm.subaction.value=='basic') { if (frm.multiquery.value.length < 2) { alert("<?php echo i18n::translate('Please enter more than one character'); ?>"); return false; } } - else if(frm.subaction.value == 'advanced') + else if (frm.subaction.value == 'advanced') { message = true; name = frm.name.value; @@ -111,9 +111,9 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; dplace = frm.deathplace.value; gender = frm.gender.value; - if(name.length > 1) + if (name.length > 1) message = false; - if(bdate.length > 1) + if (bdate.length > 1) message = false; if (bplace.length > 1) message = false; @@ -121,10 +121,10 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; message = false; if (dplace.length > 1) message = false; - if(message) + if (message) { <?php if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) { ?> - if(gender.length < 1) + if (gender.length < 1) { alert("<?php echo i18n::translate('Please enter one of the following: Name, Birth Date, Birth Place, Death Date, Death Place, and Gender '); ?>"); return false; @@ -138,7 +138,7 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; return true; } - function open_link(server, pid, indiName){ + function open_link(server, pid, indiName) { window.open("addsearchlink.php?server="+server+"&pid="+pid+"&indiName="+indiName, "_blank", "top=50,left=50,width=600,height=500,scrollbars=1,scrollable=1,resizable=1"); return false; } @@ -161,7 +161,7 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; <tr> <!-- /**************************************************** General Search Form *************************************************************/ --> - <?php if($controller->action == "general") { ?> + <?php if ($controller->action == "general") { ?> <td colspan="3" class="facts_label03" style="text-align:center;"> <?php echo i18n::translate('General Search'), help_link('search_enter_terms'); ?> </td> @@ -571,7 +571,7 @@ if ($controller->action == "general" || $controller->action == "soundex") { if ($controller->action == "general") { echo "<a href='?action=soundex'>".i18n::translate('Soundex Search')."</a>"; echo " | <a href='search_advanced.php'>".i18n::translate('Advanced search')."</a>"; - if(WT_USER_CAN_EDIT) { + if (WT_USER_CAN_EDIT) { echo " | <a href='?action=replace'>".i18n::translate('Search and replace')."</a>"; } if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) { @@ -598,7 +598,7 @@ else if ($controller->action == "soundex") { echo "<a href='?action=general'>".i18n::translate('General Search')."</a>"; echo " | <a href='search_advanced.php'>".i18n::translate('Advanced search')."</a>"; - if(WT_USER_CAN_EDIT) + if (WT_USER_CAN_EDIT) { echo " | <a href='?action=replace'>".i18n::translate('Search and replace')."</a>"; } @@ -611,7 +611,7 @@ else else if ($controller->action == "multisite") { - if(WT_USER_CAN_EDIT) + if (WT_USER_CAN_EDIT) { echo "<a href='?action=replace'>".i18n::translate('Search and replace')."</a> | "; } diff --git a/search_advanced.php b/search_advanced.php index 59dc4ff3e8..e5dd27f61d 100644 --- a/search_advanced.php +++ b/search_advanced.php @@ -68,7 +68,7 @@ print_header(i18n::translate('Advanced search')); }; // all of the field options - <?php foreach($controller->getOtherFields() as $field) { ?> + <?php foreach ($controller->getOtherFields() as $field) { ?> opt = document.createElement('option'); opt.value='<?php echo $field; ?>'; opt.text='<?php echo $controller->getLabel($field); ?>'; @@ -149,7 +149,7 @@ print_header(i18n::translate('Advanced search')); <!-- // search terms --> <?php $fct = count($controller->fields); - for($i=0; $i<$fct; $i++) { + for ($i=0; $i<$fct; $i++) { if (strpos($controller->getField($i), "FAMC:HUSB:NAME")===0) continue; if (strpos($controller->getField($i), "FAMC:WIFE:NAME")===0) continue; ?> @@ -193,7 +193,7 @@ print_header(i18n::translate('Advanced search')); $fatherSurnOption = 'SDX'; $motherGivnOption = 'SDX'; $motherSurnOption = 'SDX'; - for($k=0; $k<$fct; $k++) { + for ($k=0; $k<$fct; $k++) { $searchField = $controller->getField($k); $searchOption = substr($searchField, 20); // Assume we have something like "FAMC:HUSB:NAME:GIVN:foo" switch (substr($searchField, 0, 20)) { diff --git a/sidebar.php b/sidebar.php index 28f3eb8850..bf356b023d 100644 --- a/sidebar.php +++ b/sidebar.php @@ -70,7 +70,7 @@ if ($sb_action!='none') { if ($sb_action=='loadMods') { $counter = 0; - foreach($sidebarmods as $mod) { + foreach ($sidebarmods as $mod) { if (isset($controller)) $mod->setController($controller); if ($mod->hasSidebarContent()) { ?> @@ -251,10 +251,10 @@ jQuery(document).ready(function() { // ----------------------------- <?php if ( $sidebar_state == "open" ) { ?> - <?php if ( isset($_SESSION['WT_pin']) && $_SESSION['WT_pin'] || !isset($_SESSION['WT_sb_closed']) ) { ?> + <?php if (isset($_SESSION['WT_pin']) && $_SESSION['WT_pin'] || !isset($_SESSION['WT_sb_closed'])) { ?> jQuery('#sidebar_open').click(); jQuery('#sidebar_controls').show(); - if ( pinned == false ) { + if (pinned==false) { jQuery('#sidebar_pin').click(); } <?php } else { ?> @@ -262,8 +262,8 @@ jQuery(document).ready(function() { <?php } ?> <?php } ?> - <?php if ( $sidebar_state == "closed" ) { ?> - if ( pinned == true) { + <?php if ($sidebar_state=="closed") { ?> + if (pinned==true) { jQuery('#sidebar_open').click(); } jQuery('#sidebar_controls').show(); @@ -274,7 +274,7 @@ jQuery(document).ready(function() { <?php echo WT_JS_END; echo '<div id="sidebar">'; - if ( isset($_SESSION['WT_pin']) && $_SESSION['WT_pin'] && $sidebar_state == "open") { + if (isset($_SESSION['WT_pin']) && $_SESSION['WT_pin'] && $sidebar_state == "open") { ?> <div id="sidebar_controls" class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top ui-state-focus"> <a id="sidebar_open" href="#open"><img style="margin-left:0px;" src="<?php echo $WT_IMAGES['slide_close']; ?>" border="0" title="<?php echo i18n::translate('Sidebar Open'); ?>" alt="" /></a> diff --git a/source.php b/source.php index 5ae99778fe..750bd5595a 100644 --- a/source.php +++ b/source.php @@ -51,7 +51,7 @@ if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; } -if (!$controller->source){ +if (!$controller->source) { echo "<b>", i18n::translate('Unable to find record with ID'), "</b><br /><br />"; print_footer(); exit; diff --git a/statistics.php b/statistics.php index 4a0a93c0d5..8dc1c5399c 100644 --- a/statistics.php +++ b/statistics.php @@ -460,7 +460,7 @@ if (isset($content) && $content==1) { box.style.display = "none"; } } - function openPopup(){ + function openPopup() { window.open("", "_popup", "top=50, left=50, width=950, height=480, scrollbars=0, scrollable=0"); return true; } @@ -750,7 +750,7 @@ if (isset($content) && $content==1) { <script type="text/javascript"> //<![CDATA[ jQuery.noConflict(); - jQuery(document).ready(function(){ + jQuery(document).ready(function() { jQuery("#tabbar").tabs(); }); //]]> @@ -760,12 +760,12 @@ if (isset($content) && $content==1) { var selectedTab = ""; if (selectedTab != "" && selectedTab != "undefined" && selectedTab != null) { var selectedTab = selectedTab; - }else{ + } else { var selectedTab = <?php echo $tab; ?>; } var tabCache = new Array(); - jQuery(document).ready(function(){ + jQuery(document).ready(function() { // TODO: change images directory when the common images will be deleted. jQuery('#tabs').tabs({ spinner: '<img src=\"images/loading.gif\" height=\"18\" border=\"0\" />' }); jQuery("#tabs").tabs({ cache: true, selected: selectedTab }); diff --git a/statisticsplot.php b/statisticsplot.php index bd63b66add..9b75bf26d3 100644 --- a/statisticsplot.php +++ b/statisticsplot.php @@ -42,11 +42,11 @@ $stats = new stats($GEDCOM); function bimo() { global $z_as, $months, $zgrenzen, $stats, $n1; - if ($z_as == 300){ + if ($z_as == 300) { $num = $stats->statsBirth(false); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { fill_ydata(0, $key, $values['total']); $n1+=$values['total']; } @@ -57,7 +57,7 @@ function bimo() { $num = $stats->statsBirth(false, true); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { if ($values['i_sex']=='M') { fill_ydata(0, $key, $values['total']); $n1+=$values['total']; @@ -76,7 +76,7 @@ function bimo() { $num = $stats->statsBirth(false, false, $zstart, $boundary); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { fill_ydata($boundary, $key, $values['total']); $n1+=$values['total']; } @@ -99,11 +99,11 @@ echo "not work yet"; function demo() { global $z_as, $months, $zgrenzen, $stats, $n1; - if ($z_as == 300){ + if ($z_as == 300) { $num = $stats->statsDeath(false); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { fill_ydata(0, $key, $values['total']); $n1+=$values['total']; } @@ -114,7 +114,7 @@ function demo() { $num = $stats->statsDeath(false, true); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { if ($values['i_sex']=='M') { fill_ydata(0, $key, $values['total']); $n1+=$values['total']; @@ -133,7 +133,7 @@ function demo() { $num = $stats->statsDeath(false, false, $zstart, $boundary); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { fill_ydata($boundary, $key, $values['total']); $n1+=$values['total']; } @@ -152,7 +152,7 @@ function mamo() { $num = $stats->statsMarr(false, false); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { fill_ydata(0, $key, $values['total']); $n1+=$values['total']; } @@ -165,7 +165,7 @@ function mamo() { $num = $stats->statsMarr(false, false, $zstart, $boundary); foreach ($num as $values) { foreach ($months as $key=>$month) { - if($month==$values['d_month']) { + if ($month==$values['d_month']) { fill_ydata($boundary, $key, $values['total']); $n1+=$values['total']; } @@ -187,7 +187,7 @@ function mamo1() { foreach ($num as $values) { if (!in_array($values['indi'], $indi) && !in_array($values['fams'], $fam)) { foreach ($months as $key=>$month) { - if($month==$values['month']) { + if ($month==$values['month']) { fill_ydata(0, $key, 1); $n1++; } @@ -206,7 +206,7 @@ function mamo1() { foreach ($num as $values) { if (!in_array($values['indi'], $indi) && !in_array($values['fams'], $fam)) { foreach ($months as $key=>$month) { - if($month==$values['month']) { + if ($month==$values['month']) { fill_ydata($boundary, $key, 1); $n1++; } @@ -233,7 +233,7 @@ echo "not work yet"; function agbi() { global $z_as, $zgrenzen, $stats, $n1; - if ($z_as == 300){ + if ($z_as == 300) { $num = $stats->statsAge(false, 'BIRT'); foreach ($num as $values) { foreach ($values as $age_value) { @@ -277,7 +277,7 @@ function agbi() { function agde() { global $z_as, $zgrenzen, $stats, $n1; - if ($z_as == 300){ + if ($z_as == 300) { $num = $stats->statsAge(false, 'DEAT'); foreach ($num as $values) { foreach ($values as $age_value) { @@ -321,7 +321,7 @@ function agde() { function agma() { global $z_as, $zgrenzen, $stats, $n1; - if ($z_as == 300){ + if ($z_as == 300) { $num = $stats->statsMarrAge(false, 'M'); foreach ($num as $values) { fill_ydata(0, floor($values['age']/365.25), 1); @@ -502,12 +502,12 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { else $stop = count($ydata); $yprocentmax = 0; if ($percentage) { - for($i=0; $i<$stop; $i++) { + for ($i=0; $i<$stop; $i++) { $ytotal = 0; $ymax = 0; $yprocent = 0; if (isset($ydata[$i])) { - for($j=0; $j<count($ydata[$i]); $j++) { + for ($j=0; $j<count($ydata[$i]); $j++) { if ($ydata[$i][$j] > $ymax) { $ymax = $ydata[$i][$j]; } @@ -523,16 +523,16 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { if ($ymax>0) $scalefactor = 100.0/$ymax; else $scalefactor = 0; $datastring = "chd=t:"; - for($i=0; $i<$stop; $i++) { + for ($i=0; $i<$stop; $i++) { if (isset($ydata[$i])) { - for($j=0; $j<count($ydata[$i]); $j++){ + for ($j=0; $j<count($ydata[$i]); $j++) { if ($yt[$i] > 0) { $datastring .= round($ydata[$i][$j]/$yt[$i]*100*$scalefactor, 1); } else { $datastring .= "0"; } - if (!($j == (count($ydata[$i])-1))){ + if (!($j == (count($ydata[$i])-1))) { $datastring .= ","; } } @@ -543,8 +543,8 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { } } else { - for($i=0; $i<$stop; $i++) { - for($j=0; $j<count($ydata[$i]); $j++) { + for ($i=0; $i<$stop; $i++) { + for ($j=0; $j<count($ydata[$i]); $j++) { if ($ydata[$i][$j]>$ymax) { $ymax = $ydata[$i][$j]; } @@ -553,10 +553,10 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { if ($ymax>0) $scalefactor = 100.0/$ymax; else $scalefactor = 0; $datastring = "chd=t:"; - for($i=0; $i<$stop; $i++) { - for($j=0; $j<count($ydata[$i]); $j++){ + for ($i=0; $i<$stop; $i++) { + for ($j=0; $j<count($ydata[$i]); $j++) { $datastring .= round($ydata[$i][$j]*$scalefactor, 1); - if (!($j == (count($ydata[$i])-1))){ + if (!($j == (count($ydata[$i])-1))) { $datastring .= ","; } } @@ -567,10 +567,10 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { } $colors = array("0000FF", "FFA0CB", "9F00FF", "FF7000", "905030", "FF0000", "00FF00", "F0F000"); $colorstring = "chco="; - for($i=0; $i<$stop; $i++) { + for ($i=0; $i<$stop; $i++) { if (isset($colors[$i])) { $colorstring .= $colors[$i]; - if ($i != ($stop-1)){ + if ($i != ($stop-1)) { $colorstring .= ","; } } @@ -588,14 +588,14 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { $imgurl .= "20,3"; } $imgurl .= "&chxt=x,x,y,y&chxl=0:|"; - for($i=0; $i<count($xdata); $i++) { + for ($i=0; $i<count($xdata); $i++) { $imgurl .= $xdata[$i]."|"; } $imgurl .= "1:||||".$xtitle."|2:|"; $imgurl .= "0|"; - if ($percentage){ - for($i=1; $i<11; $i++) { + if ($percentage) { + for ($i=1; $i<11; $i++) { if ($ymax < 11) $imgurl .= round($ymax*$i/10, 1)."|"; else @@ -605,12 +605,12 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { } else { if ($ymax < 11) { - for($i=1; $i<$ymax+1; $i++) { + for ($i=1; $i<$ymax+1; $i++) { $imgurl .= round($ymax*$i/($ymax), 0)."|"; } } else { - for($i=1; $i<11; $i++) { + for ($i=1; $i<11; $i++) { $imgurl .= round($ymax*$i/10, 0)."|"; } } @@ -619,9 +619,9 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { //only show legend if y-data is non-2-dimensional if (count($ydata) > 1) { $imgurl .= "&chdl="; - for($i=0; $i<count($legend); $i++){ + for ($i=0; $i<count($legend); $i++) { $imgurl .= $legend[$i]; - if (!($i == (count($legend)-1))){ + if (!($i == (count($legend)-1))) { $imgurl .= "|"; } } @@ -656,7 +656,7 @@ function calc_axis($xas_grenzen) { $xdata[$i] = $hulpar[$i1]; $xgrenzen[$i] = $hulpar[$i1]; } - else if ($hulpar[$i1]==$hulpar[0]){ + else if ($hulpar[$i1]==$hulpar[0]) { $xdata[$i]= $hulpar[$i1]."-".$hulpar[$i]; $xgrenzen[$i] = $hulpar[$i]; } @@ -773,8 +773,8 @@ function set_params($current, $indfam, $xg, $zg, $titstr, $xt, $yt, $gx, $gz, $m $xtitle= $xtitle.i18n::translate(' per time period'); } //-- reset the data array - for($i=0; $i<$zmax; $i++) { - for($j=0; $j<$xmax; $j++) { + for ($i=0; $i<$zmax; $i++) { + for ($j=0; $j<$xmax; $j++) { $ydata[$i][$j] = 0; } } @@ -791,7 +791,7 @@ function set_params($current, $indfam, $xg, $zg, $titstr, $xt, $yt, $gx, $gz, $m } } -function print_sources_stats_chart($type){ +function print_sources_stats_chart($type) { global $stats; $params[0] = "700x200"; diff --git a/timeline.php b/timeline.php index cf4c2f8d65..24e8254b8c 100644 --- a/timeline.php +++ b/timeline.php @@ -264,7 +264,7 @@ $controller->checkPrivacy(); $half = ceil($count/2); } $half++; - foreach($controller->people as $p=>$indi) { + foreach ($controller->people as $p=>$indi) { $pid = $indi->getXref(); $col = $p % 6; if ($i==$half) { @@ -349,7 +349,7 @@ if (count($controller->people)>0) { //-- at a scale of 25 or higher, show every year $mod = 25/$controller->scale; if ($mod<1) $mod = 1; - for($i=$controller->baseyear+1; $i<$controller->topyear; $i++) { + for ($i=$controller->baseyear+1; $i<$controller->topyear; $i++) { if ($i % $mod == 0) { echo "<div id=\"scale$i\" style=\"font-family: Arial; position:absolute; ".($TEXT_DIRECTION =="ltr"?"left: $basexoffset":"right: $basexoffset")."px; top:".floor($baseyoffset+(($i-$controller->baseyear)*$controller->scale)-$controller->scale/2)."px; font-size: 7pt; text-align:".($TEXT_DIRECTION =="ltr"?"left":"right").";\">"; echo $i."--"; @@ -361,13 +361,13 @@ if (count($controller->people)>0) { echo "</div>"; sort_facts($controller->indifacts); $factcount=0; - foreach($controller->indifacts as $indexval => $fact) { + foreach ($controller->indifacts as $indexval => $fact) { $controller->print_time_fact($fact); $factcount++; } // print the age boxes - foreach($controller->people as $p=>$indi) { + foreach ($controller->people as $p=>$indi) { $pid = $indi->getXref(); $ageyoffset = $baseyoffset + ($controller->bheight*$p); $col = $p % 6; @@ -411,7 +411,7 @@ if (count($controller->people)>0) { var birthmonths = new Array(); var birthdays = new Array(); <?php - foreach($controller->people as $c=>$indi) { + foreach ($controller->people as $c=>$indi) { $pid = $indi->getXref(); if (!empty($controller->birthyears[$pid])) echo "birthyears[".$c."]=".$controller->birthyears[$pid].";"; if (!empty($controller->birthmonths[$pid])) echo "birthmonths[".$c."]=".$controller->birthmonths[$pid].";"; diff --git a/useradmin.php b/useradmin.php index 74e626b13d..45d542a007 100644 --- a/useradmin.php +++ b/useradmin.php @@ -252,7 +252,7 @@ if ($action=="edituser") { var fieldIDx = jQuery(this).attr('id'); var idNum = fieldIDx.replace('RELATIONSHIP_PATH_LENGTH',''); var newIDx = "gedcomid"+idNum; - if(jQuery('#'+newIDx).val()=='') { + if (jQuery('#'+newIDx).val()=='') { alert("<?php echo i18n::translate('You must enter a GEDCOM INDI record ID before you can set the maximum relationship path length'); ?>"); jQuery(this).val(''); } @@ -502,7 +502,7 @@ if ($action == "listusers") { <script type="text/javascript" src="js/jquery/jquery.tablesorter.pager.js"></script> <script type="text/javascript"> //<