diff options
| -rw-r--r-- | help_text.php | 660 | ||||
| -rw-r--r-- | includes/functions/functions_edit.php | 510 | ||||
| -rw-r--r-- | includes/functions/functions_import.php | 522 | ||||
| -rw-r--r-- | includes/reportheader.php | 30 | ||||
| -rw-r--r-- | inverselink.php | 30 | ||||
| -rw-r--r-- | library/WT/Report/Base.php | 72 | ||||
| -rw-r--r-- | library/WT/Stats.php | 148 | ||||
| -rw-r--r-- | library/WT/User.php | 6 | ||||
| -rw-r--r-- | login.php | 90 | ||||
| -rw-r--r-- | medialist.php | 34 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php | 824 | ||||
| -rw-r--r-- | modules_v3/batch_update/admin_batch_update.php | 284 | ||||
| -rw-r--r-- | modules_v3/googlemap/module.php | 924 |
13 files changed, 2067 insertions, 2067 deletions
diff --git a/help_text.php b/help_text.php index 8bf7a81505..31a6a6d628 100644 --- a/help_text.php +++ b/help_text.php @@ -46,34 +46,34 @@ switch ($help) { ////////////////////////////////////////////////////////////////////////////// case 'ADDR': - $title=WT_Gedcom_Tag::getLabel('ADDR'); - $text=WT_I18N::translate('Enter the address into the field just as you would write it on an envelope.<br><br>Leave this field blank if you do not want to include an address.'); + $title = WT_Gedcom_Tag::getLabel('ADDR'); + $text = WT_I18N::translate('Enter the address into the field just as you would write it on an envelope.<br><br>Leave this field blank if you do not want to include an address.'); break; case 'AGNC': - $title=WT_Gedcom_Tag::getLabel('AGNC'); - $text=WT_I18N::translate('The organization, institution, corporation, individual, or other entity that has authority.<br><br>For example, an employer of an individual, or a church that administered rites or events, or an organization responsible for creating and/or archiving records.'); + $title = WT_Gedcom_Tag::getLabel('AGNC'); + $text = WT_I18N::translate('The organization, institution, corporation, individual, or other entity that has authority.<br><br>For example, an employer of an individual, or a church that administered rites or events, or an organization responsible for creating and/or archiving records.'); break; case 'ASSO_1': - $title=WT_Gedcom_Tag::getLabel('ASSO'); - $text=WT_I18N::translate('An associate is another individual who was involved with this individual, such as a friend or an employer.'); + $title = WT_Gedcom_Tag::getLabel('ASSO'); + $text = WT_I18N::translate('An associate is another individual who was involved with this individual, such as a friend or an employer.'); break; case 'ASSO_2': - $title=WT_Gedcom_Tag::getLabel('ASSO'); - $text=WT_I18N::translate('An associate is another individual who was involved with this fact or event, such as a witness or a priest.'); + $title = WT_Gedcom_Tag::getLabel('ASSO'); + $text = WT_I18N::translate('An associate is another individual who was involved with this fact or event, such as a witness or a priest.'); break; case 'CAUS': - $title=WT_Gedcom_Tag::getLabel('CAUS'); - $text=WT_I18N::translate('A description of the cause of the associated event or fact, such as the cause of death.'); + $title = WT_Gedcom_Tag::getLabel('CAUS'); + $text = WT_I18N::translate('A description of the cause of the associated event or fact, such as the cause of death.'); break; case 'DATE': - $title=WT_Gedcom_Tag::getLabel('DATE'); - $CALENDAR_FORMAT=null; // Don't perform conversions here - it will confuse the examples! - $dates=array( + $title = WT_Gedcom_Tag::getLabel('DATE'); + $CALENDAR_FORMAT = null; // Don't perform conversions here - it will confuse the examples! + $dates = array( '1900' =>new WT_Date('1900'), 'JAN 1900' =>new WT_Date('JAN 1900'), 'FEB 1900' =>new WT_Date('FEB 1900'), @@ -149,104 +149,104 @@ case 'DATE': ); foreach ($dates as &$date) { - $date=strip_tags($date->Display()); + $date = strip_tags($date->Display()); } // These shortcuts work differently for different languages switch (preg_replace('/[^DMY]/', '', str_replace(array('J', 'F'), array('D', 'M'), strtoupper($DATE_FORMAT)))) { case 'YMD': - $example1='11/12/1913'; // Note: we ignore the DMY order if it doesn't make sense. - $example2='03/02/01'; + $example1 = '11/12/1913'; // Note: we ignore the DMY order if it doesn't make sense. + $example2 = '03/02/01'; break; case 'MDY': - $example1='12/11/1913'; - $example2='02/01/03'; + $example1 = '12/11/1913'; + $example2 = '02/01/03'; break; case 'DMY': default: - $example1='11/12/1913'; - $example2='01/02/03'; + $example1 = '11/12/1913'; + $example2 = '01/02/03'; break; } - $example1.='<br>'.str_replace('/', '-', $example1).'<br>'.str_replace('/', '.', $example1); - $example2.='<br>'.str_replace('/', '-', $example2).'<br>'.str_replace('/', '.', $example2); - $text= - '<p>'.WT_I18N::translate('Dates are stored using English abbreviations and keywords. Shortcuts are available as alternatives to these abbreviations and keywords.').'</p>'. - '<table border="1">'. - '<tr><th>'.WT_I18N::translate('Date').'</th><th>'.WT_I18N::translate('Format').'</th><th>'.WT_I18N::translate('Shortcut').'</th></tr>'. - '<tr><td>'.$dates['1900'].'</td><td><tt dir="ltr" lang="en">1900</tt></td><td></td></tr>'. - '<tr><td>'.$dates['JAN 1900'].'<br>'.$dates['FEB 1900'].'<br>'.$dates['MAR 1900'].'<br>'.$dates['APR 1900'].'<br>'.$dates['MAY 1900'].'<br>'.$dates['JUN 1900'].'<br>'.$dates['JUL 1900'].'<br>'.$dates['AUG 1900'].'<br>'.$dates['SEP 1900'].'<br>'.$dates['OCT 1900'].'<br>'.$dates['NOV 1900'].'<br>'.$dates['DEC 1900'].'</td><td><tt dir="ltr" lang="en">JAN 1900<br>FEB 1900<br>MAR 1900<br>APR 1900<br>MAY 1900<br>JUN 1900<br>JUL 1900<br>AUG 1900<br>SEP 1900<br>OCT 1900<br>NOV 1900<br>DEC 1900</tt></td><td></td></tr>'. - '<tr><td>'.$dates['11 DEC 1913'].'</td><td><tt dir="ltr" lang="en">11 DEC 1913</tt></td><td><tt dir="ltr" lang="en">'.$example1.'</tt></td></tr>'. - '<tr><td>'.$dates['01 FEB 2003'].'</td><td><tt dir="ltr" lang="en">01 FEB 2003</tt></td><td><tt dir="ltr" lang="en">'.$example2.'</tt></td></tr>'. - '<tr><td>'.$dates['ABT 1900'].'</td><td><tt dir="ltr" lang="en">ABT 1900</tt></td><td><tt dir="ltr" lang="en">~1900</tt></td></tr>'. - '<tr><td>'.$dates['EST 1900'].'</td><td><tt dir="ltr" lang="en">EST 1900</tt></td><td><tt dir="ltr" lang="en">*1900</tt></td></tr>'. - '<tr><td>'.$dates['CAL 1900'].'</td><td><tt dir="ltr" lang="en">CAL 1900</tt></td><td><tt dir="ltr" lang="en">#1900</tt></td></tr>'. - '<tr><td>'.$dates['INT 1900 (...)'].'</td><td><tt dir="ltr" lang="en">INT 1900 (...)</tt></td><td></td></tr>'. - '</table>'. - '<p>'.WT_I18N::translate('Date ranges are used to indicate that an event, such as a birth, happened on an unknown date within a possible range.').'</p>'. - '<table border="1">'. - '<tr><th>'.WT_I18N::translate('Date range').'</th><th>'.WT_I18N::translate('Format').'</th><th>'.WT_I18N::translate('Shortcut').'</th></tr>'. - '<tr><td>'.$dates['BET 1900 AND 1910'].'</td><td><tt dir="ltr" lang="en">BET 1900 AND 1910</tt></td><td><tt dir="ltr" lang="en">1900-1910</tt></td></tr>'. - '<tr><td>'.$dates['AFT 1900'].'</td><td><tt dir="ltr" lang="en">AFT 1900</tt></td><td><tt dir="ltr" lang="en">>1900</tt></td></tr>'. - '<tr><td>'.$dates['BEF 1910'].'</td><td><tt dir="ltr" lang="en">BEF 1910</tt></td><td><tt dir="ltr" lang="en"><1910</tt></td></tr>'. - '<tr><td>'.$dates['BET JAN 1900 AND MAR 1900'].'</td><td><tt dir="ltr" lang="en">BET JAN 1900 AND MAR 1900</tt></td><td><tt dir="ltr" lang="en">Q1 1900</tt></td></tr>'. - '<tr><td>'.$dates['BET APR 1900 AND JUN 1900'].'</td><td><tt dir="ltr" lang="en">BET APR 1900 AND JUN 1900</tt></td><td><tt dir="ltr" lang="en">Q2 1900</tt></td></tr>'. - '<tr><td>'.$dates['BET JUL 1900 AND SEP 1900'].'</td><td><tt dir="ltr" lang="en">BET JUL 1900 AND SEP 1900</tt></td><td><tt dir="ltr" lang="en">Q3 1900</tt></td></tr>'. - '<tr><td>'.$dates['BET OCT 1900 AND DEC 1900'].'</td><td><tt dir="ltr" lang="en">BET OCT 1900 AND DEC 1900</tt></td><td><tt dir="ltr" lang="en">Q4 1900</tt></td></tr>'. - '</table>'. - '<p>'.WT_I18N::translate('Date periods are used to indicate that a fact, such as an occupation, continued for a period of time.').'</p>'. - '<table border="1">'. - '<tr><th>'.WT_I18N::translate('Date period').'</th><th>'.WT_I18N::translate('Format').'</th><th>'.WT_I18N::translate('Shortcut').'</th></tr>'. - '<tr><td>'.$dates['FROM 1900 TO 1910'].'</td><td><tt dir="ltr" lang="en">FROM 1900 TO 1910</tt></td><td><tt dir="ltr" lang="en">1900~1910</tt></td></tr>'. - '<tr><td>'.$dates['FROM 1900'].'</td><td><tt dir="ltr" lang="en">FROM 1900</tt></td><td><tt dir="ltr" lang="en">1900-</tt></td></tr>'. - '<tr><td>'.$dates['TO 1910'].'</td><td><tt dir="ltr" lang="en">TO 1910</tt></td><td><tt dir="ltr" lang="en">-1900</tt></td></tr>'. - '</table>'. - '<p>'.WT_I18N::translate('Simple dates are assumed to be in the gregorian calendar. To specify a date in another calendar, add a keyword before the date. This keyword is optional if the month or year format make the date unambiguous.').'</p>'. - '<table border="1">'. - '<tr><th>'.WT_I18N::translate('Date').'</th><th>'.WT_I18N::translate('Format').'</th></tr>'. - '<tr><td colspan="2" align="center">'.WT_I18N::translate('Julian').'</td></tr>'. - '<tr><td>'.$dates['@#DJULIAN@ 14 JAN 1700'].'</td><td><tt dir="ltr" lang="en">@#DJULIAN@ 14 JAN 1700</tt></td></tr>'. - '<tr><td>'.$dates['@#DJULIAN@ 44 B.C.'].'</td><td><tt dir="ltr" lang="en">@#DJULIAN@ 44 B.C.</tt></td></tr>'. - '<tr><td>'.$dates['@#DJULIAN@ 20 FEB 1742/43'].'</td><td><tt dir="ltr" lang="en">@#DJULIAN@ 20 FEB 1742/43</tt></td></tr>'. - '<tr><td>'.$dates['BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752'].'</td><td><tt dir="ltr" lang="en">BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752</tt></td></tr>'. - '<tr><td colspan="2" align="center">'.WT_I18N::translate('Jewish').'</td></tr>'. - '<tr><td>'.$dates['@#DHEBREW@ 5481'].'</td><td><tt dir="ltr" lang="en">@#DHEBREW@ 5481</tt></td></tr>'. - '<tr><td>'.$dates['@#DHEBREW@ TSH 5481'].'</td><td><tt dir="ltr" lang="en">@#DHEBREW@ TSH 5481</tt></td></tr>'. - '<tr><td>'.$dates['ABT @#DHEBREW@ CSH 5481'].'</td><td><tt dir="ltr" lang="en">ABT @#DHEBREW@ CSH 5481</tt></td></tr>'. - '<tr><td>'.$dates['BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481'].'</td><td><tt dir="ltr" lang="en">BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481</tt></td></tr>'. - '<tr><td>'.$dates['FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481'].'</td><td><tt dir="ltr" lang="en">FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481</tt></td></tr>'. - '<tr><td>'.$dates['AFT @#DHEBREW@ ADR 5481'].'</td><td><tt dir="ltr" lang="en">AFT @#DHEBREW@ ADR 5481</tt></td></tr>'. - '<tr><td>'.$dates['AFT @#DHEBREW@ ADS 5480'].'</td><td><tt dir="ltr" lang="en">AFT @#DHEBREW@ ADS 5480</tt></td></tr>'. - '<tr><td>'.$dates['BEF @#DHEBREW@ NSN 5481'].'</td><td><tt dir="ltr" lang="en">BEF @#DHEBREW@ NSN 5481</tt></td></tr>'. - '<tr><td>'.$dates['ABT @#DHEBREW@ IYR 5481'].'</td><td><tt dir="ltr" lang="en">ABT @#DHEBREW@ IYR 5481</tt></td></tr>'. - '<tr><td>'.$dates['FROM @#DHEBREW@ SVN 5481'].'</td><td><tt dir="ltr" lang="en">FROM @#DHEBREW@ SVN 5481</tt></td></tr>'. - '<tr><td>'.$dates['TO @#DHEBREW@ TMZ 5481'].'</td><td><tt dir="ltr" lang="en">TO @#DHEBREW@ TMZ 5481</tt></td></tr>'. - '<tr><td>'.$dates['EST @#DHEBREW@ AAV 5481'].'</td><td><tt dir="ltr" lang="en">EST @#DHEBREW@ AAV 5481</tt></td></tr>'. - '<tr><td>'.$dates['@#DHEBREW@ 03 ELL 5481'].'</td><td><tt dir="ltr" lang="en">@#DHEBREW@ 03 ELL 5481</tt></td></tr>'. - '<tr><td colspan="2" align="center">'.WT_I18N::translate('Hijri').'</td></tr>'. - '<tr><td>'.$dates['@#DHIJRI@ 1497'].'</td><td><tt dir="ltr" lang="en">@#DHIJRI@ 1497</tt></td></tr>'. - '<tr><td>'.$dates['@#DHIJRI@ MUHAR 1497'].'</td><td><tt dir="ltr" lang="en">@#DHIJRI@ MUHAR 1497</tt></td></tr>'. - '<tr><td>'.$dates['ABT @#DHIJRI@ SAFAR 1497'].'</td><td><tt dir="ltr" lang="en">ABT @#DHIJRI@ SAFAR 1497</tt></td></tr>'. - '<tr><td>'.$dates['BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497'].'</td><td><tt dir="ltr" lang="en">BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497</tt></td></tr>'. - '<tr><td>'.$dates['FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497'].'</td><td><tt dir="ltr" lang="en">FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497</tt></td></tr>'. - '<tr><td>'.$dates['AFT @#DHIJRI@ RAJAB 1497'].'</td><td><tt dir="ltr" lang="en">AFT @#DHIJRI@ RAJAB 1497</tt></td></tr>'. - '<tr><td>'.$dates['BEF @#DHIJRI@ SHAAB 1497'].'</td><td><tt dir="ltr" lang="en">BEF @#DHIJRI@ SHAAB 1497</tt></td></tr>'. - '<tr><td>'.$dates['ABT @#DHIJRI@ RAMAD 1497'].'</td><td><tt dir="ltr" lang="en">ABT @#DHIJRI@ RAMAD 1497</tt></td></tr>'. - '<tr><td>'.$dates['FROM @#DHIJRI@ SHAWW 1497'].'</td><td><tt dir="ltr" lang="en">FROM @#DHIJRI@ SHAWW 1497</tt></td></tr>'. - '<tr><td>'.$dates['TO @#DHIJRI@ DHUAQ 1497'].'</td><td><tt dir="ltr" lang="en">TO @#DHIJRI@ DHUAQ 1497</tt></td></tr>'. - '<tr><td>'.$dates['@#DHIJRI@ 03 DHUAH 1497'].'</td><td><tt dir="ltr" lang="en">@#DHIJRI@ 03 DHUAH 1497</tt></td></tr>'. - '<tr><td colspan="2" align="center">'.WT_I18N::translate('French').'</td></tr>'. - '<tr><td>'.$dates['@#DFRENCH R@ 12'].'</td><td><tt dir="ltr" lang="en">@#DFRENCH R@ 12</tt></td></tr>'. - '<tr><td>'.$dates['@#DFRENCH R@ VEND 12'].'</td><td><tt dir="ltr" lang="en">@#DFRENCH R@ VEND 12</tt></td></tr>'. - '<tr><td>'.$dates['ABT @#DFRENCH R@ BRUM 12'].'</td><td><tt dir="ltr" lang="en">ABT @#DFRENCH R@ BRUM 12</tt></td></tr>'. - '<tr><td>'.$dates['BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12'].'</td><td><tt dir="ltr" lang="en">BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12</tt></td></tr>'. - '<tr><td>'.$dates['FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12'].'</td><td><tt dir="ltr" lang="en">FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12</tt></td></tr>'. - '<tr><td>'.$dates['AFT @#DFRENCH R@ GERM 12'].'</td><td><tt dir="ltr" lang="en">AFT @#DFRENCH R@ GERM 12</tt></td></tr>'. - '<tr><td>'.$dates['BEF @#DFRENCH R@ FLOR 12'].'</td><td><tt dir="ltr" lang="en">BEF @#DFRENCH R@ FLOR 12</tt></td></tr>'. - '<tr><td>'.$dates['ABT @#DFRENCH R@ PRAI 12'].'</td><td><tt dir="ltr" lang="en">ABT @#DFRENCH R@ PRAI 12</tt></td></tr>'. - '<tr><td>'.$dates['FROM @#DFRENCH R@ MESS 12'].'</td><td><tt dir="ltr" lang="en">FROM @#DFRENCH R@ MESS 12</tt></td></tr>'. - '<tr><td>'.$dates['TO @#DFRENCH R@ THER 12'].'</td><td><tt dir="ltr" lang="en">TO @#DFRENCH R@ THER 12</tt></td></tr>'. - '<tr><td>'.$dates['EST @#DFRENCH R@ FRUC 12'].'</td><td><tt dir="ltr" lang="en">EST @#DFRENCH R@ FRUC 12</tt></td></tr>'. - '<tr><td>'.$dates['@#DFRENCH R@ 03 COMP 12'].'</td><td><tt dir="ltr" lang="en">@#DFRENCH R@ 03 COMP 12</tt></td></tr>'. + $example1 .= '<br>' . str_replace('/', '-', $example1) . '<br>' . str_replace('/', '.', $example1); + $example2 .= '<br>' . str_replace('/', '-', $example2) . '<br>' . str_replace('/', '.', $example2); + $text = + '<p>' . WT_I18N::translate('Dates are stored using English abbreviations and keywords. Shortcuts are available as alternatives to these abbreviations and keywords.') . '</p>' . + '<table border="1">' . + '<tr><th>' . WT_I18N::translate('Date') . '</th><th>' . WT_I18N::translate('Format') . '</th><th>' . WT_I18N::translate('Shortcut') . '</th></tr>' . + '<tr><td>' . $dates['1900'] . '</td><td><tt dir="ltr" lang="en">1900</tt></td><td></td></tr>' . + '<tr><td>' . $dates['JAN 1900'] . '<br>' . $dates['FEB 1900'] . '<br>' . $dates['MAR 1900'] . '<br>' . $dates['APR 1900'] . '<br>' . $dates['MAY 1900'] . '<br>' . $dates['JUN 1900'] . '<br>' . $dates['JUL 1900'] . '<br>' . $dates['AUG 1900'] . '<br>' . $dates['SEP 1900'] . '<br>' . $dates['OCT 1900'] . '<br>' . $dates['NOV 1900'] . '<br>' . $dates['DEC 1900'] . '</td><td><tt dir="ltr" lang="en">JAN 1900<br>FEB 1900<br>MAR 1900<br>APR 1900<br>MAY 1900<br>JUN 1900<br>JUL 1900<br>AUG 1900<br>SEP 1900<br>OCT 1900<br>NOV 1900<br>DEC 1900</tt></td><td></td></tr>' . + '<tr><td>' . $dates['11 DEC 1913'] . '</td><td><tt dir="ltr" lang="en">11 DEC 1913</tt></td><td><tt dir="ltr" lang="en">' . $example1 . '</tt></td></tr>' . + '<tr><td>' . $dates['01 FEB 2003'] . '</td><td><tt dir="ltr" lang="en">01 FEB 2003</tt></td><td><tt dir="ltr" lang="en">' . $example2 . '</tt></td></tr>' . + '<tr><td>' . $dates['ABT 1900'] . '</td><td><tt dir="ltr" lang="en">ABT 1900</tt></td><td><tt dir="ltr" lang="en">~1900</tt></td></tr>' . + '<tr><td>' . $dates['EST 1900'] . '</td><td><tt dir="ltr" lang="en">EST 1900</tt></td><td><tt dir="ltr" lang="en">*1900</tt></td></tr>' . + '<tr><td>' . $dates['CAL 1900'] . '</td><td><tt dir="ltr" lang="en">CAL 1900</tt></td><td><tt dir="ltr" lang="en">#1900</tt></td></tr>' . + '<tr><td>' . $dates['INT 1900 (...)'] . '</td><td><tt dir="ltr" lang="en">INT 1900 (...)</tt></td><td></td></tr>' . + '</table>' . + '<p>' . WT_I18N::translate('Date ranges are used to indicate that an event, such as a birth, happened on an unknown date within a possible range.') . '</p>' . + '<table border="1">' . + '<tr><th>' . WT_I18N::translate('Date range') . '</th><th>' . WT_I18N::translate('Format') . '</th><th>' . WT_I18N::translate('Shortcut') . '</th></tr>' . + '<tr><td>' . $dates['BET 1900 AND 1910'] . '</td><td><tt dir="ltr" lang="en">BET 1900 AND 1910</tt></td><td><tt dir="ltr" lang="en">1900-1910</tt></td></tr>' . + '<tr><td>' . $dates['AFT 1900'] . '</td><td><tt dir="ltr" lang="en">AFT 1900</tt></td><td><tt dir="ltr" lang="en">>1900</tt></td></tr>' . + '<tr><td>' . $dates['BEF 1910'] . '</td><td><tt dir="ltr" lang="en">BEF 1910</tt></td><td><tt dir="ltr" lang="en"><1910</tt></td></tr>' . + '<tr><td>' . $dates['BET JAN 1900 AND MAR 1900'] . '</td><td><tt dir="ltr" lang="en">BET JAN 1900 AND MAR 1900</tt></td><td><tt dir="ltr" lang="en">Q1 1900</tt></td></tr>' . + '<tr><td>' . $dates['BET APR 1900 AND JUN 1900'] . '</td><td><tt dir="ltr" lang="en">BET APR 1900 AND JUN 1900</tt></td><td><tt dir="ltr" lang="en">Q2 1900</tt></td></tr>' . + '<tr><td>' . $dates['BET JUL 1900 AND SEP 1900'] . '</td><td><tt dir="ltr" lang="en">BET JUL 1900 AND SEP 1900</tt></td><td><tt dir="ltr" lang="en">Q3 1900</tt></td></tr>' . + '<tr><td>' . $dates['BET OCT 1900 AND DEC 1900'] . '</td><td><tt dir="ltr" lang="en">BET OCT 1900 AND DEC 1900</tt></td><td><tt dir="ltr" lang="en">Q4 1900</tt></td></tr>' . + '</table>' . + '<p>' . WT_I18N::translate('Date periods are used to indicate that a fact, such as an occupation, continued for a period of time.') . '</p>' . + '<table border="1">' . + '<tr><th>' . WT_I18N::translate('Date period') . '</th><th>' . WT_I18N::translate('Format') . '</th><th>' . WT_I18N::translate('Shortcut') . '</th></tr>' . + '<tr><td>' . $dates['FROM 1900 TO 1910'] . '</td><td><tt dir="ltr" lang="en">FROM 1900 TO 1910</tt></td><td><tt dir="ltr" lang="en">1900~1910</tt></td></tr>' . + '<tr><td>' . $dates['FROM 1900'] . '</td><td><tt dir="ltr" lang="en">FROM 1900</tt></td><td><tt dir="ltr" lang="en">1900-</tt></td></tr>' . + '<tr><td>' . $dates['TO 1910'] . '</td><td><tt dir="ltr" lang="en">TO 1910</tt></td><td><tt dir="ltr" lang="en">-1900</tt></td></tr>' . + '</table>' . + '<p>' . WT_I18N::translate('Simple dates are assumed to be in the gregorian calendar. To specify a date in another calendar, add a keyword before the date. This keyword is optional if the month or year format make the date unambiguous.') . '</p>' . + '<table border="1">' . + '<tr><th>' . WT_I18N::translate('Date') . '</th><th>' . WT_I18N::translate('Format') . '</th></tr>' . + '<tr><td colspan="2" align="center">' . WT_I18N::translate('Julian') . '</td></tr>' . + '<tr><td>' . $dates['@#DJULIAN@ 14 JAN 1700'] . '</td><td><tt dir="ltr" lang="en">@#DJULIAN@ 14 JAN 1700</tt></td></tr>' . + '<tr><td>' . $dates['@#DJULIAN@ 44 B.C.'] . '</td><td><tt dir="ltr" lang="en">@#DJULIAN@ 44 B.C.</tt></td></tr>' . + '<tr><td>' . $dates['@#DJULIAN@ 20 FEB 1742/43'] . '</td><td><tt dir="ltr" lang="en">@#DJULIAN@ 20 FEB 1742/43</tt></td></tr>' . + '<tr><td>' . $dates['BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752'] . '</td><td><tt dir="ltr" lang="en">BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752</tt></td></tr>' . + '<tr><td colspan="2" align="center">' . WT_I18N::translate('Jewish') . '</td></tr>' . + '<tr><td>' . $dates['@#DHEBREW@ 5481'] . '</td><td><tt dir="ltr" lang="en">@#DHEBREW@ 5481</tt></td></tr>' . + '<tr><td>' . $dates['@#DHEBREW@ TSH 5481'] . '</td><td><tt dir="ltr" lang="en">@#DHEBREW@ TSH 5481</tt></td></tr>' . + '<tr><td>' . $dates['ABT @#DHEBREW@ CSH 5481'] . '</td><td><tt dir="ltr" lang="en">ABT @#DHEBREW@ CSH 5481</tt></td></tr>' . + '<tr><td>' . $dates['BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481'] . '</td><td><tt dir="ltr" lang="en">BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481</tt></td></tr>' . + '<tr><td>' . $dates['FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481'] . '</td><td><tt dir="ltr" lang="en">FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481</tt></td></tr>' . + '<tr><td>' . $dates['AFT @#DHEBREW@ ADR 5481'] . '</td><td><tt dir="ltr" lang="en">AFT @#DHEBREW@ ADR 5481</tt></td></tr>' . + '<tr><td>' . $dates['AFT @#DHEBREW@ ADS 5480'] . '</td><td><tt dir="ltr" lang="en">AFT @#DHEBREW@ ADS 5480</tt></td></tr>' . + '<tr><td>' . $dates['BEF @#DHEBREW@ NSN 5481'] . '</td><td><tt dir="ltr" lang="en">BEF @#DHEBREW@ NSN 5481</tt></td></tr>' . + '<tr><td>' . $dates['ABT @#DHEBREW@ IYR 5481'] . '</td><td><tt dir="ltr" lang="en">ABT @#DHEBREW@ IYR 5481</tt></td></tr>' . + '<tr><td>' . $dates['FROM @#DHEBREW@ SVN 5481'] . '</td><td><tt dir="ltr" lang="en">FROM @#DHEBREW@ SVN 5481</tt></td></tr>' . + '<tr><td>' . $dates['TO @#DHEBREW@ TMZ 5481'] . '</td><td><tt dir="ltr" lang="en">TO @#DHEBREW@ TMZ 5481</tt></td></tr>' . + '<tr><td>' . $dates['EST @#DHEBREW@ AAV 5481'] . '</td><td><tt dir="ltr" lang="en">EST @#DHEBREW@ AAV 5481</tt></td></tr>' . + '<tr><td>' . $dates['@#DHEBREW@ 03 ELL 5481'] . '</td><td><tt dir="ltr" lang="en">@#DHEBREW@ 03 ELL 5481</tt></td></tr>' . + '<tr><td colspan="2" align="center">' . WT_I18N::translate('Hijri') . '</td></tr>' . + '<tr><td>' . $dates['@#DHIJRI@ 1497'] . '</td><td><tt dir="ltr" lang="en">@#DHIJRI@ 1497</tt></td></tr>' . + '<tr><td>' . $dates['@#DHIJRI@ MUHAR 1497'] . '</td><td><tt dir="ltr" lang="en">@#DHIJRI@ MUHAR 1497</tt></td></tr>' . + '<tr><td>' . $dates['ABT @#DHIJRI@ SAFAR 1497'] . '</td><td><tt dir="ltr" lang="en">ABT @#DHIJRI@ SAFAR 1497</tt></td></tr>' . + '<tr><td>' . $dates['BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497'] . '</td><td><tt dir="ltr" lang="en">BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497</tt></td></tr>' . + '<tr><td>' . $dates['FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497'] . '</td><td><tt dir="ltr" lang="en">FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497</tt></td></tr>' . + '<tr><td>' . $dates['AFT @#DHIJRI@ RAJAB 1497'] . '</td><td><tt dir="ltr" lang="en">AFT @#DHIJRI@ RAJAB 1497</tt></td></tr>' . + '<tr><td>' . $dates['BEF @#DHIJRI@ SHAAB 1497'] . '</td><td><tt dir="ltr" lang="en">BEF @#DHIJRI@ SHAAB 1497</tt></td></tr>' . + '<tr><td>' . $dates['ABT @#DHIJRI@ RAMAD 1497'] . '</td><td><tt dir="ltr" lang="en">ABT @#DHIJRI@ RAMAD 1497</tt></td></tr>' . + '<tr><td>' . $dates['FROM @#DHIJRI@ SHAWW 1497'] . '</td><td><tt dir="ltr" lang="en">FROM @#DHIJRI@ SHAWW 1497</tt></td></tr>' . + '<tr><td>' . $dates['TO @#DHIJRI@ DHUAQ 1497'] . '</td><td><tt dir="ltr" lang="en">TO @#DHIJRI@ DHUAQ 1497</tt></td></tr>' . + '<tr><td>' . $dates['@#DHIJRI@ 03 DHUAH 1497'] . '</td><td><tt dir="ltr" lang="en">@#DHIJRI@ 03 DHUAH 1497</tt></td></tr>' . + '<tr><td colspan="2" align="center">' . WT_I18N::translate('French') . '</td></tr>' . + '<tr><td>' . $dates['@#DFRENCH R@ 12'] . '</td><td><tt dir="ltr" lang="en">@#DFRENCH R@ 12</tt></td></tr>' . + '<tr><td>' . $dates['@#DFRENCH R@ VEND 12'] . '</td><td><tt dir="ltr" lang="en">@#DFRENCH R@ VEND 12</tt></td></tr>' . + '<tr><td>' . $dates['ABT @#DFRENCH R@ BRUM 12'] . '</td><td><tt dir="ltr" lang="en">ABT @#DFRENCH R@ BRUM 12</tt></td></tr>' . + '<tr><td>' . $dates['BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12'] . '</td><td><tt dir="ltr" lang="en">BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12</tt></td></tr>' . + '<tr><td>' . $dates['FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12'] . '</td><td><tt dir="ltr" lang="en">FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12</tt></td></tr>' . + '<tr><td>' . $dates['AFT @#DFRENCH R@ GERM 12'] . '</td><td><tt dir="ltr" lang="en">AFT @#DFRENCH R@ GERM 12</tt></td></tr>' . + '<tr><td>' . $dates['BEF @#DFRENCH R@ FLOR 12'] . '</td><td><tt dir="ltr" lang="en">BEF @#DFRENCH R@ FLOR 12</tt></td></tr>' . + '<tr><td>' . $dates['ABT @#DFRENCH R@ PRAI 12'] . '</td><td><tt dir="ltr" lang="en">ABT @#DFRENCH R@ PRAI 12</tt></td></tr>' . + '<tr><td>' . $dates['FROM @#DFRENCH R@ MESS 12'] . '</td><td><tt dir="ltr" lang="en">FROM @#DFRENCH R@ MESS 12</tt></td></tr>' . + '<tr><td>' . $dates['TO @#DFRENCH R@ THER 12'] . '</td><td><tt dir="ltr" lang="en">TO @#DFRENCH R@ THER 12</tt></td></tr>' . + '<tr><td>' . $dates['EST @#DFRENCH R@ FRUC 12'] . '</td><td><tt dir="ltr" lang="en">EST @#DFRENCH R@ FRUC 12</tt></td></tr>' . + '<tr><td>' . $dates['@#DFRENCH R@ 03 COMP 12'] . '</td><td><tt dir="ltr" lang="en">@#DFRENCH R@ 03 COMP 12</tt></td></tr>' . '</table>'; break; @@ -254,24 +254,24 @@ case 'EMAI': case 'EMAIL': case 'EMAL': case '_EMAIL': - $title=WT_Gedcom_Tag::getLabel('EMAIL'); - $text=WT_I18N::translate('Enter the email address.<br><br>An example email address looks like this: <b>name@hotmail.com</b> Leave this field blank if you do not want to include an email address.'); + $title = WT_Gedcom_Tag::getLabel('EMAIL'); + $text = WT_I18N::translate('Enter the email address.<br><br>An example email address looks like this: <b>name@hotmail.com</b> Leave this field blank if you do not want to include an email address.'); break; case 'FAX': - $title=WT_Gedcom_Tag::getLabel('FAX'); - $text=WT_I18N::translate('Enter the FAX number including the country and area code.<br><br>Leave this field blank if you do not want to include a FAX number. For example, a number in Germany might be +49 25859 56 76 89 and a number in USA or Canada might be +1 888 555-1212.'); + $title = WT_Gedcom_Tag::getLabel('FAX'); + $text = WT_I18N::translate('Enter the FAX number including the country and area code.<br><br>Leave this field blank if you do not want to include a FAX number. For example, a number in Germany might be +49 25859 56 76 89 and a number in USA or Canada might be +1 888 555-1212.'); break; case 'FORM': - $title=WT_Gedcom_Tag::getLabel('FORM'); - $text=WT_I18N::translate('This is an optional field that can be used to enter the file format of the media object. Some genealogy programs may look at this field to determine how to handle the item. However, since media do not transfer across computer systems very well, this field is not very important.'); + $title = WT_Gedcom_Tag::getLabel('FORM'); + $text = WT_I18N::translate('This is an optional field that can be used to enter the file format of the media object. Some genealogy programs may look at this field to determine how to handle the item. However, since media do not transfer across computer systems very well, this field is not very important.'); break; // This help text is used for all NAME components case 'NAME': - $title=WT_Gedcom_Tag::getLabel('NAME'); - $text= + $title = WT_Gedcom_Tag::getLabel('NAME'); + $text = '<p>' . WT_I18N::translate('The <b>name</b> field contains the individual’s full name, as they would have spelled it or as it was recorded. This is how it will be displayed on screen. It uses standard genealogical annotations to identify different parts of the name.') . '</p>' . @@ -291,111 +291,111 @@ case 'NAME': break; case 'SURN': - $title=WT_Gedcom_Tag::getLabel('SURN'); - $text='<p>' . + $title = WT_Gedcom_Tag::getLabel('SURN'); + $text = '<p>' . WT_I18N::translate('The <b>surname</b> field contains a name that is used for sorting and grouping. It can be different to the individual’s actual surname which is always taken from the <b>name</b> field. This field can be used to sort surnames with or without a prefix (Gogh / van Gogh) and to group spelling variations or inflections (Kowalski / Kowalska). If an individual needs to be listed under more than one surname, each name should be separated by a comma.') . '</p>'; break; case 'NOTE': - $title=WT_Gedcom_Tag::getLabel('NOTE'); - $text=WT_I18N::translate('Notes are free-form text and will appear in the Fact Details section of the page.'); + $title = WT_Gedcom_Tag::getLabel('NOTE'); + $text = WT_I18N::translate('Notes are free-form text and will appear in the Fact Details section of the page.'); break; case 'OBJE': - $title=WT_Gedcom_Tag::getLabel('OBJE'); - $text= - '<p>'. - WT_I18N::translate('A media object is a record in the family tree which contains information about a media file. This information may include a title, a copyright notice, a transcript, privacy restrictions, etc. The media file, such as the photo or video, can be stored locally (on this webserver) or remotely (on a different webserver).'). + $title = WT_Gedcom_Tag::getLabel('OBJE'); + $text = + '<p>' . + WT_I18N::translate('A media object is a record in the family tree which contains information about a media file. This information may include a title, a copyright notice, a transcript, privacy restrictions, etc. The media file, such as the photo or video, can be stored locally (on this webserver) or remotely (on a different webserver).') . '</p>'; break; case 'PAGE': - $title=WT_Gedcom_Tag::getLabel('PAGE'); - $text=WT_I18N::translate('In the citation details field you would enter the page number or other information that might help someone find the information in the source.'); + $title = WT_Gedcom_Tag::getLabel('PAGE'); + $text = WT_I18N::translate('In the citation details field you would enter the page number or other information that might help someone find the information in the source.'); break; case 'PEDI': - $title=WT_Gedcom_Tag::getLabel('PEDI'); - $text=WT_I18N::translate('A child may have more than one set of parents. The relationship between the child and the parents can be biological, legal, or based on local culture and tradition. If no pedigree is specified, then a biological relationship will be assumed.'); + $title = WT_Gedcom_Tag::getLabel('PEDI'); + $text = WT_I18N::translate('A child may have more than one set of parents. The relationship between the child and the parents can be biological, legal, or based on local culture and tradition. If no pedigree is specified, then a biological relationship will be assumed.'); break; case 'PHON': - $title=WT_Gedcom_Tag::getLabel('PHON'); - $text=WT_I18N::translate('Enter the phone number including the country and area code.<br><br>Leave this field blank if you do not want to include a phone number. For example, a number in Germany might be +49 25859 56 76 89 and a number in USA or Canada might be +1 888 555-1212.'); + $title = WT_Gedcom_Tag::getLabel('PHON'); + $text = WT_I18N::translate('Enter the phone number including the country and area code.<br><br>Leave this field blank if you do not want to include a phone number. For example, a number in Germany might be +49 25859 56 76 89 and a number in USA or Canada might be +1 888 555-1212.'); break; case 'PLAC': - $title=WT_Gedcom_Tag::getLabel('PLAC'); - $text=WT_I18N::translate('Places should be entered according to the standards for genealogy. In genealogy, places are recorded with the most specific information about the place first and then working up to the least specific place last, using commas to separate the different place levels. The level at which you record the place information should represent the levels of government or church where vital records for that place are kept.<br><br>For example, a place like Salt Lake City would be entered as “Salt Lake City, Salt Lake, Utah, USA”.<br><br>Let’s examine each part of this place. The first part, “Salt Lake City,” is the city or township where the event occurred. In some countries, there may be municipalities or districts inside a city which are important to note. In that case, they should come before the city. The next part, “Salt Lake,” is the county. “Utah” is the state, and “USA” is the country. It is important to note each place because genealogical records are kept by the governments of each level.<br><br>If a level of the place is unknown, you should leave a space between the commas. Suppose, in the example above, you didn’t know the county for Salt Lake City. You should then record it like this: “Salt Lake City, , Utah, USA”. Suppose you only know that an individual was born in Utah. You would enter the information like this: “, , Utah, USA”. <br><br>You can use the <b>Find Place</b> link to help you find places that already exist in the database.'); + $title = WT_Gedcom_Tag::getLabel('PLAC'); + $text = WT_I18N::translate('Places should be entered according to the standards for genealogy. In genealogy, places are recorded with the most specific information about the place first and then working up to the least specific place last, using commas to separate the different place levels. The level at which you record the place information should represent the levels of government or church where vital records for that place are kept.<br><br>For example, a place like Salt Lake City would be entered as “Salt Lake City, Salt Lake, Utah, USA”.<br><br>Let’s examine each part of this place. The first part, “Salt Lake City,” is the city or township where the event occurred. In some countries, there may be municipalities or districts inside a city which are important to note. In that case, they should come before the city. The next part, “Salt Lake,” is the county. “Utah” is the state, and “USA” is the country. It is important to note each place because genealogical records are kept by the governments of each level.<br><br>If a level of the place is unknown, you should leave a space between the commas. Suppose, in the example above, you didn’t know the county for Salt Lake City. You should then record it like this: “Salt Lake City, , Utah, USA”. Suppose you only know that an individual was born in Utah. You would enter the information like this: “, , Utah, USA”. <br><br>You can use the <b>Find Place</b> link to help you find places that already exist in the database.'); break; case 'RELA': - $title=WT_Gedcom_Tag::getLabel('RELA'); - $text=WT_I18N::translate('Select a relationship name from the list. Selecting <b>Godfather</b> means: <i>This associate is the godfather of the current individual</i>.'); + $title = WT_Gedcom_Tag::getLabel('RELA'); + $text = WT_I18N::translate('Select a relationship name from the list. Selecting <b>Godfather</b> means: <i>This associate is the godfather of the current individual</i>.'); break; case 'RESN': - $title=WT_Gedcom_Tag::getLabel('RESN'); - $text= - WT_I18N::translate('Restrictions can be added to records and/or facts. They restrict who can view the data and who can edit it.'). - '<br><br>'. + $title = WT_Gedcom_Tag::getLabel('RESN'); + $text = + WT_I18N::translate('Restrictions can be added to records and/or facts. They restrict who can view the data and who can edit it.') . + '<br><br>' . WT_I18N::translate('Note that if a user account is linked to a record, then that user will always be able to view that record.'); break; case 'ROMN': - $title=WT_Gedcom_Tag::getLabel('ROMN'); - $text=WT_I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use a non-Latin alphabet such as Hebrew, Greek, Russian, Chinese, or Arabic to enter the name in the standard name fields, then you can use this field to enter the same name using the Latin alphabet. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Romanized”, it is not restricted to containing only characters based on the Latin alphabet. This might be of use with Japanese names, where three different alphabets may occur.'); + $title = WT_Gedcom_Tag::getLabel('ROMN'); + $text = WT_I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use a non-Latin alphabet such as Hebrew, Greek, Russian, Chinese, or Arabic to enter the name in the standard name fields, then you can use this field to enter the same name using the Latin alphabet. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Romanized”, it is not restricted to containing only characters based on the Latin alphabet. This might be of use with Japanese names, where three different alphabets may occur.'); break; case 'SEX': - $title=WT_Gedcom_Tag::getLabel('SEX'); - $text=WT_I18N::translate('Choose the appropriate gender from the drop-down list. The <b>unknown</b> option indicates that the gender is unknown.'); + $title = WT_Gedcom_Tag::getLabel('SEX'); + $text = WT_I18N::translate('Choose the appropriate gender from the drop-down list. The <b>unknown</b> option indicates that the gender is unknown.'); break; case 'SHARED_NOTE': - $title=WT_Gedcom_Tag::getLabel('SHARED_NOTE'); - $text=WT_I18N::translate('Shared notes are free-form text and will appear in the Fact Details section of the page.<br><br>Each shared note can be linked to more than one individual, family, source, or event.'); + $title = WT_Gedcom_Tag::getLabel('SHARED_NOTE'); + $text = WT_I18N::translate('Shared notes are free-form text and will appear in the Fact Details section of the page.<br><br>Each shared note can be linked to more than one individual, family, source, or event.'); break; case 'SOUR': - $title=WT_Gedcom_Tag::getLabel('SOUR'); - $text=WT_I18N::translate('This field allows you to change the source record that this fact’s source citation links to. This field takes a source ID. Beside the field will be listed the title of the current source ID. Use the <b>Find ID</b> link to look up the source’s ID number. To remove the entire citation, make this field blank.'); + $title = WT_Gedcom_Tag::getLabel('SOUR'); + $text = WT_I18N::translate('This field allows you to change the source record that this fact’s source citation links to. This field takes a source ID. Beside the field will be listed the title of the current source ID. Use the <b>Find ID</b> link to look up the source’s ID number. To remove the entire citation, make this field blank.'); break; case 'STAT': - $title=WT_Gedcom_Tag::getLabel('STAT'); - $text=WT_I18N::translate('This is an optional status field and is used mostly for LDS ordinances as they are run through the TempleReady program.'); + $title = WT_Gedcom_Tag::getLabel('STAT'); + $text = WT_I18N::translate('This is an optional status field and is used mostly for LDS ordinances as they are run through the TempleReady program.'); break; case 'TEMP': - $title=WT_Gedcom_Tag::getLabel('TEMP'); - $text=WT_I18N::translate('For LDS ordinances, this field records the temple where it was performed.'); + $title = WT_Gedcom_Tag::getLabel('TEMP'); + $text = WT_I18N::translate('For LDS ordinances, this field records the temple where it was performed.'); break; case 'TEXT': - $title=WT_Gedcom_Tag::getLabel('TEXT'); - $text=WT_I18N::translate('In this field you would enter the citation text for this source. Examples of data may be a transcription of the text from the source, or a description of what was in the citation.'); + $title = WT_Gedcom_Tag::getLabel('TEXT'); + $text = WT_I18N::translate('In this field you would enter the citation text for this source. Examples of data may be a transcription of the text from the source, or a description of what was in the citation.'); break; case 'TIME': - $title=WT_Gedcom_Tag::getLabel('TIME'); - $text=WT_I18N::translate('Enter the time for this event in 24-hour format with leading zeroes. Midnight is 00:00. Examples: 04:50 13:00 20:30.'); + $title = WT_Gedcom_Tag::getLabel('TIME'); + $text = WT_I18N::translate('Enter the time for this event in 24-hour format with leading zeroes. Midnight is 00:00. Examples: 04:50 13:00 20:30.'); break; case 'WWW': - $title=WT_Gedcom_Tag::getLabel('WWW'); - $text=WT_I18N::translate('Enter the URL address including the http://.<br><br>An example URL looks like this: <b>http://www.webtrees.net/</b>. Leave this field blank if you do not want to include a URL.'); + $title = WT_Gedcom_Tag::getLabel('WWW'); + $text = WT_I18N::translate('Enter the URL address including the http://.<br><br>An example URL looks like this: <b>http://www.webtrees.net/</b>. Leave this field blank if you do not want to include a URL.'); break; case '_HEB': - $title=WT_Gedcom_Tag::getLabel('_HEB'); - $text=WT_I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use the Latin alphabet to enter the name in the standard name fields, then you can use this field to enter the same name in the non-Latin alphabet such as Greek, Hebrew, Russian, Arabic, or Chinese. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Hebrew”, it is not restricted to containing only Hebrew characters.'); + $title = WT_Gedcom_Tag::getLabel('_HEB'); + $text = WT_I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use the Latin alphabet to enter the name in the standard name fields, then you can use this field to enter the same name in the non-Latin alphabet such as Greek, Hebrew, Russian, Arabic, or Chinese. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Hebrew”, it is not restricted to containing only Hebrew characters.'); break; case '_PRIM': - $title=WT_Gedcom_Tag::getLabel('_PRIM'); - $text=WT_I18N::translate('Use this field to signal that this media item is the highlighted or primary item for the individual it is attached to. The highlighted image is the one that will be used on charts and on the individual’s page.'); + $title = WT_Gedcom_Tag::getLabel('_PRIM'); + $text = WT_I18N::translate('Use this field to signal that this media item is the highlighted or primary item for the individual it is attached to. The highlighted image is the one that will be used on charts and on the individual’s page.'); break; ////////////////////////////////////////////////////////////////////////////// @@ -403,59 +403,59 @@ case '_PRIM': ////////////////////////////////////////////////////////////////////////////// case 'CHECK_MARRIAGE_RELATIONS': - $title=WT_I18N::translate('Check relationships by marriage'); - $text=WT_I18N::translate('When calculating relationships, this option controls whether webtrees will include spouses/partners as well as blood relatives.'); + $title = WT_I18N::translate('Check relationships by marriage'); + $text = WT_I18N::translate('When calculating relationships, this option controls whether webtrees will include spouses/partners as well as blood relatives.'); break; case 'MAX_DESCENDANCY_GENERATIONS': - $title=WT_I18N::translate('Maximum descendancy generations'); - $text=WT_I18N::translate('Set the maximum number of generations to display on descendancy charts.'); + $title = WT_I18N::translate('Maximum descendancy generations'); + $text = WT_I18N::translate('Set the maximum number of generations to display on descendancy charts.'); break; case 'PEDIGREE_LAYOUT': - $title=/* I18N: A site configuration setting */ WT_I18N::translate('Default pedigree chart layout'); - $text=/* I18N: Help text for the “Default pedigree chart layout” tree configuration setting */ WT_I18N::translate('This option indicates whether the pedigree chart should be generated in landscape or portrait mode.'); + $title = /* I18N: A site configuration setting */ WT_I18N::translate('Default pedigree chart layout'); + $text = /* I18N: Help text for the “Default pedigree chart layout” tree configuration setting */ WT_I18N::translate('This option indicates whether the pedigree chart should be generated in landscape or portrait mode.'); break; case 'PEDIGREE_SHOW_GENDER': - $title=WT_I18N::translate('Gender icon on charts'); - $text=WT_I18N::translate('This option controls whether or not to show the individual’s gender icon on charts.<br><br>Since the gender is also indicated by the color of the box, this option doesn’t conceal the gender. The option simply removes some duplicate information from the box.'); + $title = WT_I18N::translate('Gender icon on charts'); + $text = WT_I18N::translate('This option controls whether or not to show the individual’s gender icon on charts.<br><br>Since the gender is also indicated by the color of the box, this option doesn’t conceal the gender. The option simply removes some duplicate information from the box.'); break; case 'RELATIONSHIP_PATH_LENGTH': - $title=WT_I18N::translate('Restrict to immediate family'); - $text= - WT_I18N::translate('Where a user is associated to an individual record in a family tree and has a role of member, editor, or moderator, you can prevent them from accessing the details of distant, living relations. You specify the number of relationship steps that the user is allowed to see.'). - '<br><br>'. - WT_I18N::translate('For example, if you specify a path length of 2, the individual will be able to see their grandson (child, child), their aunt (parent, sibling), their step-daughter (spouse, child), but not their first cousin (parent, sibling, child).'). - '<br><br>'. + $title = WT_I18N::translate('Restrict to immediate family'); + $text = + WT_I18N::translate('Where a user is associated to an individual record in a family tree and has a role of member, editor, or moderator, you can prevent them from accessing the details of distant, living relations. You specify the number of relationship steps that the user is allowed to see.') . + '<br><br>' . + WT_I18N::translate('For example, if you specify a path length of 2, the individual will be able to see their grandson (child, child), their aunt (parent, sibling), their step-daughter (spouse, child), but not their first cousin (parent, sibling, child).') . + '<br><br>' . WT_I18N::translate('Note: longer path lengths require a lot of calculation, which can make your site run slowly for these users.'); break; case 'SHOW_EST_LIST_DATES': - $title=WT_I18N::translate('Estimated dates for birth and death'); - $text=WT_I18N::translate('This option controls whether or not to show estimated dates for birth and death instead of leaving blanks on individual lists and charts for individuals whose dates are not known.'); + $title = WT_I18N::translate('Estimated dates for birth and death'); + $text = WT_I18N::translate('This option controls whether or not to show estimated dates for birth and death instead of leaving blanks on individual lists and charts for individuals whose dates are not known.'); break; case 'SHOW_MEDIA_DOWNLOAD': - $title=WT_I18N::translate('Show download link in media viewer'); - $text=WT_I18N::translate('The Media Viewer can show a link which, when clicked, will download the media file to the local PC.<br><br>You may want to hide the download link for security reasons.'); + $title = WT_I18N::translate('Show download link in media viewer'); + $text = WT_I18N::translate('The Media Viewer can show a link which, when clicked, will download the media file to the local PC.<br><br>You may want to hide the download link for security reasons.'); break; case 'SHOW_PARENTS_AGE': - $title=WT_I18N::translate('Show age of parents next to child’s birthdate'); - $text=WT_I18N::translate('This option controls whether or not to show age of father and mother next to child’s birthdate on charts.'); + $title = WT_I18N::translate('Show age of parents next to child’s birthdate'); + $text = WT_I18N::translate('This option controls whether or not to show age of father and mother next to child’s birthdate on charts.'); break; case 'THUMBNAIL_WIDTH': - $title=WT_I18N::translate('Width of generated thumbnails'); - $text=WT_I18N::translate('This is the width (in pixels) that the program will use when automatically generating thumbnails. The default setting is 100.'); + $title = WT_I18N::translate('Width of generated thumbnails'); + $text = WT_I18N::translate('This is the width (in pixels) that the program will use when automatically generating thumbnails. The default setting is 100.'); break; case 'USE_RELATIONSHIP_PRIVACY': - $title=WT_I18N::translate('Use relationship privacy'); - $text=WT_I18N::translate('<b>No</b> means that authenticated users can see the details of all living individuals. <b>Yes</b> means that users can only see the private information of living individuals they are related to.<br><br>This option sets the default for all users who have access to this genealogical database. The administrator can override this option for individual users by editing the user’s account details.'); + $title = WT_I18N::translate('Use relationship privacy'); + $text = WT_I18N::translate('<b>No</b> means that authenticated users can see the details of all living individuals. <b>Yes</b> means that users can only see the private information of living individuals they are related to.<br><br>This option sets the default for all users who have access to this genealogical database. The administrator can override this option for individual users by editing the user’s account details.'); break; ////////////////////////////////////////////////////////////////////////////// @@ -463,121 +463,121 @@ case 'USE_RELATIONSHIP_PRIVACY': ////////////////////////////////////////////////////////////////////////////// case 'add_facts': - $title=WT_I18N::translate('Add a fact'); - $text=WT_I18N::translate('Here you can add a fact to the record being edited.<br><br>First choose a fact from the drop-down list, then click the <b>Add</b> button. All possible facts that you can add to the database are in that drop-down list.'); - $text.='<br><br>'; - $text.='<b>'.WT_I18N::translate('Add from clipboard').'</b>'; - $text.='<br><br>'; - $text.=WT_I18N::translate('webtrees allows you to copy up to 10 facts, with all their details, to a clipboard. This clipboard is different from the clippings cart that you can use to export portions of your database.<br><br>You can select any of the facts from the clipboard and copy the selected fact to the individual, family, media, source, or repository record currently being edited. However, you cannot copy facts of dissimilar record types. For example, you cannot copy a marriage fact to a source or an individual record since the marriage fact is associated only with family records.<br><br>This is very helpful when entering similar facts, such as census facts, for many individuals or families.'); + $title = WT_I18N::translate('Add a fact'); + $text = WT_I18N::translate('Here you can add a fact to the record being edited.<br><br>First choose a fact from the drop-down list, then click the <b>Add</b> button. All possible facts that you can add to the database are in that drop-down list.'); + $text .= '<br><br>'; + $text .= '<b>' . WT_I18N::translate('Add from clipboard') . '</b>'; + $text .= '<br><br>'; + $text .= WT_I18N::translate('webtrees allows you to copy up to 10 facts, with all their details, to a clipboard. This clipboard is different from the clippings cart that you can use to export portions of your database.<br><br>You can select any of the facts from the clipboard and copy the selected fact to the individual, family, media, source, or repository record currently being edited. However, you cannot copy facts of dissimilar record types. For example, you cannot copy a marriage fact to a source or an individual record since the marriage fact is associated only with family records.<br><br>This is very helpful when entering similar facts, such as census facts, for many individuals or families.'); break; case 'add_note': // This is a general help text for multiple pages - $title=WT_I18N::translate('Add a new note'); - $text=WT_I18N::translate('If you have a note to add to this record, this is the place to do so.<br><br>Just click the link, a window will open, and you can type your note. When you are finished typing, just click the button below the box, close the window, and that’s all.'); + $title = WT_I18N::translate('Add a new note'); + $text = WT_I18N::translate('If you have a note to add to this record, this is the place to do so.<br><br>Just click the link, a window will open, and you can type your note. When you are finished typing, just click the button below the box, close the window, and that’s all.'); break; case 'add_shared_note': // This is a general help text for multiple pages - $title=WT_I18N::translate('Add a new shared note'); - $text=WT_I18N::translate('When you click the <b>Add a new shared note</b> link, a new window will open. You can choose to link to an existing shared note, or you can create a new shared note and at the same time create a link to it.'); + $title = WT_I18N::translate('Add a new shared note'); + $text = WT_I18N::translate('When you click the <b>Add a new shared note</b> link, a new window will open. You can choose to link to an existing shared note, or you can create a new shared note and at the same time create a link to it.'); break; case 'add_source': // This is a general help text for multiple pages - $title=WT_I18N::translate('Add a new source citation'); - $text=WT_I18N::translate('Here you can add a source <b>Citation</b> to this record.<br><br>Just click the link, a window will open, and you can choose the source from the list (Find ID) or create a new source and then add the citation.<br><br>Adding sources is an important part of genealogy because it allows other researchers to verify where you obtained your information.'); + $title = WT_I18N::translate('Add a new source citation'); + $text = WT_I18N::translate('Here you can add a source <b>Citation</b> to this record.<br><br>Just click the link, a window will open, and you can choose the source from the list (Find ID) or create a new source and then add the citation.<br><br>Adding sources is an important part of genealogy because it allows other researchers to verify where you obtained your information.'); break; case 'annivers_year_select': - $title=WT_I18N::translate('Year input box'); - $text=WT_I18N::translate('This input box lets you change that year of the calendar. Type a year into the box and press <b>Enter</b> to change the calendar to that year.<br><br><b>Advanced features</b> for <b>View year</b><dl><dt><b>More than one year</b></dt><dd>You can search for dates in a range of years.<br><br>Year ranges are <u>inclusive</u>. This means that the date range extends from 1 January of the first year of the range to 31 December of the last year mentioned. Here are a few examples of year ranges:<br><br><b>1992-5</b> for all events from 1992 to 1995.<br><b>1972-89</b> for all events from 1972 to 1989.<br><b>1610-759</b> for all events from 1610 to 1759.<br><b>1880-1905</b> for all events from 1880 to 1905.<br><b>880-1105</b> for all events from 880 to 1105.<br><br>To see all the events in a given decade or century, you can use <b>?</b> in place of the final digits. For example, <b>197?</b> for all events from 1970 to 1979 or <b>16??</b> for all events from 1600 to 1699.<br><br>Selecting a range of years will change the calendar to the year view.</dd></dl>'); + $title = WT_I18N::translate('Year input box'); + $text = WT_I18N::translate('This input box lets you change that year of the calendar. Type a year into the box and press <b>Enter</b> to change the calendar to that year.<br><br><b>Advanced features</b> for <b>View year</b><dl><dt><b>More than one year</b></dt><dd>You can search for dates in a range of years.<br><br>Year ranges are <u>inclusive</u>. This means that the date range extends from 1 January of the first year of the range to 31 December of the last year mentioned. Here are a few examples of year ranges:<br><br><b>1992-5</b> for all events from 1992 to 1995.<br><b>1972-89</b> for all events from 1972 to 1989.<br><b>1610-759</b> for all events from 1610 to 1759.<br><b>1880-1905</b> for all events from 1880 to 1905.<br><b>880-1105</b> for all events from 880 to 1105.<br><br>To see all the events in a given decade or century, you can use <b>?</b> in place of the final digits. For example, <b>197?</b> for all events from 1970 to 1979 or <b>16??</b> for all events from 1600 to 1699.<br><br>Selecting a range of years will change the calendar to the year view.</dd></dl>'); break; case 'block_move_right': - $title=WT_I18N::translate('Move list entries'); - $text=WT_I18N::translate('Use these buttons to move an entry from one list to another.<br><br>Highlight the entry to be moved, and then click a button to move or copy that entry in the direction of the arrow. Use the <b>»</b> and <b>«</b> buttons to move the highlighted entry from the leftmost to the rightmost list or vice-versa. Use the <b>></b> and <b><</b> buttons to move the highlighted entry between the Available blocks list and the list to its right or left.<br><br>The entries in the Available Blocks list do not change, regardless of what you do with the Move right and Move left buttons. This is so because the same block can appear several times on the same page. The HTML block is a good example of why you might want to do this.'); + $title = WT_I18N::translate('Move list entries'); + $text = WT_I18N::translate('Use these buttons to move an entry from one list to another.<br><br>Highlight the entry to be moved, and then click a button to move or copy that entry in the direction of the arrow. Use the <b>»</b> and <b>«</b> buttons to move the highlighted entry from the leftmost to the rightmost list or vice-versa. Use the <b>></b> and <b><</b> buttons to move the highlighted entry between the Available blocks list and the list to its right or left.<br><br>The entries in the Available Blocks list do not change, regardless of what you do with the Move right and Move left buttons. This is so because the same block can appear several times on the same page. The HTML block is a good example of why you might want to do this.'); break; case 'block_move_up': - $title=WT_I18N::translate('Move list entries'); - $text=WT_I18N::translate('Use these buttons to re-arrange the order of the entries within the list. The blocks will be printed in the order in which they are listed.<br><br>Highlight the entry to be moved, and then click a button to move that entry up or down.'); + $title = WT_I18N::translate('Move list entries'); + $text = WT_I18N::translate('Use these buttons to re-arrange the order of the entries within the list. The blocks will be printed in the order in which they are listed.<br><br>Highlight the entry to be moved, and then click a button to move that entry up or down.'); break; case 'default_gedcom': - $title=WT_I18N::translate('Default family tree'); - $text=WT_I18N::translate('This option selects the family tree that is shown to visitors when they first arrive at the site.'); + $title = WT_I18N::translate('Default family tree'); + $text = WT_I18N::translate('This option selects the family tree that is shown to visitors when they first arrive at the site.'); break; case 'download_gedcom': - $title=WT_I18N::translate('Download family tree'); - $text=WT_I18N::translate('This option will download the family tree to a GEDCOM file on your computer.'); + $title = WT_I18N::translate('Download family tree'); + $text = WT_I18N::translate('This option will download the family tree to a GEDCOM file on your computer.'); break; case 'edit_add_ASSO': - $title=WT_I18N::translate('Add a new associate'); - $text=WT_I18N::translate('Add a new associate allows you to link a fact with an associated individual in the site. This is one way in which you might record that someone was the godfather of another individual.'); + $title = WT_I18N::translate('Add a new associate'); + $text = WT_I18N::translate('Add a new associate allows you to link a fact with an associated individual in the site. This is one way in which you might record that someone was the godfather of another individual.'); break; case 'edit_add_GEDFact_ASSISTED': - $title=WT_I18N::translate('GEDFact shared note assistant'); - $text=WT_I18N::translate('Clicking the “+” icon will open the GEDFact shared note assistant window.<br>Specific help will be found there.<br><br>When you click the “save” button, the ID of the shared note will be pasted here.'); + $title = WT_I18N::translate('GEDFact shared note assistant'); + $text = WT_I18N::translate('Clicking the “+” icon will open the GEDFact shared note assistant window.<br>Specific help will be found there.<br><br>When you click the “save” button, the ID of the shared note will be pasted here.'); break; case 'edit_add_NOTE': - $title=WT_I18N::translate('Add a new note'); - $text=WT_I18N::translate('This section allows you to add a new note to the fact that you are currently editing. Notes are free-form text and will appear in the Fact Details section of the page.'); + $title = WT_I18N::translate('Add a new note'); + $text = WT_I18N::translate('This section allows you to add a new note to the fact that you are currently editing. Notes are free-form text and will appear in the Fact Details section of the page.'); break; case 'edit_add_SHARED_NOTE': - $title=WT_I18N::translate('Add a new shared note'); - $text=WT_I18N::translate('Shared notes, like regular notes, are free-form text. Unlike regular notes, each shared note can be linked to more than one individual, family, source, or fact.<br><br>By clicking the appropriate icon, you can establish a link to an existing shared note or create a new shared note and at the same time link to it. If a link to an existing shared note has already been established, you can also edit that note’s contents.<br><ul><li><b>Link to an existing shared note</b><div style="padding-left:20px;">If you already know the ID number of the desired shared note, you can enter that number directly into the field.<br><br>When you click the <b>Find shared note</b> icon, you will be able to search the text of all existing shared notes and then choose one of them. The ID number of the chosen note will be entered into the field automatically.<br><br>You must click the <b>Add</b> button to update the original record.</div><br></li><li><b>Create a new shared note</b><div style="padding-left:20px;">When you click the <b>Create a new shared note</b> icon, a new window will open. You can enter the text of the new note as you wish. As with regular notes, you can enter URLs.<br><br>When you click the <b>Save</b> button, you will see a message with the ID number of the newly created shared note. You should click on this message to close the editing window and also copy that new ID number directly into the ID number field. If you just close the window, the newly created ID number will not be copied automatically.<br><br>You must click the <b>Add</b> button to update the original record.</div><br></li><li><b>Edit an existing shared note</b><div style="padding-left:20px;">When you click the <b>Edit shared note</b> icon, a new window will open. You can change the text of the existing shared note as you wish. As with regular notes, you can enter URLs.<br><br>When you click the <b>Save</b> button, the text of the shared note will be updated. You can close the window and then click the <b>Save</b> button again.<br><br>When you change the text of a shared note, your change will be reflected in all places to which that shared note is currently linked. New links that you establish after having made your change will also use the updated text.</div></li></ul>'); + $title = WT_I18N::translate('Add a new shared note'); + $text = WT_I18N::translate('Shared notes, like regular notes, are free-form text. Unlike regular notes, each shared note can be linked to more than one individual, family, source, or fact.<br><br>By clicking the appropriate icon, you can establish a link to an existing shared note or create a new shared note and at the same time link to it. If a link to an existing shared note has already been established, you can also edit that note’s contents.<br><ul><li><b>Link to an existing shared note</b><div style="padding-left:20px;">If you already know the ID number of the desired shared note, you can enter that number directly into the field.<br><br>When you click the <b>Find shared note</b> icon, you will be able to search the text of all existing shared notes and then choose one of them. The ID number of the chosen note will be entered into the field automatically.<br><br>You must click the <b>Add</b> button to update the original record.</div><br></li><li><b>Create a new shared note</b><div style="padding-left:20px;">When you click the <b>Create a new shared note</b> icon, a new window will open. You can enter the text of the new note as you wish. As with regular notes, you can enter URLs.<br><br>When you click the <b>Save</b> button, you will see a message with the ID number of the newly created shared note. You should click on this message to close the editing window and also copy that new ID number directly into the ID number field. If you just close the window, the newly created ID number will not be copied automatically.<br><br>You must click the <b>Add</b> button to update the original record.</div><br></li><li><b>Edit an existing shared note</b><div style="padding-left:20px;">When you click the <b>Edit shared note</b> icon, a new window will open. You can change the text of the existing shared note as you wish. As with regular notes, you can enter URLs.<br><br>When you click the <b>Save</b> button, the text of the shared note will be updated. You can close the window and then click the <b>Save</b> button again.<br><br>When you change the text of a shared note, your change will be reflected in all places to which that shared note is currently linked. New links that you establish after having made your change will also use the updated text.</div></li></ul>'); if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) { - $text.='<p class="warning">'.WT_I18N::translate('You should avoid using the vertical line character “|” in your notes. It is used internally by webtrees and may cause your note to display incorrectly.').'</p>'; + $text .= '<p class="warning">' . WT_I18N::translate('You should avoid using the vertical line character “|” in your notes. It is used internally by webtrees and may cause your note to display incorrectly.') . '</p>'; } break; case 'edit_add_SOUR': - $title=WT_I18N::translate('Add a new source citation'); - $text=WT_I18N::translate('This section allows you to add a new source citation to the fact that you are currently editing.<br><br>In the Source field you enter the ID for the source. Click the “Create a new source” link if you need to enter a new source. In the citation details field you would enter the page number or other information that might help someone find the information in the source. In the Text field you would enter the text transcription from the source.'); + $title = WT_I18N::translate('Add a new source citation'); + $text = WT_I18N::translate('This section allows you to add a new source citation to the fact that you are currently editing.<br><br>In the Source field you enter the ID for the source. Click the “Create a new source” link if you need to enter a new source. In the citation details field you would enter the page number or other information that might help someone find the information in the source. In the Text field you would enter the text transcription from the source.'); break; case 'edit_edit_raw': - $title=WT_I18N::translate('Edit raw GEDCOM'); - $text= - WT_I18N::translate('This page allows you to bypass the usual forms, and edit the underlying data directly. It is an advanced option, and you should not use it unless you understand the GEDCOM format. If you make a mistake here, it can be difficult to fix.'). - '<br><br>'. + $title = WT_I18N::translate('Edit raw GEDCOM'); + $text = + WT_I18N::translate('This page allows you to bypass the usual forms, and edit the underlying data directly. It is an advanced option, and you should not use it unless you understand the GEDCOM format. If you make a mistake here, it can be difficult to fix.') . + '<br><br>' . /* I18N: %s is a URL */ WT_I18N::translate('You can download a copy of the GEDCOM specification from %s.', '<a href="http://wiki.webtrees.net/w/images-en/Ged551-5.pdf">http://wiki.webtrees.net/w/images-en/Ged551-5.pdf</a>'); break; case 'edit_merge': - $title=WT_I18N::translate('Merge records'); - $text=WT_I18N::translate('This page will allow you to merge two GEDCOM records from the same GEDCOM file.<br><br>This is useful for individuals who have merged GEDCOMs and now have many individuals, families, and sources that are the same.<br><br>The page consists of three steps.<br><ol><li>You enter two GEDCOM IDs. The IDs <u>must</u> be of the same type. You cannot merge an individual and a family or family and source, for example.<br>In the <b>Merge To ID:</b> field enter the ID of the record you want to be the new record after the merge is complete.<br>In the <b>Merge From ID:</b> field enter the ID of the record whose information will be merged into the Merge To ID: record. This record will be deleted after the Merge.</li><li>You select what facts you want to keep from the two records when they are merged. Just click the checkboxes next to the ones you want to keep.</li><li>You inspect the results of the merge, just like with all other changes made online.</li></ol>Someone with Accept rights will have to authorize your changes to make them permanent.'); + $title = WT_I18N::translate('Merge records'); + $text = WT_I18N::translate('This page will allow you to merge two GEDCOM records from the same GEDCOM file.<br><br>This is useful for individuals who have merged GEDCOMs and now have many individuals, families, and sources that are the same.<br><br>The page consists of three steps.<br><ol><li>You enter two GEDCOM IDs. The IDs <u>must</u> be of the same type. You cannot merge an individual and a family or family and source, for example.<br>In the <b>Merge To ID:</b> field enter the ID of the record you want to be the new record after the merge is complete.<br>In the <b>Merge From ID:</b> field enter the ID of the record whose information will be merged into the Merge To ID: record. This record will be deleted after the Merge.</li><li>You select what facts you want to keep from the two records when they are merged. Just click the checkboxes next to the ones you want to keep.</li><li>You inspect the results of the merge, just like with all other changes made online.</li></ol>Someone with Accept rights will have to authorize your changes to make them permanent.'); break; case 'edit_SOUR_EVEN': - $title=WT_I18N::translate('Associate events with this source'); - $text=WT_I18N::translate('Each source records specific events, generally for a given date range and for a place jurisdiction. For example a Census records census events and church records record birth, marriage, and death events.<br><br>Select the events that are recorded by this source from the list of events provided. The date should be specified in a range format such as <i>FROM 1900 TO 1910</i>. The place jurisdiction is the name of the lowest jurisdiction that encompasses all lower-level places named in this source. For example, “Oneida, Idaho, USA” would be used as a source jurisdiction place for events occurring in the various towns within Oneida County. “Idaho, USA” would be the source jurisdiction place if the events recorded took place not only in Oneida County but also in other counties in Idaho.'); + $title = WT_I18N::translate('Associate events with this source'); + $text = WT_I18N::translate('Each source records specific events, generally for a given date range and for a place jurisdiction. For example a Census records census events and church records record birth, marriage, and death events.<br><br>Select the events that are recorded by this source from the list of events provided. The date should be specified in a range format such as <i>FROM 1900 TO 1910</i>. The place jurisdiction is the name of the lowest jurisdiction that encompasses all lower-level places named in this source. For example, “Oneida, Idaho, USA” would be used as a source jurisdiction place for events occurring in the various towns within Oneida County. “Idaho, USA” would be the source jurisdiction place if the events recorded took place not only in Oneida County but also in other counties in Idaho.'); break; case 'edituser_contact_meth': - $title=WT_I18N::translate('Contact method'); - $text=WT_I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.'); + $title = WT_I18N::translate('Contact method'); + $text = WT_I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.'); break; case 'edituser_gedcomid': - $title=WT_I18N::translate('Individual record'); - $text=WT_I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.'); + $title = WT_I18N::translate('Individual record'); + $text = WT_I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.'); break; case 'email': - $title=WT_I18N::translate('Email address'); - $text=WT_I18N::translate('This email address will be used to send you password reminders, site notifications, and messages from other family members who are registered on the site.'); + $title = WT_I18N::translate('Email address'); + $text = WT_I18N::translate('This email address will be used to send you password reminders, site notifications, and messages from other family members who are registered on the site.'); break; case 'export_gedcom': - $title=WT_I18N::translate('Export family tree'); - $text= + $title = WT_I18N::translate('Export family tree'); + $text = '<p>' . WT_I18N::translate('This option will save the family tree to a GEDCOM file on the server.') . '</p><p>' . @@ -587,43 +587,43 @@ case 'export_gedcom': break; case 'fambook_descent': - $title=WT_I18N::translate('Descendant generations'); - $text=WT_I18N::translate('This value determines the number of descendant generations of the root individual that will be printed in hourglass format.'); + $title = WT_I18N::translate('Descendant generations'); + $text = WT_I18N::translate('This value determines the number of descendant generations of the root individual that will be printed in hourglass format.'); break; case 'fan_width': - $title=WT_I18N::translate('Width'); - $text=WT_I18N::translate('Here you can change the diagram width from 50 percent to 300 percent. At 100 percent the output image is about 640 pixels wide.'); + $title = WT_I18N::translate('Width'); + $text = WT_I18N::translate('Here you can change the diagram width from 50 percent to 300 percent. At 100 percent the output image is about 640 pixels wide.'); break; case 'gedcom_news_archive': - $title=WT_I18N::translate('View archive'); - $text=WT_I18N::translate('To reduce the height of the News block, the administrator has hidden some articles. You can reveal these hidden articles by clicking the <b>View archive</b> link.'); + $title = WT_I18N::translate('View archive'); + $text = WT_I18N::translate('To reduce the height of the News block, the administrator has hidden some articles. You can reveal these hidden articles by clicking the <b>View archive</b> link.'); break; case 'gedcom_news_flag': - $title=WT_I18N::translate('Limit:'); - $text=WT_I18N::translate('Enter the limiting value here.<br><br>If you have opted to limit the news article display according to age, any article older than the number of days entered here will be hidden from view. If you have opted to limit the news article display by number, only the specified number of recent articles, ordered by age, will be shown. The remaining articles will be hidden from view.<br><br>Zeros entered here will disable the limit, causing all news articles to be shown.'); + $title = WT_I18N::translate('Limit:'); + $text = WT_I18N::translate('Enter the limiting value here.<br><br>If you have opted to limit the news article display according to age, any article older than the number of days entered here will be hidden from view. If you have opted to limit the news article display by number, only the specified number of recent articles, ordered by age, will be shown. The remaining articles will be hidden from view.<br><br>Zeros entered here will disable the limit, causing all news articles to be shown.'); break; case 'gedcom_news_limit': - $title=WT_I18N::translate('Limit display by:'); - $text=WT_I18N::translate('You can limit the number of news articles displayed, thereby reducing the height of the GEDCOM News block.<br><br>This option determines whether any limits should be applied or whether the limit should be according to the age of the article or according to the number of articles.'); + $title = WT_I18N::translate('Limit display by:'); + $text = WT_I18N::translate('You can limit the number of news articles displayed, thereby reducing the height of the GEDCOM News block.<br><br>This option determines whether any limits should be applied or whether the limit should be according to the age of the article or according to the number of articles.'); break; case 'google_chart_surname': - $title=WT_I18N::translate('Surname'); - $text=WT_I18N::translate('The number of occurrences of the specified name will be shown on the map. If you leave this field empty, the most common surname will be used.'); + $title = WT_I18N::translate('Surname'); + $text = WT_I18N::translate('The number of occurrences of the specified name will be shown on the map. If you leave this field empty, the most common surname will be used.'); break; case 'header_favorites': - $title=WT_I18N::translate('Favorites'); - $text=WT_I18N::translate('The Favorites drop-down list shows the favorites that you have selected on your “My page”. It also shows the favorites that the site administrator has selected for the currently active GEDCOM. Clicking on one of the favorites entries will take you directly to the Individual Information page of that individual.<br><br>More help about adding favorites is available in your “My page”.'); + $title = WT_I18N::translate('Favorites'); + $text = WT_I18N::translate('The Favorites drop-down list shows the favorites that you have selected on your “My page”. It also shows the favorites that the site administrator has selected for the currently active GEDCOM. Clicking on one of the favorites entries will take you directly to the Individual Information page of that individual.<br><br>More help about adding favorites is available in your “My page”.'); break; case 'import_gedcom': - $title=WT_I18N::translate('Import family tree'); - $text= + $title = WT_I18N::translate('Import family tree'); + $text = '<p>' . WT_I18N::translate('This option deletes all the genealogy data in your family tree and replaces it with data from a GEDCOM file on the server.') . '</p><p>' . @@ -633,176 +633,176 @@ case 'import_gedcom': break; case 'include_media': - $title=WT_I18N::translate('Include media (automatically zips files)'); - $text=WT_I18N::translate('Select this option to include the media files associated with the records in your clippings cart. Choosing this option will automatically zip the files during download.'); + $title = WT_I18N::translate('Include media (automatically zips files)'); + $text = WT_I18N::translate('Select this option to include the media files associated with the records in your clippings cart. Choosing this option will automatically zip the files during download.'); break; case 'lifespan_chart': - $title=WT_I18N::translate('Lifespans'); - $text=WT_I18N::translate('On this chart you can display one or more individuals along a horizontal timeline. This chart allows you to see how the lives of different individuals overlapped.<br><br>You can add individuals to the chart individually or by family groups by their IDs. The previous list will be remembered as you add more individuals to the chart. You can clear the chart at any time with the <b>Clear chart</b> button.<br><br>You can also add individuals to the chart by searching for them by date range or locality.'); + $title = WT_I18N::translate('Lifespans'); + $text = WT_I18N::translate('On this chart you can display one or more individuals along a horizontal timeline. This chart allows you to see how the lives of different individuals overlapped.<br><br>You can add individuals to the chart individually or by family groups by their IDs. The previous list will be remembered as you add more individuals to the chart. You can clear the chart at any time with the <b>Clear chart</b> button.<br><br>You can also add individuals to the chart by searching for them by date range or locality.'); break; case 'next_path': - $title=WT_I18N::translate('Find the next relationship path'); - $text=WT_I18N::translate('You can click this button to see whether there is another relationship path between the two individuals. Previously found paths can be displayed again by clicking the link with the path number.'); + $title = WT_I18N::translate('Find the next relationship path'); + $text = WT_I18N::translate('You can click this button to see whether there is another relationship path between the two individuals. Previously found paths can be displayed again by clicking the link with the path number.'); break; case 'no_update_CHAN': - $title=WT_I18N::translate('Do not update the “last change” record'); - $text=WT_I18N::translate('Administrators sometimes need to clean up and correct the data submitted by users. For example, they might need to correct the PLAC location to include the country. When administrators make such corrections, information about the original change is normally replaced. This may not be desirable.<br><br>When this option is selected, webtrees will retain the original change information instead of replacing it with that of the current session. With this option selected, administrators also have the ability to modify or delete the information associated with the original CHAN tag.'); + $title = WT_I18N::translate('Do not update the “last change” record'); + $text = WT_I18N::translate('Administrators sometimes need to clean up and correct the data submitted by users. For example, they might need to correct the PLAC location to include the country. When administrators make such corrections, information about the original change is normally replaced. This may not be desirable.<br><br>When this option is selected, webtrees will retain the original change information instead of replacing it with that of the current session. With this option selected, administrators also have the ability to modify or delete the information associated with the original CHAN tag.'); break; case 'oldest_top': - $title=WT_I18N::translate('Show oldest top'); - $text=WT_I18N::translate('When this check box is checked, the chart will be printed with oldest individuals at the top. When it is unchecked, youngest individuals will appear at the top.'); + $title = WT_I18N::translate('Show oldest top'); + $text = WT_I18N::translate('When this check box is checked, the chart will be printed with oldest individuals at the top. When it is unchecked, youngest individuals will appear at the top.'); break; case 'password': - $title=WT_I18N::translate('Password'); - $text=WT_I18N::translate('Passwords must be at least 6 characters long and are case-sensitive, so that “secret” is different to “SECRET”.'); + $title = WT_I18N::translate('Password'); + $text = WT_I18N::translate('Passwords must be at least 6 characters long and are case-sensitive, so that “secret” is different to “SECRET”.'); break; case 'password_confirm': - $title=WT_I18N::translate('Confirm password'); - $text=WT_I18N::translate('Type your password again, to make sure you have typed it correctly.'); + $title = WT_I18N::translate('Confirm password'); + $text = WT_I18N::translate('Type your password again, to make sure you have typed it correctly.'); break; case 'pending_changes': - $title=WT_I18N::translate('Pending changes'); - $text= - '<p>'. - WT_I18N::translate('When you add, edit, or delete information, the changes are not saved immediately. Instead, they are kept in a “pending” area. These pending changes need to be reviewed by a moderator before they are accepted.'). - '</p><p>'. - WT_I18N::translate('This process allows the site’s owner to ensure that the new information follows the site’s standards and conventions, has proper source attributions, etc.'). - '</p><p>'. - WT_I18N::translate('Pending changes are only shown when your account has permission to edit. When you log out, you will no longer be able to see them. Also, pending changes are only shown on certain pages. For example, they are not shown in lists, reports, or search results.'). + $title = WT_I18N::translate('Pending changes'); + $text = + '<p>' . + WT_I18N::translate('When you add, edit, or delete information, the changes are not saved immediately. Instead, they are kept in a “pending” area. These pending changes need to be reviewed by a moderator before they are accepted.') . + '</p><p>' . + WT_I18N::translate('This process allows the site’s owner to ensure that the new information follows the site’s standards and conventions, has proper source attributions, etc.') . + '</p><p>' . + WT_I18N::translate('Pending changes are only shown when your account has permission to edit. When you log out, you will no longer be able to see them. Also, pending changes are only shown on certain pages. For example, they are not shown in lists, reports, or search results.') . '</p>'; if (Auth::isAdmin()) { - $text.= - '<p>'. - WT_I18N::translate('Each user account has an option to “automatically accept changes”. When this is enabled, any changes made by that user are saved immediately. Many administrators enable this for their own user account.'). + $text .= + '<p>' . + WT_I18N::translate('Each user account has an option to “automatically accept changes”. When this is enabled, any changes made by that user are saved immediately. Many administrators enable this for their own user account.') . '</p>'; } break; case 'ppp_view_records': - $title=WT_I18N::translate('View all records'); - $text=WT_I18N::translate('Clicking on this link will show you a list of all of the individuals and families that have events occurring in this place. When you get to the end of a place hierarchy, which is normally a town or city, the name list will be shown automatically.'); + $title = WT_I18N::translate('View all records'); + $text = WT_I18N::translate('Clicking on this link will show you a list of all of the individuals and families that have events occurring in this place. When you get to the end of a place hierarchy, which is normally a town or city, the name list will be shown automatically.'); break; case 'real_name': - $title=WT_I18N::translate('Real name'); - $text=WT_I18N::translate('This is your real name, as you would like it displayed on screen.'); + $title = WT_I18N::translate('Real name'); + $text = WT_I18N::translate('This is your real name, as you would like it displayed on screen.'); break; case 'register_comments': - $title=WT_I18N::translate('Comments'); - $text=WT_I18N::translate('Use this field to tell the site administrator why you are requesting an account and how you are related to the genealogy displayed on this site. You can also use this to enter any other comments you may have for the site administrator.'); + $title = WT_I18N::translate('Comments'); + $text = WT_I18N::translate('Use this field to tell the site administrator why you are requesting an account and how you are related to the genealogy displayed on this site. You can also use this to enter any other comments you may have for the site administrator.'); break; case 'register_gedcomid': - $title=WT_I18N::translate('Individual record'); - $text=WT_I18N::translate('Every individual in the database has a unique ID number on this site. If you know the ID number for your own record, please enter it here. If you don’t know your ID number or could not find it because of privacy settings, please provide enough information in the comments field to help the site administrator identify who you are on this site so that he can set the ID for you.'); + $title = WT_I18N::translate('Individual record'); + $text = WT_I18N::translate('Every individual in the database has a unique ID number on this site. If you know the ID number for your own record, please enter it here. If you don’t know your ID number or could not find it because of privacy settings, please provide enough information in the comments field to help the site administrator identify who you are on this site so that he can set the ID for you.'); break; case 'remove_person': - $title=WT_I18N::translate('Remove person'); - $text=WT_I18N::translate('Click this link to remove the individual from the timeline.'); + $title = WT_I18N::translate('Remove person'); + $text = WT_I18N::translate('Click this link to remove the individual from the timeline.'); break; case 'role': - $title=WT_I18N::translate('Role'); - $text= - WT_I18N::translate('A role is a set of access rights, which give permission to view data, change configuration settings, etc. Access rights are assigned to roles, and roles are granted to users. Each family tree can assign different access to each role, and users can have a different role in each family tree.'). - '<br><br>'. - '<dl>'. - '<dt>'.WT_I18N::translate('Visitor').'</dt><dd>'. - WT_I18N::translate('Everybody has this role, including visitors to the site and search engines.'). - '</dd>'. - '<dl>'. - '<dt>'.WT_I18N::translate('Member').'</dt><dd>'. - WT_I18N::translate('This role has all the permissions of the visitor role, plus any additional access granted by the family tree configuration.'). - '</dd>'. - '<dl>'. - '<dt>'.WT_I18N::translate('Editor').'</dt><dd>'. - WT_I18N::translate('This role has all the permissions of the member role, plus permission to add/change/delete data. Any changes will need to be approved by a moderator, unless the user has the “automatically accept changes” option enabled.'). - '</dd>'. - '<dl>'. - '<dt>'.WT_I18N::translate('Moderator').'</dt><dd>'. - WT_I18N::translate('This role has all the permissions of the editor role, plus permission to approve/reject changes made by other users.'). - '</dd>'. - '<dl>'. - '<dt>'.WT_I18N::translate('Manager').'</dt><dd>'. - WT_I18N::translate('This role has all the permissions of the moderator role, plus any additional access granted by the family tree configuration, plus permission to change the settings/configuration of a family tree.'). - '</dd>'. - '<dl>'. - '<dt>'.WT_I18N::translate('Administrator').'</dt><dd>'. - WT_I18N::translate('This role has all the permissions of the manager role in all family trees, plus permission to change the settings/configuration of the site, users, and modules.'). + $title = WT_I18N::translate('Role'); + $text = + WT_I18N::translate('A role is a set of access rights, which give permission to view data, change configuration settings, etc. Access rights are assigned to roles, and roles are granted to users. Each family tree can assign different access to each role, and users can have a different role in each family tree.') . + '<br><br>' . + '<dl>' . + '<dt>' . WT_I18N::translate('Visitor') . '</dt><dd>' . + WT_I18N::translate('Everybody has this role, including visitors to the site and search engines.') . + '</dd>' . + '<dl>' . + '<dt>' . WT_I18N::translate('Member') . '</dt><dd>' . + WT_I18N::translate('This role has all the permissions of the visitor role, plus any additional access granted by the family tree configuration.') . + '</dd>' . + '<dl>' . + '<dt>' . WT_I18N::translate('Editor') . '</dt><dd>' . + WT_I18N::translate('This role has all the permissions of the member role, plus permission to add/change/delete data. Any changes will need to be approved by a moderator, unless the user has the “automatically accept changes” option enabled.') . + '</dd>' . + '<dl>' . + '<dt>' . WT_I18N::translate('Moderator') . '</dt><dd>' . + WT_I18N::translate('This role has all the permissions of the editor role, plus permission to approve/reject changes made by other users.') . + '</dd>' . + '<dl>' . + '<dt>' . WT_I18N::translate('Manager') . '</dt><dd>' . + WT_I18N::translate('This role has all the permissions of the moderator role, plus any additional access granted by the family tree configuration, plus permission to change the settings/configuration of a family tree.') . + '</dd>' . + '<dl>' . + '<dt>' . WT_I18N::translate('Administrator') . '</dt><dd>' . + WT_I18N::translate('This role has all the permissions of the manager role in all family trees, plus permission to change the settings/configuration of the site, users, and modules.') . '</dd>'; break; case 'show_fact_sources': - $title=WT_I18N::translate('Show all sources'); - $text=WT_I18N::translate('When this option is checked, you can see all source or note records for this individual. When this option is unchecked, source or note records that are associated with other facts for this individual will not be shown.'); + $title = WT_I18N::translate('Show all sources'); + $text = WT_I18N::translate('When this option is checked, you can see all source or note records for this individual. When this option is unchecked, source or note records that are associated with other facts for this individual will not be shown.'); break; case 'show_spouse': - $title=WT_I18N::translate('Show spouses'); - $text=WT_I18N::translate('By default this chart does not show spouses for the descendants because it makes the chart harder to read and understand. Turning this option on will show spouses on the chart.'); + $title = WT_I18N::translate('Show spouses'); + $text = WT_I18N::translate('By default this chart does not show spouses for the descendants because it makes the chart harder to read and understand. Turning this option on will show spouses on the chart.'); break; case 'simple_filter': - $title=WT_I18N::translate('Simple search filter'); - $text=WT_I18N::translate('Simple search filter based on the characters entered, no wildcards are accepted.'); + $title = WT_I18N::translate('Simple search filter'); + $text = WT_I18N::translate('Simple search filter based on the characters entered, no wildcards are accepted.'); break; case 'upload_gedcom': - $title=WT_I18N::translate('Upload family tree'); - $text=WT_I18N::translate('This option deletes all the genealogy data in your family tree and replaces it with data from a GEDCOM file on your computer.'); + $title = WT_I18N::translate('Upload family tree'); + $text = WT_I18N::translate('This option deletes all the genealogy data in your family tree and replaces it with data from a GEDCOM file on your computer.'); break; case 'upload_media': - $title=WT_I18N::translate('Upload media files'); - $text=WT_I18N::translate('Upload one or more media files from your local computer. Media files can be pictures, video, audio, or other formats.'); + $title = WT_I18N::translate('Upload media files'); + $text = WT_I18N::translate('Upload one or more media files from your local computer. Media files can be pictures, video, audio, or other formats.'); break; case 'upload_server_file': - $title=WT_I18N::translate('Filename on server'); - $text=WT_I18N::translate('The media file you are uploading can be, and probably should be, named differently on the server than it is on your local computer. This is so because often the local filename has meaning to you but is much less meaningful to others visiting this site. Consider also the possibility that you and someone else both try to upload different files called “granny.jpg“.<br><br>In this field, you specify the new name of the file you are uploading. The name you enter here will also be used to name the thumbnail, which can be uploaded separately or generated automatically. You do not need to enter the filename extension (jpg, gif, pdf, doc, etc.)<br><br>Leave this field blank to keep the original name of the file you have uploaded from your local computer.'); + $title = WT_I18N::translate('Filename on server'); + $text = WT_I18N::translate('The media file you are uploading can be, and probably should be, named differently on the server than it is on your local computer. This is so because often the local filename has meaning to you but is much less meaningful to others visiting this site. Consider also the possibility that you and someone else both try to upload different files called “granny.jpg“.<br><br>In this field, you specify the new name of the file you are uploading. The name you enter here will also be used to name the thumbnail, which can be uploaded separately or generated automatically. You do not need to enter the filename extension (jpg, gif, pdf, doc, etc.)<br><br>Leave this field blank to keep the original name of the file you have uploaded from your local computer.'); break; case 'upload_server_folder': - $title=WT_I18N::translate('Folder name on server'); - $text= + $title = WT_I18N::translate('Folder name on server'); + $text = '<p>' . WT_I18N::translate('If you have a large number of media files, you can organize them into folders and subfolders.') . '</p>'; break; case 'upload_thumbnail_file': - $title=WT_I18N::translate('Thumbnail to upload'); - $text=WT_I18N::translate('Choose the thumbnail image that you want to upload. Although thumbnails can be generated automatically for images, you may wish to generate your own thumbnail, especially for other media types. For example, you can provide a still image from a video, or a photograph of the individual who made an audio recording.'); + $title = WT_I18N::translate('Thumbnail to upload'); + $text = WT_I18N::translate('Choose the thumbnail image that you want to upload. Although thumbnails can be generated automatically for images, you may wish to generate your own thumbnail, especially for other media types. For example, you can provide a still image from a video, or a photograph of the individual who made an audio recording.'); break; case 'useradmin_gedcomid': - $title=WT_I18N::translate('Individual record'); - $text=WT_I18N::translate('The individual record identifies the user in each family tree. Since a user can view the details of their individual record, this can only be set by an administrator. If the user does not have a record in a family tree, leave it empty.'); + $title = WT_I18N::translate('Individual record'); + $text = WT_I18N::translate('The individual record identifies the user in each family tree. Since a user can view the details of their individual record, this can only be set by an administrator. If the user does not have a record in a family tree, leave it empty.'); break; case 'username': - $title=WT_I18N::translate('Username'); - $text= - '<p>'. - WT_I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.'). - '</p><p>'. - WT_I18N::translate('Usernames may not contain the following characters: < > " %% { } ;'). + $title = WT_I18N::translate('Username'); + $text = + '<p>' . + WT_I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') . + '</p><p>' . + WT_I18N::translate('Usernames may not contain the following characters: < > " %% { } ;') . '</p>'; break; case 'zip': - $title=WT_I18N::translate('Zip clippings'); - $text=WT_I18N::translate('Select this option as to save your clippings in a ZIP file. For more information about ZIP files, please visit <a href="http://www.winzip.com" target="_blank">http://www.winzip.com</a>.'); + $title = WT_I18N::translate('Zip clippings'); + $text = WT_I18N::translate('Select this option as to save your clippings in a ZIP file. For more information about ZIP files, please visit <a href="http://www.winzip.com" target="_blank">http://www.winzip.com</a>.'); break; default: @@ -810,7 +810,7 @@ default: $text = WT_I18N::translate('The help text has not been written for this item.'); // If we've been called from a module, allow the module to provide the help text $mod = WT_Filter::get('mod', '[A-Za-z0-9_]+'); - if (array_key_exists($mod, WT_Module::getActiveModules()) && file_exists(WT_ROOT.WT_MODULES_DIR.$mod.'/help_text.php')) { + if (array_key_exists($mod, WT_Module::getActiveModules()) && file_exists(WT_ROOT . WT_MODULES_DIR . $mod . '/help_text.php')) { require WT_ROOT . WT_MODULES_DIR . $mod . '/help_text.php'; } break; diff --git a/includes/functions/functions_edit.php b/includes/functions/functions_edit.php index 9feeb17d04..04a33ab9d8 100644 --- a/includes/functions/functions_edit.php +++ b/includes/functions/functions_edit.php @@ -33,9 +33,9 @@ use WT\Auth; * * @return string */ -function edit_field_inline($name, $value, WT_Controller_Base $controller=null) { - $html='<span class="editable" id="' . $name . '">' . WT_Filter::escapeHtml($value) . '</span>'; - $js='jQuery("#' . $name . '").editable("' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'save.php", {submitdata: {csrf: WT_CSRF_TOKEN}, submit:" ' . /* I18N: button label */ WT_I18N::translate('save') . ' ", style:"inherit", placeholder: "'.WT_I18N::translate('click to edit').'"});'; +function edit_field_inline($name, $value, WT_Controller_Base $controller = null) { + $html = '<span class="editable" id="' . $name . '">' . WT_Filter::escapeHtml($value) . '</span>'; + $js = 'jQuery("#' . $name . '").editable("' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'save.php", {submitdata: {csrf: WT_CSRF_TOKEN}, submit:" ' . /* I18N: button label */ WT_I18N::translate('save') . ' ", style:"inherit", placeholder: "' . WT_I18N::translate('click to edit') . '"});'; if ($controller) { $controller->addInlineJavascript($js); @@ -55,9 +55,9 @@ function edit_field_inline($name, $value, WT_Controller_Base $controller=null) { * * @return string */ -function edit_text_inline($name, $value, WT_Controller_Base $controller=null) { - $html='<span class="editable" style="white-space:pre-wrap;" id="' . $name . '">' . WT_Filter::escapeHtml($value) . '</span>'; - $js='jQuery("#' . $name . '").editable("' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'save.php", {submitdata: {csrf: WT_CSRF_TOKEN}, submit:" ' . WT_I18N::translate('save') . ' ", style:"inherit", placeholder: "'.WT_I18N::translate('click to edit').'", type: "textarea", rows:4, cols:60 });'; +function edit_text_inline($name, $value, WT_Controller_Base $controller = null) { + $html = '<span class="editable" style="white-space:pre-wrap;" id="' . $name . '">' . WT_Filter::escapeHtml($value) . '</span>'; + $js = 'jQuery("#' . $name . '").editable("' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'save.php", {submitdata: {csrf: WT_CSRF_TOKEN}, submit:" ' . WT_I18N::translate('save') . ' ", style:"inherit", placeholder: "' . WT_I18N::translate('click to edit') . '", type: "textarea", rows:4, cols:60 });'; if ($controller) { $controller->addInlineJavascript($js); @@ -79,33 +79,33 @@ function edit_text_inline($name, $value, WT_Controller_Base $controller=null) { * * @return string */ -function select_edit_control($name, $values, $empty, $selected, $extra='') { +function select_edit_control($name, $values, $empty, $selected, $extra = '') { if (is_null($empty)) { - $html=''; + $html = ''; } else { if (empty($selected)) { - $html='<option value="" selected="selected">'.WT_Filter::escapeHtml($empty).'</option>'; + $html = '<option value="" selected="selected">' . WT_Filter::escapeHtml($empty) . '</option>'; } else { - $html='<option value="">'.WT_Filter::escapeHtml($empty).'</option>'; + $html = '<option value="">' . WT_Filter::escapeHtml($empty) . '</option>'; } } // A completely empty list would be invalid, and break various things if (empty($values) && empty($html)) { - $html='<option value=""></option>'; + $html = '<option value=""></option>'; } foreach ($values as $key => $value) { // PHP array keys are cast to integers! Cast them back - if ((string)$key === (string)$selected) { - $html.='<option value="'.WT_Filter::escapeHtml($key).'" selected="selected" dir="auto">'.WT_Filter::escapeHtml($value).'</option>'; + if ((string) $key === (string) $selected) { + $html .= '<option value="' . WT_Filter::escapeHtml($key) . '" selected="selected" dir="auto">' . WT_Filter::escapeHtml($value) . '</option>'; } else { - $html.='<option value="'.WT_Filter::escapeHtml($key).'" dir="auto">'.WT_Filter::escapeHtml($value).'</option>'; + $html .= '<option value="' . WT_Filter::escapeHtml($key) . '" dir="auto">' . WT_Filter::escapeHtml($value) . '</option>'; } } - if (substr($name, -2)=='[]') { + if (substr($name, -2) == '[]') { // id attribute is not used for arrays - return '<select name="'.$name.'" '.$extra.'>'.$html.'</select>'; + return '<select name="' . $name . '" ' . $extra . '>' . $html . '</select>'; } else { - return '<select id="'.$name.'" name="'.$name.'" '.$extra.'>'.$html.'</select>'; + return '<select id="' . $name . '" name="' . $name . '" ' . $extra . '>' . $html . '</select>'; } } @@ -120,19 +120,19 @@ function select_edit_control($name, $values, $empty, $selected, $extra='') { * * @return string */ -function select_edit_control_inline($name, $values, $empty, $selected, WT_Controller_Base $controller=null) { +function select_edit_control_inline($name, $values, $empty, $selected, WT_Controller_Base $controller = null) { if (!is_null($empty)) { // Push ''=>$empty onto the front of the array, maintaining keys - $tmp=array(''=>WT_Filter::escapeHtml($empty)); + $tmp = array(''=>WT_Filter::escapeHtml($empty)); foreach ($values as $key=>$value) { - $tmp[$key]=WT_Filter::escapeHtml($value); + $tmp[$key] = WT_Filter::escapeHtml($value); } - $values=$tmp; + $values = $tmp; } - $values['selected']=WT_Filter::escapeHtml($selected); + $values['selected'] = WT_Filter::escapeHtml($selected); - $html='<span class="editable" id="' . $name . '">' . (array_key_exists($selected, $values) ? $values[$selected] : '') . '</span>'; - $js='jQuery("#' . $name . '").editable("' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'save.php", {submitdata: {csrf: WT_CSRF_TOKEN}, type:"select", data:' . json_encode($values) . ', submit:" ' . WT_I18N::translate('save') . ' ", style:"inherit", placeholder: "'.WT_I18N::translate('click to edit').'", callback:function(value, settings) {jQuery(this).html(settings.data[value]);} });'; + $html = '<span class="editable" id="' . $name . '">' . (array_key_exists($selected, $values) ? $values[$selected] : '') . '</span>'; + $js = 'jQuery("#' . $name . '").editable("' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'save.php", {submitdata: {csrf: WT_CSRF_TOKEN}, type:"select", data:' . json_encode($values) . ', submit:" ' . WT_I18N::translate('save') . ' ", style:"inherit", placeholder: "' . WT_I18N::translate('click to edit') . '", callback:function(value, settings) {jQuery(this).html(settings.data[value]);} });'; if ($controller) { $controller->addInlineJavascript($js); @@ -158,7 +158,7 @@ function radio_buttons($name, $values, $selected, $extra = '') { foreach ($values as $key => $value) { $html .= '<label ' . $extra . '><input type="radio" name="' . $name . '" value="' . WT_Filter::escapeHtml($key) . '"'; // PHP array keys are cast to integers! Cast them back - if ((string)$key === (string)$selected) { + if ((string) $key === (string) $selected) { $html .= ' checked'; } $html .= '>' . WT_Filter::escapeHtml($value) . '</label>'; @@ -174,7 +174,7 @@ function radio_buttons($name, $values, $selected, $extra = '') { * * @return string */ -function edit_field_yes_no($name, $selected=false) { +function edit_field_yes_no($name, $selected = false) { return radio_buttons( $name, array(false=>WT_I18N::translate('no'), true=>WT_I18N::translate('yes')), $selected ); @@ -189,9 +189,9 @@ function edit_field_yes_no($name, $selected=false) { * * @return string */ -function edit_field_yes_no_inline($name, $selected=false, WT_Controller_Base $controller=null) { +function edit_field_yes_no_inline($name, $selected = false, WT_Controller_Base $controller = null) { return select_edit_control_inline( - $name, array(true=>WT_I18N::translate('yes'), false=>WT_I18N::translate('no')), null, (int)$selected, $controller + $name, array(true=>WT_I18N::translate('yes'), false=>WT_I18N::translate('no')), null, (int) $selected, $controller ); } @@ -204,8 +204,8 @@ function edit_field_yes_no_inline($name, $selected=false, WT_Controller_Base $co * * @return string */ -function checkbox($name, $is_checked=false, $extra='') { - return '<input type="checkbox" name="'.$name.'" value="1" '.($is_checked ? 'checked="checked" ' : '').$extra.'>'; +function checkbox($name, $is_checked = false, $extra = '') { + return '<input type="checkbox" name="' . $name . '" value="1" ' . ($is_checked ? 'checked="checked" ' : '') . $extra . '>'; } /** @@ -220,12 +220,12 @@ function checkbox($name, $is_checked=false, $extra='') { * * @return string */ -function two_state_checkbox($name, $is_checked=0, $extra='') { +function two_state_checkbox($name, $is_checked = 0, $extra = '') { return - '<input type="hidden" id="'.$name.'" name="'.$name.'" value="'.($is_checked?1:0).'">'. - '<input type="checkbox" name="'.$name.'-GUI-ONLY" value="1"'. - ($is_checked ? ' checked="checked"' : ''). - ' onclick="document.getElementById(\''.$name.'\').value=(this.checked?1:0);" '.$extra.'>'; + '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . ($is_checked ? 1 : 0) . '">' . + '<input type="checkbox" name="' . $name . '-GUI-ONLY" value="1"' . + ($is_checked ? ' checked="checked"' : '') . + ' onclick="document.getElementById(\'' . $name . '\').value=(this.checked?1:0);" ' . $extra . '>'; } /** @@ -241,11 +241,11 @@ function edit_language_checkboxes($field_prefix, $languages) { $i = 0; foreach (WT_I18N::installed_languages() as $code=>$name) { - $content = '<input type="checkbox" name="'.$field_prefix.$code.'" id="'.$field_prefix.$code.'"'; - if (strpos(",{$languages},", ",{$code},")!==false) { + $content = '<input type="checkbox" name="' . $field_prefix . $code . '" id="' . $field_prefix . $code . '"'; + if (strpos(",{$languages},", ",{$code},") !== false) { $content .= ' checked="checked"'; } - $content .= '><label for="'.$field_prefix.$code.'"> '.$name.'</label>'; + $content .= '><label for="' . $field_prefix . $code . '"> ' . $name . '</label>'; // print in three columns switch ($i % 3) { case 0: @@ -283,8 +283,8 @@ function edit_language_checkboxes($field_prefix, $languages) { * * @return string */ -function edit_field_access_level($name, $selected='', $extra='') { - $ACCESS_LEVEL=array( +function edit_field_access_level($name, $selected = '', $extra = '') { + $ACCESS_LEVEL = array( WT_PRIV_PUBLIC=>WT_I18N::translate('Show to visitors'), WT_PRIV_USER =>WT_I18N::translate('Show to members'), WT_PRIV_NONE =>WT_I18N::translate('Show to managers'), @@ -302,8 +302,8 @@ function edit_field_access_level($name, $selected='', $extra='') { * * @return string */ -function edit_field_resn($name, $selected='', $extra='') { - $RESN=array( +function edit_field_resn($name, $selected = '', $extra = '') { + $RESN = array( '' =>'', 'none' =>WT_I18N::translate('Show to visitors'), // Not valid GEDCOM, but very useful 'privacy' =>WT_I18N::translate('Show to members'), @@ -322,9 +322,9 @@ function edit_field_resn($name, $selected='', $extra='') { * * @return string */ -function edit_field_contact($name, $selected='', $extra='') { +function edit_field_contact($name, $selected = '', $extra = '') { // Different ways to contact the users - $CONTACT_METHODS=array( + $CONTACT_METHODS = array( 'messaging' =>WT_I18N::translate('Internal messaging'), 'messaging2'=>WT_I18N::translate('Internal messaging with emails'), 'messaging3'=>WT_I18N::translate('webtrees sends emails with no storage'), @@ -343,9 +343,9 @@ function edit_field_contact($name, $selected='', $extra='') { * * @return string */ -function edit_field_contact_inline($name, $selected='', WT_Controller_Base $controller=null) { +function edit_field_contact_inline($name, $selected = '', WT_Controller_Base $controller = null) { // Different ways to contact the users - $CONTACT_METHODS=array( + $CONTACT_METHODS = array( 'messaging' =>WT_I18N::translate('webtrees internal messaging'), 'messaging2'=>WT_I18N::translate('Internal messaging with emails'), 'messaging3'=>WT_I18N::translate('webtrees sends emails with no storage'), @@ -364,7 +364,7 @@ function edit_field_contact_inline($name, $selected='', WT_Controller_Base $cont * * @return string */ -function edit_field_language($name, $selected='', $extra='') { +function edit_field_language($name, $selected = '', $extra = '') { return select_edit_control($name, WT_I18N::installed_languages(), null, $selected, $extra); } @@ -377,7 +377,7 @@ function edit_field_language($name, $selected='', $extra='') { * * @return string */ -function edit_field_language_inline($name, $selected='', WT_Controller_Base $controller=null) { +function edit_field_language_inline($name, $selected = '', WT_Controller_Base $controller = null) { return select_edit_control_inline( $name, WT_I18N::installed_languages(), null, $selected, $controller ); @@ -394,10 +394,10 @@ function edit_field_language_inline($name, $selected='', WT_Controller_Base $con * * @return string */ -function edit_field_integers($name, $selected='', $min, $max, $extra='') { - $array=array(); - for ($i=$min; $i<=$max; ++$i) { - $array[$i]=WT_I18N::number($i); +function edit_field_integers($name, $selected = '', $min, $max, $extra = '') { + $array = array(); + for ($i = $min; $i <= $max; ++$i) { + $array[$i] = WT_I18N::number($i); } return select_edit_control($name, $array, null, $selected, $extra); } @@ -411,13 +411,13 @@ function edit_field_integers($name, $selected='', $min, $max, $extra='') { * * @return string */ -function edit_field_username($name, $selected='', $extra='') { - $all_users=WT_DB::prepare( +function edit_field_username($name, $selected = '', $extra = '') { + $all_users = WT_DB::prepare( "SELECT user_name, CONCAT_WS(' ', real_name, '-', user_name) FROM `##user` ORDER BY real_name" )->fetchAssoc(); // The currently selected user may not exist if ($selected && !array_key_exists($selected, $all_users)) { - $all_users[$selected]=$selected; + $all_users[$selected] = $selected; } return select_edit_control($name, $all_users, '-', $selected, $extra); @@ -433,7 +433,7 @@ function edit_field_username($name, $selected='', $extra='') { * * @return string */ -function edit_field_adop($name, $selected='', $extra='', WT_Individual $individual=null) { +function edit_field_adop($name, $selected = '', $extra = '', WT_Individual $individual = null) { return select_edit_control($name, WT_Gedcom_Code_Adop::getValues($individual), null, $selected, $extra); } @@ -447,7 +447,7 @@ function edit_field_adop($name, $selected='', $extra='', WT_Individual $individu * * @return string */ -function edit_field_pedi($name, $selected='', $extra='', WT_Individual $individual=null) { +function edit_field_pedi($name, $selected = '', $extra = '', WT_Individual $individual = null) { return select_edit_control($name, WT_Gedcom_Code_Pedi::getValues($individual), '', $selected, $extra); } @@ -461,7 +461,7 @@ function edit_field_pedi($name, $selected='', $extra='', WT_Individual $individu * * @return string */ -function edit_field_name_type($name, $selected='', $extra='', WT_Individual $individual=null) { +function edit_field_name_type($name, $selected = '', $extra = '', WT_Individual $individual = null) { return select_edit_control($name, WT_Gedcom_Code_Name::getValues($individual), '', $selected, $extra); } @@ -474,11 +474,11 @@ function edit_field_name_type($name, $selected='', $extra='', WT_Individual $ind * * @return string */ -function edit_field_rela($name, $selected='', $extra='') { - $rela_codes=WT_Gedcom_Code_Rela::getValues(); +function edit_field_rela($name, $selected = '', $extra = '') { + $rela_codes = WT_Gedcom_Code_Rela::getValues(); // The user is allowed to specify values that aren't in the list. if (!array_key_exists($selected, $rela_codes)) { - $rela_codes[$selected]=$selected; + $rela_codes[$selected] = $selected; } return select_edit_control($name, $rela_codes, '', $selected, $extra); } @@ -492,11 +492,11 @@ function edit_field_rela($name, $selected='', $extra='') { * @return string */ function remove_links($gedrec, $xref) { - $gedrec = preg_replace('/\n1 '.WT_REGEX_TAG.' @'.$xref.'@(\n[2-9].*)*/', '', $gedrec); - $gedrec = preg_replace('/\n2 '.WT_REGEX_TAG.' @'.$xref.'@(\n[3-9].*)*/', '', $gedrec); - $gedrec = preg_replace('/\n3 '.WT_REGEX_TAG.' @'.$xref.'@(\n[4-9].*)*/', '', $gedrec); - $gedrec = preg_replace('/\n4 '.WT_REGEX_TAG.' @'.$xref.'@(\n[5-9].*)*/', '', $gedrec); - $gedrec = preg_replace('/\n5 '.WT_REGEX_TAG.' @'.$xref.'@(\n[6-9].*)*/', '', $gedrec); + $gedrec = preg_replace('/\n1 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[2-9].*)*/', '', $gedrec); + $gedrec = preg_replace('/\n2 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[3-9].*)*/', '', $gedrec); + $gedrec = preg_replace('/\n3 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[4-9].*)*/', '', $gedrec); + $gedrec = preg_replace('/\n4 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[5-9].*)*/', '', $gedrec); + $gedrec = preg_replace('/\n5 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[6-9].*)*/', '', $gedrec); return $gedrec; } @@ -510,8 +510,8 @@ function remove_links($gedrec, $xref) { */ function print_calendar_popup($id) { return - ' <a href="#" onclick="cal_toggleDate(\'caldiv'.$id.'\', \''.$id.'\'); return false;" class="icon-button_calendar" title="'.WT_I18N::translate('Select a date').'"></a>'. - '<div id="caldiv'.$id.'" style="position:absolute;visibility:hidden;background-color:white;z-index:1000;"></div>'; + ' <a href="#" onclick="cal_toggleDate(\'caldiv' . $id . '\', \'' . $id . '\'); return false;" class="icon-button_calendar" title="' . WT_I18N::translate('Select a date') . '"></a>' . + '<div id="caldiv' . $id . '" style="position:absolute;visibility:hidden;background-color:white;z-index:1000;"></div>'; } /** @@ -520,7 +520,7 @@ function print_calendar_popup($id) { * @return string */ function print_addnewmedia_link($element_id) { - return '<a href="#" onclick="pastefield=document.getElementById(\''.$element_id.'\'); window.open(\'addmedia.php?action=showmediaform\', \'_blank\', edit_window_specs); return false;" class="icon-button_addmedia" title="'.WT_I18N::translate('Create a new media object').'"></a>'; + return '<a href="#" onclick="pastefield=document.getElementById(\'' . $element_id . '\'); window.open(\'addmedia.php?action=showmediaform\', \'_blank\', edit_window_specs); return false;" class="icon-button_addmedia" title="' . WT_I18N::translate('Create a new media object') . '"></a>'; } /** @@ -529,7 +529,7 @@ function print_addnewmedia_link($element_id) { * @return string */ function print_addnewrepository_link($element_id) { - return '<a href="#" onclick="addnewrepository(document.getElementById(\''.$element_id.'\')); return false;" class="icon-button_addrepository" title="'.WT_I18N::translate('Create a new repository').'"></a>'; + return '<a href="#" onclick="addnewrepository(document.getElementById(\'' . $element_id . '\')); return false;" class="icon-button_addrepository" title="' . WT_I18N::translate('Create a new repository') . '"></a>'; } /** @@ -538,7 +538,7 @@ function print_addnewrepository_link($element_id) { * @return string */ function print_addnewnote_link($element_id) { - return '<a href="#" onclick="addnewnote(document.getElementById(\''.$element_id.'\')); return false;" class="icon-button_addnote" title="'.WT_I18N::translate('Create a new shared note').'"></a>'; + return '<a href="#" onclick="addnewnote(document.getElementById(\'' . $element_id . '\')); return false;" class="icon-button_addnote" title="' . WT_I18N::translate('Create a new shared note') . '"></a>'; } /** @@ -547,7 +547,7 @@ function print_addnewnote_link($element_id) { * @return string */ function print_editnote_link($note_id) { - return '<a href="#" onclick="edit_note(\''.$note_id.'\'); return false;" class="icon-button_note" title="'.WT_I18N::translate('Edit shared note').'"></a>'; + return '<a href="#" onclick="edit_note(\'' . $note_id . '\'); return false;" class="icon-button_note" title="' . WT_I18N::translate('Edit shared note') . '"></a>'; } /** @@ -556,7 +556,7 @@ function print_editnote_link($note_id) { * @return string */ function print_addnewsource_link($element_id) { - return '<a href="#" onclick="addnewsource(document.getElementById(\''.$element_id.'\')); return false;" class="icon-button_addsource" title="'.WT_I18N::translate('Create a new source').'"></a>'; + return '<a href="#" onclick="addnewsource(document.getElementById(\'' . $element_id . '\')); return false;" class="icon-button_addsource" title="' . WT_I18N::translate('Create a new source') . '"></a>'; } /** @@ -589,18 +589,18 @@ function add_simple_tag( static $source_element_id; $subnamefacts = array("NPFX", "GIVN", "SPFX", "SURN", "NSFX", "_MARNM_SURN"); - preg_match('/^(?:(\d+) ('.WT_REGEX_TAG.') ?(.*))/', $tag, $match); + preg_match('/^(?:(\d+) (' . WT_REGEX_TAG . ') ?(.*))/', $tag, $match); list(, $level, $fact, $value) = $match; // element name : used to POST data - if ($level==0) { - if ($upperlevel) $element_name=$upperlevel . '_' . $fact; - else $element_name=$fact; // ex: OCCU - } else $element_name="text[]"; - if ($level==1) $main_fact=$fact; + if ($level == 0) { + if ($upperlevel) $element_name = $upperlevel . '_' . $fact; + else $element_name = $fact; // ex: OCCU + } else $element_name = "text[]"; + if ($level == 1) $main_fact = $fact; // element id : used by javascript functions - if ($level==0) + if ($level == 0) $element_id = $fact; else $element_id = $fact . Uuid::uuid4(); @@ -610,9 +610,9 @@ function add_simple_tag( // field value $islink = (substr($value, 0, 1) === '@' && substr($value, 0, 2) != '@#'); if ($islink) { - $value = trim(substr($tag, strlen($fact)+3), " @\r"); + $value = trim(substr($tag, strlen($fact) + 3), " @\r"); } else { - $value = substr($tag, strlen($fact)+3); + $value = substr($tag, strlen($fact) + 3); } if ($fact == 'REPO' || $fact == 'SOUR' || $fact == 'OBJE' || $fact == 'FAMC') $islink = true; @@ -624,12 +624,12 @@ function add_simple_tag( // label echo "<tr id=\"", $element_id, "_tr\" "; - if ($fact=="MAP" || ($fact=="LATI" || $fact=="LONG") && $value=='') { + if ($fact == "MAP" || ($fact == "LATI" || $fact == "LONG") && $value == '') { echo " style=\"display:none;\""; } echo " >"; - if (in_array($fact, $subnamefacts) || $fact=="LATI" || $fact=="LONG") { + if (in_array($fact, $subnamefacts) || $fact == "LATI" || $fact == "LONG") { echo "<td class=\"optionbox wrap width25\">"; } else { echo "<td class=\"descriptionbox wrap width25\">"; @@ -644,20 +644,20 @@ function add_simple_tag( if ($label) { echo $label; } elseif ($upperlevel) { - echo WT_Gedcom_Tag::getLabel($upperlevel.':'.$fact); + echo WT_Gedcom_Tag::getLabel($upperlevel . ':' . $fact); } else { echo WT_Gedcom_Tag::getLabel($fact); } // help link // If using GEDFact-assistant window - if ($action=="addnewnote_assisted") { + if ($action == "addnewnote_assisted") { // Do not print on GEDFact Assistant window } else { // Not all facts have help text. switch ($fact) { case 'FORM': - if ($upperlevel!='OBJE') { + if ($upperlevel != 'OBJE') { echo help_link($fact); } break; @@ -669,13 +669,13 @@ function add_simple_tag( } break; case 'NAME': - if ($upperlevel!='REPO') { + if ($upperlevel != 'REPO') { echo help_link($fact); } break; case 'ASSO': case '_ASSO': // Some apps (including webtrees) use "2 _ASSO", since "2 ASSO" is not strictly valid GEDCOM - if ($level==1) { + if ($level == 1) { echo help_link('ASSO_1'); } else { echo help_link('ASSO_2'); @@ -713,9 +713,9 @@ function add_simple_tag( } } // tag level - if ($level>0) { - if ($fact=='TEXT' && $level>1) { - echo "<input type=\"hidden\" name=\"glevels[]\" value=\"", $level-1, "\">"; + if ($level > 0) { + if ($fact == 'TEXT' && $level > 1) { + echo "<input type=\"hidden\" name=\"glevels[]\" value=\"", $level - 1, "\">"; echo "<input type=\"hidden\" name=\"islink[]\" value=\"0\">"; echo "<input type=\"hidden\" name=\"tag[]\" value=\"DATA\">"; //-- leave data text[] value empty because the following TEXT line will @@ -735,18 +735,18 @@ function add_simple_tag( } // retrieve linked NOTE - if ($fact=="NOTE" && $islink) { - $note1=WT_Note::getInstance($value); + if ($fact == "NOTE" && $islink) { + $note1 = WT_Note::getInstance($value); if ($note1) { - $noterec=$note1->getGedcom(); + $noterec = $note1->getGedcom(); preg_match("/$value/i", $noterec, $notematch); - $value=$notematch[0]; + $value = $notematch[0]; } } - if (in_array($fact, $emptyfacts) && ($value=='' || $value=='Y' || $value=='y')) { + if (in_array($fact, $emptyfacts) && ($value == '' || $value == 'Y' || $value == 'y')) { echo "<input type=\"hidden\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", $value, "\">"; - if ($level<=1) { + if ($level <= 1) { echo '<input type="checkbox" '; if ($value) { echo ' checked="checked"'; @@ -755,39 +755,39 @@ function add_simple_tag( echo WT_I18N::translate('yes'); } - } else if ($fact=="TEMP") { + } else if ($fact == "TEMP") { echo select_edit_control($element_name, WT_Gedcom_Code_Temp::templeNames(), WT_I18N::translate('No temple - living ordinance'), $value); - } else if ($fact=="ADOP") { + } else if ($fact == "ADOP") { echo edit_field_adop($element_name, $value, '', $person); - } else if ($fact=="PEDI") { + } else if ($fact == "PEDI") { echo edit_field_pedi($element_name, $value, '', $person); - } else if ($fact=='STAT') { + } else if ($fact == 'STAT') { echo select_edit_control($element_name, WT_Gedcom_Code_Stat::statusNames($upperlevel), '', $value); - } else if ($fact=='RELA') { + } else if ($fact == 'RELA') { echo edit_field_rela($element_name, strtolower($value)); - } else if ($fact=='QUAY') { + } else if ($fact == 'QUAY') { echo select_edit_control($element_name, WT_Gedcom_Code_Quay::getValues(), '', $value); - } else if ($fact=='_WT_USER') { + } else if ($fact == '_WT_USER') { echo edit_field_username($element_name, $value); - } else if ($fact=='RESN') { + } else if ($fact == 'RESN') { echo edit_field_resn($element_name, $value); - } else if ($fact=='_PRIM') { + } else if ($fact == '_PRIM') { echo '<select id="', $element_id, '" name="', $element_name, '" >'; echo '<option value=""></option>'; echo '<option value="Y"'; - if ($value=='Y') echo ' selected="selected"'; + if ($value == 'Y') echo ' selected="selected"'; echo '>', WT_I18N::translate('yes'), '</option>'; echo '<option value="N"'; - if ($value=='N') echo ' selected="selected"'; + if ($value == 'N') echo ' selected="selected"'; echo '>', WT_I18N::translate('no'), '</option>'; echo '</select>'; - } else if ($fact=='SEX') { + } else if ($fact == 'SEX') { echo '<select id="', $element_id, '" name="', $element_name, '"><option value="M"'; - if ($value=='M') echo ' selected="selected"'; + if ($value == 'M') echo ' selected="selected"'; echo '>', WT_I18N::translate('Male'), '</option><option value="F"'; - if ($value=='F') echo ' selected="selected"'; + if ($value == 'F') echo ' selected="selected"'; echo '>', WT_I18N::translate('Female'), '</option><option value="U"'; - if ($value=='U' || empty($value)) echo ' selected="selected"'; + if ($value == 'U' || empty($value)) echo ' selected="selected"'; echo '>', WT_I18N::translate_c('unknown gender', 'Unknown'), '</option></select>'; } else if ($fact == 'TYPE' && $level == '3') { //-- Build the selector for the Media 'TYPE' Fact @@ -804,19 +804,19 @@ function add_simple_tag( echo '>', $typeValue, '</option>'; } echo '</select>'; - } else if (($fact=='NAME' && $upperlevel!='REPO') || $fact=='_MARNM') { + } else if (($fact == 'NAME' && $upperlevel != 'REPO') || $fact == '_MARNM') { // Populated in javascript from sub-tags echo "<input type=\"hidden\" id=\"", $element_id, "\" name=\"", $element_name, "\" onchange=\"updateTextName('", $element_id, "');\" value=\"", WT_Filter::escapeHtml($value), "\" class=\"", $fact, "\">"; echo '<span id="', $element_id, '_display" dir="auto">', WT_Filter::escapeHtml($value), '</span>'; - echo ' <a href="#edit_name" onclick="convertHidden(\'', $element_id, '\'); return false;" class="icon-edit_indi" title="'.WT_I18N::translate('Edit name').'"></a>'; + echo ' <a href="#edit_name" onclick="convertHidden(\'', $element_id, '\'); return false;" class="icon-edit_indi" title="' . WT_I18N::translate('Edit name') . '"></a>'; } else { // textarea - if ($fact=='TEXT' || $fact=='ADDR' || ($fact=='NOTE' && !$islink)) { + if ($fact == 'TEXT' || $fact == 'ADDR' || ($fact == 'NOTE' && !$islink)) { echo "<textarea id=\"", $element_id, "\" name=\"", $element_name, "\" dir=\"auto\">", WT_Filter::escapeHtml($value), "</textarea><br>"; } else { // text // If using GEDFact-assistant window - if ($action=="addnewnote_assisted") { + if ($action == "addnewnote_assisted") { echo "<input type=\"text\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", WT_Filter::escapeHtml($value), "\" style=\"width:4.1em;\" dir=\"ltr\""; } else { echo "<input type=\"text\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", WT_Filter::escapeHtml($value), "\" dir=\"ltr\""; @@ -872,13 +872,13 @@ function add_simple_tag( echo '>'; } - $tmp_array = array('TYPE','TIME','NOTE','SOUR','REPO','OBJE','ASSO','_ASSO','AGE'); + $tmp_array = array('TYPE', 'TIME', 'NOTE', 'SOUR', 'REPO', 'OBJE', 'ASSO', '_ASSO', 'AGE'); // split PLAC - if ($fact=='PLAC') { + if ($fact == 'PLAC') { echo "<div id=\"", $element_id, "_pop\" style=\"display: inline;\">"; echo print_specialchar_link($element_id), ' ', print_findplace_link($element_id); - echo '<span onclick="jQuery(\'tr[id^=', $upperlevel,'_LATI],tr[id^=', $upperlevel,'_LONG],tr[id^=LATI],tr[id^=LONG]\').toggle(\'fast\'); return false;" class="icon-target" title="', WT_Gedcom_Tag::getLabel('LATI'), ' / ', WT_Gedcom_Tag::getLabel('LONG'), '"></span>'; + echo '<span onclick="jQuery(\'tr[id^=', $upperlevel, '_LATI],tr[id^=', $upperlevel, '_LONG],tr[id^=LATI],tr[id^=LONG]\').toggle(\'fast\'); return false;" class="icon-target" title="', WT_Gedcom_Tag::getLabel('LATI'), ' / ', WT_Gedcom_Tag::getLabel('LONG'), '"></span>'; echo '</div>'; if (array_key_exists('places_assistant', WT_Module::getActiveModules())) { places_assistant_WT_Module::setup_place_subfields($element_id); @@ -889,27 +889,27 @@ function add_simple_tag( } } // MARRiage TYPE : hide text field and show a selection list - if ($fact=='TYPE' && $level==2 && $tags[0]=='MARR') { + if ($fact == 'TYPE' && $level == 2 && $tags[0] == 'MARR') { echo '<script>'; echo "document.getElementById('", $element_id, "').style.display='none'"; echo '</script>'; echo "<select id=\"", $element_id, "_sel\" onchange=\"document.getElementById('", $element_id, "').value=this.value;\" >"; foreach (array("Unknown", "Civil", "Religious", "Partners") as $key) { - if ($key=="Unknown") echo "<option value=\"\""; + if ($key == "Unknown") echo "<option value=\"\""; else echo "<option value=\"", $key, "\""; - $a=strtolower($key); - $b=strtolower($value); + $a = strtolower($key); + $b = strtolower($value); if (@strpos($a, $b) !== false || @strpos($b, $a) !== false) { echo ' selected="selected"'; } - $tmp="MARR_".strtoupper($key); + $tmp = "MARR_" . strtoupper($key); echo ">", WT_Gedcom_Tag::getLabel($tmp), "</option>"; } echo "</select>"; } // NAME TYPE : hide text field and show a selection list - else if ($fact=='TYPE' && $level==0) { - $onchange = 'onchange="document.getElementById(\''.$element_id.'\').value=this.value;"'; + else if ($fact == 'TYPE' && $level == 0) { + $onchange = 'onchange="document.getElementById(\'' . $element_id . '\').value=this.value;"'; echo edit_field_name_type($element_name, $value, $onchange, $person); echo '<script>'; echo "document.getElementById('", $element_id, "').style.display='none';"; @@ -940,22 +940,22 @@ function add_simple_tag( case 'SOUR': echo print_findsource_link($element_id, $element_id . '_description'), ' ', print_addnewsource_link($element_id); //-- checkboxes to apply '1 SOUR' to BIRT/MARR/DEAT as '2 SOUR' - if ($level==1) { + if ($level == 1) { echo '<br>'; - if ($PREFER_LEVEL2_SOURCES==='0') { - $level1_checked=''; - $level2_checked=''; - } else if ($PREFER_LEVEL2_SOURCES==='1' || $PREFER_LEVEL2_SOURCES===true) { - $level1_checked=''; - $level2_checked=' checked="checked"'; + if ($PREFER_LEVEL2_SOURCES === '0') { + $level1_checked = ''; + $level2_checked = ''; + } else if ($PREFER_LEVEL2_SOURCES === '1' || $PREFER_LEVEL2_SOURCES === true) { + $level1_checked = ''; + $level2_checked = ' checked="checked"'; } else { - $level1_checked=' checked="checked"'; - $level2_checked=''; + $level1_checked = ' checked="checked"'; + $level2_checked = ''; } - if (strpos($bdm, 'B')!==false) { + if (strpos($bdm, 'B') !== false) { echo ' <input type="checkbox" name="SOUR_INDI" ', $level1_checked, ' value="1">'; echo WT_I18N::translate('Individual'); - if (preg_match_all('/('.WT_REGEX_TAG.')/', $QUICK_REQUIRED_FACTS, $matches)) { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) { foreach ($matches[1] as $match) { if (!in_array($match, explode('|', WT_EVENTS_DEAT))) { echo ' <input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="1">'; @@ -964,8 +964,8 @@ function add_simple_tag( } } } - if (strpos($bdm, 'D')!==false) { - if (preg_match_all('/('.WT_REGEX_TAG.')/', $QUICK_REQUIRED_FACTS, $matches)) { + if (strpos($bdm, 'D') !== false) { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) { foreach ($matches[1] as $match) { if (in_array($match, explode('|', WT_EVENTS_DEAT))) { echo ' <input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="1">'; @@ -974,10 +974,10 @@ function add_simple_tag( } } } - if (strpos($bdm, 'M')!==false) { + if (strpos($bdm, 'M') !== false) { echo ' <input type="checkbox" name="SOUR_FAM" ', $level1_checked, ' value="1">'; echo WT_I18N::translate('Family'); - if (preg_match_all('/('.WT_REGEX_TAG.')/', $QUICK_REQUIRED_FAMFACTS, $matches)) { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $QUICK_REQUIRED_FAMFACTS, $matches)) { foreach ($matches[1] as $match) { echo ' <input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="1">'; echo WT_Gedcom_Tag::getLabel($match); @@ -1057,7 +1057,7 @@ function add_simple_tag( } // pastable values - if ($fact=='FORM' && $upperlevel=='OBJE') print_autopaste_link($element_id, $FILE_FORM_accept); + if ($fact == 'FORM' && $upperlevel == 'OBJE') print_autopaste_link($element_id, $FILE_FORM_accept); echo '</div>', $extra, '</td></tr>'; return $element_id; @@ -1069,7 +1069,7 @@ function add_simple_tag( * @param string $tag * @param integer $level */ -function print_add_layer($tag, $level=2) { +function print_add_layer($tag, $level = 2) { global $FULL_SOURCES, $WT_TREE; switch ($tag) { @@ -1082,27 +1082,27 @@ function print_add_layer($tag, $level=2) { // 2 SOUR add_simple_tag($level . ' SOUR @'); // 3 PAGE - add_simple_tag(($level+1) . ' PAGE'); + add_simple_tag(($level + 1) . ' PAGE'); // 3 DATA // 4 TEXT - add_simple_tag(($level+2) . ' TEXT'); + add_simple_tag(($level + 2) . ' TEXT'); if ($FULL_SOURCES) { // 4 DATE - add_simple_tag(($level+2) . ' DATE', '', WT_Gedcom_Tag::getLabel('DATA:DATE')); + add_simple_tag(($level + 2) . ' DATE', '', WT_Gedcom_Tag::getLabel('DATA:DATE')); // 3 QUAY - add_simple_tag(($level+1) . ' QUAY'); + add_simple_tag(($level + 1) . ' QUAY'); } // 3 OBJE - add_simple_tag(($level+1) . ' OBJE'); + add_simple_tag(($level + 1) . ' OBJE'); // 3 SHARED_NOTE - add_simple_tag(($level+1) . ' SHARED_NOTE'); + add_simple_tag(($level + 1) . ' SHARED_NOTE'); echo '</table></div>'; break; case 'ASSO': case 'ASSO2': //-- Add a new ASSOciate - if ($tag=='ASSO') { + if ($tag == 'ASSO') { echo "<a href=\"#\" onclick=\"return expand_layer('newasso');\"><i id=\"newasso_img\" class=\"icon-plus\"></i> ", WT_I18N::translate('Add a new associate'), '</a>'; echo help_link('edit_add_ASSO'); echo '<br>'; @@ -1117,11 +1117,11 @@ function print_add_layer($tag, $level=2) { // 2 ASSO add_simple_tag($level . ' ASSO @'); // 3 RELA - add_simple_tag(($level+1) . ' RELA'); + add_simple_tag(($level + 1) . ' RELA'); // 3 NOTE - add_simple_tag(($level+1) . ' NOTE'); + add_simple_tag(($level + 1) . ' NOTE'); // 3 SHARED_NOTE - add_simple_tag(($level+1) . ' SHARED_NOTE'); + add_simple_tag(($level + 1) . ' SHARED_NOTE'); echo '</table></div>'; break; @@ -1182,7 +1182,7 @@ function addSimpleTags($fact) { global $ADVANCED_PLAC_FACTS, $nonplacfacts, $nondatefacts; // For new individuals, these facts default to "Y" - if ($fact=='MARR') { + if ($fact == 'MARR') { add_simple_tag("0 {$fact} Y"); } else { add_simple_tag("0 {$fact}"); @@ -1195,7 +1195,7 @@ function addSimpleTags($fact) { if (!in_array($fact, $nonplacfacts)) { add_simple_tag("0 PLAC", $fact, WT_Gedcom_Tag::getLabel("{$fact}:PLAC")); - if (preg_match_all('/('.WT_REGEX_TAG.')/', $ADVANCED_PLAC_FACTS, $match)) { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_PLAC_FACTS, $match)) { foreach ($match[1] as $tag) { add_simple_tag("0 {$tag}", $fact, WT_Gedcom_Tag::getLabel("{$fact}:PLAC:{$tag}")); } @@ -1214,24 +1214,24 @@ function addSimpleTags($fact) { function addNewName() { global $ADVANCED_NAME_FACTS, $WT_TREE; - $gedrec="\n1 NAME ".WT_Filter::post('NAME'); + $gedrec = "\n1 NAME " . WT_Filter::post('NAME'); - $tags=array('NPFX', 'GIVN', 'SPFX', 'SURN', 'NSFX'); + $tags = array('NPFX', 'GIVN', 'SPFX', 'SURN', 'NSFX'); - if (preg_match_all('/('.WT_REGEX_TAG.')/', $ADVANCED_NAME_FACTS, $match)) { - $tags=array_merge($tags, $match[1]); + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_NAME_FACTS, $match)) { + $tags = array_merge($tags, $match[1]); } // Paternal and Polish and Lithuanian surname traditions can also create a _MARNM $SURNAME_TRADITION = $WT_TREE->getPreference('SURNAME_TRADITION'); - if ($SURNAME_TRADITION=='paternal' || $SURNAME_TRADITION=='polish' || $SURNAME_TRADITION=='lithuanian') { - $tags[]='_MARNM'; + if ($SURNAME_TRADITION == 'paternal' || $SURNAME_TRADITION == 'polish' || $SURNAME_TRADITION == 'lithuanian') { + $tags[] = '_MARNM'; } foreach (array_unique($tags) as $tag) { - $TAG=WT_Filter::post($tag); + $TAG = WT_Filter::post($tag); if ($TAG) { - $gedrec.="\n2 {$tag} {$TAG}"; + $gedrec .= "\n2 {$tag} {$TAG}"; } } return $gedrec; @@ -1262,30 +1262,30 @@ function addNewFact($fact) { $FACT = WT_Filter::post($fact); $DATE = WT_Filter::post("{$fact}_DATE"); $PLAC = WT_Filter::post("{$fact}_PLAC"); - if ($DATE || $PLAC || $FACT && $FACT!='Y') { - if ($FACT && $FACT!='Y') { - $gedrec="\n1 {$fact} {$FACT}"; + if ($DATE || $PLAC || $FACT && $FACT != 'Y') { + if ($FACT && $FACT != 'Y') { + $gedrec = "\n1 {$fact} {$FACT}"; } else { - $gedrec="\n1 {$fact}"; + $gedrec = "\n1 {$fact}"; } if ($DATE) { - $gedrec.="\n2 DATE {$DATE}"; + $gedrec .= "\n2 DATE {$DATE}"; } if ($PLAC) { - $gedrec.="\n2 PLAC {$PLAC}"; + $gedrec .= "\n2 PLAC {$PLAC}"; - if (preg_match_all('/('.WT_REGEX_TAG.')/', $ADVANCED_PLAC_FACTS, $match)) { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_PLAC_FACTS, $match)) { foreach ($match[1] as $tag) { - $TAG=WT_Filter::post("{$fact}_{$tag}"); + $TAG = WT_Filter::post("{$fact}_{$tag}"); if ($TAG) { - $gedrec.="\n3 {$tag} {$TAG}"; + $gedrec .= "\n3 {$tag} {$TAG}"; } } } - $LATI=WT_Filter::post("{$fact}_LATI"); - $LONG=WT_Filter::post("{$fact}_LONG"); + $LATI = WT_Filter::post("{$fact}_LATI"); + $LONG = WT_Filter::post("{$fact}_LONG"); if ($LATI || $LONG) { - $gedrec.="\n3 MAP\n4 LATI {$LATI}\n4 LONG {$LONG}"; + $gedrec .= "\n3 MAP\n4 LATI {$LATI}\n4 LONG {$LONG}"; } } if (WT_Filter::postBool("SOUR_{$fact}")) { @@ -1293,7 +1293,7 @@ function addNewFact($fact) { } else { return $gedrec; } - } elseif ($FACT=='Y') { + } elseif ($FACT == 'Y') { if (WT_Filter::postBool("SOUR_{$fact}")) { return updateSOUR("\n1 {$fact} Y", 2); } else { @@ -1344,16 +1344,16 @@ function splitSOUR() { $inSOUR = false; - for ($i=0; $i<count($glevels); $i++) { + for ($i = 0; $i < count($glevels); $i++) { if ($inSOUR) { - if ($levelSOUR<$glevels[$i]) { + if ($levelSOUR < $glevels[$i]) { $dest = "S"; } else { $inSOUR = false; $dest = "R"; } } else { - if ($tag[$i]=="SOUR") { + if ($tag[$i] == "SOUR") { $inSOUR = true; $levelSOUR = $glevels[$i]; $dest = "S"; @@ -1361,7 +1361,7 @@ function splitSOUR() { $dest = "R"; } } - if ($dest=="S") { + if ($dest == "S") { $glevelsSOUR[] = $glevels[$i]; $tagSOUR[] = $tag[$i]; $islinkSOUR[] = $islink[$i]; @@ -1389,7 +1389,7 @@ function updateSOUR($inputRec, $levelOverride = 'no') { global $glevels, $tag, $islink, $text; global $glevelsSOUR, $tagSOUR, $islinkSOUR, $textSOUR; - if (count($tagSOUR)==0) { + if (count($tagSOUR) == 0) { return $inputRec; // No update required } @@ -1429,7 +1429,7 @@ function updateRest($inputRec, $levelOverride = 'no') { global $glevels, $tag, $islink, $text; global $glevelsRest, $tagRest, $islinkRest, $textRest; - if (count($tagRest)==0) { + if (count($tagRest) == 0) { return $inputRec; // No update required } @@ -1483,44 +1483,44 @@ function updateRest($inputRec, $levelOverride = 'no') { function handle_updates($newged, $levelOverride = 'no') { global $glevels, $islink, $tag, $uploaded_files, $text; - if ($levelOverride=="no" || count($glevels)==0) $levelAdjust = 0; + 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 // were incorrectly left intact. // The sub-records should be deleted. - if ($tag[$j]=="SOUR" && ($text[$j]=="@@" || $text[$j]=='')) { + if ($tag[$j] == "SOUR" && ($text[$j] == "@@" || $text[$j] == '')) { $text[$j] = ''; - $k = $j+1; - while (($k<count($glevels))&&($glevels[$k]>$glevels[$j])) { + $k = $j + 1; + while (($k < count($glevels)) && ($glevels[$k] > $glevels[$j])) { $text[$k] = ''; $k++; } } - if (trim($text[$j])!='') { + if (trim($text[$j]) != '') { $pass = true; } else { //-- for facts with empty values they must have sub records //-- this section checks if they have subrecords - $k=$j+1; - $pass=false; - while (($k<count($glevels))&&($glevels[$k]>$glevels[$j])) { - if ($text[$k]!='') { - if (($tag[$j]!="OBJE")||($tag[$k]=="FILE")) { - $pass=true; + $k = $j + 1; + $pass = false; + while (($k < count($glevels)) && ($glevels[$k] > $glevels[$j])) { + if ($text[$k] != '') { + if (($tag[$j] != "OBJE") || ($tag[$k] == "FILE")) { + $pass = true; break; } } - if (($tag[$k]=="FILE")&&(count($uploaded_files)>0)) { + if (($tag[$k] == "FILE") && (count($uploaded_files) > 0)) { $filename = array_shift($uploaded_files); if (!empty($filename)) { $text[$k] = $filename; - $pass=true; + $pass = true; break; } } @@ -1532,10 +1532,10 @@ function handle_updates($newged, $levelOverride = 'no') { //--- then write the line to the gedcom record //if ((($text[trim($j)]!='')||($pass==true)) && (strlen($text[$j]) > 0)) { //-- we have to let some emtpy text lines pass through... (DEAT, BIRT, etc) - if ($pass==true) { - $newline = $glevels[$j]+$levelAdjust.' '.$tag[$j]; + if ($pass == true) { + $newline = $glevels[$j] + $levelAdjust . ' ' . $tag[$j]; //-- check and translate the incoming dates - if ($tag[$j] == 'DATE' && $text[$j]!='') { + if ($tag[$j] == 'DATE' && $text[$j] != '') { } if ($text[$j] != '') { if ($islink[$j]) { @@ -1544,7 +1544,7 @@ function handle_updates($newged, $levelOverride = 'no') { $newline .= ' ' . $text[$j]; } } - $newged .= "\n".str_replace("\n", "\n" . (1 + substr($newline, 0, 1)) . ' CONT ', $newline); + $newged .= "\n" . str_replace("\n", "\n" . (1 + substr($newline, 0, 1)) . ' CONT ', $newline); } } @@ -1606,7 +1606,7 @@ function create_edit_form(WT_GedcomRecord $record, WT_Fact $fact) { $pid = $record->getXref(); - $tags=array(); + $tags = array(); $gedlines = explode("\n", $fact->getGedcom()); $linenum = 0; @@ -1627,58 +1627,58 @@ function create_edit_form(WT_GedcomRecord $record, WT_Fact $fact) { // NB add_missing_subtags() already takes care of the simple cases // where a level 1 tag is missing a level 2 tag. Here we only need to // handle the more complicated cases. - $expected_subtags=array( + $expected_subtags = array( 'SOUR'=>array('PAGE', 'DATA'), 'DATA'=>array('TEXT'), 'PLAC'=>array('MAP'), 'MAP' =>array('LATI', 'LONG') ); if ($FULL_SOURCES) { - $expected_subtags['SOUR'][]='QUAY'; - $expected_subtags['DATA'][]='DATE'; + $expected_subtags['SOUR'][] = 'QUAY'; + $expected_subtags['DATA'][] = 'DATE'; } - if (preg_match_all('/('.WT_REGEX_TAG.')/', $ADVANCED_PLAC_FACTS, $match)) { - $expected_subtags['PLAC']=array_merge($match[1], $expected_subtags['PLAC']); + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_PLAC_FACTS, $match)) { + $expected_subtags['PLAC'] = array_merge($match[1], $expected_subtags['PLAC']); } - $stack=array(0=>$level0type); + $stack = array(0=>$level0type); // Loop on existing tags : while (true) { // Keep track of our hierarchy, e.g. 1=>BIRT, 2=>PLAC, 3=>FONE - $stack[(int)$level]=$type; + $stack[(int) $level] = $type; // Merge them together, e.g. BIRT:PLAC:FONE - $label=implode(':', array_slice($stack, 1, $level)); + $label = implode(':', array_slice($stack, 1, $level)); $text = ''; - for ($j=2; $j<count($fields); $j++) { - if ($j>2) $text .= ' '; + 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)) { - $text.="\n".$cmatch[1]; + while (($i + 1 < count($gedlines)) && (preg_match("/" . ($level + 1) . " CONT ?(.*)/", $gedlines[$i + 1], $cmatch) > 0)) { + $text .= "\n" . $cmatch[1]; $i++; } - if ($type=="SOUR") { + if ($type == "SOUR") { $inSource = true; $levelSource = $level; - } elseif ($levelSource>=$level) { + } elseif ($levelSource >= $level) { $inSource = false; } - if ($type!="DATA" && $type!="CONT") { - $tags[]=$type; + if ($type != "DATA" && $type != "CONT") { + $tags[] = $type; $person = WT_Individual::getInstance($pid); - $subrecord = $level.' '.$type.' '.$text; - if ($inSource && $type=="DATE") { + $subrecord = $level . ' ' . $type . ' ' . $text; + if ($inSource && $type == "DATE") { add_simple_tag($subrecord, '', WT_Gedcom_Tag::getLabel($label, $person)); - } elseif (!$inSource && $type=="DATE") { + } elseif (!$inSource && $type == "DATE") { add_simple_tag($subrecord, $level1type, WT_Gedcom_Tag::getLabel($label, $person)); $add_date = false; - } elseif ($type=='STAT') { + } elseif ($type == 'STAT') { add_simple_tag($subrecord, $level1type, WT_Gedcom_Tag::getLabel($label, $person)); - } elseif ($level0type=='REPO') { + } elseif ($level0type == 'REPO') { $repo = WT_Repository::getInstance($pid); add_simple_tag($subrecord, $level0type, WT_Gedcom_Tag::getLabel($label, $repo)); } else { @@ -1687,21 +1687,21 @@ function create_edit_form(WT_GedcomRecord $record, WT_Fact $fact) { } // Get a list of tags present at the next level - $subtags=array(); - for ($ii=$i+1; isset($gedlines[$ii]) && preg_match('/^\s*(\d+)\s+(\S+)/', $gedlines[$ii], $mm) && $mm[1]>$level; ++$ii) - if ($mm[1]==$level+1) - $subtags[]=$mm[2]; + $subtags = array(); + for ($ii = $i + 1; isset($gedlines[$ii]) && preg_match('/^\s*(\d+)\s+(\S+)/', $gedlines[$ii], $mm) && $mm[1] > $level; ++$ii) + if ($mm[1] == $level + 1) + $subtags[] = $mm[2]; // Insert missing tags if (!empty($expected_subtags[$type])) { foreach ($expected_subtags[$type] as $subtag) { if (!in_array($subtag, $subtags)) { - if (!$inSource || $subtag!="DATA") { - add_simple_tag(($level+1).' '.$subtag, '', WT_Gedcom_Tag::getLabel("{$label}:{$subtag}")); + if (!$inSource || $subtag != "DATA") { + add_simple_tag(($level + 1) . ' ' . $subtag, '', WT_Gedcom_Tag::getLabel("{$label}:{$subtag}")); } if (!empty($expected_subtags[$subtag])) { foreach ($expected_subtags[$subtag] as $subsubtag) { - add_simple_tag(($level+2).' '.$subsubtag, '', WT_Gedcom_Tag::getLabel("{$label}:{$subtag}:{$subsubtag}")); + add_simple_tag(($level + 2) . ' ' . $subsubtag, '', WT_Gedcom_Tag::getLabel("{$label}:{$subtag}:{$subsubtag}")); } } } @@ -1709,10 +1709,10 @@ function create_edit_form(WT_GedcomRecord $record, WT_Fact $fact) { } // Awkward special cases - if ($level==2 && $type=='DATE' && in_array($level1type, $date_and_time) && !in_array('TIME', $subtags)) { + if ($level == 2 && $type == 'DATE' && in_array($level1type, $date_and_time) && !in_array('TIME', $subtags)) { add_simple_tag("3 TIME"); // TIME is NOT a valid 5.5.1 tag } - if ($level==2 && $type=='STAT' && WT_Gedcom_Code_Temp::isTagLDS($level1type) && !in_array('DATE', $subtags)) { + if ($level == 2 && $type == 'STAT' && WT_Gedcom_Code_Temp::isTagLDS($level1type) && !in_array('DATE', $subtags)) { add_simple_tag("3 DATE", '', WT_Gedcom_Tag::getLabel('STAT:DATE')); } @@ -1728,10 +1728,10 @@ function create_edit_form(WT_GedcomRecord $record, WT_Fact $fact) { } else { $level = 0; } - if ($level<=$glevel) break; + if ($level <= $glevel) break; } - if ($level1type!='_PRIM') { + if ($level1type != '_PRIM') { insert_missing_subtags($level1type, $add_date); } return $level1type; @@ -1743,39 +1743,39 @@ function create_edit_form(WT_GedcomRecord $record, WT_Fact $fact) { * @param string $level1tag the type of the level 1 gedcom record * @param boolean $add_date */ -function insert_missing_subtags($level1tag, $add_date=false) { +function insert_missing_subtags($level1tag, $add_date = false) { global $tags, $date_and_time, $level2_tags, $ADVANCED_PLAC_FACTS, $ADVANCED_NAME_FACTS; global $nondatefacts, $nonplacfacts; // handle MARRiage TYPE $type_val = ''; - if (substr($level1tag, 0, 5)=='MARR_') { + if (substr($level1tag, 0, 5) == 'MARR_') { $type_val = substr($level1tag, 5); $level1tag = 'MARR'; } foreach ($level2_tags as $key=>$value) { - if ($key=='DATE' && in_array($level1tag, $nondatefacts) || $key=='PLAC' && in_array($level1tag, $nonplacfacts)) { + if ($key == 'DATE' && in_array($level1tag, $nondatefacts) || $key == 'PLAC' && in_array($level1tag, $nonplacfacts)) { continue; } if (in_array($level1tag, $value) && !in_array($key, $tags)) { - if ($key=='TYPE') { - add_simple_tag('2 TYPE '.$type_val, $level1tag); - } elseif ($level1tag=='_TODO' && $key=='DATE') { - add_simple_tag('2 '.$key.' '.strtoupper(date('d M Y')), $level1tag); - } elseif ($level1tag=='_TODO' && $key=='_WT_USER') { - add_simple_tag('2 '.$key.' '.Auth::user()->getUserName(), $level1tag); - } else if ($level1tag=='TITL' && strstr($ADVANCED_NAME_FACTS, $key)!==false) { - add_simple_tag('2 '.$key, $level1tag); - } else if ($level1tag=='NAME' && strstr($ADVANCED_NAME_FACTS, $key)!==false) { - add_simple_tag('2 '.$key, $level1tag); - } else if ($level1tag!='TITL' && $level1tag!='NAME') { - add_simple_tag('2 '.$key, $level1tag); + if ($key == 'TYPE') { + add_simple_tag('2 TYPE ' . $type_val, $level1tag); + } elseif ($level1tag == '_TODO' && $key == 'DATE') { + add_simple_tag('2 ' . $key . ' ' . strtoupper(date('d M Y')), $level1tag); + } elseif ($level1tag == '_TODO' && $key == '_WT_USER') { + add_simple_tag('2 ' . $key . ' ' . Auth::user()->getUserName(), $level1tag); + } else if ($level1tag == 'TITL' && strstr($ADVANCED_NAME_FACTS, $key) !== false) { + add_simple_tag('2 ' . $key, $level1tag); + } else if ($level1tag == 'NAME' && strstr($ADVANCED_NAME_FACTS, $key) !== false) { + add_simple_tag('2 ' . $key, $level1tag); + } else if ($level1tag != 'TITL' && $level1tag != 'NAME') { + add_simple_tag('2 ' . $key, $level1tag); } // Add level 3/4 tags as appropriate switch ($key) { case 'PLAC': - if (preg_match_all('/('.WT_REGEX_TAG.')/', $ADVANCED_PLAC_FACTS, $match)) { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_PLAC_FACTS, $match)) { foreach ($match[1] as $tag) { add_simple_tag("3 $tag", '', WT_Gedcom_Tag::getLabel("{$level1tag}:PLAC:{$tag}")); } @@ -1805,21 +1805,21 @@ function insert_missing_subtags($level1tag, $add_date=false) { add_simple_tag('3 AGE'); break; case 'FAMC': - if ($level1tag=='ADOP') + if ($level1tag == 'ADOP') add_simple_tag('3 ADOP BOTH'); break; } - } elseif ($key=='DATE' && $add_date) { + } elseif ($key == 'DATE' && $add_date) { add_simple_tag('2 DATE', $level1tag, WT_Gedcom_Tag::getLabel("{$level1tag}:DATE")); } } // Do something (anything!) with unrecognized custom tags - if (substr($level1tag, 0, 1)=='_' && $level1tag!='_UID' && $level1tag!='_TODO') + if (substr($level1tag, 0, 1) == '_' && $level1tag != '_UID' && $level1tag != '_TODO') foreach (array('DATE', 'PLAC', 'ADDR', 'AGNC', 'TYPE', 'AGE') as $tag) if (!in_array($tag, $tags)) { add_simple_tag("2 {$tag}"); - if ($tag=='PLAC') { - if (preg_match_all('/('.WT_REGEX_TAG.')/', $ADVANCED_PLAC_FACTS, $match)) { + if ($tag == 'PLAC') { + if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_PLAC_FACTS, $match)) { foreach ($match[1] as $ptag) { add_simple_tag("3 $ptag", '', WT_Gedcom_Tag::getLabel("{$level1tag}:PLAC:{$ptag}")); } diff --git a/includes/functions/functions_import.php b/includes/functions/functions_import.php index a0f53f21ea..5165a7d83e 100644 --- a/includes/functions/functions_import.php +++ b/includes/functions/functions_import.php @@ -34,435 +34,435 @@ function reformat_record_import($rec) { global $WORD_WRAPPED_NOTES, $GEDCOM_MEDIA_PATH; // Strip out UTF8 formatting characters - $rec=str_replace(array(WT_UTF8_BOM, WT_UTF8_LRM, WT_UTF8_RLM), '', $rec); + $rec = str_replace(array(WT_UTF8_BOM, WT_UTF8_LRM, WT_UTF8_RLM), '', $rec); // Strip out mac/msdos line endings - $rec=preg_replace("/[\r\n]+/", "\n", $rec); + $rec = preg_replace("/[\r\n]+/", "\n", $rec); // Extract lines from the record; lines consist of: level + optional xref + tag + optional data - $num_matches=preg_match_all('/^[ \t]*(\d+)[ \t]*(@[^@]*@)?[ \t]*(\w+)[ \t]?(.*)$/m', $rec, $matches, PREG_SET_ORDER); + $num_matches = preg_match_all('/^[ \t]*(\d+)[ \t]*(@[^@]*@)?[ \t]*(\w+)[ \t]?(.*)$/m', $rec, $matches, PREG_SET_ORDER); // Process the record line-by-line - $newrec=''; + $newrec = ''; foreach ($matches as $n=>$match) { - list(, $level, $xref, $tag, $data)=$match; - $tag=strtoupper($tag); // Tags should always be upper case + list(, $level, $xref, $tag, $data) = $match; + $tag = strtoupper($tag); // Tags should always be upper case switch ($tag) { // Convert PGV tags to WT case '_PGVU': - $tag='_WT_USER'; + $tag = '_WT_USER'; break; case '_PGV_OBJS': - $tag='_WT_OBJE_SORT'; + $tag = '_WT_OBJE_SORT'; break; // Convert FTM-style "TAG_FORMAL_NAME" into "TAG". case 'ABBREVIATION': - $tag='ABBR'; + $tag = 'ABBR'; break; case 'ADDRESS': - $tag='ADDR'; + $tag = 'ADDR'; break; case 'ADDRESS1': - $tag='ADR1'; + $tag = 'ADR1'; break; case 'ADDRESS2': - $tag='ADR2'; + $tag = 'ADR2'; break; case 'ADDRESS3': - $tag='ADR3'; + $tag = 'ADR3'; break; case 'ADOPTION': - $tag='ADOP'; + $tag = 'ADOP'; break; case 'ADULT_CHRISTENING': - $tag='CHRA'; + $tag = 'CHRA'; break; case 'AFN': // AFN values are upper case - $data=strtoupper($data); + $data = strtoupper($data); break; case 'AGENCY': - $tag='AGNC'; + $tag = 'AGNC'; break; case 'ALIAS': - $tag='ALIA'; + $tag = 'ALIA'; break; case 'ANCESTORS': - $tag='ANCE'; + $tag = 'ANCE'; break; case 'ANCES_INTEREST': - $tag='ANCI'; + $tag = 'ANCI'; break; case 'ANNULMENT': - $tag='ANUL'; + $tag = 'ANUL'; break; case 'ASSOCIATES': - $tag='ASSO'; + $tag = 'ASSO'; break; case 'AUTHOR': - $tag='AUTH'; + $tag = 'AUTH'; break; case 'BAPTISM': - $tag='BAPM'; + $tag = 'BAPM'; break; case 'BAPTISM_LDS': - $tag='BAPL'; + $tag = 'BAPL'; break; case 'BAR_MITZVAH': - $tag='BARM'; + $tag = 'BARM'; break; case 'BAS_MITZVAH': - $tag='BASM'; + $tag = 'BASM'; break; case 'BIRTH': - $tag='BIRT'; + $tag = 'BIRT'; break; case 'BLESSING': - $tag='BLES'; + $tag = 'BLES'; break; case 'BURIAL': - $tag='BURI'; + $tag = 'BURI'; break; case 'CALL_NUMBER': - $tag='CALN'; + $tag = 'CALN'; break; case 'CASTE': - $tag='CAST'; + $tag = 'CAST'; break; case 'CAUSE': - $tag='CAUS'; + $tag = 'CAUS'; break; case 'CENSUS': - $tag='CENS'; + $tag = 'CENS'; break; case 'CHANGE': - $tag='CHAN'; + $tag = 'CHAN'; break; case 'CHARACTER': - $tag='CHAR'; + $tag = 'CHAR'; break; case 'CHILD': - $tag='CHIL'; + $tag = 'CHIL'; break; case 'CHILDREN_COUNT': - $tag='NCHI'; + $tag = 'NCHI'; break; case 'CHRISTENING': - $tag='CHR'; + $tag = 'CHR'; break; case 'CONCATENATION': - $tag='CONC'; + $tag = 'CONC'; break; case 'CONFIRMATION': - $tag='CONF'; + $tag = 'CONF'; break; case 'CONFIRMATION_LDS': - $tag='CONL'; + $tag = 'CONL'; break; case 'CONTINUED': - $tag='CONT'; + $tag = 'CONT'; break; case 'COPYRIGHT': - $tag='COPR'; + $tag = 'COPR'; break; case 'CORPORATE': - $tag='CORP'; + $tag = 'CORP'; break; case 'COUNTRY': - $tag='CTRY'; + $tag = 'CTRY'; break; case 'CREMATION': - $tag='CREM'; + $tag = 'CREM'; break; case 'DATE': // Preserve text from INT dates - if (strpos($data, '(')!==false) { - list($date, $text)=explode('(', $data, 2); - $text=' ('.$text; + if (strpos($data, '(') !== false) { + list($date, $text) = explode('(', $data, 2); + $text = ' (' . $text; } else { - $date=$data; - $text=''; + $date = $data; + $text = ''; } // Capitals - $date=strtoupper($date); + $date = strtoupper($date); // Temporarily add leading/trailing spaces, to allow efficient matching below - $date=" {$date} "; + $date = " {$date} "; // Ensure space digits and letters - $date=preg_replace('/([A-Z])(\d)/', '$1 $2', $date); - $date=preg_replace('/(\d)([A-Z])/', '$1 $2', $date); + $date = preg_replace('/([A-Z])(\d)/', '$1 $2', $date); + $date = preg_replace('/(\d)([A-Z])/', '$1 $2', $date); // Ensure space before/after calendar escapes - $date=preg_replace('/@#[^@]+@/', ' $0 ', $date); + $date = preg_replace('/@#[^@]+@/', ' $0 ', $date); // "BET." => "BET" - $date=preg_replace('/(\w\w)\./', '$1', $date); + $date = preg_replace('/(\w\w)\./', '$1', $date); // "CIR" => "ABT" - $date=str_replace(' CIR ', ' ABT ', $date); - $date=str_replace(' APX ', ' ABT ', $date); + $date = str_replace(' CIR ', ' ABT ', $date); + $date = str_replace(' APX ', ' ABT ', $date); // B.C. => BC (temporarily, to allow easier handling of ".") - $date=str_replace(' B.C. ', ' BC ', $date); + $date = str_replace(' B.C. ', ' BC ', $date); // "BET X - Y " => "BET X AND Y" - $date=preg_replace('/^(.* BET .+) - (.+)/', '$1 AND $2', $date); - $date=preg_replace('/^(.* FROM .+) - (.+)/', '$1 TO $2', $date); + $date = preg_replace('/^(.* BET .+) - (.+)/', '$1 AND $2', $date); + $date = preg_replace('/^(.* FROM .+) - (.+)/', '$1 TO $2', $date); // "@#ESC@ FROM X TO Y" => "FROM @#ESC@ X TO @#ESC@ Y" - $date=preg_replace('/^ +(@#[^@]+@) +FROM +(.+) +TO +(.+)/', ' FROM $1 $2 TO $1 $3', $date); - $date=preg_replace('/^ +(@#[^@]+@) +BET +(.+) +AND +(.+)/', ' BET $1 $2 AND $1 $3', $date); + $date = preg_replace('/^ +(@#[^@]+@) +FROM +(.+) +TO +(.+)/', ' FROM $1 $2 TO $1 $3', $date); + $date = preg_replace('/^ +(@#[^@]+@) +BET +(.+) +AND +(.+)/', ' BET $1 $2 AND $1 $3', $date); // "@#ESC@ AFT X" => "AFT @#ESC@ X" - $date=preg_replace('/^ +(@#[^@]+@) +(FROM|BET|TO|AND|BEF|AFT|CAL|EST|INT|ABT) +(.+)/', ' $2 $1 $3', $date); + $date = preg_replace('/^ +(@#[^@]+@) +(FROM|BET|TO|AND|BEF|AFT|CAL|EST|INT|ABT) +(.+)/', ' $2 $1 $3', $date); // Ignore any remaining punctuation, e.g. "14-MAY, 1900" => "14 MAY 1900" // (don't change "/" - it is used in NS/OS dates) - $date=preg_replace('/[.,:;-]/', ' ', $date); + $date = preg_replace('/[.,:;-]/', ' ', $date); // BC => B.C. - $date=str_replace(' BC ', ' B.C. ', $date); + $date = str_replace(' BC ', ' B.C. ', $date); // Append the "INT" text - $data=$date.$text; + $data = $date . $text; break; case 'DEATH': - $tag='DEAT'; + $tag = 'DEAT'; break; case '_DEGREE': - $tag='_DEG'; + $tag = '_DEG'; break; case 'DESCENDANTS': - $tag='DESC'; + $tag = 'DESC'; break; case 'DESCENDANT_INT': - $tag='DESI'; + $tag = 'DESI'; break; case 'DESTINATION': - $tag='DEST'; + $tag = 'DEST'; break; case 'DIVORCE': - $tag='DIV'; + $tag = 'DIV'; break; case 'DIVORCE_FILED': - $tag='DIVF'; + $tag = 'DIVF'; break; case 'EDUCATION': - $tag='EDUC'; + $tag = 'EDUC'; break; case 'EMIGRATION': - $tag='EMIG'; + $tag = 'EMIG'; break; case 'ENDOWMENT': - $tag='ENDL'; + $tag = 'ENDL'; break; case 'ENGAGEMENT': - $tag='ENGA'; + $tag = 'ENGA'; break; case 'EVENT': - $tag='EVEN'; + $tag = 'EVEN'; break; case 'FACSIMILE': - $tag='FAX'; + $tag = 'FAX'; break; case 'FAMILY': - $tag='FAM'; + $tag = 'FAM'; break; case 'FAMILY_CHILD': - $tag='FAMC'; + $tag = 'FAMC'; break; case 'FAMILY_FILE': - $tag='FAMF'; + $tag = 'FAMF'; break; case 'FAMILY_SPOUSE': - $tag='FAMS'; + $tag = 'FAMS'; break; case 'FIRST_COMMUNION': - $tag='FCOM'; + $tag = 'FCOM'; break; case '_FILE': - $tag='FILE'; + $tag = 'FILE'; break; case 'FORMAT': - $tag='FORM'; + $tag = 'FORM'; case 'FORM': // Consistent commas - $data=preg_replace('/ *, */', ', ', $data); + $data = preg_replace('/ *, */', ', ', $data); break; case 'GEDCOM': - $tag='GEDC'; + $tag = 'GEDC'; break; case 'GIVEN_NAME': - $tag='GIVN'; + $tag = 'GIVN'; break; case 'GRADUATION': - $tag='GRAD'; + $tag = 'GRAD'; break; case 'HEADER': - $tag='HEAD'; + $tag = 'HEAD'; case 'HEAD': // HEAD records don't have an XREF or DATA - if ($level=='0') { - $xref=''; - $data=''; + if ($level == '0') { + $xref = ''; + $data = ''; } break; case 'HUSBAND': - $tag='HUSB'; + $tag = 'HUSB'; break; case 'IDENT_NUMBER': - $tag='IDNO'; + $tag = 'IDNO'; break; case 'IMMIGRATION': - $tag='IMMI'; + $tag = 'IMMI'; break; case 'INDIVIDUAL': - $tag='INDI'; + $tag = 'INDI'; break; case 'LANGUAGE': - $tag='LANG'; + $tag = 'LANG'; break; case 'LATITUDE': - $tag='LATI'; + $tag = 'LATI'; break; case 'LONGITUDE': - $tag='LONG'; + $tag = 'LONG'; break; case 'MARRIAGE': - $tag='MARR'; + $tag = 'MARR'; break; case 'MARRIAGE_BANN': - $tag='MARB'; + $tag = 'MARB'; break; case 'MARRIAGE_COUNT': - $tag='NMR'; + $tag = 'NMR'; break; case 'MARR_CONTRACT': - $tag='MARC'; + $tag = 'MARC'; break; case 'MARR_LICENSE': - $tag='MARL'; + $tag = 'MARL'; break; case 'MARR_SETTLEMENT': - $tag='MARS'; + $tag = 'MARS'; break; case 'MEDIA': - $tag='MEDI'; + $tag = 'MEDI'; break; case '_MEDICAL': - $tag='_MDCL'; + $tag = '_MDCL'; break; case '_MILITARY_SERVICE': - $tag='_MILT'; + $tag = '_MILT'; break; case 'NAME': // Tidy up whitespace - $data=preg_replace('/ +/', ' ', trim($data)); + $data = preg_replace('/ +/', ' ', trim($data)); break; case 'NAME_PREFIX': - $tag='NPFX'; + $tag = 'NPFX'; break; case 'NAME_SUFFIX': - $tag='NSFX'; + $tag = 'NSFX'; break; case 'NATIONALITY': - $tag='NATI'; + $tag = 'NATI'; break; case 'NATURALIZATION': - $tag='NATU'; + $tag = 'NATU'; break; case 'NICKNAME': - $tag='NICK'; + $tag = 'NICK'; break; case 'OBJECT': - $tag='OBJE'; + $tag = 'OBJE'; break; case 'OCCUPATION': - $tag='OCCU'; + $tag = 'OCCU'; break; case 'ORDINANCE': - $tag='ORDI'; + $tag = 'ORDI'; break; case 'ORDINATION': - $tag='ORDN'; + $tag = 'ORDN'; break; case 'PEDIGREE': - $tag='PEDI'; + $tag = 'PEDI'; case 'PEDI': // PEDI values are lower case - $data=strtolower($data); + $data = strtolower($data); break; case 'PHONE': - $tag='PHON'; + $tag = 'PHON'; break; case 'PHONETIC': - $tag='FONE'; + $tag = 'FONE'; break; case 'PHY_DESCRIPTION': - $tag='DSCR'; + $tag = 'DSCR'; break; case 'PLACE': - $tag='PLAC'; + $tag = 'PLAC'; case 'PLAC': // Consistent commas - $data=preg_replace('/ *(،|,) */', ', ', $data); + $data = preg_replace('/ *(،|,) */', ', ', $data); // The Master Genealogist stores LAT/LONG data in the PLAC field, e.g. Pennsylvania, USA, 395945N0751013W if (preg_match('/(.*), (\d\d)(\d\d)(\d\d)([NS])(\d\d\d)(\d\d)(\d\d)([EW])$/', $data, $match)) { - $data= - $match[1]."\n". - ($level+1)." MAP\n". - ($level+2)." LATI ".($match[5].(round($match[2]+($match[3]/60)+($match[4]/3600),4)))."\n". - ($level+2)." LONG ".($match[9].(round($match[6]+($match[7]/60)+($match[8]/3600),4))); + $data = + $match[1] . "\n" . + ($level + 1) . " MAP\n" . + ($level + 2) . " LATI " . ($match[5] . (round($match[2] + ($match[3] / 60) + ($match[4] / 3600), 4))) . "\n" . + ($level + 2) . " LONG " . ($match[9] . (round($match[6] + ($match[7] / 60) + ($match[8] / 3600), 4))); } break; case 'POSTAL_CODE': - $tag='POST'; + $tag = 'POST'; break; case 'PROBATE': - $tag='PROB'; + $tag = 'PROB'; break; case 'PROPERTY': - $tag='PROP'; + $tag = 'PROP'; break; case 'PUBLICATION': - $tag='PUBL'; + $tag = 'PUBL'; break; case 'QUALITY_OF_DATA': - $tag='QUAL'; + $tag = 'QUAL'; break; case 'REC_FILE_NUMBER': - $tag='RFN'; + $tag = 'RFN'; break; case 'REC_ID_NUMBER': - $tag='RIN'; + $tag = 'RIN'; break; case 'REFERENCE': - $tag='REFN'; + $tag = 'REFN'; break; case 'RELATIONSHIP': - $tag='RELA'; + $tag = 'RELA'; break; case 'RELIGION': - $tag='RELI'; + $tag = 'RELI'; break; case 'REPOSITORY': - $tag='REPO'; + $tag = 'REPO'; break; case 'RESIDENCE': - $tag='RESI'; + $tag = 'RESI'; break; case 'RESTRICTION': - $tag='RESN'; + $tag = 'RESN'; case 'RESN': // RESN values are lower case (confidential, privacy, locked, none) - $data=strtolower($data); - if ($data=='invisible') { - $data='confidential'; // From old versions of Legacy. + $data = strtolower($data); + if ($data == 'invisible') { + $data = 'confidential'; // From old versions of Legacy. } break; case 'RETIREMENT': - $tag='RETI'; + $tag = 'RETI'; break; case 'ROMANIZED': - $tag='ROMN'; + $tag = 'ROMN'; break; case 'SEALING_CHILD': - $tag='SLGC'; + $tag = 'SLGC'; break; case 'SEALING_SPOUSE': - $tag='SLGS'; + $tag = 'SLGS'; break; case 'SOC_SEC_NUMBER': - $tag='SSN'; + $tag = 'SSN'; break; case 'SEX': switch (trim($data)) { @@ -471,75 +471,75 @@ function reformat_record_import($rec) { case 'U': break; case 'm': - $data='M'; + $data = 'M'; break; case 'f': - $data='F'; + $data = 'F'; break; default: - $data='U'; + $data = 'U'; break; } break; case 'SOURCE': - $tag='SOUR'; + $tag = 'SOUR'; break; case 'STATE': - $tag='STAE'; + $tag = 'STAE'; break; case 'STATUS': - $tag='STAT'; + $tag = 'STAT'; case 'STAT': - if ($data=='CANCELLED') { + if ($data == 'CANCELLED') { // PGV mis-spells this tag - correct it. - $data='CANCELED'; + $data = 'CANCELED'; } break; case 'SUBMISSION': - $tag='SUBN'; + $tag = 'SUBN'; break; case 'SUBMITTER': - $tag='SUBM'; + $tag = 'SUBM'; break; case 'SURNAME': - $tag='SURN'; + $tag = 'SURN'; break; case 'SURN_PREFIX': - $tag='SPFX'; + $tag = 'SPFX'; break; case 'TEMPLE': - $tag='TEMP'; + $tag = 'TEMP'; case 'TEMP': // Temple codes are upper case - $data=strtoupper($data); + $data = strtoupper($data); break; case 'TITLE': - $tag='TITL'; + $tag = 'TITL'; break; case 'TRAILER': - $tag='TRLR'; + $tag = 'TRLR'; case 'TRLR': // TRLR records don't have an XREF or DATA - if ($level=='0') { - $xref=''; - $data=''; + if ($level == '0') { + $xref = ''; + $data = ''; } break; case 'VERSION': - $tag='VERS'; + $tag = 'VERS'; break; case 'WEB': - $tag='WWW'; + $tag = 'WWW'; break; } // Suppress "Y", for facts/events with a DATE or PLAC - if ($data=='y') { - $data='Y'; + if ($data == 'y') { + $data = 'Y'; } - if ($level=='1' && $data=='Y') { - for ($i=$n+1; $i<$num_matches-1 && $matches[$i][1]!='1'; ++$i) { - if ($matches[$i][3]=='DATE' || $matches[$i][3]=='PLAC') { - $data=''; + if ($level == '1' && $data == 'Y') { + for ($i = $n + 1; $i < $num_matches - 1 && $matches[$i][1] != '1'; ++$i) { + if ($matches[$i][3] == 'DATE' || $matches[$i][3] == 'PLAC') { + $data = ''; break; } } @@ -548,36 +548,36 @@ function reformat_record_import($rec) { switch ($tag) { default: // Remove tabs and multiple/leading/trailing spaces - if (strpos($data, "\t")!==false) { - $data=str_replace("\t", ' ', $data); + if (strpos($data, "\t") !== false) { + $data = str_replace("\t", ' ', $data); } - if (substr($data, 0, 1)==' ' || substr($data, -1, 1)==' ') { - $data=trim($data); + if (substr($data, 0, 1) == ' ' || substr($data, -1, 1) == ' ') { + $data = trim($data); } while (strpos($data, ' ')) { - $data=str_replace(' ', ' ', $data); + $data = str_replace(' ', ' ', $data); } - $newrec.=($newrec ? "\n" : '').$level.' '.($level=='0' && $xref ? $xref.' ' : '').$tag.($data==='' && $tag!="NOTE" ? '' : ' '.$data); + $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data); break; case 'NOTE': case 'TEXT': case 'DATA': case 'CONT': - $newrec.=($newrec ? "\n" : '').$level.' '.($level=='0' && $xref ? $xref.' ' : '').$tag.($data==='' && $tag!="NOTE" ? '' : ' '.$data); + $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data); break; case 'FILE': // Strip off the user-defined path prefix - if ($GEDCOM_MEDIA_PATH && strpos($data, $GEDCOM_MEDIA_PATH)===0) { - $data=substr($data, strlen($GEDCOM_MEDIA_PATH)); + if ($GEDCOM_MEDIA_PATH && strpos($data, $GEDCOM_MEDIA_PATH) === 0) { + $data = substr($data, strlen($GEDCOM_MEDIA_PATH)); } // convert backslashes in filenames to forward slashes $data = preg_replace("/\\\/", "/", $data); - $newrec.=($newrec ? "\n" : '').$level.' '.($level=='0' && $xref ? $xref.' ' : '').$tag.($data==='' && $tag!="NOTE" ? '' : ' '.$data); + $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data); break; case 'CONC': // Merge CONC lines, to simplify access later on. - $newrec.=($WORD_WRAPPED_NOTES ? ' ' : '').$data; + $newrec .= ($WORD_WRAPPED_NOTES ? ' ' : '') . $data; break; } } @@ -596,32 +596,32 @@ function reformat_record_import($rec) { function import_record($gedrec, $ged_id, $update) { global $USE_RIN, $GENERATE_UIDS, $keep_media; - static $sql_insert_indi=null; - static $sql_insert_fam=null; - static $sql_insert_sour=null; - static $sql_insert_media=null; - static $sql_insert_other=null; + static $sql_insert_indi = null; + static $sql_insert_fam = null; + static $sql_insert_sour = null; + static $sql_insert_media = null; + static $sql_insert_other = null; if (!$sql_insert_indi) { - $sql_insert_indi=WT_DB::prepare( + $sql_insert_indi = WT_DB::prepare( "INSERT INTO `##individuals` (i_id, i_file, i_rin, i_sex, i_gedcom) VALUES (?,?,?,?,?)" ); - $sql_insert_fam=WT_DB::prepare( + $sql_insert_fam = WT_DB::prepare( "INSERT INTO `##families` (f_id, f_file, f_husb, f_wife, f_gedcom, f_numchil) VALUES (?,?,?,?,?,?)" ); - $sql_insert_sour=WT_DB::prepare( + $sql_insert_sour = WT_DB::prepare( "INSERT INTO `##sources` (s_id, s_file, s_name, s_gedcom) VALUES (?,?,?,?)" ); - $sql_insert_media=WT_DB::prepare( + $sql_insert_media = WT_DB::prepare( "INSERT INTO `##media` (m_id, m_ext, m_type, m_titl, m_filename, m_file, m_gedcom) VALUES (?, ?, ?, ?, ?, ?, ?)" ); - $sql_insert_other=WT_DB::prepare( + $sql_insert_other = WT_DB::prepare( "INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?,?,?,?)" ); } // Escaped @ signs (only if importing from file) if (!$update) { - $gedrec=str_replace('@@', '@', $gedrec); + $gedrec = str_replace('@@', '@', $gedrec); } // Standardise gedcom format @@ -670,33 +670,33 @@ function import_record($gedrec, $ged_id, $update) { $sql_insert_indi->execute(array($xref, $ged_id, $rin, $record->getSex(), $gedrec)); // Update the cross-reference/index tables. update_places($xref, $ged_id, $gedrec); - update_dates ($xref, $ged_id, $gedrec); - update_links ($xref, $ged_id, $gedrec); - update_names ($xref, $ged_id, $record); + update_dates($xref, $ged_id, $gedrec); + update_links($xref, $ged_id, $gedrec); + update_names($xref, $ged_id, $record); break; case 'FAM': // Convert inline media into media objects $gedrec = convert_inline_media($ged_id, $gedrec); - if (preg_match('/\n1 HUSB @('.WT_REGEX_XREF.')@/', $gedrec, $match)) { + if (preg_match('/\n1 HUSB @(' . WT_REGEX_XREF . ')@/', $gedrec, $match)) { $husb = $match[1]; } else { $husb = ''; } - if (preg_match('/\n1 WIFE @('.WT_REGEX_XREF.')@/', $gedrec, $match)) { + if (preg_match('/\n1 WIFE @(' . WT_REGEX_XREF . ')@/', $gedrec, $match)) { $wife = $match[1]; } else { $wife = ''; } - $nchi = preg_match_all('/\n1 CHIL @('.WT_REGEX_XREF.')@/', $gedrec, $match); + $nchi = preg_match_all('/\n1 CHIL @(' . WT_REGEX_XREF . ')@/', $gedrec, $match); if (preg_match('/\n1 NCHI (\d+)/', $gedrec, $match)) { $nchi = max($nchi, $match[1]); } $sql_insert_fam->execute(array($xref, $ged_id, $husb, $wife, $gedrec, $nchi)); // Update the cross-reference/index tables. update_places($xref, $ged_id, $gedrec); - update_dates ($xref, $ged_id, $gedrec); - update_links ($xref, $ged_id, $gedrec); + update_dates($xref, $ged_id, $gedrec); + update_links($xref, $ged_id, $gedrec); break; case 'SOUR': // Convert inline media into media objects @@ -742,7 +742,7 @@ function import_record($gedrec, $ged_id, $update) { case 'HEAD': // Force HEAD records to have a creation date. if (!strpos($gedrec, "\n1 DATE ")) { - $gedrec.="\n1 DATE ".date('j M Y'); + $gedrec .= "\n1 DATE " . date('j M Y'); } // No break; case 'TRLR': @@ -750,14 +750,14 @@ function import_record($gedrec, $ged_id, $update) { case 'SUBN': $sql_insert_other->execute(array($xref, $ged_id, $type, $gedrec)); // Update the cross-reference/index tables. - update_links ($xref, $ged_id, $gedrec); + update_links($xref, $ged_id, $gedrec); break; default: $record = new WT_GedcomRecord($xref, $gedrec, null, $ged_id); $sql_insert_other->execute(array($xref, $ged_id, $type, $gedrec)); // Update the cross-reference/index tables. - update_links ($xref, $ged_id, $gedrec); - update_names ($xref, $ged_id, $record); + update_links($xref, $ged_id, $gedrec); + update_names($xref, $ged_id, $record); break; } } @@ -772,21 +772,21 @@ function import_record($gedrec, $ged_id, $update) { function update_places($gid, $ged_id, $gedrec) { global $placecache; - static $sql_insert_placelinks=null; - static $sql_insert_places=null; - static $sql_select_places=null; + static $sql_insert_placelinks = null; + static $sql_insert_places = null; + static $sql_select_places = null; if (!$sql_insert_placelinks) { // Use INSERT IGNORE as a (temporary) fix for https://bugs.launchpad.net/webtrees/+bug/582226 // It ignores places that utf8_unicode_ci consider to be the same (i.e. accents). // For example Québec and Quebec // We need a better solution that attaches multiple names to single places - $sql_insert_placelinks=WT_DB::prepare( + $sql_insert_placelinks = WT_DB::prepare( "INSERT IGNORE INTO `##placelinks` (pl_p_id, pl_gid, pl_file) VALUES (?,?,?)" ); - $sql_insert_places=WT_DB::prepare( + $sql_insert_places = WT_DB::prepare( "INSERT INTO `##places` (p_place, p_parent_id, p_file, p_std_soundex, p_dm_soundex) VALUES (?,?,?,?,?)" ); - $sql_select_places=WT_DB::prepare( + $sql_select_places = WT_DB::prepare( "SELECT p_id FROM `##places` WHERE p_file=? AND p_parent_id=? AND p_place=?" ); } @@ -814,12 +814,12 @@ function update_places($gid, $ged_id, $gedrec) { foreach ($secalp as $place) { $place = trim($place); - $key = strtolower($place."_".$parent_id); + $key = strtolower($place . "_" . $parent_id); //-- if this place has already been added then we don't need to add it again if (isset($placecache[$key])) { $parent_id = $placecache[$key]; if (!isset($personplace[$key])) { - $personplace[$key]=1; + $personplace[$key] = 1; $sql_insert_placelinks->execute(array($parent_id, $gid, $ged_id)); } continue; @@ -828,7 +828,7 @@ function update_places($gid, $ged_id, $gedrec) { //-- only search the database while we are finding places in it if ($search) { //-- check if this place and level has already been added - $tmp=$sql_select_places->execute(array($ged_id, $parent_id, $place))->fetchOne(); + $tmp = $sql_select_places->execute(array($ged_id, $parent_id, $place))->fetchOne(); if ($tmp) { $p_id = $tmp; } else { @@ -848,7 +848,7 @@ function update_places($gid, $ged_id, $gedrec) { //-- increment the level and assign the parent id for the next place level $parent_id = $p_id; $placecache[$key] = $p_id; - $personplace[$key]=1; + $personplace[$key] = 1; } } } @@ -861,20 +861,20 @@ function update_places($gid, $ged_id, $gedrec) { * @param string $gedrec */ function update_dates($xref, $ged_id, $gedrec) { - static $sql_insert_date=null; + static $sql_insert_date = null; if (!$sql_insert_date) { - $sql_insert_date=WT_DB::prepare( + $sql_insert_date = WT_DB::prepare( "INSERT INTO `##dates` (d_day,d_month,d_mon,d_year,d_julianday1,d_julianday2,d_fact,d_gid,d_file,d_type) VALUES (?,?,?,?,?,?,?,?,?,?)" ); } if (strpos($gedrec, '2 DATE ') && preg_match_all("/\n1 (\w+).*(?:\n[2-9].*)*(?:\n2 DATE (.+))(?:\n[2-9].*)*/", $gedrec, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { - $fact=$match[1]; - if (($fact=='FACT' || $fact=='EVEN') && preg_match("/\n2 TYPE ([A-Z]{3,5})/", $match[0], $tmatch)) { - $fact=$tmatch[1]; + $fact = $match[1]; + if (($fact == 'FACT' || $fact == 'EVEN') && preg_match("/\n2 TYPE ([A-Z]{3,5})/", $match[0], $tmatch)) { + $fact = $tmatch[1]; } - $date=new WT_Date($match[2]); + $date = new WT_Date($match[2]); $sql_insert_date->execute(array($date->date1->d, $date->date1->format('%O'), $date->date1->m, $date->date1->y, $date->date1->minJD, $date->date1->maxJD, $fact, $xref, $ged_id, $date->date1->format('%@'))); if ($date->date2) { $sql_insert_date->execute(array($date->date2->d, $date->date2->format('%O'), $date->date2->m, $date->date2->y, $date->date2->minJD, $date->date2->maxJD, $fact, $xref, $ged_id, $date->date2->format('%@'))); @@ -891,17 +891,17 @@ function update_dates($xref, $ged_id, $gedrec) { * @param string $gedrec */ function update_links($xref, $ged_id, $gedrec) { - static $sql_insert_link=null; + static $sql_insert_link = null; if (!$sql_insert_link) { - $sql_insert_link=WT_DB::prepare("INSERT INTO `##link` (l_from,l_to,l_type,l_file) VALUES (?,?,?,?)"); + $sql_insert_link = WT_DB::prepare("INSERT INTO `##link` (l_from,l_to,l_type,l_file) VALUES (?,?,?,?)"); } - if (preg_match_all('/^\d+ ('.WT_REGEX_TAG.') @('.WT_REGEX_XREF.')@/m', $gedrec, $matches, PREG_SET_ORDER)) { - $data=array(); + if (preg_match_all('/^\d+ (' . WT_REGEX_TAG . ') @(' . WT_REGEX_XREF . ')@/m', $gedrec, $matches, PREG_SET_ORDER)) { + $data = array(); foreach ($matches as $match) { // Include each link once only. - if (!in_array($match[1].$match[2], $data)) { - $data[]=$match[1].$match[2]; + if (!in_array($match[1] . $match[2], $data)) { + $data[] = $match[1] . $match[2]; // Ignore any errors, which may be caused by "duplicates" that differ on case/collation, e.g. "S1" and "s1" try { $sql_insert_link->execute(array($xref, $match[2], $match[1], $ged_id)); @@ -921,11 +921,11 @@ function update_links($xref, $ged_id, $gedrec) { * @param WT_GedcomRecord $record */ function update_names($xref, $ged_id, WT_GedcomRecord $record) { - static $sql_insert_name_indi=null; - static $sql_insert_name_other=null; + static $sql_insert_name_indi = null; + static $sql_insert_name_other = null; if (!$sql_insert_name_indi) { - $sql_insert_name_indi=WT_DB::prepare("INSERT INTO `##name` (n_file,n_id,n_num,n_type,n_sort,n_full,n_surname,n_surn,n_givn,n_soundex_givn_std,n_soundex_surn_std,n_soundex_givn_dm,n_soundex_surn_dm) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); - $sql_insert_name_other=WT_DB::prepare("INSERT INTO `##name` (n_file,n_id,n_num,n_type,n_sort,n_full) VALUES (?,?,?,?,?,?)"); + $sql_insert_name_indi = WT_DB::prepare("INSERT INTO `##name` (n_file,n_id,n_num,n_type,n_sort,n_full,n_surname,n_surn,n_givn,n_soundex_givn_std,n_soundex_surn_std,n_soundex_givn_dm,n_soundex_surn_dm) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); + $sql_insert_name_other = WT_DB::prepare("INSERT INTO `##name` (n_file,n_id,n_num,n_type,n_sort,n_full) VALUES (?,?,?,?,?,?)"); } foreach ($record->getAllNames() as $n=>$name) { @@ -935,14 +935,14 @@ function update_names($xref, $ged_id, WT_GedcomRecord $record) { $soundex_givn_dm = null; } else { $soundex_givn_std = WT_Soundex::russell($name['givn']); - $soundex_givn_dm = WT_Soundex::daitchMokotoff ($name['givn']); + $soundex_givn_dm = WT_Soundex::daitchMokotoff($name['givn']); } if ($name['surn'] == '@N.N.') { $soundex_surn_std = null; $soundex_surn_dm = null; } else { $soundex_surn_std = WT_Soundex::russell($name['surname']); - $soundex_surn_dm = WT_Soundex::daitchMokotoff ($name['surname']); + $soundex_surn_dm = WT_Soundex::daitchMokotoff($name['surname']); } $sql_insert_name_indi->execute(array($ged_id, $xref, $n, $name['type'], $name['sort'], $name['fullNN'], $name['surname'], $name['surn'], $name['givn'], $soundex_givn_std, $soundex_surn_std, $soundex_givn_dm, $soundex_surn_dm)); } else { @@ -982,13 +982,13 @@ function convert_inline_media($ged_id, $gedrec) { * @return string */ function create_media_object($level, $gedrec, $ged_id) { - static $sql_insert_media=null; - static $sql_select_media=null; + static $sql_insert_media = null; + static $sql_select_media = null; if (!$sql_insert_media) { - $sql_insert_media=WT_DB::prepare( + $sql_insert_media = WT_DB::prepare( "INSERT INTO `##media` (m_id, m_ext, m_type, m_titl, m_filename, m_file, m_gedcom) VALUES (?, ?, ?, ?, ?, ?, ?)" ); - $sql_select_media=WT_DB::prepare( + $sql_select_media = WT_DB::prepare( "SELECT m_id FROM `##media` WHERE m_filename=? AND m_titl=? AND m_file=?" ); } @@ -1011,7 +1011,7 @@ function create_media_object($level, $gedrec, $ged_id) { if (!$xref) { $xref = get_new_xref("OBJE", $ged_id); // renumber the lines - $gedrec = preg_replace_callback('/\n(\d+)/', function ($m) use ($level) { return "\n" . ($m[1] - $level); }, $gedrec); + $gedrec = preg_replace_callback('/\n(\d+)/', function($m) use ($level) { return "\n" . ($m[1] - $level); }, $gedrec); // convert to an object $gedrec = str_replace("\n0 OBJE\n", '0 @' . $xref . "@ OBJE\n", $gedrec); // Fix Legacy GEDCOMS @@ -1031,11 +1031,11 @@ function create_media_object($level, $gedrec, $ged_id) { * @param integer $ged_id */ function accept_all_changes($xref, $ged_id) { - $changes=WT_DB::prepare( - "SELECT change_id, gedcom_name, old_gedcom, new_gedcom". - " FROM `##change` c". - " JOIN `##gedcom` g USING (gedcom_id)". - " WHERE c.status='pending' AND xref=? AND gedcom_id=?". + $changes = WT_DB::prepare( + "SELECT change_id, gedcom_name, old_gedcom, new_gedcom" . + " FROM `##change` c" . + " JOIN `##gedcom` g USING (gedcom_id)" . + " WHERE c.status='pending' AND xref=? AND gedcom_id=?" . " ORDER BY change_id" )->execute(array($xref, $ged_id))->fetchAll(); foreach ($changes as $change) { @@ -1047,8 +1047,8 @@ function accept_all_changes($xref, $ged_id) { update_record($change->new_gedcom, $ged_id, false); } WT_DB::prepare( - "UPDATE `##change`". - " SET status='accepted'". + "UPDATE `##change`" . + " SET status='accepted'" . " WHERE status='pending' AND xref=? AND gedcom_id=?" )->execute(array($xref, $ged_id)); Log::addEditLog("Accepted change {$change->change_id} for {$xref} / {$change->gedcom_name} into database"); @@ -1063,8 +1063,8 @@ function accept_all_changes($xref, $ged_id) { */ function reject_all_changes($xref, $ged_id) { WT_DB::prepare( - "UPDATE `##change`". - " SET status='rejected'". + "UPDATE `##change`" . + " SET status='rejected'" . " WHERE status='pending' AND xref=? AND gedcom_id=?" )->execute(array($xref, $ged_id)); } @@ -1077,7 +1077,7 @@ function reject_all_changes($xref, $ged_id) { * @param boolean $delete */ function update_record($gedrec, $ged_id, $delete) { - if (preg_match('/^0 @('.WT_REGEX_XREF.')@ ('.WT_REGEX_TAG.')/', $gedrec, $match)) { + if (preg_match('/^0 @(' . WT_REGEX_XREF . ')@ (' . WT_REGEX_TAG . ')/', $gedrec, $match)) { list(,$gid, $type) = $match; } else { echo "ERROR: Invalid gedcom record."; @@ -1085,7 +1085,7 @@ function update_record($gedrec, $ged_id, $delete) { } // TODO deleting unlinked places can be done more efficiently in a single query - $placeids= + $placeids = WT_DB::prepare("SELECT pl_p_id FROM `##placelinks` WHERE pl_gid=? AND pl_file=?") ->execute(array($gid, $ged_id)) ->fetchOneColumn(); diff --git a/includes/reportheader.php b/includes/reportheader.php index a1b23cd1cf..761d36364e 100644 --- a/includes/reportheader.php +++ b/includes/reportheader.php @@ -34,13 +34,13 @@ if (!defined('WT_WEBTREES')) { * @global array $elementHandler */ $elementHandler = array(); -$elementHandler["Report"]["start"] ="reportStartHandler"; -$elementHandler["var"]["start"] ="varStartHandler"; -$elementHandler["Title"]["start"] ="titleStartHandler"; -$elementHandler["Title"]["end"] ="titleEndHandler"; -$elementHandler["Description"]["end"]="descriptionEndHandler"; -$elementHandler["Input"]["start"] ="inputStartHandler"; -$elementHandler["Input"]["end"] ="inputEndHandler"; +$elementHandler["Report"]["start"] = "reportStartHandler"; +$elementHandler["var"]["start"] = "varStartHandler"; +$elementHandler["Title"]["start"] = "titleStartHandler"; +$elementHandler["Title"]["end"] = "titleEndHandler"; +$elementHandler["Description"]["end"] = "descriptionEndHandler"; +$elementHandler["Input"]["start"] = "inputStartHandler"; +$elementHandler["Input"]["end"] = "inputEndHandler"; $text = ""; $report_array = array(); @@ -57,7 +57,7 @@ $report_array = array(); function startElement($parser, $name, $attrs) { global $elementHandler, $processIfs; - if (($processIfs==0) || ($name=="if")) { + if (($processIfs == 0) || ($name == "if")) { if (isset($elementHandler[$name]["start"])) { call_user_func($elementHandler[$name]["start"], $attrs); } @@ -74,7 +74,7 @@ function startElement($parser, $name, $attrs) { function endElement($parser, $name) { global $elementHandler, $processIfs; - if (($processIfs==0) || ($name=="if")) { + if (($processIfs == 0) || ($name == "if")) { if (isset($elementHandler[$name]["end"])) { call_user_func($elementHandler[$name]["end"]); } @@ -125,7 +125,7 @@ function varStartHandler($attrs) { $var = $attrs["var"]; if (!empty($var)) { $tfact = $fact; - if ($fact=="EVEN") { + if ($fact == "EVEN") { $tfact = $type; } $var = str_replace(array("@fact", "@desc"), array($tfact, $desc), $var); @@ -166,7 +166,7 @@ function descriptionEndHandler() { function inputStartHandler($attrs) { global $input, $text; - $text =""; + $text = ""; $input = array(); $input["name"] = ""; $input["type"] = ""; @@ -184,16 +184,16 @@ function inputStartHandler($attrs) { $input["lookup"] = $attrs["lookup"]; } if (isset($attrs["default"])) { - if ($attrs["default"]=="NOW") { + if ($attrs["default"] == "NOW") { $input["default"] = date("d M Y"); } else { $match = array(); - if (preg_match("/NOW\s*([+\-])\s*(\d+)/", $attrs['default'], $match)>0) { + if (preg_match("/NOW\s*([+\-])\s*(\d+)/", $attrs['default'], $match) > 0) { $plus = 1; - if ($match[1]=="-") { + if ($match[1] == "-") { $plus = -1; } - $input["default"] = date("d M Y", WT_TIMESTAMP + $plus*60*60*24*$match[2]); + $input["default"] = date("d M Y", WT_TIMESTAMP + $plus * 60 * 60 * 24 * $match[2]); } else { $input["default"] = $attrs["default"]; } diff --git a/inverselink.php b/inverselink.php index 25589fb15b..ab7e16881f 100644 --- a/inverselink.php +++ b/inverselink.php @@ -27,7 +27,7 @@ use WT\Auth; define('WT_SCRIPT_NAME', 'inverselink.php'); require './includes/session.php'; -require WT_ROOT.'includes/functions/functions_edit.php'; +require WT_ROOT . 'includes/functions/functions_edit.php'; $controller = new WT_Controller_Simple; $controller @@ -44,12 +44,12 @@ $linkto = WT_Filter::get('linkto', 'person|source|family|manage|repository|not $action = WT_Filter::get('action', 'choose|update', 'choose'); // If GedFAct_assistant/_MEDIA/ installed ====================== -if ($linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) { - require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_0_inverselink.php'; +if ($linkto == 'manage' && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) { + require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/_MEDIA/media_0_inverselink.php'; } else { //-- check for admin - $paramok = true; + $paramok = true; if (!empty($linktoid)) { $paramok = WT_GedcomRecord::getInstance($linktoid)->canShow(); } @@ -72,7 +72,7 @@ if ($linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getAct echo '<td class="optionbox wrap">'; if (!empty($mediaid)) { //-- Get the title of this existing Media item - $title= + $title = WT_DB::prepare("SELECT m_titl FROM `##media` where m_id=? AND m_file=?") ->execute(array($mediaid, WT_GED_ID)) ->fetchOne(); @@ -95,11 +95,11 @@ if ($linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getAct if ($linkto == "person") { echo WT_I18N::translate('Individual'), "</td>"; echo '<td class="optionbox wrap">'; - if ($linktoid=="") { + if ($linktoid == "") { echo '<input class="pedigree_form" type="text" name="linktoid" id="linktopid" size="3" value="', $linktoid, '"> '; echo print_findindi_link('linktopid'); } else { - $record=WT_Individual::getInstance($linktoid); + $record = WT_Individual::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } @@ -107,11 +107,11 @@ if ($linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getAct if ($linkto == "family") { echo WT_I18N::translate('Family'), '</td>'; echo '<td class="optionbox wrap">'; - if ($linktoid=="") { + if ($linktoid == "") { echo '<input class="pedigree_form" type="text" name="linktoid" id="linktofamid" size="3" value="', $linktoid, '"> '; echo print_findfamily_link('linktofamid'); } else { - $record=WT_Family::getInstance($linktoid); + $record = WT_Family::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } @@ -119,21 +119,21 @@ if ($linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getAct if ($linkto == "source") { echo WT_I18N::translate('Source'), "</td>"; echo '<td class="optionbox wrap">'; - if ($linktoid=="") { + if ($linktoid == "") { echo '<input class="pedigree_form" type="text" name="linktoid" id="linktosid" size="3" value="', $linktoid, '"> '; echo print_findsource_link('linktosid'); } else { - $record=WT_Source::getInstance($linktoid); + $record = WT_Source::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } if ($linkto == "repository") { echo WT_I18N::translate('Repository'), "</td>"; echo '<td class="optionbox wrap">'; - if ($linktoid=="") { + if ($linktoid == "") { echo '<input class="pedigree_form" type="text" name="linktoid" id="linktorid" size="3" value="', $linktoid, '">'; } else { - $record=WT_Repository::getInstance($linktoid); + $record = WT_Repository::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } @@ -141,10 +141,10 @@ if ($linkto=='manage' && array_key_exists('GEDFact_assistant', WT_Module::getAct if ($linkto == "note") { echo WT_I18N::translate('Shared note'), "</td>"; echo '<td class="optionbox wrap">'; - if ($linktoid=="") { + if ($linktoid == "") { echo '<input class="pedigree_form" type="text" name="linktoid" id="linktonid" size="3" value="', $linktoid, '">'; } else { - $record=WT_Note::getInstance($linktoid); + $record = WT_Note::getInstance($linktoid); echo $record->format_list('span', false, $record->getFullName()); } } diff --git a/library/WT/Report/Base.php b/library/WT/Report/Base.php index d900aa7c81..e107228d68 100644 --- a/library/WT/Report/Base.php +++ b/library/WT/Report/Base.php @@ -595,7 +595,7 @@ function styleStartHandler($attrs) { // int The size of the font in points $s['size'] = $wt_report->defaultFontSize; if (!empty($attrs['size'])) { - $s['size'] = (int)$attrs['size']; + $s['size'] = (int) $attrs['size']; } // Get it as int to ignore all decimal points or text (if any text then int(0)) // string B: bold, I: italic, U: underline, D: line trough, The default value is regular. @@ -621,11 +621,11 @@ function docStartHandler($attrs) { // Custom page width if (!empty($attrs['customwidth'])) { - $wt_report->pagew = (int)$attrs['customwidth']; + $wt_report->pagew = (int) $attrs['customwidth']; } // Get it as int to ignore all decimal points or text (if any text then int(0)) // Custom Page height if (!empty($attrs['customheight'])) { - $wt_report->pageh = (int)$attrs['customheight']; + $wt_report->pageh = (int) $attrs['customheight']; } // Get it as int to ignore all decimal points or text (if any text then int(0)) // Left Margin @@ -633,7 +633,7 @@ function docStartHandler($attrs) { if ($attrs['leftmargin'] === "0") { $wt_report->leftmargin = 0; } elseif (!empty($attrs['leftmargin'])) { - $wt_report->leftmargin = (int)$attrs['leftmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) + $wt_report->leftmargin = (int) $attrs['leftmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) } } // Right Margin @@ -641,7 +641,7 @@ function docStartHandler($attrs) { if ($attrs['rightmargin'] === "0") { $wt_report->rightmargin = 0; } elseif (!empty($attrs['rightmargin'])) { - $wt_report->rightmargin = (int)$attrs['rightmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) + $wt_report->rightmargin = (int) $attrs['rightmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) } } // Top Margin @@ -649,7 +649,7 @@ function docStartHandler($attrs) { if ($attrs['topmargin'] === "0") { $wt_report->topmargin = 0; } elseif (!empty($attrs['topmargin'])) { - $wt_report->topmargin = (int)$attrs['topmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) + $wt_report->topmargin = (int) $attrs['topmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) } } // Bottom Margin @@ -657,7 +657,7 @@ function docStartHandler($attrs) { if ($attrs['bottommargin'] === "0") { $wt_report->bottommargin = 0; } elseif (!empty($attrs['bottommargin'])) { - $wt_report->bottommargin = (int)$attrs['bottommargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) + $wt_report->bottommargin = (int) $attrs['bottommargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) } } // Header Margin @@ -665,7 +665,7 @@ function docStartHandler($attrs) { if ($attrs['headermargin'] === "0") { $wt_report->headermargin = 0; } elseif (!empty($attrs['headermargin'])) { - $wt_report->headermargin = (int)$attrs['headermargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) + $wt_report->headermargin = (int) $attrs['headermargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) } } // Footer Margin @@ -673,7 +673,7 @@ function docStartHandler($attrs) { if ($attrs['footermargin'] === "0") { $wt_report->footermargin = 0; } elseif (!empty($attrs['footermargin'])) { - $wt_report->footermargin = (int)$attrs['footermargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) + $wt_report->footermargin = (int) $attrs['footermargin']; // Get it as int to ignore all decimal points or text (if any text then int(0)) } } @@ -829,18 +829,18 @@ function cellStartHandler($attrs) { // int Cell height (expressed in points) The starting height of this cell. If the text wraps the height will automatically be adjusted. $height = 0; if (!empty($attrs['height'])) { - $height = (int)$attrs['height']; + $height = (int) $attrs['height']; } // int Cell width (expressed in points) Setting the width to 0 will make it the width from the current location to the right margin. $width = 0; if (!empty($attrs['width'])) { - $width = (int)$attrs['width']; + $width = (int) $attrs['width']; } // int Stretch carachter mode $stretch = 0; if (!empty($attrs['stretch'])) { - $stretch = (int)$attrs['stretch']; + $stretch = (int) $attrs['stretch']; } // mixed Position the left corner of this box on the page. The default is the current position. @@ -849,7 +849,7 @@ function cellStartHandler($attrs) { if ($attrs['left'] === ".") { $left = "."; } elseif (!empty($attrs['left'])) { - $left = (int)$attrs['left']; + $left = (int) $attrs['left']; } elseif ($attrs['left'] === "0") { $left = 0; } @@ -860,7 +860,7 @@ function cellStartHandler($attrs) { if ($attrs['top'] === ".") { $top = "."; } elseif (!empty($attrs['top'])) { - $top = (int)$attrs['top']; + $top = (int) $attrs['top']; } elseif ($attrs['top'] === "0") { $top = 0; } @@ -882,7 +882,7 @@ function cellStartHandler($attrs) { $ln = 0; if (isset($attrs['newline'])) { if (!empty($attrs['newline'])) { - $ln = (int)$attrs['newline']; + $ln = (int) $attrs['newline']; } elseif ($attrs['newline'] === "0") { $ln = 0; } @@ -1078,12 +1078,12 @@ function textBoxStartHandler($attrs) { // int The starting height of this cell. If the text wraps the height will automatically be adjusted $height = 0; if (!empty($attrs['height'])) { - $height = (int)$attrs['height']; + $height = (int) $attrs['height']; } // int Setting the width to 0 will make it the width from the current location to the margin $width = 0; if (!empty($attrs['width'])) { - $width = (int)$attrs['width']; + $width = (int) $attrs['width']; } // mixed Position the left corner of this box on the page. The default is the current position. @@ -1092,7 +1092,7 @@ function textBoxStartHandler($attrs) { if ($attrs['left'] === ".") { $left = "."; } elseif (!empty($attrs['left'])) { - $left = (int)$attrs['left']; + $left = (int) $attrs['left']; } elseif ($attrs['left'] === "0") { $left = 0; } @@ -1103,7 +1103,7 @@ function textBoxStartHandler($attrs) { if ($attrs['top'] === ".") { $top = "."; } elseif (!empty($attrs['top'])) { - $top = (int)$attrs['top']; + $top = (int) $attrs['top']; } elseif ($attrs['top'] === "0") { $top = 0; } @@ -1429,7 +1429,7 @@ function repeatTagStartHandler($attrs) { $count = preg_match_all("/$level $t(.*)/", $subrec, $match, PREG_SET_ORDER); $i = 0; while ($i < $count) { - $repeats[] = get_sub_record($level, "$level $t", $subrec, $i + 1);; + $repeats[] = get_sub_record($level, "$level $t", $subrec, $i + 1); ; $i++; } } @@ -1831,7 +1831,7 @@ function ifStartHandler($attrs) { $level++; $value = get_gedcom_value($id, $level, $gedrec); } - $value = preg_replace("/^@(".WT_REGEX_XREF.")@$/", "$1", $value); + $value = preg_replace("/^@(" . WT_REGEX_XREF . ")@$/", "$1", $value); $value = "\"" . addslashes($value) . "\""; } $condition = str_replace("@$id", $value, $condition); @@ -2012,7 +2012,7 @@ function highlightedImageStartHandler($attrs) { } elseif ($attrs['top'] === '.') { $top = '.'; } elseif (!empty($attrs['top'])) { - $top = (int)$attrs['top']; + $top = (int) $attrs['top']; } } @@ -2024,7 +2024,7 @@ function highlightedImageStartHandler($attrs) { } elseif ($attrs['left'] === '.') { $left = '.'; } elseif (!empty($attrs['left'])) { - $left = (int)$attrs['left']; + $left = (int) $attrs['left']; } } @@ -2043,10 +2043,10 @@ function highlightedImageStartHandler($attrs) { $width = 0; $height = 0; if (!empty($attrs['width'])) { - $width = (int)$attrs['width']; + $width = (int) $attrs['width']; } if (!empty($attrs['height'])) { - $height = (int)$attrs['height']; + $height = (int) $attrs['height']; } $person = WT_Individual::getInstance($id); @@ -2105,7 +2105,7 @@ function imageStartHandler($attrs) { } elseif ($attrs['top'] === '.') { $top = '.'; } elseif (!empty($attrs['top'])) { - $top = (int)$attrs['top']; + $top = (int) $attrs['top']; } } @@ -2117,7 +2117,7 @@ function imageStartHandler($attrs) { } elseif ($attrs['left'] === '.') { $left = '.'; } elseif (!empty($attrs['left'])) { - $left = (int)$attrs['left']; + $left = (int) $attrs['left']; } } @@ -2136,10 +2136,10 @@ function imageStartHandler($attrs) { $width = 0; $height = 0; if (!empty($attrs['width'])) { - $width = (int)$attrs['width']; + $width = (int) $attrs['width']; } if (!empty($attrs['height'])) { - $height = (int)$attrs['height']; + $height = (int) $attrs['height']; } $file = ''; @@ -2222,7 +2222,7 @@ function lineStartHandler($attrs) { } elseif ($attrs['x1'] === ".") { $x1 = "."; } elseif (!empty($attrs['x1'])) { - $x1 = (int)$attrs['x1']; + $x1 = (int) $attrs['x1']; } } // Start vertical position, current position (default) @@ -2233,7 +2233,7 @@ function lineStartHandler($attrs) { } elseif ($attrs['y1'] === ".") { $y1 = "."; } elseif (!empty($attrs['y1'])) { - $y1 = (int)$attrs['y1']; + $y1 = (int) $attrs['y1']; } } // End horizontal position, maximum width (default) @@ -2244,7 +2244,7 @@ function lineStartHandler($attrs) { } elseif ($attrs['x2'] === ".") { $x2 = "."; } elseif (!empty($attrs['x2'])) { - $x2 = (int)$attrs['x2']; + $x2 = (int) $attrs['x2']; } } // End vertical position @@ -2255,7 +2255,7 @@ function lineStartHandler($attrs) { } elseif ($attrs['y2'] === ".") { $y2 = "."; } elseif (!empty($attrs['y2'])) { - $y2 = (int)$attrs['y2']; + $y2 = (int) $attrs['y2']; } } @@ -2314,7 +2314,7 @@ function listStartHandler($attrs) { // Substitute global vars $value = preg_replace_callback( '/\$(\w+)/', - function ($matches) use ($vars) { + function($matches) use ($vars) { return $vars[$matches[1]]['id']; }, $value @@ -2577,7 +2577,7 @@ function listStartHandler($attrs) { uasort($list, array("WT_GedcomRecord", "compare")); break; case "CHAN": - uasort($list, function (WT_GedcomRecord $x, WT_GedcomRecord $y) { + uasort($list, function(WT_GedcomRecord $x, WT_GedcomRecord $y) { return $y->lastChangeTimestamp(true) - $x->lastChangeTimestamp(true); }); break; @@ -3036,7 +3036,7 @@ function get_gedcom_value($tag, $level, $gedrec) { $tags = explode(':', $tag); $origlevel = $level; if ($level == 0) { - $level = $gedrec{0} + 1; + $level = $gedrec{0} +1; } $subrec = $gedrec; diff --git a/library/WT/Stats.php b/library/WT/Stats.php index fc68415ebe..ea931387e8 100644 --- a/library/WT/Stats.php +++ b/library/WT/Stats.php @@ -128,7 +128,7 @@ class WT_Stats { isset($funcs) or $funcs = get_class_methods($this); // Extract all tags from the provided text - preg_match_all("/#([^#]+)(?=#)/", (string)$text, $match); + preg_match_all("/#([^#]+)(?=#)/", (string) $text, $match); $tags = $match[1]; $c = count($tags); $new_tags = array(); // tag to replace @@ -327,7 +327,7 @@ class WT_Stats { */ private function totalIndividualsQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file = ?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file = ?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -345,7 +345,7 @@ class WT_Stats { private function totalIndisWithSourcesQuery() { $rows = $this->runSql("SELECT SQL_CACHE COUNT(DISTINCT i_id) AS tot FROM `##link`, `##individuals` WHERE i_id=l_from AND i_file=l_file AND l_file=" . $this->tree->tree_id . " AND l_type='SOUR'"); - return (int)$rows[0]['tot']; + return (int) $rows[0]['tot']; } /** @@ -407,7 +407,7 @@ class WT_Stats { */ private function totalFamiliesQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##families` WHERE f_file=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##families` WHERE f_file=?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -425,7 +425,7 @@ class WT_Stats { private function totalFamsWithSourcesQuery() { $rows = $this->runSql("SELECT SQL_CACHE COUNT(DISTINCT f_id) AS tot FROM `##link`, `##families` WHERE f_id=l_from AND f_file=l_file AND l_file=" . $this->tree->tree_id . " AND l_type='SOUR'"); - return (int)$rows[0]['tot']; + return (int) $rows[0]['tot']; } /** @@ -488,7 +488,7 @@ class WT_Stats { */ private function totalSourcesQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##sources` WHERE s_file=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##sources` WHERE s_file=?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -512,7 +512,7 @@ class WT_Stats { */ private function totalNotesQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file=?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -536,7 +536,7 @@ class WT_Stats { */ private function totalRepositoriesQuery() { return - (Int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file=?") + (Int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file=?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -714,7 +714,7 @@ class WT_Stats { */ private function totalSexMalesQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?") ->execute(array($this->tree->tree_id, 'M')) ->fetchOne(); } @@ -738,7 +738,7 @@ class WT_Stats { */ private function totalSexFemalesQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?") ->execute(array($this->tree->tree_id, 'F')) ->fetchOne(); } @@ -762,7 +762,7 @@ class WT_Stats { */ private function totalSexUnknownQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?") ->execute(array($this->tree->tree_id, 'U')) ->fetchOne(); } @@ -854,7 +854,7 @@ class WT_Stats { */ private function totalLivingQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -878,7 +878,7 @@ class WT_Stats { */ private function totalDeceasedQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -949,7 +949,7 @@ class WT_Stats { */ public function totalUsers($params = array()) { if (isset($params[0])) { - $total = count(User::all()) + (int)$params[0]; + $total = count(User::all()) + (int) $params[0]; } else { $total = count(User::all()); } @@ -998,7 +998,7 @@ class WT_Stats { } } - return (int)WT_DB::prepare($sql)->execute($vars)->fetchOne(); + return (int) WT_DB::prepare($sql)->execute($vars)->fetchOne(); } /** @@ -1384,7 +1384,7 @@ class WT_Stats { */ private function totalPlacesQuery() { return - (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##places` WHERE p_file=?") + (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##places` WHERE p_file=?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } @@ -1536,7 +1536,7 @@ class WT_Stats { $chart_url .= "&chs=" . $WT_STATS_MAP_X . "x" . $WT_STATS_MAP_Y; $chart_url .= "&chld=" . implode('', array_keys($surn_countries)) . "&chd=s:"; foreach ($surn_countries as $count) { - $chart_url .= substr(WT_GOOGLE_CHART_ENCODING, (int)($count / max($surn_countries) * 61), 1); + $chart_url .= substr(WT_GOOGLE_CHART_ENCODING, (int) ($count / max($surn_countries) * 61), 1); } $chart = '<div id="google_charts" class="center">'; $chart .= '<b>' . $chart_title . '</b><br><br>'; @@ -2028,7 +2028,7 @@ class WT_Stats { } break; case 'age': - $result = WT_I18N::number((int)($row['age'] / 365.25)); + $result = WT_I18N::number((int) ($row['age'] / 365.25)); break; case 'name': $result = "<a href=\"" . $person->getHtmlUrl() . "\">" . $person->getFullName() . "</a>"; @@ -2055,7 +2055,7 @@ class WT_Stats { $sex_search = ''; } if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -2089,10 +2089,10 @@ class WT_Stats { foreach ($rows as $row) { $person = WT_Individual::getInstance($row['deathdate']); $age = $row['age']; - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } @@ -2140,7 +2140,7 @@ class WT_Stats { $sex_search = ''; } if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -2167,10 +2167,10 @@ class WT_Stats { foreach ($rows as $row) { $person = WT_Individual::getInstance($row['id']); $age = (WT_CLIENT_JD - $row['age']); - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } @@ -2234,10 +2234,10 @@ class WT_Stats { $row = $rows[0]; $age = $row['age']; if ($show_years) { - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } elseif (!empty($age)) { $age = $age . 'd'; } @@ -2344,7 +2344,7 @@ class WT_Stats { while ($offset = strpos($title, ' ', $offset + 1)) { $counter[] = $offset; } - $half = (int)(count($counter) / 2); + $half = (int) (count($counter) / 2); $chtt = substr_replace($title, '|', $counter[$half], 1); } return '<img src="' . "https://chart.googleapis.com/chart?cht=bvg&chs={$sizes[0]}x{$sizes[1]}&chm=D,FF0000,2,0,3,1|N*f1*,000000,0,-1,11,1|N*f1*,000000,1,-1,11,1&chf=bg,s,ffffff00|c,s,ffffff00&chtt=" . rawurlencode($chtt) . "&chd={$chd}&chco=0000FF,FFA0CB,FF0000&chbh=20,3&chxt=x,x,y,y&chxl=" . rawurlencode($chxl) . "&chdl=" . rawurlencode(WT_I18N::translate('Males') . '|' . WT_I18N::translate('Females') . '|' . WT_I18N::translate('Average age at death')) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . WT_I18N::translate('Average age related to death century') . "\" title=\"" . WT_I18N::translate('Average age related to death century') . "\" />"; @@ -2810,16 +2810,16 @@ class WT_Stats { case 'age': $age = $row['age']; if ($show_years) { - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } $result = get_age_at_event($age, true); } else { - $result = WT_I18N::number((int)($age / 365.25)); + $result = WT_I18N::number((int) ($age / 365.25)); } break; } @@ -2837,7 +2837,7 @@ class WT_Stats { global $TEXT_DIRECTION; if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -2920,10 +2920,10 @@ class WT_Stats { if ($type == 'name') { return $family->format_list('span', false, $family->getFullName()); } - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } @@ -2971,7 +2971,7 @@ class WT_Stats { global $TEXT_DIRECTION; if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -3007,10 +3007,10 @@ class WT_Stats { break; } $age = $fam['age']; - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } @@ -3097,16 +3097,16 @@ class WT_Stats { case 'age': $age = $row['age']; if ($show_years) { - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } $result = get_age_at_event($age, true); } else { - $result = (int)($age / 365.25); + $result = (int) ($age / 365.25); } break; } @@ -3559,7 +3559,7 @@ class WT_Stats { while ($offset = strpos(WT_I18N::translate('Average age in century of marriage'), ' ', $offset + 1)) { $counter[] = $offset; } - $half = (int)(count($counter) / 2); + $half = (int) (count($counter) / 2); $chtt = substr_replace(WT_I18N::translate('Average age in century of marriage'), '|', $counter[$half], 1); } return "<img src=\"" . "https://chart.googleapis.com/chart?cht=bvg&chs={$sizes[0]}x{$sizes[1]}&chm=D,FF0000,2,0,3,1|{$chmm}{$chmf}&chf=bg,s,ffffff00|c,s,ffffff00&chtt=" . rawurlencode($chtt) . "&chd={$chd}&chco=0000FF,FFA0CB,FF0000&chbh=20,3&chxt=x,x,y,y&chxl=" . rawurlencode($chxl) . "&chdl=" . rawurlencode(WT_I18N::translate('Males') . "|" . WT_I18N::translate('Females') . "|" . WT_I18N::translate('Average age')) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . WT_I18N::translate('Average age in century of marriage') . "\" title=\"" . WT_I18N::translate('Average age in century of marriage') . "\" />"; @@ -3965,7 +3965,7 @@ class WT_Stats { global $TEXT_DIRECTION; if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -4022,7 +4022,7 @@ class WT_Stats { global $TEXT_DIRECTION; if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -4077,10 +4077,10 @@ class WT_Stats { return $return; } $age = $fam['age']; - if ((int)($age / 365.25) > 0) { - $age = (int)($age / 365.25) . 'y'; - } elseif ((int)($age / 30.4375) > 0) { - $age = (int)($age / 30.4375) . 'm'; + if ((int) ($age / 365.25) > 0) { + $age = (int) ($age / 365.25) . 'y'; + } elseif ((int) ($age / 30.4375) > 0) { + $age = (int) ($age / 30.4375) . 'm'; } else { $age = $age . 'd'; } @@ -4342,7 +4342,7 @@ class WT_Stats { $total = 10; } $sizes = explode('x', $size); - $total = (int)$total; + $total = (int) $total; $rows = $this->runSql( " SELECT SQL_CACHE f_numchil AS tot, f_id AS id" . " FROM `##families`" . @@ -4684,13 +4684,13 @@ class WT_Stats { $chm .= 't' . $unknown . ',000000,0,' . $i . ',11,1'; $chxl .= WT_I18N::translate_c('unknown century', 'Unknown') . "|1:||" . WT_I18N::translate('century') . "|2:|0|"; $step = $max + 1; - for ($d = (int)($max + 1); $d > 0; $d--) { + for ($d = (int) ($max + 1); $d > 0; $d--) { if (($max + 1) < ($d * 10 + 1) && fmod(($max + 1), $d) == 0) { $step = $d; } } - if ($step == (int)($max + 1)) { - for ($d = (int)($max); $d > 0; $d--) { + if ($step == (int) ($max + 1)) { + for ($d = (int) ($max); $d > 0; $d--) { if ($max < ($d * 10 + 1) && fmod($max, $d) == 0) { $step = $d; } @@ -4713,7 +4713,7 @@ class WT_Stats { global $TEXT_DIRECTION; if (isset($params[0])) { - $total = (int)$params[0]; + $total = (int) $params[0]; } else { $total = 10; } @@ -4794,12 +4794,12 @@ class WT_Stats { */ private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = array()) { if (isset($params[0]) && $params[0] > 0) { - $threshold = (int)$params[0]; + $threshold = (int) $params[0]; } else { $threshold = $this->tree->getPreference('COMMON_NAMES_THRESHOLD'); } if (isset($params[1])) { - $maxtoshow = (int)$params[1]; + $maxtoshow = (int) $params[1]; } else { $maxtoshow = 0; } @@ -4985,12 +4985,12 @@ class WT_Stats { global $GEDCOM; if (isset($params[0]) && $params[0] != '' && $params[0] >= 0) { - $threshold = (int)$params[0]; + $threshold = (int) $params[0]; } else { $threshold = 1; } if (isset($params[1]) && $params[1] != '' && $params[1] >= 0) { - $maxtoshow = (int)$params[1]; + $maxtoshow = (int) $params[1]; } else { $maxtoshow = 10; } @@ -5817,9 +5817,9 @@ class WT_Stats { if ($value < 0) { $value = 0; } - $first = (int)($value / 64); + $first = (int) ($value / 64); $second = $value % 64; - $encoding .= $xencoding[(int)$first] . $xencoding[(int)$second]; + $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; } return $encoding; } @@ -5957,7 +5957,7 @@ class WT_Stats { * @return string */ public function totalUserMessages() { - $total = (int)WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##message` WHERE user_id = ?") + $total = (int) WT_DB::prepare("SELECT SQL_CACHE COUNT(*) FROM `##message` WHERE user_id = ?") ->execute(array(Auth::id())) ->fetchOne(); @@ -5971,7 +5971,7 @@ class WT_Stats { */ public function totalUserJournal() { try { - $number = (int)WT_DB::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") + $number = (int) WT_DB::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") ->execute(array(Auth::id())) ->fetchOne(); } catch (PDOException $ex) { @@ -5989,7 +5989,7 @@ class WT_Stats { */ public function totalGedcomNews() { try { - $number = (int)WT_DB::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") + $number = (int) WT_DB::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") ->execute(array($this->tree->tree_id)) ->fetchOne(); } catch (PDOException $ex) { diff --git a/library/WT/User.php b/library/WT/User.php index a605a15db1..18fafd8ba6 100644 --- a/library/WT/User.php +++ b/library/WT/User.php @@ -150,7 +150,7 @@ class User { * @return integer */ public static function count() { - return (int)WT_DB::prepare( + return (int) WT_DB::prepare( "SELECT SQL_CACHE COUNT(*)" . " FROM `##user`" . " WHERE user_id > 0" @@ -232,8 +232,8 @@ class User { */ public static function allLoggedIn() { $rows = WT_DB::prepare( - "SELECT SQL_NO_CACHE DISTINCT user_id, user_name, real_name, email". - " FROM `##user`". + "SELECT SQL_NO_CACHE DISTINCT user_id, user_name, real_name, email" . + " FROM `##user`" . " JOIN `##session` USING (user_id)" )->fetchAll(); @@ -28,7 +28,7 @@ use WT\User; define('WT_SCRIPT_NAME', 'login.php'); require './includes/session.php'; -require WT_ROOT.'includes/functions/functions_edit.php'; +require WT_ROOT . 'includes/functions/functions_edit.php'; // If we are already logged in, then go to the “Home page” if (Auth::check() && WT_GED_ID) { header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH); @@ -41,7 +41,7 @@ $REQUIRE_ADMIN_AUTH_REGISTRATION = WT_Site::getPreference('REQUIRE_ADMIN_AUTH_RE $action = WT_Filter::post('action'); $user_realname = WT_Filter::post('user_realname'); -$user_name = WT_Filter::post('user_name', WT_REGEX_USERNAME); +$user_name = WT_Filter::post('user_name', WT_REGEX_USERNAME); $user_email = WT_Filter::postEmail('user_email'); $user_password01 = WT_Filter::post('user_password01', WT_REGEX_PASSWORD); $user_password02 = WT_Filter::post('user_password02', WT_REGEX_PASSWORD); @@ -112,7 +112,7 @@ case 'login': $latest_version_txt = fetch_latest_version(); if (preg_match('/^[0-9.]+\|[0-9.]+\|/', $latest_version_txt)) { list($latest_version, $earliest_version, $download_url) = explode('|', $latest_version_txt); - if (version_compare(WT_VERSION, $latest_version)<0) { + if (version_compare(WT_VERSION, $latest_version) < 0) { // An upgrade is available. Let the admin know, by redirecting to the upgrade wizard $url = 'admin_site_upgrade.php'; } @@ -160,7 +160,7 @@ default: echo WT_I18N::translate('<center><b>Welcome to this genealogy website</b></center><br>Access to this site is permitted to <u>family members only</u>.<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 the information you provide, the administrator will either approve or decline your request for an account. You will receive an email when your request is approved.'); break; case 4: - echo '<p>', WT_Site::getPreference('WELCOME_TEXT_AUTH_MODE_'.WT_LOCALE), '</p>'; + echo '<p>', WT_Site::getPreference('WELCOME_TEXT_AUTH_MODE_' . WT_LOCALE), '</p>'; break; } @@ -195,14 +195,14 @@ default: <a href="#" id="passwd_click">', WT_I18N::translate('Request new password'), '</a> </div>'; if (WT_Site::getPreference('USE_REGISTRATION_MODULE')) { - echo '<div><a href="'.WT_LOGIN_URL.'?action=register">', WT_I18N::translate('Request new user account'), '</a></div>'; + echo '<div><a href="' . WT_LOGIN_URL . '?action=register">', WT_I18N::translate('Request new user account'), '</a></div>'; } } echo '</form>'; // hidden New Password block echo '<div id="new_passwd"> - <form id="new_passwd_form" name="new_passwd_form" action="'.WT_LOGIN_URL.'" method="post"> + <form id="new_passwd_form" name="new_passwd_form" action="'.WT_LOGIN_URL . '" method="post"> <input type="hidden" name="action" value="requestpw"> <h4>', WT_I18N::translate('Lost password request'), '</h4> <div> @@ -229,9 +229,9 @@ case 'requestpw': if ($user) { $passchars = 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $user_new_pw = ''; - $max = strlen($passchars)-1; - for ($i=0; $i<8; $i++) { - $index = rand(0,$max); + $max = strlen($passchars) - 1; + for ($i = 0; $i < 8; $i++) { + $index = rand(0, $max); $user_new_pw .= $passchars{$index}; } @@ -245,7 +245,7 @@ case 'requestpw': WT_I18N::translate('Hello %s…', WT_Filter::escapeHtml($user->getRealName())) . WT_Mail::EOL . WT_Mail::EOL . WT_I18N::translate('A new password was requested for your user name.') . WT_Mail::EOL . WT_Mail::EOL . WT_I18N::translate('Username') . ": " . WT_Filter::escapeHtml($user->getUserName()) . WT_Mail::EOL . - WT_I18N::translate('Password') . ": " . $user_new_pw . WT_Mail::EOL . WT_Mail::EOL . + WT_I18N::translate('Password') . ": " . $user_new_pw . WT_Mail::EOL . WT_Mail::EOL . WT_I18N::translate('After you have logged in, select the “My account” link under the “My page” menu and fill in the password fields to change your password.') . WT_Mail::EOL . WT_Mail::EOL . '<a href="' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'login.php?ged=' . WT_GEDURL . '">' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'login.php?ged=' . WT_GEDURL . '</a>' ); @@ -263,21 +263,21 @@ case 'requestpw': case 'register': if (!WT_Site::getPreference('USE_REGISTRATION_MODULE')) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); + header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH); exit; } $controller->setPageTitle(WT_I18N::translate('Request new user account')); // The form parameters are mandatory, and the validation errors are shown in the client. - if ($WT_SESSION->good_to_send && $user_name && $user_password01 && $user_password01==$user_password02 && $user_realname && $user_email && $user_comments) { + if ($WT_SESSION->good_to_send && $user_name && $user_password01 && $user_password01 == $user_password02 && $user_realname && $user_email && $user_comments) { // These validation errors cannot be shown in the client. if (User::findByIdentifier($user_name)) { WT_FlashMessages::addMessage(WT_I18N::translate('Duplicate user name. A user with that user name already exists. Please choose another user name.')); } elseif (User::findByIdentifier($user_email)) { WT_FlashMessages::addMessage(WT_I18N::translate('Duplicate email address. A user with that email already exists.')); - } elseif (preg_match('/(?!'.preg_quote(WT_SERVER_NAME, '/').')(((?:ftp|http|https):\/\/)[a-zA-Z0-9.-]+)/', $user_comments, $match)) { + } elseif (preg_match('/(?!' . preg_quote(WT_SERVER_NAME, '/') . ')(((?:ftp|http|https):\/\/)[a-zA-Z0-9.-]+)/', $user_comments, $match)) { WT_FlashMessages::addMessage( WT_I18N::translate('You are not allowed to send messages that contain external links.') . ' ' . WT_I18N::translate('You should delete the “%1$s” from “%2$s” and try again.', $match[2], $match[1]) @@ -290,18 +290,18 @@ case 'register': $user = User::create($user_name, $user_realname, $user_email, $user_password01); $user - ->setPreference('language', WT_LOCALE) - ->setPreference('verified', '0') + ->setPreference('language', WT_LOCALE) + ->setPreference('verified', '0') ->setPreference('verified_by_admin', !$REQUIRE_ADMIN_AUTH_REGISTRATION) - ->setPreference('reg_timestamp', date('U')) - ->setPreference('reg_hashcode', md5(Uuid::uuid4())) - ->setPreference('contactmethod', 'messaging2') - ->setPreference('comment', $user_comments) - ->setPreference('visibleonline', '1') - ->setPreference('editaccount', '1') - ->setPreference('auto_accept', '0') - ->setPreference('canadmin', '0') - ->setPreference('sessiontime', '0'); + ->setPreference('reg_timestamp', date('U')) + ->setPreference('reg_hashcode', md5(Uuid::uuid4())) + ->setPreference('contactmethod', 'messaging2') + ->setPreference('comment', $user_comments) + ->setPreference('visibleonline', '1') + ->setPreference('editaccount', '1') + ->setPreference('auto_accept', '0') + ->setPreference('canadmin', '0') + ->setPreference('sessiontime', '0'); // Generate an email in the admin’s language $webmaster = User::find($WT_TREE->getPreference('WEBMASTER_USER_ID')); @@ -311,10 +311,10 @@ case 'register': WT_I18N::translate('Hello administrator…') . WT_Mail::EOL . WT_Mail::EOL . /* I18N: %s is a server name/URL */ WT_I18N::translate('A prospective user has registered with webtrees at %s.', WT_SERVER_NAME . WT_SCRIPT_PATH . ' ' . $WT_TREE->tree_title_html) . WT_Mail::EOL . WT_Mail::EOL . - WT_I18N::translate('Username') . ' ' . $user->getUserName() . WT_Mail::EOL . - WT_I18N::translate('Real name') . ' ' . $user->getRealName() . WT_Mail::EOL . - WT_I18N::translate('Email address:') . ' ' . $user->getEmail() . WT_Mail::EOL . - WT_I18N::translate('Comments') . ' ' . $user_comments . WT_Mail::EOL . WT_Mail::EOL . + WT_I18N::translate('Username') . ' ' . $user->getUserName() . WT_Mail::EOL . + WT_I18N::translate('Real name') . ' ' . $user->getRealName() . WT_Mail::EOL . + WT_I18N::translate('Email address:') . ' ' . $user->getEmail() . WT_Mail::EOL . + WT_I18N::translate('Comments') . ' ' . $user_comments . WT_Mail::EOL . WT_Mail::EOL . WT_I18N::translate('The user has been sent an e-mail with the information necessary to confirm the access request') . WT_Mail::EOL . WT_Mail::EOL; if ($REQUIRE_ADMIN_AUTH_REGISTRATION) { $mail1_body .= WT_I18N::translate('You will be informed by e-mail when this prospective user has confirmed the request. You can then complete the process by activating the user name. The new user will not be able to login until you activate the account.'); @@ -329,20 +329,20 @@ case 'register': echo '<div id="login-register-page">'; // Generate an email in the user’s language - $mail2_body= + $mail2_body = WT_I18N::translate('Hello %s…', $user->getRealName()) . WT_Mail::EOL . WT_Mail::EOL . /* I18N: %1$s is the site URL and %2$s is an email address */ - WT_I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_SERVER_NAME . WT_SCRIPT_PATH . ' ' . $WT_TREE->tree_title_html, $user->getEmail()) . ' '. + WT_I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_SERVER_NAME . WT_SCRIPT_PATH . ' ' . $WT_TREE->tree_title_html, $user->getEmail()) . ' ' . WT_I18N::translate('Information about the request is shown under the link below.') . WT_Mail::EOL . WT_I18N::translate('Please click on the following link and fill in the requested data to confirm your request and email address.') . WT_Mail::EOL . WT_Mail::EOL . - '<a href="' . WT_LOGIN_URL . "?user_name=".WT_Filter::escapeUrl($user->getUserName())."&user_hashcode=".$user->getPreference('reg_hashcode') . '&action=userverify">' . - WT_LOGIN_URL . "?user_name=".WT_Filter::escapeUrl($user->getUserName())."&user_hashcode=".urlencode($user->getPreference('reg_hashcode'))."&action=userverify" . + '<a href="' . WT_LOGIN_URL . "?user_name=" . WT_Filter::escapeUrl($user->getUserName()) . "&user_hashcode=" . $user->getPreference('reg_hashcode') . '&action=userverify">' . + WT_LOGIN_URL . "?user_name=" . WT_Filter::escapeUrl($user->getUserName()) . "&user_hashcode=" . urlencode($user->getPreference('reg_hashcode')) . "&action=userverify" . '</a>' . WT_Mail::EOL . WT_Mail::EOL . WT_I18N::translate('Username') . " " . WT_Filter::escapeHtml($user->getUserName()) . WT_Mail::EOL . WT_I18N::translate('Verification code:') . " " . $user->getPreference('reg_hashcode') . WT_Mail::EOL . - WT_I18N::translate('Comments').": " . $user->getPreference('comment') . WT_Mail::EOL . + WT_I18N::translate('Comments') . ": " . $user->getPreference('comment') . WT_Mail::EOL . WT_I18N::translate('If you didn’t request an account, you can just delete this message.') . WT_Mail::EOL; - $mail2_subject = /* I18N: %s is a server name/URL */ WT_I18N::translate('Your registration at %s', WT_SERVER_NAME.WT_SCRIPT_PATH); + $mail2_subject = /* I18N: %s is a server name/URL */ WT_I18N::translate('Your registration at %s', WT_SERVER_NAME . WT_SCRIPT_PATH); $mail2_to = $user->getEmail(); $mail2_from = $WEBTREES_EMAIL; @@ -376,7 +376,7 @@ case 'register': $mail1_body ); $mail1_method = $webmaster->getPreference('contact_method'); - if ($mail1_method!='messaging3' && $mail1_method!='mailto' && $mail1_method!='none') { + if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') { WT_DB::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)") ->execute(array($user->getEmail(), $WT_REQUEST->getClientIp(), $webmaster->getUserId(), $mail1_subject, WT_Filter::unescapeHtml($mail1_body))); } @@ -407,7 +407,7 @@ case 'register': echo '</div>'; } echo '<div id="register-box"> - <form id="register-form" name="register-form" method="post" action="'.WT_LOGIN_URL.'" onsubmit="return checkform(this);" autocomplete="off"> + <form id="register-form" name="register-form" method="post" action="'.WT_LOGIN_URL . '" onsubmit="return checkform(this);" autocomplete="off"> <input type="hidden" name="action" value="register"> <h4>', WT_I18N::translate('All fields must be completed.'), '</h4><hr> <div> @@ -427,12 +427,12 @@ case 'register': </div> <div> <label for="user_password01">', WT_I18N::translate('Desired password'), help_link('password'), - '<input type="password" id="user_password01" name="user_password01" value="', WT_Filter::escapeHtml($user_password01), '" required placeholder="', /* I18N: placeholder text for new-password field */ WT_I18N::plural('Use at least %s character.', 'Use at least %s characters.', WT_MINIMUM_PASSWORD_LENGTH, WT_I18N::number(WT_MINIMUM_PASSWORD_LENGTH)), '" pattern="'. WT_REGEX_PASSWORD .'" onchange="form.user_password02.pattern = regex_quote(this.value);"> + '<input type="password" id="user_password01" name="user_password01" value="', WT_Filter::escapeHtml($user_password01), '" required placeholder="', /* I18N: placeholder text for new-password field */ WT_I18N::plural('Use at least %s character.', 'Use at least %s characters.', WT_MINIMUM_PASSWORD_LENGTH, WT_I18N::number(WT_MINIMUM_PASSWORD_LENGTH)), '" pattern="' . WT_REGEX_PASSWORD . '" onchange="form.user_password02.pattern = regex_quote(this.value);"> </label> </div> <div> <label for="user_password02">', WT_I18N::translate('Confirm password'), help_link('password_confirm'), - '<input type="password" id="user_password02" name="user_password02" value="', WT_Filter::escapeHtml($user_password02), '" required placeholder="', /* I18N: placeholder text for repeat-password field */ WT_I18N::translate('Type the password again.'), '" pattern="'. WT_REGEX_PASSWORD .'"> + '<input type="password" id="user_password02" name="user_password02" value="', WT_Filter::escapeHtml($user_password02), '" required placeholder="', /* I18N: placeholder text for repeat-password field */ WT_I18N::translate('Type the password again.'), '" pattern="' . WT_REGEX_PASSWORD . '"> </label> </div> <div> @@ -453,7 +453,7 @@ case 'register': case 'userverify': if (!WT_Site::getPreference('USE_REGISTRATION_MODULE')) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); + header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH); exit; } @@ -514,8 +514,8 @@ case 'verify_hash': } $mail1_body .= WT_Mail::EOL . - '<a href="'. WT_SERVER_NAME.WT_SCRIPT_PATH."admin_users.php?filter=" . WT_Filter::escapeUrl($user->getUserName()) . '">' . - WT_SERVER_NAME.WT_SCRIPT_PATH."admin_users.php?filter=" . WT_Filter::escapeUrl($user->getUserName()) . + '<a href="' . WT_SERVER_NAME . WT_SCRIPT_PATH . "admin_users.php?filter=" . WT_Filter::escapeUrl($user->getUserName()) . '">' . + WT_SERVER_NAME . WT_SCRIPT_PATH . "admin_users.php?filter=" . WT_Filter::escapeUrl($user->getUserName()) . '</a>' . WT_Mail::auditFooter(); @@ -528,7 +528,7 @@ case 'verify_hash': $controller->pageHeader(); echo '<div id="login-register-page">'; - echo '<h2>'.WT_I18N::translate('User verification').'</h2>'; + echo '<h2>' . WT_I18N::translate('User verification') . '</h2>'; echo '<div id="user-verify">'; echo WT_I18N::translate('The data for the user <b>%s</b> was checked.', $user_name); if ($user) { @@ -546,8 +546,8 @@ case 'verify_hash': $mail1_subject, $mail1_body ); - $mail1_method = $webmaster->getPreference('CONTACT_METHOD'); - if ($mail1_method!='messaging3' && $mail1_method!='mailto' && $mail1_method!='none') { + $mail1_method = $webmaster->getPreference('CONTACT_METHOD'); + if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') { WT_DB::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)") ->execute(array($user_name, $WT_REQUEST->getClientIp(), $webmaster->getUserId(), $mail1_subject, WT_Filter::unescapeHtml($mail1_body))); } @@ -562,7 +562,7 @@ case 'verify_hash': } Log::addAuthenticationLog('User ' . $user_name . ' verified their email address'); - echo '<br><br>'.WT_I18N::translate('You have confirmed your request to become a registered user.').'<br><br>'; + echo '<br><br>' . WT_I18N::translate('You have confirmed your request to become a registered user.') . '<br><br>'; if ($REQUIRE_ADMIN_AUTH_REGISTRATION && !$user->getPreference('verified_by_admin')) { echo WT_I18N::translate('The administrator has been informed. As soon as he gives you permission to login, you can login with your user name and password.'); } else { diff --git a/medialist.php b/medialist.php index 8754e94fa1..b35e048a68 100644 --- a/medialist.php +++ b/medialist.php @@ -23,8 +23,8 @@ define('WT_SCRIPT_NAME', 'medialist.php'); require './includes/session.php'; -require_once WT_ROOT.'includes/functions/functions_edit.php'; -require_once WT_ROOT.'includes/functions/functions_print_facts.php'; +require_once WT_ROOT . 'includes/functions/functions_edit.php'; +require_once WT_ROOT . 'includes/functions/functions_print_facts.php'; $controller = new WT_Controller_Page; $controller @@ -34,7 +34,7 @@ $controller $search = WT_Filter::get('search'); $sortby = WT_Filter::get('sortby', 'file|title', 'title'); if (!WT_USER_CAN_EDIT && !WT_USER_CAN_ACCEPT) { - $sortby='title'; + $sortby = 'title'; } $start = WT_Filter::getInteger('start'); $max = WT_Filter::get('max', '10|20|30|40|50|75|100|125|150|200', '20'); @@ -87,10 +87,10 @@ $medialist = WT_Query_Media::mediaList( echo WT_I18N::translate('Sort order'); echo '</td><td class="optionbox wrap width25">'; echo '<select name="sortby">'; - echo '<option value="title" ', ($sortby=='title') ? 'selected="selected"' : '', '>'; + echo '<option value="title" ', ($sortby == 'title') ? 'selected="selected"' : '', '>'; echo /* I18N: An option in a list-box */ WT_I18N::translate('sort by title'); echo '</option>'; - echo '<option value="file" ', ($sortby=='file') ? 'selected="selected"' : '' , '>'; + echo '<option value="file" ', ($sortby == 'file') ? 'selected="selected"' : '', '>'; echo /* I18N: An option in a list-box */ WT_I18N::translate('sort by filename'); echo '</option>'; echo '</select>'; @@ -172,7 +172,7 @@ if ($search) { echo '<div><p style="text-align: center;">', WT_I18N::translate('Media objects found'), ' ', $ct, '</p>'; - if ($ct>0) { + if ($ct > 0) { $currentPage = ((int) ($start / $max)) + 1; $lastPage = (int) (($ct + $max - 1) / $max); @@ -183,12 +183,12 @@ if ($search) { echo '<table class="list_table_controls"><tr><td>'; if ($TEXT_DIRECTION === 'ltr') { - if ($ct>$max) { + if ($ct > $max) { if ($currentPage > 1) { echo '<a href="medialist.php?action=no&search=no&folder=', rawurlencode($folder), '&sortby=', $sortby, '&subdirs=', $subdirs, '&filter=', rawurlencode($filter), '&columns=', $columns, '&apply_filter=', $apply_filter, '&start=0&max=', $max, '" class="icon-ldarrow"></a>'; } if ($start > 0) { - $newstart = $start-$max; + $newstart = $start - $max; if ($start < 0) { $start = 0; } @@ -196,13 +196,13 @@ if ($search) { } } } else { - if ($ct>$max) { + if ($ct > $max) { if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; echo '<a href="medialist.php?action=no&search=no&folder=', rawurlencode($folder), '&sortby=', $sortby, '&subdirs=', $subdirs, '&filter=', rawurlencode($filter), '&columns=', $columns, '&apply_filter=', $apply_filter, '&start=', $lastStart, '&max=', $max, '" class="icon-rdarrow"></a>'; } if ($start + $max < $ct) { - $newstart = $start+$count; + $newstart = $start + $count; if ($start < 0) { $start = 0; } @@ -214,7 +214,7 @@ if ($search) { echo '<td>', WT_I18N::translate('Page %s of %s', $currentPage, $lastPage), '</td>'; echo '<td>'; if ($TEXT_DIRECTION === 'ltr') { - if ($ct>$max) { + if ($ct > $max) { if ($start + $max < $ct) { $newstart = $start + $count; if ($start < 0) { @@ -248,7 +248,7 @@ if ($search) { } echo '<tbody><tr>'; - for ($i=$start, $n=0; $i<$start+$count; ++$i) { + for ($i = $start, $n = 0; $i < $start + $count; ++$i) { $mediaobject = $medialist[$i]; if ($columns == '1') { @@ -265,7 +265,7 @@ if ($search) { echo WT_Controller_Media::getMediaListMenu($mediaobject); } // If sorting by title, highlight the title. If sorting by filename, highlight the filename - if ($sortby=='title') { + if ($sortby == 'title') { echo '<p><b><a href="', $mediaobject->getHtmlUrl(), '">'; echo $mediaobject->getFullName(); echo '</a></b></p>'; @@ -299,13 +299,13 @@ if ($search) { echo print_fact_notes($mediaobject->getGedcom(), 1); echo '</div>'; foreach ($mediaobject->linkedIndividuals('OBJE') as $individual) { - echo '<a href="' . $individual->getHtmlUrl() . '">' . WT_I18N::translate('View person') . ' — ' . $individual->getFullname().'</a><br>'; + echo '<a href="' . $individual->getHtmlUrl() . '">' . WT_I18N::translate('View person') . ' — ' . $individual->getFullname() . '</a><br>'; } foreach ($mediaobject->linkedFamilies('OBJE') as $family) { - echo '<a href="' . $family->getHtmlUrl() . '">' . WT_I18N::translate('View family') . ' — ' . $family->getFullname().'</a><br>'; + echo '<a href="' . $family->getHtmlUrl() . '">' . WT_I18N::translate('View family') . ' — ' . $family->getFullname() . '</a><br>'; } foreach ($mediaobject->linkedSources('OBJE') as $source) { - echo '<a href="' . $source->getHtmlUrl() . '">' . WT_I18N::translate('View source') . ' — ' . $source->getFullname().'</a><br>'; + echo '<a href="' . $source->getHtmlUrl() . '">' . WT_I18N::translate('View source') . ' — ' . $source->getFullname() . '</a><br>'; } echo '</td></tr></table>'; echo '</td>'; @@ -315,7 +315,7 @@ if ($search) { } // end media loop // An odd number of media objects in two columns requires an empty cell - if ($columns == 2 && $n%2 == 1) { + if ($columns == 2 && $n % 2 == 1) { echo '<td></td>'; } diff --git a/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php b/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php index 55df699418..8697e31870 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php @@ -50,8 +50,8 @@ if (!defined('WT_WEBTREES')) { </script> <?php echo "<input id=personid type=\"text\" size=\"20\" style=\"color: #000000;\" value=\"\">"; - echo "<a href=\"#\" onclick=\"findindi()\">" ; - echo " ".WT_I18N::translate('Search'); + echo "<a href=\"#\" onclick=\"findindi()\">"; + echo " " . WT_I18N::translate('Search'); echo '</a>'; ?> </td> @@ -75,7 +75,7 @@ if (!defined('WT_WEBTREES')) { <?php // Header text with "Head" button ================================================= $headImg = '<i class="headimg vmiddle icon-button_head"></i>'; - $headImg2 = '<i class="headimg2 vmiddle icon-button_head" title="'.WT_I18N::translate('Click to choose individual as head of family.').'"></i>'; + $headImg2 = '<i class="headimg2 vmiddle icon-button_head" title="' . WT_I18N::translate('Click to choose individual as head of family.') . '"></i>'; echo WT_I18N::translate('Click %s to choose individual as head of family.', $headImg); ?> </td> @@ -94,13 +94,13 @@ if (!defined('WT_WEBTREES')) { $chBLDarray = Array(); foreach ($family->getChildren() as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } @@ -108,7 +108,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getHusband()) { //-- Parents Husbands Parents -------------------------------------- - $gparent=$family->getHusband(); + $gparent = $family->getHusband(); foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); $pwife = $cfamily->getWife(); @@ -119,14 +119,14 @@ if (!defined('WT_WEBTREES')) { //-- Parents Husbands Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $label = get_close_relationship_name($person, $gparent); @@ -142,14 +142,14 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value" style="text-decoration:none;" > <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$gparent->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $gparent->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> </td> <td align="left" class="facts_value nowrap"> <a href='#' onclick='insertRowToTable("<?php - echo $gparent->getXref() ; // pid = PID + echo $gparent->getXref(); // pid = PID ?>", "<?php echo WT_Filter::escapeHtml($fulln); // nam = Full Name ?>", "<?php @@ -167,21 +167,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $gparent->getSex(); // gend = Gender ?>", "<?php - if ($married>=0) { + if ($married >= 0) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($gparent->getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$gparent->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($gparent->getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -199,13 +199,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Husband Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $gparent->getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $gparent->getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> </a> </td> @@ -217,7 +217,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getWife()) { //-- Parents Wifes Parent Family --------------------------- - $gparent=$family->getWife(); + $gparent = $family->getWife(); $cfamily = null; foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); @@ -229,25 +229,25 @@ if (!defined('WT_WEBTREES')) { //-- Wifes Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available if ($cfamily && $cfamily->getHusband()) { $husbnams = $cfamily->getHusband()->getAllNames(); - if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { + if ($husbnams[0]['surname'] == "@N.N." || $husbnams[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $husbnams[0]['surname']; } } - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $husbnam; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $husbnam; } } $label = get_close_relationship_name($person, $gparent); @@ -262,7 +262,7 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$gparent->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $gparent->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> @@ -287,21 +287,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $gparent->getSex(); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])) { + if ($married >= 0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($gparent->getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$gparent->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($gparent->getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -319,13 +319,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Wife Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $gparent->getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $gparent->getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> </a> </td> @@ -339,40 +339,40 @@ if (!defined('WT_WEBTREES')) { foreach ($family->getChildren() as $child) { // Get Child’s Children’s Name DOB DOD ---- - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name// Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } // Get child’s marriage status ---- - $married=""; - $marrdate=""; + $married = ""; + $marrdate = ""; foreach ($child->getSpouseFamilies() as $childfamily) { - $marrdate=$childfamily->getMarriageDate(); + $marrdate = $childfamily->getMarriageDate(); $married = WT_Date::Compare($censdate, $marrdate); } $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - for ($i=0; $i<count($nam); $i++) { - if ($chnam[$i]['type']=='_MARNM') { - $chfulmn = rtrim($chnam[$i]['givn'],'*') . ' ' . $chnam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($chnam[$i]['type'] == '_MARNM') { + $chfulmn = rtrim($chnam[$i]['givn'], '*') . ' ' . $chnam[$i]['surname']; } } $label = get_close_relationship_name($person, $child); @@ -388,7 +388,7 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $child->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> @@ -416,21 +416,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $child->getSex(); // gend = Gender ?>", "<?php - if ($married>0) { + if ($married > 0) { echo "M"; // cond = Condition (Married) - } else if ($married<0 || ($married=="0") ) { + } else if ($married < 0 || ($married == "0")) { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$child->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $child->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -448,7 +448,7 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Child Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $child->getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } @@ -478,13 +478,13 @@ if (!defined('WT_WEBTREES')) { $chBLDarray = Array(); foreach ($family->getChildren() as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } @@ -492,7 +492,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getHusband()) { //-- Step Husbands Parent Family -------------------------------------- - $gparent=$family->getHusband(); + $gparent = $family->getHusband(); foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); $pwife = $cfamily->getWife(); @@ -503,14 +503,14 @@ if (!defined('WT_WEBTREES')) { //-- Step Husbands Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $label = get_close_relationship_name($person, $gparent); @@ -527,7 +527,7 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$gparent->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $gparent->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> @@ -552,21 +552,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $gparent->getSex(); // gend = Gender ?>", "<?php - if ($married>=0) { + if ($married >= 0) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($gparent->getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$gparent->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($gparent->getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -584,13 +584,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Step Husband Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $gparent->getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $gparent->getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> </a> </td> @@ -602,7 +602,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getWife()) { //-- Step Wifes Parent Family -------------------------------------- - $gparent=$family->getWife(); + $gparent = $family->getWife(); $cfamily = null; foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); @@ -614,25 +614,25 @@ if (!defined('WT_WEBTREES')) { //-- Step Wifes Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available if ($cfamily && $cfamily->getHusband()) { $husbnams = $cfamily->getHusband()->getAllNames(); - if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { + if ($husbnams[0]['surname'] == "@N.N." || $husbnams[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $husbnams[0]['surname']; } } - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $husbnam; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $husbnam; } } $label = get_close_relationship_name($person, $gparent); @@ -649,14 +649,14 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$gparent->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $gparent->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> </td> <td align="left" class="facts_value nowrap"> <a href='#' onclick='insertRowToTable("<?php - echo $gparent->getXref() ; // pid = PID + echo $gparent->getXref(); // pid = PID ?>", "<?php echo WT_Filter::escapeHtml($fulln); // nam = Full Name ?>", "<?php @@ -666,7 +666,7 @@ if (!defined('WT_WEBTREES')) { echo WT_Filter::escapeHtml($fulln); // mnam = Full Name } ?>", "<?php - if ($person ===$gparent) { + if ($person === $gparent) { echo 'head'; } else { echo WT_Filter::escapeHtml($label); @@ -674,21 +674,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $gparent->getSex(); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])) { + if ($married >= 0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($gparent->getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$gparent->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($gparent->getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -706,13 +706,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Step Wife Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $gparent->getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $gparent->getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> </a> </td> @@ -724,33 +724,33 @@ if (!defined('WT_WEBTREES')) { foreach ($family->getChildren() as $child) { // Get Child’s Children - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - for ($i=0; $i<count($nam); $i++) { - if ($chnam[$i]['type']=='_MARNM') { - $chfulmn = rtrim($chnam[$i]['givn'],'*') . ' ' . $chnam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($chnam[$i]['type'] == '_MARNM') { + $chfulmn = rtrim($chnam[$i]['givn'], '*') . ' ' . $chnam[$i]['surname']; } } $label = get_close_relationship_name($person, $child); @@ -767,7 +767,7 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $child->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> @@ -777,7 +777,7 @@ if (!defined('WT_WEBTREES')) { if (($child->canShow())) { ?> <a href='#' onclick='insertRowToTable("<?php - echo $child->getXref() ; // pid = PID + echo $child->getXref(); // pid = PID ?>", "<?php echo WT_Filter::escapeHtml($fulln); // nam = Full Name ?>", "<?php @@ -798,14 +798,14 @@ if (!defined('WT_WEBTREES')) { echo ""; // cond = Condition (Married or Single) ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$child->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $child->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -823,13 +823,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Child Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $child->getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $child->getFullName(); // Full Name (Link) + echo $child->getFullName(); // Full Name (Link) ?> </a> <?php @@ -853,13 +853,13 @@ if (!defined('WT_WEBTREES')) { $chBLDarray = Array(); foreach ($family->getChildren() as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } @@ -867,7 +867,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getHusband()) { //-- Spouse Husbands Parents -------------------------------------- - $gparent=$family->getHusband(); + $gparent = $family->getHusband(); foreach ($gparent->getChildFamilies() as $cfamily) { $phusb = $cfamily->getHusband(); $pwife = $cfamily->getWife(); @@ -878,14 +878,14 @@ if (!defined('WT_WEBTREES')) { //-- Spouse Husbands Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $label = get_close_relationship_name($person, $gparent); @@ -902,14 +902,14 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$gparent->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $gparent->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> </td> <td align="left" class="facts_value nowrap"> <a href='#' onclick='insertRowToTable("<?php - echo $gparent->getXref() ; // pid = PID + echo $gparent->getXref(); // pid = PID ?>", "<?php echo WT_Filter::escapeHtml($fulln); // nam = Full Name ?>", "<?php @@ -927,21 +927,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $gparent->getSex(); // gend = Gender ?>", "<?php - if ($married>=0) { + if ($married >= 0) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($gparent->getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$gparent->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($gparent->getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -959,13 +959,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Husband Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $gparent->getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $gparent->getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> </a> </td> @@ -977,7 +977,7 @@ if (!defined('WT_WEBTREES')) { if ($family->getWife()) { //-- Spouse Wifes Parents -------------------------------------- - $gparent=$family->getWife(); + $gparent = $family->getWife(); $cfamily = null; foreach ($gparent->getChildFamilies() as $cfamily) { $husb = $cfamily->getHusband(); @@ -989,25 +989,25 @@ if (!defined('WT_WEBTREES')) { //-- Spouse Wifes Details -------------------------------------- $married = WT_Date::Compare($censdate, $marrdate); $nam = $gparent->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; $husbnam = null; // Get wifes married name if available if ($cfamily && $cfamily->getHusband()) { $husbnams = $cfamily->getHusband()->getAllNames(); - if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") { + if ($husbnams[0]['surname'] == "@N.N." || $husbnams[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $husbnams[0]['surname']; } } - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $husbnam; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $husbnam; } } $label = get_close_relationship_name($person, $gparent); @@ -1024,14 +1024,14 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$gparent->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $gparent->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> </td> <td align="left" class="facts_value nowrap"> <a href='#' onclick='insertRowToTable("<?php - echo $gparent->getXref() ; // pid = PID + echo $gparent->getXref(); // pid = PID ?>", "<?php echo WT_Filter::escapeHtml($fulln); // nam = Full Name ?>", "<?php @@ -1049,21 +1049,21 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $gparent->getSex(); // gend = Gender ?>", "<?php - if ($married>=0 && isset($nam[1])) { + if ($married >= 0 && isset($nam[1])) { echo "M"; // cond = Condition (Married) } else { echo "S"; // cond = Condition (Single) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($gparent->getBirthDate()->minJD()+$gparent->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($gparent->getBirthDate()->minJD() + $gparent->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$gparent->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $gparent->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($gparent->getDeathDate()->minJD()+$gparent->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($gparent->getDeathDate()->minJD() + $gparent->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -1081,13 +1081,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Wife Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $gparent->getSex()=="F") { + if (isset($chBLDarray) && $gparent->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $gparent->getFullName(); // Full Name (Link) + echo $gparent->getFullName(); // Full Name (Link) ?> </a> </td> @@ -1098,42 +1098,42 @@ if (!defined('WT_WEBTREES')) { foreach ($family->getChildren() as $child) { // Get Spouse child’s marriage status - $married=""; - $marrdate=""; + $married = ""; + $marrdate = ""; foreach ($child->getSpouseFamilies() as $childfamily) { - $marrdate=$childfamily->getMarriageDate(); + $marrdate = $childfamily->getMarriageDate(); $married = WT_Date::Compare($censdate, $marrdate); } // Get Child’s Children - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); $chfulln = WT_Filter::escapeHtml($chfulln); // Child’s Full Name// Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } // Get Spouse child’s details $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - for ($i=0; $i<count($nam); $i++) { - if ($chnam[$i]['type']=='_MARNM') { - $chfulmn = rtrim($chnam[$i]['givn'],'*') . ' ' . $chnam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($chnam[$i]['type'] == '_MARNM') { + $chfulmn = rtrim($chnam[$i]['givn'], '*') . ' ' . $chnam[$i]['surname']; } } $label = get_close_relationship_name($person, $child); @@ -1148,7 +1148,7 @@ if (!defined('WT_WEBTREES')) { </td> <td align="left" class="facts_value"> <?php - echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; + echo "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=" . $child->getXref() . "&gedcom=" . WT_GEDURL . "\">"; echo $headImg2; echo "</a>"; ?> @@ -1158,7 +1158,7 @@ if (!defined('WT_WEBTREES')) { if (($child->canShow())) { ?> <a href='#' onclick='insertRowToTable("<?php - echo $child->getXref() ; // pid = PID + echo $child->getXref(); // pid = PID ?>", "<?php echo WT_Filter::escapeHtml($fulln); // nam = Full Name ?>", "<?php @@ -1176,23 +1176,23 @@ if (!defined('WT_WEBTREES')) { ?>", "<?php echo $child->getSex(); // gend = Gender ?>", "<?php - if ($married>0) { + if ($married > 0) { echo "M"; // cond = Condition (Married) - } else if ($married<0 || ($married=="0") ) { + } else if ($married < 0 || ($married == "0")) { echo "S"; // cond = Condition (Single) } else { echo ""; // cond = Condition (Not Known) } ?>", "<?php if ($marrdate) { - echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian) + echo ($marrdate->minJD() + $marrdate->maxJD()) / 2; // dom = Date of Marriage (Julian) } ?>", "<?php - echo ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian) + echo ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // dob = Date of Birth (Julian) ?>", "<?php - echo $censyear-$child->getbirthyear(); // age = Census Date minus YOB + echo $censyear - $child->getbirthyear(); // age = Census Date minus YOB ?>", "<?php - echo ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian) + echo ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // dod = Date of Death (Julian) ?>", "<?php echo ""; // occu = Occupation ?>", "<?php @@ -1210,13 +1210,13 @@ if (!defined('WT_WEBTREES')) { echo 'UNK, UNK, UNK, UNK'; // mbirthpl = Child Mother’s Place of Birth Not known } ?>", "<?php - if (isset($chBLDarray) && $child->getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); echo $chBLDarray; // Array of Children (name, birthdate, deathdate) } ?>");'> <?php - echo $child->getFullName(); // Full Name (Link) + echo $child->getFullName(); // Full Name (Link) ?> </a> <?php @@ -1253,9 +1253,9 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent; global $natdad, $natmom, $censyear; - $person=WT_Individual::getInstance($pid); + $person = WT_Individual::getInstance($pid); - $tmp = array('M'=>'','F'=>'F', 'U'=>'NN'); + $tmp = array('M'=>'', 'F'=>'F', 'U'=>'NN'); $isF = $tmp[$person->getSex()]; $spouselinks = ''; $parentlinks = ''; @@ -1264,20 +1264,20 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($person->canShowName()) { //-- draw a box for the family popup - if ($TEXT_DIRECTION=="rtl") { + if ($TEXT_DIRECTION == "rtl") { $spouselinks .= "<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">"; - $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br>"; + $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" . $person->getFullName() . ")<br>"; $parentlinks .= "<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">"; - $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br>"; + $parentlinks .= "<b>" . WT_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\">"; - $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br>"; + $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>"; } else { $spouselinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">"; - $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br>"; + $spouselinks .= "<b>" . WT_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\">"; - $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br>"; + $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>"; $step_parentlinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">"; - $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br>"; + $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>"; } $persons = ''; @@ -1296,13 +1296,13 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $chBLDarray = Array(); foreach ($children as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1311,7 +1311,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($husb || $children) { if ($husb) { // Parent Husbands Parents - $gparent=WT_Individual::getInstance($husb->getXref()); + $gparent = WT_Individual::getInstance($husb->getXref()); $parfams = $gparent->getChildFamilies(); foreach ($parfams as $pfamily) { $phusb = $pfamily->getHusband(); @@ -1324,54 +1324,54 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $person_parent = 'Yes'; if ($husb->canShowName()) { $nam = $husb->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable("; - $parentlinks .= "'".$husb->getXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $parentlinks .= "'" . $husb->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Married Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Married Name } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Father in Law',"; // label = 1st Gen Male Relationship } else { $parentlinks .= "'Grand-Father',"; // label = 2st Gen Male Relationship } - $parentlinks .= "'".$husb->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $husb->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($husb->getBirthDate()->minJD()+$husb->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($husb->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$husb->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($husb->getBirthDate()->minJD() + $husb->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($husb->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $husb->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($husb->getDeathDate()->minJD()+$husb->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($husb->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($husb->getDeathDate()->minJD() + $husb->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($husb->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pHusbFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace } if (isset($pHusbMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace } - if (isset($chBLDarray) && $husb->getSex()=="F") { + if (isset($chBLDarray) && $husb->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1399,59 +1399,59 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { } // Parent Wifes Details - $person_parent="Yes"; + $person_parent = "Yes"; if ($wife->canShowName()) { $nam = $wife->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable("; - $parentlinks .= "'".$wife->getXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $parentlinks .= "'" . $wife->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulmn))."',"; + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',"; } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Mother in Law',"; // label = 1st Gen Female Relationship } else { $parentlinks .= "'Grand-Mother',"; // label = 2st Gen Female Relationship } - $parentlinks .= "'".$wife->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $wife->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($wife->getBirthDate()->minJD()+$wife->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($wife->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($wife->getBirthDate()->minJD() + $wife->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($wife->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $wife->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($wife->getDeathDate()->minJD()+$wife->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($wife->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($wife->getDeathDate()->minJD() + $wife->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($wife->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pWifeFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($pWifeMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $wife->getSex()=="F") { + if (isset($chBLDarray) && $wife->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1478,13 +1478,13 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $chBLDarray = Array(); foreach ($children as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1495,7 +1495,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if (($husb || $children) && $husb !== $person) { if ($husb) { // Step Husbands Parents - $gparent=WT_Individual::getInstance($husb->getXref()); + $gparent = WT_Individual::getInstance($husb->getXref()); $parfams = $gparent->getChildFamilies(); foreach ($parfams as $pfamily) { $phusb = $pfamily->getHusband(); @@ -1507,54 +1507,54 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $person_step = 'Yes'; if ($husb->canShowName()) { $nam = $husb->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable("; - $parentlinks .= "'".$husb->getXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $parentlinks .= "'" . $husb->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Married Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Married Name } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Step Father-in-Law',"; // label = 1st Gen Male Relationship } else { $parentlinks .= "'Step Grand-Father',"; // label = 2st Gen Male Relationship } - $parentlinks .= "'".$husb->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $husb->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($husb->getBirthDate()->minJD()+$husb->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($husb->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$husb->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($husb->getBirthDate()->minJD() + $husb->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($husb->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $husb->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($husb->getDeathDate()->minJD()+$husb->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($husb->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($husb->getDeathDate()->minJD() + $husb->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($husb->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pHusbFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace } if (isset($pHusbMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pHusbMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace } - if (isset($chBLDarray) && $husb->getSex()=="F") { + if (isset($chBLDarray) && $husb->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1575,7 +1575,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($wife || $children) { if ($wife) { // Step Wifes Parents - $gparent=WT_Individual::getInstance($wife->getXref()); + $gparent = WT_Individual::getInstance($wife->getXref()); $parfams = $gparent->getChildFamilies(); foreach ($parfams as $pfamily) { $pwhusb = $pfamily->getHusband(); @@ -1587,56 +1587,56 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $person_step = 'Yes'; if ($wife->canShowName()) { $nam = $wife->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM') { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM') { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } } $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable("; - $parentlinks .= "'".$wife->getXref()."',"; // pid = PID - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $parentlinks .= "'" . $wife->getXref() . "',"; // pid = PID + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($fulmn)) { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulmn))."',"; // mnam = Full Married Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',"; // mnam = Full Married Name } else { - $parentlinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Wife" || $currpid=="Husband") { + if ($currpid == "Wife" || $currpid == "Husband") { $parentlinks .= "'Step Mother-in-Law',"; // label = 1st Gen Female Relationship } else { $parentlinks .= "'Step Grand-Mother',"; // label = 2st Gen Female Relationship } - $parentlinks .= "'".$wife->getSex()."',"; // sex = Gender - $parentlinks .= "''".","; // cond = Condition (Married etc) + $parentlinks .= "'" . $wife->getSex() . "',"; // sex = Gender + $parentlinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $parentlinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } - $parentlinks .= "'".(($wife->getBirthDate()->minJD()+$wife->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($wife->getbirthyear()>=1) { - $parentlinks .= "'".($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth + $parentlinks .= "'" . (($wife->getBirthDate()->minJD() + $wife->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($wife->getbirthyear() >= 1) { + $parentlinks .= "'" . ($censyear - $wife->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $parentlinks .= "''".","; // age = Undefined + $parentlinks .= "''" . ","; // age = Undefined } - $parentlinks .= "'".(($wife->getDeathDate()->minJD()+$wife->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $parentlinks .= "''".","; // occu = Occupation - $parentlinks .= "'".WT_Filter::escapeHtml($wife->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $parentlinks .= "'" . (($wife->getDeathDate()->minJD() + $wife->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $parentlinks .= "''" . ","; // occu = Occupation + $parentlinks .= "'" . WT_Filter::escapeHtml($wife->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pWifeFBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeFBP)."'".","; // fbirthpl = Fathers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($pWifeMBP)) { - $parentlinks .= "'".WT_Filter::escapeHtml($pWifeMBP)."'".","; // mbirthpl = Mothers Birthplace + $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $parentlinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $wife->getSex()=="F") { + if (isset($chBLDarray) && $wife->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $parentlinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $parentlinks .= "''"; } @@ -1663,13 +1663,13 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $chBLDarray = Array(); foreach ($children as $child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); // Child’s Full Name + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1679,7 +1679,7 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { if ($spouse) { // Spouse Parents - $gparent=WT_Individual::getInstance($spouse->getXref()); + $gparent = WT_Individual::getInstance($spouse->getXref()); $spousefams = $gparent->getChildFamilies(); foreach ($spousefams as $pfamily) { $phusb = $pfamily->getHusband(); @@ -1691,67 +1691,67 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { // Spouse Details if ($spouse->canShowName()) { $nam = $spouse->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); // If spouse is a wife, then get her married name or default to her birth name - for ($i=0; $i<count($nam); $i++) { - if ($nam[$i]['type']=='_MARNM' && $is_wife) { - $fulmn = rtrim($nam[$i]['givn'],'*') . ' ' . $nam[$i]['surname']; + for ($i = 0; $i < count($nam); $i++) { + if ($nam[$i]['type'] == '_MARNM' && $is_wife) { + $fulmn = rtrim($nam[$i]['givn'], '*') . ' ' . $nam[$i]['surname']; } else { $fulmn = $fulln; } } $spouselinks .= "<a href=\"#\" onclick=\"insertRowToTable("; - $spouselinks .= "'".$spouse->getXref()."',"; // pid = PID - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $spouselinks .= "'" . $spouse->getXref() . "',"; // pid = PID + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; if (isset($fulmn)) { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulmn))."',"; + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',"; } else { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; } - if ($currpid=="Son" || $currpid=="Daughter") { - if ($spouse->getSex()=="M") { + if ($currpid == "Son" || $currpid == "Daughter") { + if ($spouse->getSex() == "M") { $spouselinks .= "'Son in Law',"; // label = Male Relationship } else { $spouselinks .= "'Daughter in Law',"; // label = Female Relationship } } else { - if ($spouse->getSex()=="M") { + if ($spouse->getSex() == "M") { $spouselinks .= "'Brother in Law',"; // label = Male Relationship } else { $spouselinks .= "'Sister in Law',"; // label = Female Relationship } } - $spouselinks .= "'".$spouse->getSex()."',"; // sex = Gender - $spouselinks .= "''".","; // cond = Condition (Married etc) + $spouselinks .= "'" . $spouse->getSex() . "',"; // sex = Gender + $spouselinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $spouselinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; + $spouselinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; } - $spouselinks .= "'".(($spouse->getBirthDate()->minJD()+$spouse->getBirthDate()->maxJD())/2)."',"; - if ($spouse->getbirthyear()>=1) { - $spouselinks .= "'".($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth + $spouselinks .= "'" . (($spouse->getBirthDate()->minJD() + $spouse->getBirthDate()->maxJD()) / 2) . "',"; + if ($spouse->getbirthyear() >= 1) { + $spouselinks .= "'" . ($censyear - $spouse->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $spouselinks .= "''".","; // age = Undefined + $spouselinks .= "''" . ","; // age = Undefined } - $spouselinks .= "'".(($spouse->getDeathDate()->minJD()+$spouse->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $spouselinks .= "''".","; // occu = Occupation - $spouselinks .= "'".WT_Filter::escapeHtml($spouse->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $spouselinks .= "'" . (($spouse->getDeathDate()->minJD() + $spouse->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $spouselinks .= "''" . ","; // occu = Occupation + $spouselinks .= "'" . WT_Filter::escapeHtml($spouse->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($pSpouseFBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($pSpouseFBP)."'".","; // fbirthpl = Fathers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($pSpouseFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($pSpouseMBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($pSpouseMBP)."'".","; // mbirthpl = Mothers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($pSpouseMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $spouse->getSex()=="F") { + if (isset($chBLDarray) && $spouse->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $spouselinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $spouselinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $spouselinks .= "''"; } @@ -1771,10 +1771,10 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { // Children $spouselinks .= "<ul class=\"clist\">"; foreach ($children as $child) { - $persons="Yes"; + $persons = "Yes"; // Child’s Parents - $gparent=WT_Individual::getInstance($child->getXref()); + $gparent = WT_Individual::getInstance($child->getXref()); foreach ($gparent->getChildFamilies() as $family) { $husb = $family->getHusband(); $wife = $family->getWife(); @@ -1783,18 +1783,18 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { } // Child’s Children - $chBLDarray=Array(); + $chBLDarray = Array(); foreach ($child->getSpouseFamilies() as $childfamily) { $chchildren = $childfamily->getChildren(); foreach ($chchildren as $chchild) { $chnam = $chchild->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); // Child’s Full Name - $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) - $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); // Child’s Full Name + $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) + $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } @@ -1812,75 +1812,75 @@ function print_pedigree_person_nav_cens($pid, $currpid, $censyear) { $spouselinks .= '<li>'; if ($child->canShowName()) { $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*') . ' ' . $nam[0]['surname']; - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); + $fulln = rtrim($nam[0]['givn'], '*') . ' ' . $nam[0]['surname']; + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); // Get childs married name if available - $chfulmn=null; + $chfulmn = null; $chnam = $child->getAllNames(); - if ($chhusbnam[0]['surname']=="@N.N." || $chhusbnam[0]['surname']=="") { + if ($chhusbnam[0]['surname'] == "@N.N." || $chhusbnam[0]['surname'] == "") { // if Husband or his name is not known then use wifes birth name $husbnam = $nam[0]['surname']; } else { $husbnam = $chhusbnam[0]['surname']; } - for ($i=0; $i<count($nam); $i++) { - if ($chnam[$i]['type']=='_MARNM') { - $chfulmn = rtrim($chnam[$i]['givn'],'*') . ' ' . $husbnam; + for ($i = 0; $i < count($nam); $i++) { + if ($chnam[$i]['type'] == '_MARNM') { + $chfulmn = rtrim($chnam[$i]['givn'], '*') . ' ' . $husbnam; } } $spouselinks .= "<a href=\"#\" onclick=\"insertRowToTable("; - $spouselinks .= "'".$child->getXref()."',"; - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // nam = Name + $spouselinks .= "'" . $child->getXref() . "',"; + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // nam = Name if (isset($chfulmn)) { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($chfulmn))."',"; // mnam = Full Married Name + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($chfulmn)) . "',"; // mnam = Full Married Name } else { - $spouselinks .= "'".WT_Filter::escapeHtml(strip_tags($fulln))."',"; // mnam = Full Name + $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',"; // mnam = Full Name } - if ($currpid=="Son" || $currpid=="Daughter") { - if ($child->getSex()=="M") { + if ($currpid == "Son" || $currpid == "Daughter") { + if ($child->getSex() == "M") { $spouselinks .= "'Grand-Son',"; // label = Male Relationship } else { $spouselinks .= "'Grand-Daughter',"; // label = Female Relationship } } else { - if ($child->getSex()=="M") { + if ($child->getSex() == "M") { $spouselinks .= "'Nephew',"; // label = Male Relationship } else { $spouselinks .= "'Niece',"; // label = Female Relationship } } - $spouselinks .= "'".$child->getSex()."',"; // sex = Gender - $spouselinks .= "''".","; // cond = Condition (Married etc) + $spouselinks .= "'" . $child->getSex() . "',"; // sex = Gender + $spouselinks .= "''" . ","; // cond = Condition (Married etc) if ($marrdate) { - $spouselinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian) + $spouselinks .= "'" . (($marrdate->minJD() + $marrdate->maxJD()) / 2) . "',"; // dom = Date of Marriage (Julian) } else { - $spouselinks .= "'nm'".","; + $spouselinks .= "'nm'" . ","; } - $spouselinks .= "'".(($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth - if ($child->getbirthyear()>=1) { - $spouselinks .= "'".($censyear-$child->getbirthyear())."',"; // age = Census Year - Year of Birth + $spouselinks .= "'" . (($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2) . "',"; // dob = Date of Birth + if ($child->getbirthyear() >= 1) { + $spouselinks .= "'" . ($censyear - $child->getbirthyear()) . "',"; // age = Census Year - Year of Birth } else { - $spouselinks .= "''".","; // age = Undefined + $spouselinks .= "''" . ","; // age = Undefined } - $spouselinks .= "'".(($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death - $spouselinks .= "''".","; // occu = Occupation - $spouselinks .= "'".WT_Filter::escapeHtml($child->getBirthPlace())."'".","; // birthpl = Individuals Birthplace + $spouselinks .= "'" . (($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2) . "',"; // dod = Date of Death + $spouselinks .= "''" . ","; // occu = Occupation + $spouselinks .= "'" . WT_Filter::escapeHtml($child->getBirthPlace()) . "'" . ","; // birthpl = Individuals Birthplace if (isset($ChildFBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($ChildFBP)."'".","; // fbirthpl = Fathers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($ChildFBP) . "'" . ","; // fbirthpl = Fathers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // fbirthpl = Fathers Birthplace Not Known } if (isset($ChildMBP)) { - $spouselinks .= "'".WT_Filter::escapeHtml($ChildMBP)."'".","; // mbirthpl = Mothers Birthplace + $spouselinks .= "'" . WT_Filter::escapeHtml($ChildMBP) . "'" . ","; // mbirthpl = Mothers Birthplace } else { - $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known + $spouselinks .= "'UNK, UNK, UNK, UNK'" . ","; // mbirthpl = Mothers Birthplace Not Known } - if (isset($chBLDarray) && $child->getSex()=="F") { + if (isset($chBLDarray) && $child->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); - $spouselinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate) + $spouselinks .= "'" . $chBLDarray . "'"; // Array of Children (name, birthdate, deathdate) } else { $spouselinks .= "''"; } diff --git a/modules_v3/batch_update/admin_batch_update.php b/modules_v3/batch_update/admin_batch_update.php index 8a7caa8aa3..d6db1e0a43 100644 --- a/modules_v3/batch_update/admin_batch_update.php +++ b/modules_v3/batch_update/admin_batch_update.php @@ -24,17 +24,17 @@ require_once WT_ROOT . 'includes/functions/functions_edit.php'; * Class batch_update */ class batch_update { - var $plugin =null; // Form parameter: chosen plugin - var $xref =null; // Form parameter: record to update - var $action =null; // Form parameter: how to update record - var $data =null; // Form parameter: additional details for $action - var $plugins =null; // Array of available plugins - var $PLUGIN =null; // An instance of a plugin object - var $all_xrefs=null; // An array of all xrefs that might need to be updated - var $prev_xref=null; // The previous xref to process - var $curr_xref=null; // The xref to process - var $next_xref=null; // The next xref to process - var $record =null; // A GedcomRecord object corresponding to $curr_xref + var $plugin = null; // Form parameter: chosen plugin + var $xref = null; // Form parameter: record to update + var $action = null; // Form parameter: how to update record + var $data = null; // Form parameter: additional details for $action + var $plugins = null; // Array of available plugins + var $PLUGIN = null; // An instance of a plugin object + var $all_xrefs = null; // An array of all xrefs that might need to be updated + var $prev_xref = null; // The previous xref to process + var $curr_xref = null; // The xref to process + var $next_xref = null; // The next xref to process + var $record = null; // A GedcomRecord object corresponding to $curr_xref /** * What is the name of this plugin? @@ -52,64 +52,64 @@ class batch_update { */ function main() { // HTML common to all pages - $html= - self::getJavascript(). - '<form id="batch_update_form" action="module.php" method="get">'. - '<input type="hidden" name="mod" value="batch_update">'. - '<input type="hidden" name="mod_action" value="admin_batch_update">'. - '<input type="hidden" name="xref" value="'.$this->xref.'">'. - '<input type="hidden" name="action" value="">'. // will be set by javascript for next update - '<input type="hidden" name="data" value="">'. // will be set by javascript for next update - '<table id="batch_update"><tr>'. - '<th>'.WT_I18N::translate('Family tree').'</th>'. - '<td>'.select_edit_control('ged', WT_Tree::getNameList(), '', WT_GEDCOM, 'onchange="reset_reload();"'). - '</td></tr><tr><th>'.WT_I18N::translate('Batch update').'</th><td><select name="plugin" onchange="reset_reload();">'; + $html = + self::getJavascript() . + '<form id="batch_update_form" action="module.php" method="get">' . + '<input type="hidden" name="mod" value="batch_update">' . + '<input type="hidden" name="mod_action" value="admin_batch_update">' . + '<input type="hidden" name="xref" value="' . $this->xref . '">' . + '<input type="hidden" name="action" value="">' . // will be set by javascript for next update + '<input type="hidden" name="data" value="">' . // will be set by javascript for next update + '<table id="batch_update"><tr>' . + '<th>' . WT_I18N::translate('Family tree') . '</th>' . + '<td>' . select_edit_control('ged', WT_Tree::getNameList(), '', WT_GEDCOM, 'onchange="reset_reload();"') . + '</td></tr><tr><th>' . WT_I18N::translate('Batch update') . '</th><td><select name="plugin" onchange="reset_reload();">'; if (!$this->plugin) { - $html.='<option value="" selected="selected"></option>'; + $html .= '<option value="" selected="selected"></option>'; } foreach ($this->plugins as $class=>$plugin) { - $html.='<option value="'.$class.'"'.($this->plugin==$class ? ' selected="selected"' : '').'>'.$plugin->getName().'</option>'; + $html .= '<option value="' . $class . '"' . ($this->plugin == $class ? ' selected="selected"' : '') . '>' . $plugin->getName() . '</option>'; } - $html.='</select>'; + $html .= '</select>'; if ($this->PLUGIN) { - $html.='<br><em>'.$this->PLUGIN->getDescription().'</em>'; + $html .= '<br><em>' . $this->PLUGIN->getDescription() . '</em>'; } - $html.='</td></tr>'; + $html .= '</td></tr>'; if (!Auth::user()->getPreference('auto_accept')) { - $html.='<tr><td colspan="2" class="warning">'.WT_I18N::translate('Your user account does not have “automatically approve changes” enabled. You will only be able to change one record at a time.').'</td></tr>'; + $html .= '<tr><td colspan="2" class="warning">' . WT_I18N::translate('Your user account does not have “automatically approve changes” enabled. You will only be able to change one record at a time.') . '</td></tr>'; } // If a plugin is selected, display the details if ($this->PLUGIN) { - $html.=$this->PLUGIN->getOptionsForm(); - if (substr($this->action, -4)=='_all') { + $html .= $this->PLUGIN->getOptionsForm(); + if (substr($this->action, -4) == '_all') { // Reset - otherwise we might "undo all changes", which refreshes the // page, which makes them all again! - $html.='<script>reset_reload();</script>'; + $html .= '<script>reset_reload();</script>'; } else { if ($this->curr_xref) { // Create an object, so we can get the latest version of the name. - $this->record=WT_GedcomRecord::getInstance($this->curr_xref); + $this->record = WT_GedcomRecord::getInstance($this->curr_xref); - $html.= - '</table><table id="batch_update2"><tr><td>'. - self::createSubmitButton(WT_I18N::translate('previous'), $this->prev_xref). - self::createSubmitButton(WT_I18N::translate('next'), $this->next_xref). - '</td><th><a href="'.$this->record->getHtmlUrl().'">'.$this->record->getFullName().'</a>'. - '</th>'. - '</tr><tr><td valign="top">'. - '<br>'.implode('<br>',$this->PLUGIN->getActionButtons($this->curr_xref, $this->record)).'<br>'. - '</td><td dir="ltr" align="left">'. + $html .= + '</table><table id="batch_update2"><tr><td>' . + self::createSubmitButton(WT_I18N::translate('previous'), $this->prev_xref) . + self::createSubmitButton(WT_I18N::translate('next'), $this->next_xref) . + '</td><th><a href="' . $this->record->getHtmlUrl() . '">' . $this->record->getFullName() . '</a>' . + '</th>' . + '</tr><tr><td valign="top">' . + '<br>' . implode('<br>', $this->PLUGIN->getActionButtons($this->curr_xref, $this->record)) . '<br>' . + '</td><td dir="ltr" align="left">' . $this->PLUGIN->getActionPreview($this->record) . '</td></tr>'; } else { - $html.='<tr><td class="accepted" colspan=2>'.WT_I18N::translate('Nothing found.').'</td></tr>'; + $html .= '<tr><td class="accepted" colspan=2>' . WT_I18N::translate('Nothing found.') . '</td></tr>'; } } } - $html.='</table></form>'; + $html .= '</table></form>'; return $html; } @@ -118,24 +118,24 @@ class batch_update { * Constructor - initialise variables and validate user-input */ public function __construct() { - $this->plugins=self::getPluginList(); // List of available plugins - $this->plugin =WT_Filter::get('plugin'); // User parameters - $this->xref =WT_Filter::get('xref', WT_REGEX_XREF); - $this->action =WT_Filter::get('action'); - $this->data =WT_Filter::get('data'); + $this->plugins = self::getPluginList(); // List of available plugins + $this->plugin = WT_Filter::get('plugin'); // User parameters + $this->xref = WT_Filter::get('xref', WT_REGEX_XREF); + $this->action = WT_Filter::get('action'); + $this->data = WT_Filter::get('data'); // Don't do any processing until a plugin is chosen. if ($this->plugin && array_key_exists($this->plugin, $this->plugins)) { - $this->PLUGIN=new $this->plugin; + $this->PLUGIN = new $this->plugin; $this->PLUGIN->getOptions(); $this->getAllXrefs(); switch ($this->action) { case 'update': - $record=self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]); + $record = self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]); if ($this->PLUGIN->doesRecordNeedUpdate($this->xref, $record)) { - $newrecord=$this->PLUGIN->updateRecord($this->xref, $record); - if ($newrecord!=$record) { + $newrecord = $this->PLUGIN->updateRecord($this->xref, $record); + if ($newrecord != $record) { if ($newrecord) { WT_GedcomRecord::getInstance($this->xref)->updateRecord($newrecord, $this->PLUGIN->chan); } else { @@ -143,14 +143,14 @@ class batch_update { } } } - $this->xref=$this->findNextXref($this->xref); + $this->xref = $this->findNextXref($this->xref); break; case 'update_all': foreach ($this->all_xrefs as $xref=>$type) { - $record=self::getLatestRecord($xref, $type); + $record = self::getLatestRecord($xref, $type); if ($this->PLUGIN->doesRecordNeedUpdate($xref, $record)) { - $newrecord=$this->PLUGIN->updateRecord($xref, $record); - if ($newrecord!=$record) { + $newrecord = $this->PLUGIN->updateRecord($xref, $record); + if ($newrecord != $record) { if ($newrecord) { WT_GedcomRecord::getInstance($this->xref)->updateRecord($newrecord, $this->PLUGIN->chan); } else { @@ -159,7 +159,7 @@ class batch_update { } } } - $this->xref=''; + $this->xref = ''; return; default: break; @@ -170,20 +170,20 @@ class batch_update { // been specified at all. if (array_key_exists($this->xref, $this->all_xrefs) && $this->PLUGIN->doesRecordNeedUpdate($this->xref, self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]))) { - $this->curr_xref=$this->xref; + $this->curr_xref = $this->xref; } // The requested record doesn't need updating - find one that does if (!$this->curr_xref) { - $this->curr_xref=$this->findNextXref($this->xref); + $this->curr_xref = $this->findNextXref($this->xref); } if (!$this->curr_xref) { - $this->curr_xref=$this->findPrevXref($this->xref); + $this->curr_xref = $this->findPrevXref($this->xref); } // If we've found a record to update, get details and look for the next/prev if ($this->curr_xref) { - $this->record=self::getLatestRecord($this->curr_xref, $this->all_xrefs[$this->curr_xref]); - $this->prev_xref=$this->findPrevXref($this->curr_xref); - $this->next_xref=$this->findNextXref($this->curr_xref); + $this->record = self::getLatestRecord($this->curr_xref, $this->all_xrefs[$this->curr_xref]); + $this->prev_xref = $this->findPrevXref($this->curr_xref); + $this->next_xref = $this->findNextXref($this->curr_xref); } } } @@ -197,8 +197,8 @@ class batch_update { */ function findNextXref($xref) { foreach (array_keys($this->all_xrefs) as $key) { - if ($key>$xref) { - $record=self::getLatestRecord($key, $this->all_xrefs[$key]); + if ($key > $xref) { + $record = self::getLatestRecord($key, $this->all_xrefs[$key]); if ($this->PLUGIN->doesRecordNeedUpdate($key, $record)) { return $key; } @@ -216,8 +216,8 @@ class batch_update { */ function findPrevXref($xref) { foreach (array_reverse(array_keys($this->all_xrefs)) as $key) { - if ($key<$xref) { - $record=self::getLatestRecord($key, $this->all_xrefs[$key]); + if ($key < $xref) { + $record = self::getLatestRecord($key, $this->all_xrefs[$key]); if ($this->PLUGIN->doesRecordNeedUpdate($key, $record)) { return $key; } @@ -230,36 +230,36 @@ class batch_update { * Generate a list of all XREFs. */ function getAllXrefs() { - $sql=array(); - $vars=array(); + $sql = array(); + $vars = array(); foreach ($this->PLUGIN->getRecordTypesToUpdate() as $type) { switch ($type) { case 'INDI': - $sql[]="SELECT i_id, 'INDI' FROM `##individuals` WHERE i_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT i_id, 'INDI' FROM `##individuals` WHERE i_file=?"; + $vars[] = WT_GED_ID; break; case 'FAM': - $sql[]="SELECT f_id, 'FAM' FROM `##families` WHERE f_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT f_id, 'FAM' FROM `##families` WHERE f_file=?"; + $vars[] = WT_GED_ID; break; case 'SOUR': - $sql[]="SELECT s_id, 'SOUR' FROM `##sources` WHERE s_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT s_id, 'SOUR' FROM `##sources` WHERE s_file=?"; + $vars[] = WT_GED_ID; break; case 'OBJE': - $sql[]="SELECT m_id, 'OBJE' FROM `##media` WHERE m_file=?"; - $vars[]=WT_GED_ID; + $sql[] = "SELECT m_id, 'OBJE' FROM `##media` WHERE m_file=?"; + $vars[] = WT_GED_ID; break; default: - $sql[]="SELECT o_id, ? FROM `##other` WHERE o_type=? AND o_file=?"; - $vars[]=$type; - $vars[]=$type; - $vars[]=WT_GED_ID; + $sql[] = "SELECT o_id, ? FROM `##other` WHERE o_type=? AND o_file=?"; + $vars[] = $type; + $vars[] = $type; + $vars[] = WT_GED_ID; break; } } - $this->all_xrefs= - WT_DB::prepare(implode(' UNION ', $sql).' ORDER BY 1 ASC') + $this->all_xrefs = + WT_DB::prepare(implode(' UNION ', $sql) . ' ORDER BY 1 ASC') ->execute($vars) ->fetchAssoc(); } @@ -270,14 +270,14 @@ class batch_update { * @return base_plugin[] */ static function getPluginList() { - $array=array(); - $dir=dirname(__FILE__).'/plugins/'; - $dir_handle=opendir($dir); - while ($file=readdir($dir_handle)) { - if (substr($file, -4)=='.php') { - require dirname(__FILE__).'/plugins/'.$file; - $class=basename($file, '.php').'_bu_plugin'; - $array[$class]=new $class; + $array = array(); + $dir = dirname(__FILE__) . '/plugins/'; + $dir_handle = opendir($dir); + while ($file = readdir($dir_handle)) { + if (substr($file, -4) == '.php') { + require dirname(__FILE__) . '/plugins/' . $file; + $class = basename($file, '.php') . '_bu_plugin'; + $array[$class] = new $class; } } closedir($dir_handle); @@ -292,13 +292,13 @@ class batch_update { */ static function getJavascript() { return - '<script>'. - 'function reset_reload() {'. - ' var bu_form=document.getElementById("batch_update_form");'. - ' bu_form.xref.value="";'. - ' bu_form.action.value="";'. - ' bu_form.data.value="";'. - ' bu_form.submit();'. + '<script>' . + 'function reset_reload() {' . + ' var bu_form=document.getElementById("batch_update_form");' . + ' bu_form.xref.value="";' . + ' bu_form.action.value="";' . + ' bu_form.data.value="";' . + ' bu_form.submit();' . '}</script>' ; } @@ -313,14 +313,14 @@ class batch_update { * * @return string */ - static function createSubmitButton($text, $xref, $action='', $data='') { + static function createSubmitButton($text, $xref, $action = '', $data = '') { return - '<input type="submit" value="'.$text.'" onclick="'. - 'this.form.xref.value=\''.WT_Filter::escapeHtml($xref).'\';'. - 'this.form.action.value=\''.WT_Filter::escapeHtml($action).'\';'. - 'this.form.data.value=\''.WT_Filter::escapeHtml($data).'\';'. - 'return true;"'. - ($xref ? '' : ' disabled').'>'; + '<input type="submit" value="' . $text . '" onclick="' . + 'this.form.xref.value=\'' . WT_Filter::escapeHtml($xref) . '\';' . + 'this.form.action.value=\'' . WT_Filter::escapeHtml($action) . '\';' . + 'this.form.data.value=\'' . WT_Filter::escapeHtml($data) . '\';' . + 'return true;"' . + ($xref ? '' : ' disabled') . '>'; } /** @@ -361,7 +361,7 @@ class batch_update { * string updateRecord($xref, $gedrec) */ class base_plugin { - var $chan=false; // User option; update change record + var $chan = false; // User option; update change record /** * Default is to operate on INDI records @@ -376,7 +376,7 @@ class base_plugin { * Default option is just the "don't update CHAN record" */ function getOptions() { - $this->chan=WT_Filter::getBool('chan'); + $this->chan = WT_Filter::getBool('chan'); } /** @@ -386,10 +386,10 @@ class base_plugin { */ function getOptionsForm() { return - '<tr><th>'.WT_I18N::translate('Do not update the “last change” record').'</th>'. - '<td><select name="chan" onchange="this.form.submit();">'. - '<option value="0"' . ($this->chan ? '' : ' selected="selected"') . '>'.WT_I18N::translate('yes') .'</option>'. - '<option value="1"' . ($this->chan ? ' selected="selected"' : '') . '>'.WT_I18N::translate('no').'</option>'. + '<tr><th>' . WT_I18N::translate('Do not update the “last change” record') . '</th>' . + '<td><select name="chan" onchange="this.form.submit();">' . + '<option value="0"' . ($this->chan ? '' : ' selected="selected"') . '>' . WT_I18N::translate('yes') . '</option>' . + '<option value="1"' . ($this->chan ? ' selected="selected"' : '') . '>' . WT_I18N::translate('no') . '</option>' . '</select></td></tr>'; } @@ -403,12 +403,12 @@ class base_plugin { function getActionButtons($xref) { if (Auth::user()->getPreference('auto_accept')) { return array( - batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update'), + batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update'), batch_update::createSubmitButton(WT_I18N::translate('Update all'), $xref, 'update_all') ); } else { return array( - batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update') + batch_update::createSubmitButton(WT_I18N::translate('Update'), $xref, 'update') ); } } @@ -421,34 +421,34 @@ class base_plugin { * @return string */ function getActionPreview(WT_GedcomRecord $record) { - $old_lines=preg_split('/[\n]+/', $record->getGedcom()); - $new_lines=preg_split('/[\n]+/', $this->updateRecord($record->getXref(), $record->getGedcom())); + $old_lines = preg_split('/[\n]+/', $record->getGedcom()); + $new_lines = preg_split('/[\n]+/', $this->updateRecord($record->getXref(), $record->getGedcom())); // Find matching lines using longest-common-subsequence algorithm. - $lcs=self::LongestCommonSubsequence($old_lines, $new_lines, 0, count($old_lines)-1, 0, count($new_lines)-1); + $lcs = self::LongestCommonSubsequence($old_lines, $new_lines, 0, count($old_lines) - 1, 0, count($new_lines) - 1); - $diff_lines=array(); - $last_old=-1; - $last_new=-1; + $diff_lines = array(); + $last_old = -1; + $last_new = -1; while ($lcs) { - list($old, $new)=array_shift($lcs); - while ($last_old<$old-1) { - $diff_lines[]=self::decorateDeletedText($old_lines[++$last_old]); + list($old, $new) = array_shift($lcs); + while ($last_old < $old - 1) { + $diff_lines[] = self::decorateDeletedText($old_lines[++$last_old]); } - while ($last_new<$new-1) { - $diff_lines[]=self::decorateInsertedText($new_lines[++$last_new]); + while ($last_new < $new - 1) { + $diff_lines[] = self::decorateInsertedText($new_lines[++$last_new]); } - $diff_lines[]=$new_lines[$new]; - $last_old=$old; - $last_new=$new; + $diff_lines[] = $new_lines[$new]; + $last_old = $old; + $last_new = $new; } - while ($last_old<count($old_lines)-1) { - $diff_lines[]=self::decorateDeletedText($old_lines[++$last_old]); + while ($last_old < count($old_lines) - 1) { + $diff_lines[] = self::decorateDeletedText($old_lines[++$last_old]); } - while ($last_new<count($new_lines)-1) { - $diff_lines[]=self::decorateInsertedText($new_lines[++$last_new]); + while ($last_new < count($new_lines) - 1) { + $diff_lines[] = self::decorateInsertedText($new_lines[++$last_new]); } - return '<pre>'.self::createEditLinks(implode("\n", $diff_lines)).'</pre>'; + return '<pre>' . self::createEditLinks(implode("\n", $diff_lines)) . '</pre>'; } /** @@ -464,21 +464,21 @@ class base_plugin { * @return array */ private static function LongestCommonSubsequence($X, $Y, $x1, $x2, $y1, $y2) { - if ($x2-$x1>=0 && $y2-$y1>=0) { - if ($X[$x1]==$Y[$y1]) { + if ($x2 - $x1 >= 0 && $y2 - $y1 >= 0) { + if ($X[$x1] == $Y[$y1]) { // Match at start of sequence - $tmp=self::LongestCommonSubsequence($X, $Y, $x1+1, $x2, $y1+1, $y2); + $tmp = self::LongestCommonSubsequence($X, $Y, $x1 + 1, $x2, $y1 + 1, $y2); array_unshift($tmp, array($x1, $y1)); return $tmp; - } elseif ($X[$x2]==$Y[$y2]) { + } elseif ($X[$x2] == $Y[$y2]) { // Match at end of sequence - $tmp=self::LongestCommonSubsequence($X, $Y, $x1, $x2-1, $y1, $y2-1); + $tmp = self::LongestCommonSubsequence($X, $Y, $x1, $x2 - 1, $y1, $y2 - 1); array_push($tmp, array($x2, $y2)); return $tmp; } else { // No match. Look for subsequences - $tmp1=self::LongestCommonSubsequence($X, $Y, $x1, $x2, $y1, $y2-1); - $tmp2=self::LongestCommonSubsequence($X, $Y, $x1, $x2-1, $y1, $y2); + $tmp1 = self::LongestCommonSubsequence($X, $Y, $x1, $x2, $y1, $y2 - 1); + $tmp2 = self::LongestCommonSubsequence($X, $Y, $x1, $x2 - 1, $y1, $y2); return count($tmp1) > count($tmp2) ? $tmp1 : $tmp2; } } else { @@ -495,7 +495,7 @@ class base_plugin { * @return string */ static function decorateInsertedText($text) { - return '<span class="added_text">'.$text.'</span>'; + return '<span class="added_text">' . $text . '</span>'; } /** @@ -506,7 +506,7 @@ class base_plugin { * @return string */ static function decorateDeletedText($text) { - return '<span class="deleted_text">'.$text.'</span>'; + return '<span class="deleted_text">' . $text . '</span>'; } /** diff --git a/modules_v3/googlemap/module.php b/modules_v3/googlemap/module.php index 5a9af2c51d..a61cb1ce90 100644 --- a/modules_v3/googlemap/module.php +++ b/modules_v3/googlemap/module.php @@ -47,7 +47,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Create GM tables, if not already present try { - WT_DB::updateSchema(WT_ROOT.WT_MODULES_DIR.'/googlemap/db_schema/', 'GM_SCHEMA_VERSION', 5); + WT_DB::updateSchema(WT_ROOT . WT_MODULES_DIR . '/googlemap/db_schema/', 'GM_SCHEMA_VERSION', 5); } catch (PDOException $ex) { // The schema update scripts should never fail. If they do, there is no clean recovery. die($ex); @@ -56,21 +56,21 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Set default values try { // TODO: do this once only, in a db_schema upgrade script? - $this->setSetting('GM_MAP_TYPE', $this->getSetting('GM_MAP_TYPE', 'G_NORMAL_MAP')); // G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP - $this->setSetting('GM_MAX_ZOOM', $this->getSetting('GM_MAX_ZOOM', '20')); // max zoom level - $this->setSetting('GM_MIN_ZOOM', $this->getSetting('GM_MIN_ZOOM', '2')); // min zoom level - $this->setSetting('GM_PRECISION_0', $this->getSetting('GM_PRECISION_0', '0')); // Country level - $this->setSetting('GM_PRECISION_1', $this->getSetting('GM_PRECISION_1', '1')); // State level - $this->setSetting('GM_PRECISION_2', $this->getSetting('GM_PRECISION_2', '2')); // City level - $this->setSetting('GM_PRECISION_3', $this->getSetting('GM_PRECISION_3', '3')); // Neighborhood level - $this->setSetting('GM_PRECISION_4', $this->getSetting('GM_PRECISION_4', '4')); // House level - $this->setSetting('GM_PRECISION_5', $this->getSetting('GM_PRECISION_5', '5')); // Max prcision level - $this->setSetting('GM_XSIZE', $this->getSetting('GM_XSIZE', '600')); // X-size of Google map - $this->setSetting('GM_YSIZE', $this->getSetting('GM_YSIZE', '400')); // Y-size of Google map - $this->setSetting('GM_PH_XSIZE', $this->getSetting('GM_PH_XSIZE', '500')); // X-size of Place Hierarchy Google map - $this->setSetting('GM_PH_YSIZE', $this->getSetting('GM_PH_YSIZE', '350')); // Y-size of Place Hierarchy Google map - $this->setSetting('GM_PH_MARKER', $this->getSetting('GM_PH_MARKER', 'G_FLAG')); // Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon - $this->setSetting('GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE', '0')); // Display full place name or only the actual level name + $this->setSetting('GM_MAP_TYPE', $this->getSetting('GM_MAP_TYPE', 'G_NORMAL_MAP')); // G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP + $this->setSetting('GM_MAX_ZOOM', $this->getSetting('GM_MAX_ZOOM', '20')); // max zoom level + $this->setSetting('GM_MIN_ZOOM', $this->getSetting('GM_MIN_ZOOM', '2')); // min zoom level + $this->setSetting('GM_PRECISION_0', $this->getSetting('GM_PRECISION_0', '0')); // Country level + $this->setSetting('GM_PRECISION_1', $this->getSetting('GM_PRECISION_1', '1')); // State level + $this->setSetting('GM_PRECISION_2', $this->getSetting('GM_PRECISION_2', '2')); // City level + $this->setSetting('GM_PRECISION_3', $this->getSetting('GM_PRECISION_3', '3')); // Neighborhood level + $this->setSetting('GM_PRECISION_4', $this->getSetting('GM_PRECISION_4', '4')); // House level + $this->setSetting('GM_PRECISION_5', $this->getSetting('GM_PRECISION_5', '5')); // Max prcision level + $this->setSetting('GM_XSIZE', $this->getSetting('GM_XSIZE', '600')); // X-size of Google map + $this->setSetting('GM_YSIZE', $this->getSetting('GM_YSIZE', '400')); // Y-size of Google map + $this->setSetting('GM_PH_XSIZE', $this->getSetting('GM_PH_XSIZE', '500')); // X-size of Place Hierarchy Google map + $this->setSetting('GM_PH_YSIZE', $this->getSetting('GM_PH_YSIZE', '350')); // Y-size of Place Hierarchy Google map + $this->setSetting('GM_PH_MARKER', $this->getSetting('GM_PH_MARKER', 'G_FLAG')); // Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon + $this->setSetting('GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE', '0')); // Display full place name or only the actual level name } catch (Exception $ex) { // Perhaps the module hasn't been installed yet (no entry in wt_modules) } @@ -88,7 +88,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu /** {@inheritdoc} */ public function modAction($mod_action) { - switch($mod_action) { + switch ($mod_action) { case 'admin_config': $this->config(); break; @@ -118,7 +118,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu /** {@inheritdoc} */ public function getConfigLink() { - return 'module.php?mod='.$this->getName().'&mod_action=admin_config'; + return 'module.php?mod=' . $this->getName() . '&mod_action=admin_config'; } /** {@inheritdoc} */ @@ -165,7 +165,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_places">', WT_I18N::translate('Geographic data'), '</a>'; echo '</td>'; echo '<td width="25%" align="right">'; - echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_placecheck">', WT_I18N::translate('Place check'),'</a>'; + echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_placecheck">', WT_I18N::translate('Place check'), '</a>'; echo '</td>'; echo '</tr></table>'; } @@ -197,15 +197,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // end echo '</td></tr></table>'; echo '<script>loadMap();</script>'; - return '<div id="'.$this->getName().'_content">'.ob_get_clean().'</div>'; + return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; } else { - $html='<table class="facts_table">'; - $html.='<tr><td colspan="2" class="facts_value">'.WT_I18N::translate('No map data for this person'); - $html.='</td></tr>'; + $html = '<table class="facts_table">'; + $html .= '<tr><td colspan="2" class="facts_value">' . WT_I18N::translate('No map data for this person'); + $html .= '</td></tr>'; if (Auth::isAdmin()) { - $html.='<tr><td class="center" colspan="2">'; - $html.='<a href="module.php?mod=googlemap&mod_action=admin_config">'.WT_I18N::translate('Google Maps™ preferences'). '</a>'; - $html.='</td></tr>'; + $html .= '<tr><td class="center" colspan="2">'; + $html .= '<a href="module.php?mod=googlemap&mod_action=admin_config">' . WT_I18N::translate('Google Maps™ preferences') . '</a>'; + $html .= '</td></tr>'; } return $html; } @@ -227,7 +227,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * A form to edit the module configuration. */ private function config() { - require WT_ROOT.'includes/functions/functions_edit.php'; + require WT_ROOT . 'includes/functions/functions_edit.php'; $action = WT_Filter::post('action'); @@ -238,28 +238,28 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->pageHeader() ->addInlineJavascript('jQuery("#tabs").tabs();'); - if ($action=='update') { - $this->setSetting('GM_MAP_TYPE', WT_Filter::post('NEW_GM_MAP_TYPE')); - $this->setSetting('GM_USE_STREETVIEW', WT_Filter::post('NEW_GM_USE_STREETVIEW')); - $this->setSetting('GM_MIN_ZOOM', WT_Filter::post('NEW_GM_MIN_ZOOM')); - $this->setSetting('GM_MAX_ZOOM', WT_Filter::post('NEW_GM_MAX_ZOOM')); - $this->setSetting('GM_XSIZE', WT_Filter::post('NEW_GM_XSIZE')); - $this->setSetting('GM_YSIZE', WT_Filter::post('NEW_GM_YSIZE')); - $this->setSetting('GM_PRECISION_0', WT_Filter::post('NEW_GM_PRECISION_0')); - $this->setSetting('GM_PRECISION_1', WT_Filter::post('NEW_GM_PRECISION_1')); - $this->setSetting('GM_PRECISION_2', WT_Filter::post('NEW_GM_PRECISION_2')); - $this->setSetting('GM_PRECISION_3', WT_Filter::post('NEW_GM_PRECISION_3')); - $this->setSetting('GM_PRECISION_4', WT_Filter::post('NEW_GM_PRECISION_4')); - $this->setSetting('GM_PRECISION_5', WT_Filter::post('NEW_GM_PRECISION_5')); - $this->setSetting('GM_COORD', WT_Filter::post('NEW_GM_COORD')); - $this->setSetting('GM_PLACE_HIERARCHY', WT_Filter::post('NEW_GM_PLACE_HIERARCHY')); - $this->setSetting('GM_PH_XSIZE', WT_Filter::post('NEW_GM_PH_XSIZE')); - $this->setSetting('GM_PH_YSIZE', WT_Filter::post('NEW_GM_PH_YSIZE')); - $this->setSetting('GM_PH_MARKER', WT_Filter::post('NEW_GM_PH_MARKER')); - $this->setSetting('GM_DISP_SHORT_PLACE', WT_Filter::post('NEW_GM_DISP_SHORT_PLACE')); + if ($action == 'update') { + $this->setSetting('GM_MAP_TYPE', WT_Filter::post('NEW_GM_MAP_TYPE')); + $this->setSetting('GM_USE_STREETVIEW', WT_Filter::post('NEW_GM_USE_STREETVIEW')); + $this->setSetting('GM_MIN_ZOOM', WT_Filter::post('NEW_GM_MIN_ZOOM')); + $this->setSetting('GM_MAX_ZOOM', WT_Filter::post('NEW_GM_MAX_ZOOM')); + $this->setSetting('GM_XSIZE', WT_Filter::post('NEW_GM_XSIZE')); + $this->setSetting('GM_YSIZE', WT_Filter::post('NEW_GM_YSIZE')); + $this->setSetting('GM_PRECISION_0', WT_Filter::post('NEW_GM_PRECISION_0')); + $this->setSetting('GM_PRECISION_1', WT_Filter::post('NEW_GM_PRECISION_1')); + $this->setSetting('GM_PRECISION_2', WT_Filter::post('NEW_GM_PRECISION_2')); + $this->setSetting('GM_PRECISION_3', WT_Filter::post('NEW_GM_PRECISION_3')); + $this->setSetting('GM_PRECISION_4', WT_Filter::post('NEW_GM_PRECISION_4')); + $this->setSetting('GM_PRECISION_5', WT_Filter::post('NEW_GM_PRECISION_5')); + $this->setSetting('GM_COORD', WT_Filter::post('NEW_GM_COORD')); + $this->setSetting('GM_PLACE_HIERARCHY', WT_Filter::post('NEW_GM_PLACE_HIERARCHY')); + $this->setSetting('GM_PH_XSIZE', WT_Filter::post('NEW_GM_PH_XSIZE')); + $this->setSetting('GM_PH_YSIZE', WT_Filter::post('NEW_GM_PH_YSIZE')); + $this->setSetting('GM_PH_MARKER', WT_Filter::post('NEW_GM_PH_MARKER')); + $this->setSetting('GM_DISP_SHORT_PLACE', WT_Filter::post('NEW_GM_DISP_SHORT_PLACE')); - for ($i=1; $i<=9; $i++) { - $this->setSetting('GM_PREFIX_' . $i, WT_Filter::post('NEW_GM_PREFIX_' . $i)); + for ($i = 1; $i <= 9; $i++) { + $this->setSetting('GM_PREFIX_' . $i, WT_Filter::post('NEW_GM_PREFIX_' . $i)); $this->setSetting('GM_POSTFIX_' . $i, WT_Filter::post('NEW_GM_POSTFIX_' . $i)); } @@ -310,7 +310,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </tr> <tr> <th><?php echo /* I18N: http://en.wikipedia.org/wiki/Google_street_view */ WT_I18N::translate('Google Street View™'); ?></th> - <td><?php echo radio_buttons('NEW_GM_USE_STREETVIEW', array(false=>WT_I18N::translate('hide'),true=>WT_I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW')); ?></td> + <td><?php echo radio_buttons('NEW_GM_USE_STREETVIEW', array(false=>WT_I18N::translate('hide'), true=>WT_I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW')); ?></td> </tr> <tr> <th><?php echo WT_I18N::translate('Size of map (in pixels)'); ?></th> @@ -322,16 +322,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </td> </tr> <tr> - <th><?php echo WT_I18N::translate('Zoom level of map'), help_link('GM_MAP_ZOOM','googlemap'); ?></th> + <th><?php echo WT_I18N::translate('Zoom level of map'), help_link('GM_MAP_ZOOM', 'googlemap'); ?></th> <td> <?php echo WT_I18N::translate('minimum'); ?>: <select name="NEW_GM_MIN_ZOOM"> - <?php for ($j=1; $j < 15; $j++) { ?> - <option value="<?php echo $j, "\""; if ($this->getSetting('GM_MIN_ZOOM')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 1; $j < 15; $j++) { ?> + <option value="<?php echo $j, "\""; if ($this->getSetting('GM_MIN_ZOOM') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('maximum'); ?>: <select name="NEW_GM_MAX_ZOOM"> - <?php for ($j=1; $j < 21; $j++) { ?> - <option value="<?php echo $j, "\""; if ($this->getSetting('GM_MAX_ZOOM')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 1; $j < 21; $j++) { ?> + <option value="<?php echo $j, "\""; if ($this->getSetting('GM_MAX_ZOOM') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> </td> @@ -342,14 +342,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <div id="gm_advanced"> <table class="gm_edit_config"> <tr> - <th colspan="2"><?php echo WT_I18N::translate('Precision of the latitude and longitude'), help_link('GM_PRECISION','googlemap'); ?></th> + <th colspan="2"><?php echo WT_I18N::translate('Precision of the latitude and longitude'), help_link('GM_PRECISION', 'googlemap'); ?></th> <td> <table> <tr> <td><?php echo WT_I18N::translate('Country'); ?> </td> <td><select name="NEW_GM_PRECISION_0"> - <?php for ($j=0; $j < 10; $j++) { ?> - <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_0')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 0; $j < 10; $j++) { ?> + <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_0') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('digits'); ?> </td> @@ -357,8 +357,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <tr> <td><?php echo WT_I18N::translate('State'); ?> </td> <td><select name="NEW_GM_PRECISION_1"> - <?php for ($j=0; $j < 10; $j++) { ?> - <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_1')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 0; $j < 10; $j++) { ?> + <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_1') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('digits'); ?> </td> @@ -366,32 +366,32 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <tr> <td><?php echo WT_I18N::translate('City'); ?> </td> <td><select name="NEW_GM_PRECISION_2"> - <?php for ($j=0; $j < 10; $j++) { ?> - <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_2')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 0; $j < 10; $j++) { ?> + <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_2') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('digits'); ?> </td> </tr> <tr><td><?php echo WT_I18N::translate('Neighborhood'); ?> </td> <td><select name="NEW_GM_PRECISION_3"> - <?php for ($j=0; $j < 10; $j++) { ?> - <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_3')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 0; $j < 10; $j++) { ?> + <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_3') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('digits'); ?> </td> </tr> <tr><td><?php echo WT_I18N::translate('House'); ?> </td> <td><select name="NEW_GM_PRECISION_4"> - <?php for ($j=0; $j < 10; $j++) { ?> - <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_4')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 0; $j < 10; $j++) { ?> + <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_4') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('digits'); ?> </td> </tr> <tr><td><?php echo WT_I18N::translate('Max'); ?> </td> <td><select name="NEW_GM_PRECISION_5"> - <?php for ($j=0; $j < 10; $j++) { ?> - <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_5')==$j) echo " selected=\"selected\""; echo ">", $j; ?></option> + <?php for ($j = 0; $j < 10; $j++) { ?> + <option value="<?php echo $j; ?>"<?php if ($this->getSetting('GM_PRECISION_5') == $j) echo " selected=\"selected\""; echo ">", $j; ?></option> <?php } ?> </select> <?php echo WT_I18N::translate('digits'); ?> </td> @@ -400,17 +400,17 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </td> <td></td> </tr> - <th class="gm_prefix" colspan="3"><?php echo WT_I18N::translate('Optional prefixes and suffixes'), help_link('GM_NAME_PREFIX_SUFFIX','googlemap');?></th> + <th class="gm_prefix" colspan="3"><?php echo WT_I18N::translate('Optional prefixes and suffixes'), help_link('GM_NAME_PREFIX_SUFFIX', 'googlemap'); ?></th> </tr> <tr id="gm_level_titles"> <th></th> <th><?php echo WT_I18N::translate('Prefixes'); ?></th> <th><?php echo WT_I18N::translate('Suffixes'); ?></th> - <?php for ($level=1; $level < 10; $level++) { ?> + <?php for ($level = 1; $level < 10; $level++) { ?> <tr class="gm_levels"> <th> <?php - if ($level==1) { + if ($level == 1) { echo WT_I18N::translate('Country'); } else { echo WT_I18N::translate('Level'), " ", $level; @@ -443,17 +443,17 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <th><?php echo WT_I18N::translate('Type of place markers in Place Hierarchy'); ?></th> <td> <select name="NEW_GM_PH_MARKER"> - <option value="G_DEFAULT_ICON" <?php if ($this->getSetting('GM_PH_MARKER')=="G_DEFAULT_ICON") echo "selected=\"selected\""; ?>><?php echo WT_I18N::translate('Standard'); ?></option> - <option value="G_FLAG" <?php if ($this->getSetting('GM_PH_MARKER')=="G_FLAG") echo "selected=\"selected\""; ?>><?php echo WT_I18N::translate('Flag'); ?></option> + <option value="G_DEFAULT_ICON" <?php if ($this->getSetting('GM_PH_MARKER') == "G_DEFAULT_ICON") echo "selected=\"selected\""; ?>><?php echo WT_I18N::translate('Standard'); ?></option> + <option value="G_FLAG" <?php if ($this->getSetting('GM_PH_MARKER') == "G_FLAG") echo "selected=\"selected\""; ?>><?php echo WT_I18N::translate('Flag'); ?></option> </select> </td> </tr> <tr> - <th><?php echo WT_I18N::translate('Display short placenames'), help_link('GM_DISP_SHORT_PLACE','googlemap'); ?></th> + <th><?php echo WT_I18N::translate('Display short placenames'), help_link('GM_DISP_SHORT_PLACE', 'googlemap'); ?></th> <td><?php echo edit_field_yes_no('NEW_GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE')); ?></td> </tr> <tr> - <th><?php echo WT_I18N::translate('Display map coordinates'), help_link('GM_COORD','googlemap'); ?></th> + <th><?php echo WT_I18N::translate('Display map coordinates'), help_link('GM_COORD', 'googlemap'); ?></th> <td><?php echo edit_field_yes_no('NEW_GM_COORD', $this->getSetting('GM_COORD')); ?></td> </tr> </table> @@ -491,7 +491,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $action = WT_Filter::post('action'); $countrySelected = WT_Filter::get('countrySelected', null, 'Countries'); - $stateSelected = WT_Filter::get('stateSelected', null, 'States'); + $stateSelected = WT_Filter::get('stateSelected', null, 'States'); $country = array(); if (is_dir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/flags')) { @@ -525,7 +525,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $rep = opendir(WT_ROOT . WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/' . $stateSelected); while ($file = readdir($rep)) { if (stristr($file, '.png')) { - $flags_s[] = substr($file, 0, strlen($file)-4); + $flags_s[] = substr($file, 0, strlen($file) - 4); } } closedir($rep); @@ -538,7 +538,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <?php if ($_POST['selcountry'] == 'Countries') { ?> window.opener.document.editplaces.icon.value = 'places/flags/<?php echo $flags[$_POST['FLAGS']]; ?>.png'; window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"<?php echo WT_STATIC_URL, WT_MODULES_DIR; ?>googlemap/places/flags/<?php echo $country[$_POST['FLAGS']]; ?>.png\"> <a href=\"#\" onclick=\"change_icon();return false;\"><?php echo WT_I18N::translate('Change flag'); ?></a> <a href=\"#\" onclick=\"remove_icon();return false;\"><?php echo WT_I18N::translate('Remove flag'); ?></a>"; - <?php } elseif ($_POST['selstate'] != "States"){ ?> + <?php } elseif ($_POST['selstate'] != "States") { ?> window.opener.document.editplaces.icon.value = 'places/<?php echo $countrySelected, '/flags/', $_POST['selstate'], '/', $flags_s[$_POST['FLAGS']]; ?>.png'; window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"<?php echo WT_STATIC_URL, WT_MODULES_DIR; ?>googlemap/places/<?php echo $countrySelected, "/flags/", $_POST['selstate'], "/", $flags_s[$_POST['FLAGS']]; ?>.png\"> <a href=\"#\" onclick=\"change_icon();return false;\"><?php echo WT_I18N::translate('Change flag'); ?></a> <a href=\"#\" onclick=\"remove_icon();return false;\"><?php echo WT_I18N::translate('Remove flag'); ?></a>"; <?php } else { ?> @@ -566,10 +566,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <?php } $countryList = array(); - $placesDir = scandir(WT_MODULES_DIR.'googlemap/places/'); + $placesDir = scandir(WT_MODULES_DIR . 'googlemap/places/'); for ($i = 0; $i < count($country); $i++) { - if (count(preg_grep('/'.$country[$i].'/', $placesDir)) != 0) { - $rep = opendir(WT_MODULES_DIR.'googlemap/places/'.$country[$i].'/'); + if (count(preg_grep('/' . $country[$i] . '/', $placesDir)) != 0) { + $rep = opendir(WT_MODULES_DIR . 'googlemap/places/' . $country[$i] . '/'); while ($file = readdir($rep)) { if (stristr($file, 'flags')) { if (isset($countries[$country[$i]])) { @@ -585,10 +585,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu asort($countryList); $stateList = array(); if ($countrySelected != 'Countries') { - $placesDir = scandir(WT_MODULES_DIR.'googlemap/places/'.$countrySelected.'/flags/'); + $placesDir = scandir(WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/'); for ($i = 0; $i < count($flags); $i++) { if (in_array($flags[$i], $placesDir)) { - $rep = opendir(WT_MODULES_DIR.'googlemap/places/'.$countrySelected.'/flags/'.$flags[$i].'/'); + $rep = opendir(WT_MODULES_DIR . 'googlemap/places/' . $countrySelected . '/flags/' . $flags[$i] . '/'); while ($file = readdir($rep)) { $stateList[$flags[$i]] = $flags[$i]; } @@ -606,7 +606,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <table class="facts_table"> <tr> <td class="optionbox" colspan="4"> - <?php echo help_link('PLE_FLAGS','googlemap'); ?> + <?php echo help_link('PLE_FLAGS', 'googlemap'); ?> <select name="COUNTRYSELECT" dir="ltr" onchange="selectCountry()"> <option value="Countries"><?php echo WT_I18N::translate('Countries'); ?></option> <?php foreach ($countryList as $country_key=>$country_name) { @@ -622,15 +622,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $j = 1; for ($i = 0; $i < count($flags); $i++) { if ($countrySelected == 'Countries') { - $tempstr = '<td><input type="radio" dir="ltr" name="FLAGS" value="'.$i.'"><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/places/flags/'.$flags[$i].'.png" alt="'.$flags[$i].'" title="'; - if ($flags[$i]!='blank') { + $tempstr = '<td><input type="radio" dir="ltr" name="FLAGS" value="' . $i . '"><img src="' . WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/places/flags/' . $flags[$i] . '.png" alt="' . $flags[$i] . '" title="'; + if ($flags[$i] != 'blank') { if (isset($countries[$flags[$i]])) { - $tempstr.=$countries[$flags[$i]]; + $tempstr .= $countries[$flags[$i]]; } else { - $tempstr.=$flags[$i]; + $tempstr .= $flags[$i]; } } else { - $tempstr.=$countries['???']; + $tempstr .= $countries['???']; } echo $tempstr, '"> ', $flags[$i], '</input></td>'; } else { @@ -643,13 +643,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $j++; } echo '</tr><tr'; - if ($countrySelected == 'Countries' || count($stateList)==0) { + if ($countrySelected == 'Countries' || count($stateList) == 0) { echo ' style=" visibility: hidden"'; } echo '>'; ?> <td class="optionbox" colspan="4"> - <?php echo help_link('PLE_FLAGS','googlemap'); ?> + <?php echo help_link('PLE_FLAGS', 'googlemap'); ?> <select name="STATESELECT" dir="ltr" onchange="selectCountry()"> <option value="States"><?php echo /* I18N: Part of a country, state/region/county */ WT_I18N::translate('Subdivision'); ?></option> <?php foreach ($stateList as $state_key=>$state_name) { @@ -665,7 +665,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $j = 1; for ($i = 0; $i < count($flags_s); $i++) { if ($stateSelected != 'States') { - echo '<td><input type="radio" dir="ltr" name="FLAGS" value="', $i, '"><img src="', WT_STATIC_URL.WT_MODULES_DIR, 'googlemap/places/', $countrySelected, '/flags/', $stateSelected, '/', $flags_s[$i], '.png"> ', $flags_s[$i], '</input></td>'; + echo '<td><input type="radio" dir="ltr" name="FLAGS" value="', $i, '"><img src="', WT_STATIC_URL . WT_MODULES_DIR, 'googlemap/places/', $countrySelected, '/flags/', $stateSelected, '/', $flags_s[$i], '.png"> ', $flags_s[$i], '</input></td>'; } if ($j == 4) { echo '</tr><tr>'; @@ -727,10 +727,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <?php echo WT_I18N::translate('Generations'); ?> </td> <td class="descriptionbox wrap"> - <?php echo WT_I18N::translate('Hide flags'), help_link('PEDIGREE_MAP_hideflags','googlemap'); ?> + <?php echo WT_I18N::translate('Hide flags'), help_link('PEDIGREE_MAP_hideflags', 'googlemap'); ?> </td> <td class="descriptionbox wrap"> - <?php echo WT_I18N::translate('Hide lines'), help_link('PEDIGREE_MAP_hidelines','googlemap'); ?> + <?php echo WT_I18N::translate('Hide lines'), help_link('PEDIGREE_MAP_hidelines', 'googlemap'); ?> </td> </tr> <tr> @@ -741,7 +741,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <td class="optionbox"> <select name="PEDIGREE_GENERATIONS"> <?php - for ($p=3; $p<=$MAX_PEDIGREE_GENERATIONS; $p++) { + for ($p = 3; $p <= $MAX_PEDIGREE_GENERATIONS; $p++) { echo '<option value="', $p, '" '; if ($p == $controller->PEDIGREE_GENERATIONS) { echo 'selected="selected"'; @@ -781,18 +781,18 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <!-- count records by type --> <?php - $curgen=1; - $priv=0; - $count=0; - $miscount=0; + $curgen = 1; + $priv = 0; + $count = 0; + $miscount = 0; $missing = ''; $latlongval = array(); $lat = array(); $lon = array(); - for ($i=0; $i<($controller->treesize); $i++) { + for ($i = 0; $i < ($controller->treesize); $i++) { // -- check to see if we have moved to the next generation - if ($i+1 >= pow(2, $curgen)) {$curgen++;} + if ($i + 1 >= pow(2, $curgen)) {$curgen++; } $person = $controller->ancestors[$i]; if (!empty($person)) { $name = $person->getFullName(); @@ -863,7 +863,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '<td valign="top">'; // print summary statistics if (isset($curgen)) { - $total=pow(2,$curgen)-1; + $total = pow(2, $curgen) - 1; echo WT_I18N::plural( '%1$d individual displayed, out of the normal total of %2$d, from %3$d generations.', '%1$d individuals displayed, out of the normal total of %2$d, from %3$d generations.', @@ -877,7 +877,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($priv) { echo WT_I18N::plural('%s individual is private.', '%s individuals are private.', $priv, $priv), '<br>'; } - if ($count+$priv != $total) { + if ($count + $priv != $total) { if ($miscount == 0) { echo WT_I18N::translate('No ancestors in the database.'), "<br>"; } else { @@ -892,8 +892,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '</td>'; echo '</tr>'; echo '</table>'; - echo '</div>';// close #pedigreemap_chart - echo '</div>';// close #pedigreemap-page + echo '</div>'; // close #pedigreemap_chart + echo '</div>'; // close #pedigreemap-page ?> <!-- end of map display --> <!-- Start of map scripts --> @@ -912,7 +912,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu global $controller, $SHOW_HIGHLIGHT_IMAGES, $PEDIGREE_GENERATIONS; // The HomeControl returns the map to the original position and style - $js='function HomeControl(controlDiv, pm_map) {'. + $js = 'function HomeControl(controlDiv, pm_map) {' . // Set CSS styles for the DIV containing the control // Setting padding to 5 px will offset the control from the edge of the map 'controlDiv.style.paddingTop = "5px"; @@ -935,7 +935,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu controlText.style.fontSize = "12px"; controlText.style.paddingLeft = "15px"; controlText.style.paddingRight = "15px"; - controlText.innerHTML = "<b>'.WT_I18N::translate('Redraw map').'<\/b>"; + controlText.innerHTML = "<b>'.WT_I18N::translate('Redraw map') . '<\/b>"; controlUI.appendChild(controlText);'. // Setup the click event listeners: simply set the map to original LatLng 'google.maps.event.addDomListener(controlUI, "click", function() { @@ -956,7 +956,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu google.maps.event.trigger(gmarkers[i], "click"); }'. // this variable will collect the html which will eventually be placed in the side_bar - 'var side_bar_html = "";'. + 'var side_bar_html = "";' . // arrays to hold copies of the markers and html used by the side_bar // because the function closure trick doesnt work there 'var gmarkers = []; @@ -1246,7 +1246,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu lastlinkid=linkid; });'. // save the info we need to use later for the side_bar - 'gmarkers[i] = marker;'. + 'gmarkers[i] = marker;' . // add a line to the side_bar html 'side_bar_html += "<br><div id=\'"+linkid+"\' onclick=\'myclick(" + i + ")\'>" + html +"<br></div>"; i++; @@ -1305,14 +1305,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $name = $person->getFullName(); // -- check to see if we have moved to the next generation - if ($i+1 >= pow(2, $curgen)) { + if ($i + 1 >= pow(2, $curgen)) { $curgen++; } $relationship = get_close_relationship_name($controller->root, $person); - $event = '<img src="'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/images/sq'.$curgen.'.png" width="10" height="10"> '. - '<strong>'.$relationship.'</strong>'; + $event = '<img src="' . WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/images/sq' . $curgen . '.png" width="10" height="10"> ' . + '<strong>' . $relationship . '</strong>'; // add thumbnail image if ($SHOW_HIGHLIGHT_IMAGES) { $image = $person->displayImage(); @@ -1322,18 +1322,18 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // end of add image $dataleft = WT_Filter::escapeJs($image . $event . ' — ' . $name); - $datamid = WT_Filter::escapeJs(' <span><a href="' . $person->getHtmlUrl() . '">('.WT_I18N::translate('View person').')</a></span>'); - $dataright = WT_Filter::escapeJs('<br><strong>'. WT_I18N::translate('Birth:') . ' </strong>' . $person->getBirthDate()->display() . ' — ' . $person->getBirthPlace()); + $datamid = WT_Filter::escapeJs(' <span><a href="' . $person->getHtmlUrl() . '">(' . WT_I18N::translate('View person') . ')</a></span>'); + $dataright = WT_Filter::escapeJs('<br><strong>' . WT_I18N::translate('Birth:') . ' </strong>' . $person->getBirthDate()->display() . ' — ' . $person->getBirthPlace()); $latlongval[$i] = $this->getLatitudeAndLongitudeFromPlaceLocation($person->getBirthPlace()); if ($latlongval[$i]) { - $lat[$i] = (double)str_replace(array('N', 'S', ','), array('', '-', '.'), $latlongval[$i]->pl_lati); - $lon[$i] = (double)str_replace(array('E', 'W', ','), array('', '-', '.'), $latlongval[$i]->pl_long); + $lat[$i] = (double) str_replace(array('N', 'S', ','), array('', '-', '.'), $latlongval[$i]->pl_lati); + $lon[$i] = (double) str_replace(array('E', 'W', ','), array('', '-', '.'), $latlongval[$i]->pl_long); if ($lat[$i] || $lon[$i]) { if (!$hideflags && $latlongval[$i]->pl_icon) { $flags[$i] = $latlongval[$i]->pl_icon; $ffile = strrchr($latlongval[$i]->pl_icon, '/'); - $ffile = substr($ffile,1, strpos($ffile, '.')-1); + $ffile = substr($ffile, 1, strpos($ffile, '.') - 1); if (empty($flags[$ffile])) { $flags[$ffile] = $i; // Only generate the flag once $js .= 'var point = new google.maps.LatLng(' . $lat[$i] . ',' . $lon[$i] . ');'; @@ -1386,14 +1386,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $js .= "' title='" . WT_I18N::translate('Pedigree map') . "'>" . $dataleft . "</a>" . $datamid . $dataright . "</div>\", \"" . $marker_number . "\");"; // Construct the polygon lines if (!$hidelines) { - $to_child = (intval(($i-1)/2)); // Draw a line from parent to child - if (array_key_exists($to_child, $lat) && $lat[$to_child]!=0 && $lon[$to_child]!=0) { - $js.=' + $to_child = (intval(($i - 1) / 2)); // Draw a line from parent to child + if (array_key_exists($to_child, $lat) && $lat[$to_child] != 0 && $lon[$to_child] != 0) { + $js .= ' var linecolor; var plines; - var lines = [new google.maps.LatLng('.$lat[$i].','.$lon[$i].'), - new google.maps.LatLng('.$lat[$to_child].','.$lon[$to_child].')]; - linecolor = "'.$colored_line[$curgen].'"; + var lines = [new google.maps.LatLng('.$lat[$i] . ',' . $lon[$i] . '), + new google.maps.LatLng('.$lat[$to_child] . ',' . $lon[$to_child] . ')]; + linecolor = "'.$colored_line[$curgen] . '"; plines = new google.maps.Polygon({ paths: lines, strokeColor: linecolor, @@ -1406,8 +1406,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } // Extend and fit marker bounds - $js.='bounds.extend(point);'; - $js.='pm_map.fitBounds(bounds);'; + $js .= 'bounds.extend(point);'; + $js .= 'pm_map.fitBounds(bounds);'; $count++; } } @@ -1415,23 +1415,23 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $latlongval[$i] = null; } } - $js.='pm_map.setCenter(bounds.getCenter());'. + $js .= 'pm_map.setCenter(bounds.getCenter());' . // Close the sidebar highlight when the infowindow is closed 'google.maps.event.addListener(infowindow, "closeclick", function() { document.getElementById(lastlinkid).className = "person_box:target"; });'. // put the assembled side_bar_html contents into the side_bar div - 'document.getElementById("side_bar").innerHTML = side_bar_html;'. + 'document.getElementById("side_bar").innerHTML = side_bar_html;' . // create the context menu div 'var contextmenu = document.createElement("div"); contextmenu.style.visibility="hidden"; - contextmenu.innerHTML = "<a href=\'#\' onclick=\'zoomIn()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom in').' </div></a>" - + "<a href=\'#\' onclick=\'zoomOut()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom out').' </div></a>" - + "<a href=\'#\' onclick=\'zoomInHere()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom in here').'</div></a>" - + "<a href=\'#\' onclick=\'zoomOutHere()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom out here').' </div></a>" - + "<a href=\'#\' onclick=\'centreMapHere()\'><div class=\'optionbox\'> '.WT_I18N::translate('Center map here').' </div></a>";'. + contextmenu.innerHTML = "<a href=\'#\' onclick=\'zoomIn()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom in') . ' </div></a>" + + "<a href=\'#\' onclick=\'zoomOut()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom out') . ' </div></a>" + + "<a href=\'#\' onclick=\'zoomInHere()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom in here') . '</div></a>" + + "<a href=\'#\' onclick=\'zoomOutHere()\'><div class=\'optionbox\'> '.WT_I18N::translate('Zoom out here') . ' </div></a>" + + "<a href=\'#\' onclick=\'centreMapHere()\'><div class=\'optionbox\'> '.WT_I18N::translate('Center map here') . ' </div></a>";' . // listen for singlerightclick - 'google.maps.event.addListener(pm_map,"singlerightclick", function(pixel,tile) {'. + 'google.maps.event.addListener(pm_map,"singlerightclick", function(pixel,tile) {' . // store the "pixel" info in case we need it later // adjust the context menu location if near an egde // create a GControlPosition @@ -1447,15 +1447,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu }); '. // functions that perform the context menu options - 'function zoomIn() {'. + 'function zoomIn() {' . // perform the requested operation - 'pm_map.zoomIn();'. + 'pm_map.zoomIn();' . // hide the context menu now that it has been used 'contextmenu.style.visibility="hidden"; } function zoomOut() {'. // perform the requested operation - 'pm_map.zoomOut();'. + 'pm_map.zoomOut();' . // hide the context menu now that it has been used 'contextmenu.style.visibility="hidden"; } @@ -1493,9 +1493,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * ... */ private function adminPlaceCheck() { - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; - $action = WT_Filter::get('action', '','go'); + $action = WT_Filter::get('action', '', 'go'); $gedcom_id = WT_Filter::get('gedcom_id', null, WT_GED_ID); $country = WT_Filter::get('country', '.+', 'XYZ'); $state = WT_Filter::get('state', '.+', 'XYZ'); @@ -1511,16 +1511,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <table id="gm_config"> <tr> <th> - <a href="module.php?mod=googlemap&mod_action=admin_config">', WT_I18N::translate('Google Maps™ preferences'),'</a> + <a href="module.php?mod=googlemap&mod_action=admin_config">', WT_I18N::translate('Google Maps™ preferences'), '</a> </th> <th> <a href="module.php?mod=googlemap&mod_action=admin_places"> - ', WT_I18N::translate('Geographic data'),' + ', WT_I18N::translate('Geographic data'), ' </a> </th> <th> <a class="current" href="module.php?mod=googlemap&mod_action=admin_placecheck"> - ', WT_I18N::translate('Place check'),' + ', WT_I18N::translate('Place check'), ' </a> </th> </tr> @@ -1538,27 +1538,27 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <select name="country" onchange="this.form.submit();"> <option value="XYZ" selected="selected">', /* I18N: first/default option in a drop-down listbox */ WT_I18N::translate('<select>'), '</option> <option value="XYZ">', WT_I18N::translate('All'), '</option>'; - $rows=WT_DB::prepare("SELECT pl_id, pl_place FROM `##placelocation` WHERE pl_level=0 ORDER BY pl_place") + $rows = WT_DB::prepare("SELECT pl_id, pl_place FROM `##placelocation` WHERE pl_level=0 ORDER BY pl_place") ->fetchAssoc(); foreach ($rows as $id=>$place) { echo '<option value="', WT_Filter::escapeHtml($place), '"'; - if ($place==$country) { + if ($place == $country) { echo ' selected="selected"'; - $par_id=$id; + $par_id = $id; } echo '>', WT_Filter::escapeHtml($place), '</option>'; } echo '</select>'; - if ($country!='XYZ') { + if ($country != 'XYZ') { echo '<label>', /* I18N: Part of a country, state/region/county */ WT_I18N::translate('Subdivision'), '</label> <select name="state" onchange="this.form.submit();"> <option value="XYZ" selected="selected">', WT_I18N::translate('<select>'), '</option> <option value="XYZ">', WT_I18N::translate('All'), '</option>'; - $places=WT_DB::prepare("SELECT pl_place FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place") + $places = WT_DB::prepare("SELECT pl_place FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place") ->execute(array($par_id)) ->fetchOneColumn(); foreach ($places as $place) { - echo '<option value="', WT_Filter::escapeHtml($place), '"', $place==$state?' selected="selected"':'', '>', WT_Filter::escapeHtml($place), '</option>'; + echo '<option value="', WT_Filter::escapeHtml($place), '"', $place == $state ? ' selected="selected"' : '', '>', WT_Filter::escapeHtml($place), '</option>'; } echo '</select>'; } @@ -1568,63 +1568,63 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo ' checked="checked"'; } echo '>'; - echo '</div>';// close div gm_check + echo '</div>'; // close div gm_check echo '<input type="hidden" name="action" value="go">'; - echo '</form>';//close form placecheck + echo '</form>'; //close form placecheck echo '<hr>'; switch ($action) { case 'go': //Identify gedcom file - $trees=WT_Tree::getAll(); + $trees = WT_Tree::getAll(); echo '<div id="gm_check_title">', $trees[$gedcom_id]->tree_title_html, '</div>'; //Select all '2 PLAC ' tags in the file and create array - $place_list=array(); - $ged_data=WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_gedcom LIKE ? AND i_file=?") + $place_list = array(); + $ged_data = WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_gedcom LIKE ? AND i_file=?") ->execute(array("%\n2 PLAC %", $gedcom_id)) ->fetchOneColumn(); foreach ($ged_data as $ged_datum) { preg_match_all('/\n2 PLAC (.+)/', $ged_datum, $matches); foreach ($matches[1] as $match) { - $place_list[$match]=true; + $place_list[$match] = true; } } - $ged_data=WT_DB::prepare("SELECT f_gedcom FROM `##families` WHERE f_gedcom LIKE ? AND f_file=?") + $ged_data = WT_DB::prepare("SELECT f_gedcom FROM `##families` WHERE f_gedcom LIKE ? AND f_file=?") ->execute(array("%\n2 PLAC %", $gedcom_id)) ->fetchOneColumn(); foreach ($ged_data as $ged_datum) { preg_match_all('/\n2 PLAC (.+)/', $ged_datum, $matches); foreach ($matches[1] as $match) { - $place_list[$match]=true; + $place_list[$match] = true; } } // Unique list of places - $place_list=array_keys($place_list); + $place_list = array_keys($place_list); // Apply_filter - if ($country=='XYZ') { - $filter='.*$'; + if ($country == 'XYZ') { + $filter = '.*$'; } else { - $filter=preg_quote($country).'$'; - if ($state!='XYZ') { - $filter=preg_quote($state).', '.$filter; + $filter = preg_quote($country) . '$'; + if ($state != 'XYZ') { + $filter = preg_quote($state) . ', ' . $filter; } } - $place_list=preg_grep('/'.$filter.'/', $place_list); + $place_list = preg_grep('/' . $filter . '/', $place_list); //sort the array, limit to unique values, and count them usort($place_list, array('WT_I18N', 'strcasecmp')); - $i=count($place_list); + $i = count($place_list); //calculate maximum no. of levels to display - $x=0; - $max=0; - while ($x<$i) { - $levels=explode(",", $place_list[$x]); - $parts=count($levels); - if ($parts>$max) $max=$parts; - $x++;} - $x=0; + $x = 0; + $max = 0; + while ($x < $i) { + $levels = explode(",", $place_list[$x]); + $parts = count($levels); + if ($parts > $max) $max = $parts; + $x++; } + $x = 0; //scripts for edit, add and refresh ?> @@ -1642,117 +1642,117 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <?php //start to produce the display table - $cols=0; - $span=$max*3+3; + $cols = 0; + $span = $max * 3 + 3; echo '<div class="gm_check_details">'; echo '<table class="gm_check_details"><tr>'; echo '<th rowspan="3">', WT_I18N::translate('Place'), '</th>'; echo '<th colspan="', $span, '">', WT_I18N::translate('Geographic data'), '</th></tr>'; echo '<tr>'; - while ($cols<$max) { + while ($cols < $max) { if ($cols == 0) { echo '<th colspan="3">', WT_I18N::translate('Country'), '</th>'; } else { - echo '<th colspan="3">', WT_I18N::translate('Level'), ' ', $cols+1, '</th>'; + echo '<th colspan="3">', WT_I18N::translate('Level'), ' ', $cols + 1, '</th>'; } $cols++; } echo '</tr><tr>'; - $cols=0; - while ($cols<$max) { + $cols = 0; + while ($cols < $max) { echo '<th>', WT_Gedcom_Tag::getLabel('PLAC'), '</th><th>', WT_I18N::translate('Latitude'), '</th><th>', WT_I18N::translate('Longitude'), '</th>'; $cols++; } echo '</tr>'; - $countrows=0; + $countrows = 0; $matched = array(); - while ($x<$i) { - $placestr=""; - $levels=explode(",", $place_list[$x]); - $parts=count($levels); - $levels=array_reverse($levels); - $placestr.="<a href=\"placelist.php?action=show"; + while ($x < $i) { + $placestr = ""; + $levels = explode(",", $place_list[$x]); + $parts = count($levels); + $levels = array_reverse($levels); + $placestr .= "<a href=\"placelist.php?action=show"; foreach ($levels as $pindex=>$ppart) { - $ppart=urlencode(trim($ppart)); - $placestr.="&parent[$pindex]=".$ppart.""; + $ppart = urlencode(trim($ppart)); + $placestr .= "&parent[$pindex]=" . $ppart . ""; } - $placestr.="\">".$place_list[$x]."</a>"; - $gedplace="<tr><td>".$placestr."</td>"; - $z=0; - $id=0; - $level=0; - $matched[$x]=0;// used to exclude places where the gedcom place is matched at all levels - $mapstr_edit="<a href=\"#\" onclick=\"edit_place_location('"; - $mapstr_add="<a href=\"#\" onclick=\"add_place_location('"; - $mapstr3=""; - $mapstr4=""; - $mapstr5="')\" title='"; - $mapstr6="' >"; - $mapstr7="')\">"; - $mapstr8="</a>"; + $placestr .= "\">" . $place_list[$x] . "</a>"; + $gedplace = "<tr><td>" . $placestr . "</td>"; + $z = 0; + $id = 0; + $level = 0; + $matched[$x] = 0; // used to exclude places where the gedcom place is matched at all levels + $mapstr_edit = "<a href=\"#\" onclick=\"edit_place_location('"; + $mapstr_add = "<a href=\"#\" onclick=\"add_place_location('"; + $mapstr3 = ""; + $mapstr4 = ""; + $mapstr5 = "')\" title='"; + $mapstr6 = "' >"; + $mapstr7 = "')\">"; + $mapstr8 = "</a>"; $plac = array(); $lati = array(); $long = array(); - while ($z<$parts) { - if ($levels[$z]==' ' || $levels[$z]=='') - $levels[$z]="unknown";// GoogleMap module uses "unknown" while GEDCOM uses , , + while ($z < $parts) { + if ($levels[$z] == ' ' || $levels[$z] == '') + $levels[$z] = "unknown"; // GoogleMap module uses "unknown" while GEDCOM uses , , - $levels[$z]=rtrim(ltrim($levels[$z])); + $levels[$z] = rtrim(ltrim($levels[$z])); - $placelist = $this->createPossiblePlaceNames($levels[$z], $z+1); // add the necessary prefix/postfix values to the place name + $placelist = $this->createPossiblePlaceNames($levels[$z], $z + 1); // add the necessary prefix/postfix values to the place name foreach ($placelist as $key=>$placename) { - $row= + $row = WT_DB::prepare("SELECT pl_id, pl_place, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place") ->execute(array($z, $id, $placename)) ->fetchOneRow(PDO::FETCH_ASSOC); if (!empty($row['pl_id'])) { - $row['pl_placerequested']=$levels[$z]; // keep the actual place name that was requested so we can display that instead of what is in the db + $row['pl_placerequested'] = $levels[$z]; // keep the actual place name that was requested so we can display that instead of what is in the db break; } } - if ($row['pl_id']!='') { - $id=$row['pl_id']; + if ($row['pl_id'] != '') { + $id = $row['pl_id']; } - if ($row['pl_place']!='') { - $placestr2=$mapstr_edit.$id."&level=".$level.$mapstr3.$mapstr5.WT_I18N::translate('Zoom=').$row['pl_zoom'].$mapstr6.$row['pl_placerequested'].$mapstr8; - if ($row['pl_place']=='unknown') + if ($row['pl_place'] != '') { + $placestr2 = $mapstr_edit . $id . "&level=" . $level . $mapstr3 . $mapstr5 . WT_I18N::translate('Zoom=') . $row['pl_zoom'] . $mapstr6 . $row['pl_placerequested'] . $mapstr8; + if ($row['pl_place'] == 'unknown') $matched[$x]++; } else { - if ($levels[$z]=="unknown") { - $placestr2=$mapstr_add.$id."&level=".$level.$mapstr3.$mapstr7."<strong>".rtrim(ltrim(WT_I18N::translate('unknown')))."</strong>".$mapstr8;$matched[$x]++; + if ($levels[$z] == "unknown") { + $placestr2 = $mapstr_add . $id . "&level=" . $level . $mapstr3 . $mapstr7 . "<strong>" . rtrim(ltrim(WT_I18N::translate('unknown'))) . "</strong>" . $mapstr8; $matched[$x]++; } else { - $placestr2=$mapstr_add.$id."&place_name=".urlencode($levels[$z])."&level=".$level.$mapstr3.$mapstr7.'<span class="error">'.rtrim(ltrim($levels[$z])).'</span>'.$mapstr8;$matched[$x]++; + $placestr2 = $mapstr_add . $id . "&place_name=" . urlencode($levels[$z]) . "&level=" . $level . $mapstr3 . $mapstr7 . '<span class="error">' . rtrim(ltrim($levels[$z])) . '</span>' . $mapstr8; $matched[$x]++; } } - $plac[$z]="<td>".$placestr2."</td>\n"; - if ($row['pl_lati']=='0') { - $lati[$z]="<td class='error'><strong>".$row['pl_lati']."</strong></td>"; - } elseif ($row['pl_lati']!='') { - $lati[$z]="<td>".$row['pl_lati']."</td>"; + $plac[$z] = "<td>" . $placestr2 . "</td>\n"; + if ($row['pl_lati'] == '0') { + $lati[$z] = "<td class='error'><strong>" . $row['pl_lati'] . "</strong></td>"; + } elseif ($row['pl_lati'] != '') { + $lati[$z] = "<td>" . $row['pl_lati'] . "</td>"; } else { - $lati[$z]="<td class='error center'><strong>X</strong></td>";$matched[$x]++; + $lati[$z] = "<td class='error center'><strong>X</strong></td>"; $matched[$x]++; } - if ($row['pl_long']=='0') { - $long[$z]="<td class='error'><strong>".$row['pl_long']."</strong></td>"; - } elseif ($row['pl_long']!='') { - $long[$z]="<td>".$row['pl_long']."</td>"; + if ($row['pl_long'] == '0') { + $long[$z] = "<td class='error'><strong>" . $row['pl_long'] . "</strong></td>"; + } elseif ($row['pl_long'] != '') { + $long[$z] = "<td>" . $row['pl_long'] . "</td>"; } else { - $long[$z]="<td class='error center'><strong>X</strong></td>";$matched[$x]++; + $long[$z] = "<td class='error center'><strong>X</strong></td>"; $matched[$x]++; } $level++; - $mapstr3=$mapstr3."&parent[".$z."]=".WT_Filter::escapeJs($row['pl_placerequested']); - $mapstr4=$mapstr4."&parent[".$z."]=".WT_Filter::escapeJs($levels[$z]); + $mapstr3 = $mapstr3 . "&parent[" . $z . "]=" . WT_Filter::escapeJs($row['pl_placerequested']); + $mapstr4 = $mapstr4 . "&parent[" . $z . "]=" . WT_Filter::escapeJs($levels[$z]); $z++; } if ($matching) { - $matched[$x]=1; + $matched[$x] = 1; } - if ($matched[$x]!=0) { + if ($matched[$x] != 0) { echo $gedplace; - $z=0; - while ($z<$max) { - if ($z<$parts) { + $z = 0; + while ($z < $max) { + if ($z < $parts) { echo $plac[$z]; echo $lati[$z]; echo $long[$z]; @@ -1932,14 +1932,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } if ($ctla && $ctlo) { $i++; - $gmarks[$i]=array( + $gmarks[$i] = array( 'class' => 'optionbox', 'date' => $fact->getDate()->display(true), 'fact_label' => $fact->getLabel(), 'image' => $spouse ? $spouse->displayImage() : Theme::theme()->icon($fact), 'info' => $fact->getValue(), - 'lat' => str_replace(array('N', 'S', ','), array('', '-', '.') , $match1[1]), - 'lng' => str_replace(array('E', 'W', ','), array('', '-', '.') , $match2[1]), + 'lat' => str_replace(array('N', 'S', ','), array('', '-', '.'), $match1[1]), + 'lng' => str_replace(array('E', 'W', ','), array('', '-', '.'), $match2[1]), 'name' => $spouse ? '<a href="' . $spouse->getHtmlUrl() . '"' . $spouse->getFullName() . '</a>' : '', 'pl_icon' => '', 'place' => $fact->getPlace()->getFullName(), @@ -1992,7 +1992,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $ctlo = preg_match('/\n4 LONG (.+)/', $birthrec, $match2); if ($ctla && $ctlo) { $i++; - $gmarks[$i]=array( + $gmarks[$i] = array( 'date' => $birth->getDate()->display(true), 'image' => $child->displayImage(), 'info' => '', @@ -2330,24 +2330,24 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Add the markers to the map from the $gmarks array var locations = [ - <?php foreach($gmarks as $n=>$gmark) { ?> + <?php foreach ($gmarks as $n=>$gmark) { ?> <?php echo $n ? ',' : ''; ?> { - "event": "<?php echo WT_Filter::escapeJs($gmark['fact_label'] ); ?>", - "lat": "<?php echo WT_Filter::escapeJs($gmark['lat'] ); ?>", - "lng": "<?php echo WT_Filter::escapeJs($gmark['lng'] ); ?>", - "date": "<?php echo WT_Filter::escapeJs($gmark['date'] ); ?>", - "info": "<?php echo WT_Filter::escapeJs($gmark['info'] ); ?>", - "name": "<?php echo WT_Filter::escapeJs($gmark['name'] ); ?>", - "place": "<?php echo WT_Filter::escapeJs($gmark['place'] ); ?>", - "tooltip": "<?php echo WT_Filter::escapeJs($gmark['tooltip'] ); ?>", - "image": "<?php echo WT_Filter::escapeJs($gmark['image'] ); ?>", - "pl_icon": "<?php echo WT_Filter::escapeJs($gmark['pl_icon'] ); ?>", - "sv_lati": "<?php echo WT_Filter::escapeJs($gmark['sv_lati'] ); ?>", - "sv_long": "<?php echo WT_Filter::escapeJs($gmark['sv_long'] ); ?>", - "sv_bearing": "<?php echo WT_Filter::escapeJs($gmark['sv_bearing'] ); ?>", + "event": "<?php echo WT_Filter::escapeJs($gmark['fact_label']); ?>", + "lat": "<?php echo WT_Filter::escapeJs($gmark['lat']); ?>", + "lng": "<?php echo WT_Filter::escapeJs($gmark['lng']); ?>", + "date": "<?php echo WT_Filter::escapeJs($gmark['date']); ?>", + "info": "<?php echo WT_Filter::escapeJs($gmark['info']); ?>", + "name": "<?php echo WT_Filter::escapeJs($gmark['name']); ?>", + "place": "<?php echo WT_Filter::escapeJs($gmark['place']); ?>", + "tooltip": "<?php echo WT_Filter::escapeJs($gmark['tooltip']); ?>", + "image": "<?php echo WT_Filter::escapeJs($gmark['image']); ?>", + "pl_icon": "<?php echo WT_Filter::escapeJs($gmark['pl_icon']); ?>", + "sv_lati": "<?php echo WT_Filter::escapeJs($gmark['sv_lati']); ?>", + "sv_long": "<?php echo WT_Filter::escapeJs($gmark['sv_long']); ?>", + "sv_bearing": "<?php echo WT_Filter::escapeJs($gmark['sv_bearing']); ?>", "sv_elevation": "<?php echo WT_Filter::escapeJs($gmark['sv_elevation']); ?>", - "sv_zoom": "<?php echo WT_Filter::escapeJs($gmark['sv_zoom'] ); ?>" + "sv_zoom": "<?php echo WT_Filter::escapeJs($gmark['sv_zoom']); ?>" } <?php } ?> ]; @@ -2599,7 +2599,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu WT_DB::prepare("SELECT pl_place, pl_id, pl_lati, pl_long, pl_zoom, sv_long, sv_lati, sv_bearing, sv_elevation, sv_zoom FROM `##placelocation` WHERE pl_id=?") ->execute(array($levelm)) ->fetch(PDO::FETCH_ASSOC); - if ($STREETVIEW && $level!=0 ) { + if ($STREETVIEW && $level != 0) { echo '<div id="place_map" style="margin-top:20px; border:1px solid gray; width: ', $this->getSetting('GM_PH_XSIZE'), 'px; height: ', $this->getSetting('GM_PH_YSIZE'), 'px; '; } else { echo '<div id="place_map" style="border:1px solid gray; width:', $this->getSetting('GM_PH_XSIZE'), 'px; height:', $this->getSetting('GM_PH_YSIZE'), 'px; '; @@ -2608,33 +2608,33 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '</td>'; echo '<script src="', $this->googleMapsScript(), '"></script>'; - $plzoom = $latlng['pl_zoom']; // Map zoom level + $plzoom = $latlng['pl_zoom']; // Map zoom level if (Auth::isAdmin()) { $placecheck_url = 'module.php?mod=googlemap&mod_action=admin_placecheck'; - if ($parent && isset($parent[0]) ) { - $placecheck_url .= '&country='.$parent[0]; + if ($parent && isset($parent[0])) { + $placecheck_url .= '&country=' . $parent[0]; if (isset($parent[1])) { - $placecheck_url .= '&state='.$parent[1]; + $placecheck_url .= '&state=' . $parent[1]; } } $adminplaces_url = 'module.php?mod=googlemap&mod_action=admin_places'; if ($latlng && isset($latlng['pl_id'])) { - $adminplaces_url .= '&parent='.$latlng['pl_id']; + $adminplaces_url .= '&parent=' . $latlng['pl_id']; } echo '</tr><tr><td>'; echo '<a href="module.php?mod=googlemap&mod_action=admin_config">', WT_I18N::translate('Google Maps™ preferences'), '</a>'; echo ' | '; - echo '<a href="'.$adminplaces_url.'">', WT_I18N::translate('Geographic data'), '</a>'; + echo '<a href="' . $adminplaces_url . '">', WT_I18N::translate('Geographic data'), '</a>'; echo ' | '; - echo '<a href="'.$placecheck_url.'">', WT_I18N::translate('Place check'), '</a>'; + echo '<a href="' . $placecheck_url . '">', WT_I18N::translate('Place check'), '</a>'; if (array_key_exists('batch_update', WT_Module::getActiveModules())) { - $placelevels=preg_replace('/, '.WT_I18N::translate('unknown').'/', ', ', $placelevels); // replace ", unknown" with ", " - $placelevels=substr($placelevels, 2); // remove the leading ", " + $placelevels = preg_replace('/, ' . WT_I18N::translate('unknown') . '/', ', ', $placelevels); // replace ", unknown" with ", " + $placelevels = substr($placelevels, 2); // remove the leading ", " if ($placelevels) { - $batchupdate_url='module.php?mod=batch_update&mod_action=admin_batch_update&plugin=search_replace_bu_plugin&method=exact&ged='.WT_GEDCOM.'&search='.urlencode($placelevels); // exact match + $batchupdate_url = 'module.php?mod=batch_update&mod_action=admin_batch_update&plugin=search_replace_bu_plugin&method=exact&ged=' . WT_GEDCOM . '&search=' . urlencode($placelevels); // exact match echo ' | '; - echo '<a href="'.$batchupdate_url.'">', WT_I18N::translate('Batch update'), '</a>'; + echo '<a href="' . $batchupdate_url . '">', WT_I18N::translate('Batch update'), '</a>'; } } } @@ -2656,32 +2656,32 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '); global $pl_lati, $pl_long; - if ($level>=1) { - $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlng['pl_lati']); // WT_placelocation lati - $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlng['pl_long']); // WT_placelocation long + if ($level >= 1) { + $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlng['pl_lati']); // WT_placelocation lati + $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlng['pl_long']); // WT_placelocation long // Check if Streetview location parameters are stored in database - $placeid = $latlng['pl_id']; // Placelocation place id - $sv_lat = $latlng['sv_lati']; // StreetView Point of View Latitude - $sv_lng = $latlng['sv_long']; // StreetView Point of View Longitude - $sv_dir = $latlng['sv_bearing']; // StreetView Point of View Direction (degrees from North) - $sv_pitch = $latlng['sv_elevation']; // StreetView Point of View Elevation (+90 to -90 degrees (+=down, -=up) - $sv_zoom = $latlng['sv_zoom']; // StreetView Point of View Zoom (0, 1, 2 or 3) + $placeid = $latlng['pl_id']; // Placelocation place id + $sv_lat = $latlng['sv_lati']; // StreetView Point of View Latitude + $sv_lng = $latlng['sv_long']; // StreetView Point of View Longitude + $sv_dir = $latlng['sv_bearing']; // StreetView Point of View Direction (degrees from North) + $sv_pitch = $latlng['sv_elevation']; // StreetView Point of View Elevation (+90 to -90 degrees (+=down, -=up) + $sv_zoom = $latlng['sv_zoom']; // StreetView Point of View Zoom (0, 1, 2 or 3) // Check if Street View Lati/Long are the default of 0 or null, if so use regular Place Lati/Long to set an initial location for the panda ------------ - if (($latlng['sv_lati']==null && $latlng['sv_long']==null) || ($latlng['sv_lati']==0 && $latlng['sv_long']==0)) { + if (($latlng['sv_lati'] == null && $latlng['sv_long'] == null) || ($latlng['sv_lati'] == 0 && $latlng['sv_long'] == 0)) { $sv_lat = $pl_lati; $sv_lng = $pl_long; } // Set Street View parameters to numeric value if NULL (avoids problem with Google Street View™ Pane not rendering) - if ($sv_dir==null) { - $sv_dir=0; + if ($sv_dir == null) { + $sv_dir = 0; } - if ($sv_pitch==null) { - $sv_pitch=0; + if ($sv_pitch == null) { + $sv_pitch = 0; } - if ($sv_zoom==null) { - $sv_zoom=1; + if ($sv_zoom == null) { + $sv_zoom = 1; } ?> @@ -2691,11 +2691,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <?php $list_latlon = ( - WT_Gedcom_Tag::getLabel('LATI')."<input name='sv_latiText' id='sv_latiText' type='text' style='width:42px; background:none; border:none;' value='".$sv_lat."'>". - WT_Gedcom_Tag::getLabel('LONG')."<input name='sv_longText' id='sv_longText' type='text' style='width:42px; background:none; border:none;' value='".$sv_lng."'>". - /* I18N: Compass bearing (in degrees), for street-view mapping */ WT_I18N::translate('Bearing')."<input name='sv_bearText' id='sv_bearText' type='text' style='width:46px; background:none; border:none;' value='".$sv_dir."'>". - /* I18N: Angle of elevation (in degrees), for street-view mapping */ WT_I18N::translate('Elevation')."<input name='sv_elevText' id='sv_elevText' type='text' style='width:30px; background:none; border:none;' value='".$sv_pitch."'>". - WT_I18N::translate('Zoom')."<input name='sv_zoomText' id='sv_zoomText' type='text' style='width:30px; background:none; border:none;' value='".$sv_zoom."'> + WT_Gedcom_Tag::getLabel('LATI') . "<input name='sv_latiText' id='sv_latiText' type='text' style='width:42px; background:none; border:none;' value='" . $sv_lat . "'>" . + WT_Gedcom_Tag::getLabel('LONG') . "<input name='sv_longText' id='sv_longText' type='text' style='width:42px; background:none; border:none;' value='" . $sv_lng . "'>" . + /* I18N: Compass bearing (in degrees), for street-view mapping */ WT_I18N::translate('Bearing') . "<input name='sv_bearText' id='sv_bearText' type='text' style='width:46px; background:none; border:none;' value='" . $sv_dir . "'>" . + /* I18N: Angle of elevation (in degrees), for street-view mapping */ WT_I18N::translate('Elevation') . "<input name='sv_elevText' id='sv_elevText' type='text' style='width:30px; background:none; border:none;' value='" . $sv_pitch . "'>" . + WT_I18N::translate('Zoom') . "<input name='sv_zoomText' id='sv_zoomText' type='text' style='width:30px; background:none; border:none;' value='" . $sv_zoom . "'> "); if (Auth::isAdmin()) { echo "<table align=\"center\" style=\"margin-left:6px; border:solid 1px black; width:522px; margin-top:-28px; background:#cccccc; \">"; @@ -2766,7 +2766,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * @param string $placelevels * @param boolean $lastlevel */ - private function printGoogleMapMarkers($place2, $level, $parent, $levelm, $linklevels, $placelevels, $lastlevel=false) { + private function printGoogleMapMarkers($place2, $level, $parent, $levelm, $linklevels, $placelevels, $lastlevel = false) { if (($place2['lati'] == NULL) || ($place2['long'] == NULL) || (($place2['lati'] == '0') && ($place2['long'] == '0'))) { echo 'var icon_type = new google.maps.MarkerImage();'; echo 'icon_type.image = "', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/marker_yellow.png";'; @@ -2801,13 +2801,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } else { if ($place2['place'] == 'Unknown') { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes(WT_I18N::translate('unknown').$placelevels); + echo addslashes(WT_I18N::translate('unknown') . $placelevels); } else { echo WT_I18N::translate('unknown'); } } else { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes($place2['place'].$placelevels); + echo addslashes($place2['place'] . $placelevels); } else { echo addslashes($place2['place']); } @@ -2817,8 +2817,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($lastlevel) { $this->printHowManyPeople($level, $parent); } else { - $parent[$level]=$place2['place']; - $this->printHowManyPeople($level+1, $parent); + $parent[$level] = $place2['place']; + $this->printHowManyPeople($level + 1, $parent); } echo '<br>', WT_I18N::translate('This place has no coordinates'); if (Auth::isAdmin()) @@ -2831,12 +2831,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($lati >= 0) { $lati = abs($lati); } elseif ($lati < 0) { - $lati = '-'.abs($lati); + $lati = '-' . abs($lati); } if ($long >= 0) { $long = abs($long); } elseif ($long < 0) { - $long = '-'.abs($long); + $long = '-' . abs($long); } // flags by kiwi3685 --- @@ -2880,13 +2880,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } else { if ($place2['place'] == 'Unknown') { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes(WT_I18N::translate('unknown').$placelevels); + echo addslashes(WT_I18N::translate('unknown') . $placelevels); } else { echo WT_I18N::translate('unknown'); } } else { if (!$this->getSetting('GM_DISP_SHORT_PLACE')) { - echo addslashes($place2['place'].$placelevels); + echo addslashes($place2['place'] . $placelevels); } else { echo addslashes($place2['place']); } @@ -2896,11 +2896,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($lastlevel) { $this->printHowManyPeople($level, $parent); } else { - $parent[$level]=$place2['place']; - $this->printHowManyPeople($level+1, $parent); + $parent[$level] = $place2['place']; + $this->printHowManyPeople($level + 1, $parent); } - $temp=addslashes($place2['place']); - $temp=str_replace(array('‎', '‏'), array(WT_UTF8_LRM, WT_UTF8_RLM), $temp); + $temp = addslashes($place2['place']); + $temp = str_replace(array('‎', '‏'), array(WT_UTF8_LRM, WT_UTF8_RLM), $temp); if (!$this->getSetting('GM_COORD')) { echo "<br><br></div>\", icon_type, \"", $temp, "\");"; } else { @@ -2972,13 +2972,13 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Creates a marker whose info window displays the given name function createMarker(point, html, icon, name) { // Choose icon and shadow ============ - if (icon.image && '.$level.'<=3) { - if (icon.image!="'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/images/marker_yellow.png") { + if (icon.image && '.$level . '<=3) { + if (icon.image!="'.WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/images/marker_yellow.png") { var iconImage = new google.maps.MarkerImage(icon.image, new google.maps.Size(25, 15), new google.maps.Point(0,0), new google.maps.Point(1, 45)); - var iconShadow = new google.maps.MarkerImage("'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/images/flag_shadow.png", + var iconShadow = new google.maps.MarkerImage("'.WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/images/flag_shadow.png", new google.maps.Size(35, 45), new google.maps.Point(0,0), new google.maps.Point(1, 45)); @@ -3045,21 +3045,21 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu '); $levelm = $this->setLevelMap($level, $parent); - if (isset($levelo[0])) $levelo[0]=0; - $numls = count($parent)-1; + if (isset($levelo[0])) $levelo[0] = 0; + $numls = count($parent) - 1; $levelo = $this->checkWhereAmI($numls, $levelm); - if ($numfound<2 && ($level==1 || !isset($levelo[$level-1]))) { + if ($numfound < 2 && ($level == 1 || !isset($levelo[$level - 1]))) { $controller->addInlineJavascript('map.maxZoom=6;'); - } elseif ($numfound<2 && !isset($levelo[$level-2])) { - } elseif ($level==2) { + } elseif ($numfound < 2 && !isset($levelo[$level - 2])) { + } elseif ($level == 2) { $controller->addInlineJavascript('map.maxZoom=10;'); } //create markers ob_start(); // TODO: rewrite print_gm_markers, and the functions called therein, to either return text or add JS directly. - if ($numfound==0 && $level>0) { - if (isset($levelo[($level-1)])) { // ** BH not sure yet what this if statement is for ... TODO ** + if ($numfound == 0 && $level > 0) { + if (isset($levelo[($level - 1)])) { // ** BH not sure yet what this if statement is for ... TODO ** // show the current place on the map $place = WT_DB::prepare("SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id=?") @@ -3070,10 +3070,10 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // re-calculate the hierarchy information required to display the current place $thisloc = $parent; array_pop($thisloc); - $thislevel = $level-1 ; - $thislinklevels = substr($linklevels,0,strrpos($linklevels,'&')); - if (strpos($placelevels,',',1)) { - $thisplacelevels = substr($placelevels,strpos($placelevels,',',1)); + $thislevel = $level - 1; + $thislinklevels = substr($linklevels, 0, strrpos($linklevels, '&')); + if (strpos($placelevels, ',', 1)) { + $thisplacelevels = substr($placelevels, strpos($placelevels, ',', 1)); } else { // this is the top level, remove everything $thisplacelevels = ''; @@ -3085,26 +3085,26 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } // display any sub-places - $placeidlist=array(); + $placeidlist = array(); foreach ($place_names as $placename) { $thisloc = $parent; $thisloc[] = $placename; - $this_levelm = $this->setLevelMap($level+1, $thisloc); + $this_levelm = $this->setLevelMap($level + 1, $thisloc); if ($this_levelm) $placeidlist[] = $this_levelm; } if ($placeidlist) { // flip the array (thus removing duplicates) - $placeidlist=array_flip($placeidlist); + $placeidlist = array_flip($placeidlist); // remove entry for parent location unset($placeidlist[$levelm]); } if ($placeidlist) { // the keys are all we care about (this reverses the earlier array_flip, and ensures there are no "holes" in the array) - $placeidlist=array_keys($placeidlist); + $placeidlist = array_keys($placeidlist); // note: this implode/array_fill code generates one '?' for each entry in the $placeidlist array $placelist = - WT_DB::prepare('SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id IN ('.implode(',', array_fill(0, count($placeidlist), '?')).')') + WT_DB::prepare('SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id IN (' . implode(',', array_fill(0, count($placeidlist), '?')) . ')') ->execute($placeidlist) ->fetchAll(PDO::FETCH_ASSOC); @@ -3142,14 +3142,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * @return int */ private function getHighestIndex() { - return (int)WT_DB::prepare("SELECT MAX(pl_id) FROM `##placelocation`")->fetchOne(); + return (int) WT_DB::prepare("SELECT MAX(pl_id) FROM `##placelocation`")->fetchOne(); } /** * @return int */ private function getHighestLevel() { - return (int)WT_DB::prepare("SELECT MAX(pl_level) FROM `##placelocation`")->fetchOne(); + return (int) WT_DB::prepare("SELECT MAX(pl_level) FROM `##placelocation`")->fetchOne(); } /** @@ -3173,9 +3173,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ))->fetchAll(); } else { $rows = WT_DB::prepare( - "SELECT DISTINCT pl_id, pl_place, pl_lati, pl_long, pl_zoom, pl_icon". - " FROM `##placelocation`". - " INNER JOIN `##places` ON `##placelocation`.pl_place=`##places`.p_place". + "SELECT DISTINCT pl_id, pl_place, pl_lati, pl_long, pl_zoom, pl_icon" . + " FROM `##placelocation`" . + " INNER JOIN `##places` ON `##placelocation`.pl_place=`##places`.p_place" . " WHERE pl_parent_id = :parent_id" . " ORDER BY pl_place COLLATE :collation" )->execute(array( @@ -3253,12 +3253,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * ... */ private function placesEdit() { - require WT_ROOT.'includes/functions/functions_edit.php'; + require WT_ROOT . 'includes/functions/functions_edit.php'; $GM_MAX_ZOOM = $this->getSetting('GM_MAX_ZOOM'); - $action = WT_Filter::post('action', null, WT_Filter::get('action')); - $placeid = WT_Filter::post('placeid', null, WT_Filter::get('placeid')); + $action = WT_Filter::post('action', null, WT_Filter::get('action')); + $placeid = WT_Filter::post('placeid', null, WT_Filter::get('placeid')); $place_name = WT_Filter::post('place_name', null, WT_Filter::get('place_name')); $controller = new WT_Controller_Simple; @@ -3268,17 +3268,17 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->addInlineJavascript('$("<link>", {rel: "stylesheet", type: "text/css", href: "' . WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/css/wt_v3_googlemap.css"}).appendTo("head");') ->pageHeader(); - $where_am_i=$this->placeIdToHierarchy($placeid); - $level=count($where_am_i); + $where_am_i = $this->placeIdToHierarchy($placeid); + $level = count($where_am_i); - if ($action=='addrecord' && Auth::isAdmin()) { - $statement= + if ($action == 'addrecord' && Auth::isAdmin()) { + $statement = WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); if (($_POST['LONG_CONTROL'] == '') || ($_POST['NEW_PLACE_LONG'] == '') || ($_POST['NEW_PLACE_LATI'] == '')) { - $statement->execute(array($this->getHighestIndex()+1, $placeid, $level, $_POST['NEW_PLACE_NAME'], null, null, $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); + $statement->execute(array($this->getHighestIndex() + 1, $placeid, $level, $_POST['NEW_PLACE_NAME'], null, null, $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); } else { - $statement->execute(array($this->getHighestIndex()+1, $placeid, $level, $_POST['NEW_PLACE_NAME'], $_POST['LONG_CONTROL'][3].$_POST['NEW_PLACE_LONG'], $_POST['LATI_CONTROL'][3].$_POST['NEW_PLACE_LATI'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); + $statement->execute(array($this->getHighestIndex() + 1, $placeid, $level, $_POST['NEW_PLACE_NAME'], $_POST['LONG_CONTROL'][3] . $_POST['NEW_PLACE_LONG'], $_POST['LATI_CONTROL'][3] . $_POST['NEW_PLACE_LATI'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'])); } // autoclose window when update successful unless debug on @@ -3289,14 +3289,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu exit; } - if ($action=='updaterecord' && Auth::isAdmin()) { - $statement= + if ($action == 'updaterecord' && Auth::isAdmin()) { + $statement = WT_DB::prepare("UPDATE `##placelocation` SET pl_place=?, pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?"); if (($_POST['LONG_CONTROL'] == '') || ($_POST['NEW_PLACE_LONG'] == '') || ($_POST['NEW_PLACE_LATI'] == '')) { $statement->execute(array($_POST['NEW_PLACE_NAME'], null, null, $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'], $placeid)); } else { - $statement->execute(array($_POST['NEW_PLACE_NAME'], $_POST['LATI_CONTROL'][3].$_POST['NEW_PLACE_LATI'], $_POST['LONG_CONTROL'][3].$_POST['NEW_PLACE_LONG'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'], $placeid)); + $statement->execute(array($_POST['NEW_PLACE_NAME'], $_POST['LATI_CONTROL'][3] . $_POST['NEW_PLACE_LATI'], $_POST['LONG_CONTROL'][3] . $_POST['NEW_PLACE_LONG'], $_POST['NEW_ZOOM_FACTOR'], $_POST['icon'], $placeid)); } // autoclose window when update successful unless debug on @@ -3324,16 +3324,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu exit; } - if ($action=="update") { + if ($action == "update") { // --- find the place in the file - $row= + $row = WT_DB::prepare("SELECT pl_place, pl_lati, pl_long, pl_icon, pl_parent_id, pl_level, pl_zoom FROM `##placelocation` WHERE pl_id=?") ->execute(array($placeid)) ->fetchOneRow(); $place_name = $row->pl_place; $place_icon = $row->pl_icon; $selected_country = explode("/", $place_icon); - if (isset($selected_country[1]) && $selected_country[1]!="flags") + if (isset($selected_country[1]) && $selected_country[1] != "flags") $selected_country = $selected_country[1]; else $selected_country = "Countries"; @@ -3342,9 +3342,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $zoomfactor = $row->pl_zoom; $parent_lati = "0.0"; $parent_long = "0.0"; - if ($row->pl_lati!==null && $row->pl_long!==null) { - $place_lati = (float)(str_replace(array('N', 'S', ','), array('', '-', '.') , $row->pl_lati)); - $place_long = (float)(str_replace(array('E', 'W', ','), array('', '-', '.') , $row->pl_long)); + if ($row->pl_lati !== null && $row->pl_long !== null) { + $place_lati = (float) (str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati)); + $place_long = (float) (str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long)); } else { $place_lati = null; $place_long = null; @@ -3352,57 +3352,57 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } do { - $row= + $row = WT_DB::prepare("SELECT pl_lati, pl_long, pl_parent_id, pl_zoom FROM `##placelocation` WHERE pl_id=?") ->execute(array($parent_id)) ->fetchOneRow(); if (!$row) { break; } - if ($row->pl_lati!==null && $row->pl_long!==null) { - $parent_lati = (float)(str_replace(array('N', 'S', ','), array('', '-', '.') , $row->pl_lati)); - $parent_long = (float)(str_replace(array('E', 'W', ','), array('', '-', '.') , $row->pl_long)); + if ($row->pl_lati !== null && $row->pl_long !== null) { + $parent_lati = (float) (str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati)); + $parent_long = (float) (str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long)); if ($zoomfactor == 1) { $zoomfactor = $row->pl_zoom; } } $parent_id = $row->pl_parent_id; } - while ($row->pl_parent_id!=0 && $row->pl_lati===null && $row->pl_long===null); + while ($row->pl_parent_id != 0 && $row->pl_lati === null && $row->pl_long === null); echo '<b>', WT_Filter::escapeHtml(str_replace('Unknown', WT_I18N::translate('unknown'), implode(WT_I18N::$list_separator, array_reverse($where_am_i, true)))), '</b><br>'; } - if ($action=='add') { + if ($action == 'add') { // --- find the parent place in the file if ($placeid != 0) { - if (!isset($place_name)) $place_name = ''; + if (!isset($place_name)) $place_name = ''; $place_lati = null; $place_long = null; $zoomfactor = 1; $parent_lati = '0.0'; $parent_long = '0.0'; $place_icon = ''; - $parent_id=$placeid; + $parent_id = $placeid; do { - $row= + $row = WT_DB::prepare("SELECT pl_lati, pl_long, pl_parent_id, pl_zoom, pl_level FROM `##placelocation` WHERE pl_id=?") ->execute(array($parent_id)) ->fetchOneRow(); - if ($row->pl_lati!==null && $row->pl_long!==null) { - $parent_lati=str_replace(array('N', 'S', ','), array('', '-', '.') , $row->pl_lati); - $parent_long=str_replace(array('E', 'W', ','), array('', '-', '.') , $row->pl_long); - $zoomfactor=$row->pl_zoom; - if ($zoomfactor>$GM_MAX_ZOOM) { - $zoomfactor=$GM_MAX_ZOOM; + if ($row->pl_lati !== null && $row->pl_long !== null) { + $parent_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $row->pl_lati); + $parent_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $row->pl_long); + $zoomfactor = $row->pl_zoom; + if ($zoomfactor > $GM_MAX_ZOOM) { + $zoomfactor = $GM_MAX_ZOOM; } - $level=$row->pl_level+1; + $level = $row->pl_level + 1; } $parent_id = $row->pl_parent_id; - } while ($row->pl_parent_id!=0 && $row->pl_lati===null && $row->pl_long===null); + } while ($row->pl_parent_id != 0 && $row->pl_lati === null && $row->pl_long === null); } else { - if (!isset($place_name)) $place_name = ''; + if (!isset($place_name)) $place_name = ''; $place_lati = null; $place_long = null; $parent_lati = "0.0"; @@ -3414,9 +3414,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } $selected_country = 'Countries'; - if (!isset($place_name) || $place_name=="") echo '<b>', WT_I18N::translate('unknown'); + if (!isset($place_name) || $place_name == "") echo '<b>', WT_I18N::translate('unknown'); else echo '<b>', $place_name; - if (count($where_am_i)>0) + if (count($where_am_i) > 0) echo ', ', WT_Filter::escapeHtml(str_replace('Unknown', WT_I18N::translate('unknown'), implode(WT_I18N::$list_separator, array_reverse($where_am_i, true)))), '</b><br>'; echo '</b><br>'; } @@ -3741,15 +3741,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu // Create the Main Location Marker <?php if ($level < 3 && $place_icon != '') { - echo 'var image = new google.maps.MarkerImage("', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/',$place_icon,'",'; - echo 'new google.maps.Size(25, 15),'; // Image size - echo 'new google.maps.Point(0, 0),'; // Image origin - echo 'new google.maps.Point(0, 44)'; // Image anchor + echo 'var image = new google.maps.MarkerImage("', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/', $place_icon, '",'; + echo 'new google.maps.Size(25, 15),'; // Image size + echo 'new google.maps.Point(0, 0),'; // Image origin + echo 'new google.maps.Point(0, 44)'; // Image anchor echo ');'; echo 'var iconShadow = new google.maps.MarkerImage("', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/flag_shadow.png",'; - echo 'new google.maps.Size(35, 45),'; // Shadow size - echo 'new google.maps.Point(0,0),'; // Shadow origin - echo 'new google.maps.Point(1, 45)'; // Shadow anchor is base of flagpole + echo 'new google.maps.Size(35, 45),'; // Shadow size + echo 'new google.maps.Point(0,0),'; // Shadow origin + echo 'new google.maps.Point(1, 45)'; // Shadow anchor is base of flagpole echo ');'; echo 'marker = new google.maps.Marker({'; echo 'icon: image,'; @@ -3847,14 +3847,14 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu var contentString = '<div id="iwcontent_edit">'+name+'<\/div>'; <?php echo 'var image = new google.maps.MarkerImage("', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/marker_yellow.png",'; - echo 'new google.maps.Size(20, 34),'; // Image size - echo 'new google.maps.Point(0, 0),'; // Image origin - echo 'new google.maps.Point(10, 34)'; // Image anchor + echo 'new google.maps.Size(20, 34),'; // Image size + echo 'new google.maps.Point(0, 0),'; // Image origin + echo 'new google.maps.Point(10, 34)'; // Image anchor echo ');'; echo 'var iconShadow = new google.maps.MarkerImage("', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/shadow50.png",'; - echo 'new google.maps.Size(37, 34),'; // Shadow size - echo 'new google.maps.Point(0, 0),'; // Shadow origin - echo 'new google.maps.Point(10, 34)'; // Shadow anchor is base of image + echo 'new google.maps.Size(37, 34),'; // Shadow size + echo 'new google.maps.Point(0, 0),'; // Shadow origin + echo 'new google.maps.Point(10, 34)'; // Shadow anchor is base of image echo ');'; ?> var marker = new google.maps.Marker({ @@ -3931,7 +3931,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } function showLocation_level(address) { - address += '<?php if ($level>0) echo ', ', addslashes(implode(', ', array_reverse($where_am_i, true))); ?>'; + address += '<?php if ($level > 0) echo ', ', addslashes(implode(', ', array_reverse($where_am_i, true))); ?>'; geocoder.geocode({'address': address}, addAddressToMap); } @@ -3975,7 +3975,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </td> </tr> <tr> - <td class="descriptionbox"><?php echo WT_I18N::translate('Precision'), help_link('PLE_PRECISION','googlemap'); ?></td> + <td class="descriptionbox"><?php echo WT_I18N::translate('Precision'), help_link('PLE_PRECISION', 'googlemap'); ?></td> <?php $exp = explode(".", $place_lati); if (isset($exp[1])) { @@ -3990,23 +3990,23 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $precision2 = -1; } ($precision1 > $precision2) ? ($precision = $precision1) : ($precision = $precision2); - if ($precision == -1 ) ($level > 3) ? ($precision = 3) : ($precision = $level); + if ($precision == -1) ($level > 3) ? ($precision = 3) : ($precision = $level); elseif ($precision > 5) { $precision = 5; } ?> <td class="optionbox" colspan="2"> - <input type="radio" id="new_prec_0" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$this->getSetting('GM_PRECISION_0')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_0'); ?>"> + <input type="radio" id="new_prec_0" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_0')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_0'); ?>"> <label for="new_prec_0"><?php echo WT_I18N::translate('Country'); ?></label> - <input type="radio" id="new_prec_1" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$this->getSetting('GM_PRECISION_1')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_1'); ?>"> + <input type="radio" id="new_prec_1" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_1')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_1'); ?>"> <label for="new_prec_1"><?php echo WT_I18N::translate('State'); ?></label> - <input type="radio" id="new_prec_2" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$this->getSetting('GM_PRECISION_2')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_2'); ?>"> + <input type="radio" id="new_prec_2" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_2')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_2'); ?>"> <label for="new_prec_2"><?php echo WT_I18N::translate('City'); ?></label> - <input type="radio" id="new_prec_3" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$this->getSetting('GM_PRECISION_3')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_3'); ?>"> + <input type="radio" id="new_prec_3" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_3')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_3'); ?>"> <label for="new_prec_3"><?php echo WT_I18N::translate('Neighborhood'); ?></label> - <input type="radio" id="new_prec_4" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision==$this->getSetting('GM_PRECISION_4')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_4'); ?>"> + <input type="radio" id="new_prec_4" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_4')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_4'); ?>"> <label for="new_prec_4"><?php echo WT_I18N::translate('House'); ?></label> - <input type="radio" id="new_prec_5" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision>=$this->getSetting('GM_PRECISION_5')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_5'); ?>"> + <input type="radio" id="new_prec_5" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision >= $this->getSetting('GM_PRECISION_5')) echo "checked=\"checked\""; ?> value="<?php echo $this->getSetting('GM_PRECISION_5'); ?>"> <label for="new_prec_5"><?php echo WT_I18N::translate('Max'); ?></label> </td> </tr> @@ -4031,12 +4031,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </td> </tr> <tr> - <td class="descriptionbox"><?php echo WT_I18N::translate('Zoom level'), help_link('PLE_ZOOM','googlemap'); ?></td> + <td class="descriptionbox"><?php echo WT_I18N::translate('Zoom level'), help_link('PLE_ZOOM', 'googlemap'); ?></td> <td class="optionbox" colspan="2"> <input type="text" id="NEW_ZOOM_FACTOR" name="NEW_ZOOM_FACTOR" value="<?php echo $zoomfactor; ?>" size="20" onchange="updateMap();"></td> </tr> <tr> - <td class="descriptionbox"><?php echo WT_I18N::translate('Flag'), help_link('PLE_ICON','googlemap'); ?></td> + <td class="descriptionbox"><?php echo WT_I18N::translate('Flag'), help_link('PLE_ICON', 'googlemap'); ?></td> <td class="optionbox" colspan="2"> <div id="flagsDiv"> <?php @@ -4063,7 +4063,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu * ... */ private function adminPlaces() { - require WT_ROOT.'includes/functions/functions_edit.php'; + require WT_ROOT . 'includes/functions/functions_edit.php'; $action = WT_Filter::get('action'); $parent = WT_Filter::get('parent'); @@ -4071,30 +4071,30 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $deleteRecord = WT_Filter::get('deleteRecord'); if (!isset($parent)) { - $parent=0; + $parent = 0; } $controller = new WT_Controller_Page; $controller->restrictAccess(Auth::isAdmin()); - if ($action=='ExportFile' && Auth::isAdmin()) { + if ($action == 'ExportFile' && Auth::isAdmin()) { Zend_Session::writeClose(); $tmp = $this->placeIdToHierarchy($parent); $maxLevel = $this->getHighestLevel(); - if ($maxLevel>8) $maxLevel=8; + if ($maxLevel > 8) $maxLevel = 8; $tmp[0] = 'places'; - $outputFileName=preg_replace('/[:;\/\\\(\)\{\}\[\] $]/', '_', implode('-', $tmp)).'.csv'; + $outputFileName = preg_replace('/[:;\/\\\(\)\{\}\[\] $]/', '_', implode('-', $tmp)) . '.csv'; header('Content-Type: application/octet-stream'); - header('Content-Disposition: attachment; filename="'.$outputFileName.'"'); + header('Content-Disposition: attachment; filename="' . $outputFileName . '"'); echo '"', WT_I18N::translate('Level'), '";"', WT_I18N::translate('Country'), '";'; - if ($maxLevel>0) echo '"', WT_I18N::translate('State'), '";'; - if ($maxLevel>1) echo '"', WT_I18N::translate('County'), '";'; - if ($maxLevel>2) echo '"', WT_I18N::translate('City'), '";'; - if ($maxLevel>3) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>4) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>5) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>6) echo '"', WT_I18N::translate('Place'), '";'; - if ($maxLevel>7) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 0) echo '"', WT_I18N::translate('State'), '";'; + if ($maxLevel > 1) echo '"', WT_I18N::translate('County'), '";'; + if ($maxLevel > 2) echo '"', WT_I18N::translate('City'), '";'; + if ($maxLevel > 3) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 4) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 5) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 6) echo '"', WT_I18N::translate('Place'), '";'; + if ($maxLevel > 7) echo '"', WT_I18N::translate('Place'), '";'; echo '"', WT_I18N::translate('Longitude'), '";"', WT_I18N::translate('Latitude'), '";'; echo '"', WT_I18N::translate('Zoom level'), '";"', WT_I18N::translate('Icon'), '";', WT_EOL; $this->outputLevel($parent); @@ -4127,9 +4127,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </table> <?php - if ($action=='ImportGedcom') { - $placelist=array(); - $j=0; + if ($action == 'ImportGedcom') { + $placelist = array(); + $j = 0; $gedcom_records = WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_file=? UNION ALL SELECT f_gedcom FROM `##families` WHERE f_file=?") ->execute(array(WT_GED_ID, WT_GED_ID)) @@ -4147,7 +4147,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($placelist[$j]['lati'] < 0) { $placelist[$j]['lati'][0] = 'S'; } else { - $placelist[$j]['lati'] = 'N'.$placelist[$j]['lati']; + $placelist[$j]['lati'] = 'N' . $placelist[$j]['lati']; } } } @@ -4158,7 +4158,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if ($placelist[$j]['long'] < 0) { $placelist[$j]['long'][0] = 'W'; } else { - $placelist[$j]['long'] = 'E'.$placelist[$j]['long']; + $placelist[$j]['long'] = 'E' . $placelist[$j]['long']; } } } @@ -4184,9 +4184,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $placelistUniq[$j]['long'] = $place['long']; $j = $j + 1; } elseif (($place['place'] == $prevPlace) && (($place['lati'] != $prevLati) || ($place['long'] != $prevLong))) { - if (($placelistUniq[$j-1]['lati'] == 0) || ($placelistUniq[$j-1]['long'] == 0)) { - $placelistUniq[$j-1]['lati'] = $place['lati']; - $placelistUniq[$j-1]['long'] = $place['long']; + if (($placelistUniq[$j - 1]['lati'] == 0) || ($placelistUniq[$j - 1]['long'] == 0)) { + $placelistUniq[$j - 1]['lati'] = $place['lati']; + $placelistUniq[$j - 1]['long'] = $place['long']; } elseif (($place['lati'] != '0') || ($place['long'] != '0')) { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>'; } @@ -4198,32 +4198,32 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $highestIndex = $this->getHighestIndex(); - $default_zoom_level=array(4, 7, 10, 12); + $default_zoom_level = array(4, 7, 10, 12); foreach ($placelistUniq as $k=>$place) { - $parent=preg_split('/ *, */', $place['place']); - $parent=array_reverse($parent); - $parent_id=0; - for ($i=0; $i<count($parent); $i++) { + $parent = preg_split('/ *, */', $place['place']); + $parent = array_reverse($parent); + $parent_id = 0; + 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]; + $default_zoom_level[$i] = $default_zoom_level[$i - 1]; + $escparent = $parent[$i]; if ($escparent == '') { $escparent = 'Unknown'; } - $row= + $row = WT_DB::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ?") ->execute(array($i, $parent_id, $escparent)) ->fetchOneRow(); - if ($i < count($parent)-1) { + if ($i < count($parent) - 1) { // Create higher-level places, if necessary if (empty($row)) { $highestIndex++; WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)") ->execute(array($highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '<br>'; - $parent_id=$highestIndex; + $parent_id = $highestIndex; } else { - $parent_id=$row->pl_id; + $parent_id = $row->pl_id; } } else { // Create lowest-level place, if necessary @@ -4233,7 +4233,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '<br>'; } else { - if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati']!='0' && $place['long']!='0') { + if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?") ->execute(array($place['lati'], $place['long'], $row->pl_id)); echo WT_Filter::escapeHtml($escparent), '<br>'; @@ -4242,12 +4242,12 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } } - $parent=0; + $parent = 0; } - if ($action=='ImportFile') { + if ($action == 'ImportFile') { $placefiles = array(); - $this->findFiles(WT_MODULES_DIR.'googlemap/extra'); + $this->findFiles(WT_MODULES_DIR . 'googlemap/extra'); sort($placefiles); ?> <form method="post" enctype="multipart/form-data" id="importfile" name="importfile" action="module.php?mod=googlemap&mod_action=admin_places&action=ImportFile2"> @@ -4256,15 +4256,15 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu <th><?php echo WT_I18N::translate('File containing places (CSV)'); ?></th> <td><input type="file" name="placesfile" size="50"></td> </tr> - <?php if (count($placefiles)>0) { ?> + <?php if (count($placefiles) > 0) { ?> <tr> - <th><?php echo WT_I18N::translate('Server file containing places (CSV)'), help_link('PLIF_LOCALFILE','googlemap'); ?></th> + <th><?php echo WT_I18N::translate('Server file containing places (CSV)'), help_link('PLIF_LOCALFILE', 'googlemap'); ?></th> <td> <select name="localfile"> <option></option> <?php foreach ($placefiles as $p=>$placefile) { ?> <option value="<?php echo WT_Filter::escapeHtml($placefile); ?>"><?php - if (substr($placefile, 0, 1)=="/") echo substr($placefile, 1); + if (substr($placefile, 0, 1) == "/") echo substr($placefile, 1); else echo $placefile; ?></option> <?php } ?> </select> @@ -4294,7 +4294,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $country_names = array(); $stats = new WT_Stats(WT_GEDCOM); foreach ($stats->iso3166() as $key=>$value) { - $country_names[$key]=WT_I18N::translate($key); + $country_names[$key] = WT_I18N::translate($key); } if (isset($_POST['cleardatabase'])) { WT_DB::exec("DELETE FROM `##placelocation` WHERE 1=1"); @@ -4302,7 +4302,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu if (!empty($_FILES['placesfile']['tmp_name'])) { $lines = file($_FILES['placesfile']['tmp_name']); } elseif (!empty($_REQUEST['localfile'])) { - $lines = file(WT_MODULES_DIR.'googlemap/extra'.$_REQUEST['localfile']); + $lines = file(WT_MODULES_DIR . 'googlemap/extra' . $_REQUEST['localfile']); } // Strip BYTE-ORDER-MARK, if present if (!empty($lines[0]) && substr($lines[0], 0, 3) === WT_UTF8_BOM) { @@ -4319,16 +4319,16 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } $fields = count($fieldrec); $set_icon = true; - if (!is_dir(WT_MODULES_DIR.'googlemap/places/flags/')) { + if (!is_dir(WT_MODULES_DIR . 'googlemap/places/flags/')) { $set_icon = false; } foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); - if (is_numeric($fieldrec[0]) && $fieldrec[0]<=$maxLevel) { + if (is_numeric($fieldrec[0]) && $fieldrec[0] <= $maxLevel) { $placelist[$j] = array(); $placelist[$j]['place'] = ''; - for ($ii=$fields-4; $ii>1; $ii--) { - if ($fieldrec[0] > $ii-2) $placelist[$j]['place'] .= $fieldrec[$ii].','; + for ($ii = $fields - 4; $ii > 1; $ii--) { + if ($fieldrec[0] > $ii - 2) $placelist[$j]['place'] .= $fieldrec[$ii] . ','; } foreach ($country_names as $countrycode => $countryname) { if ($countrycode == strtoupper($fieldrec[1])) { @@ -4337,11 +4337,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } $placelist[$j]['place'] .= $fieldrec[1]; - $placelist[$j]['long'] = $fieldrec[$fields-4]; - $placelist[$j]['lati'] = $fieldrec[$fields-3]; - $placelist[$j]['zoom'] = $fieldrec[$fields-2]; - if($set_icon) { - $placelist[$j]['icon'] = trim($fieldrec[$fields-1]); + $placelist[$j]['long'] = $fieldrec[$fields - 4]; + $placelist[$j]['lati'] = $fieldrec[$fields - 3]; + $placelist[$j]['zoom'] = $fieldrec[$fields - 2]; + if ($set_icon) { + $placelist[$j]['icon'] = trim($fieldrec[$fields - 1]); } else { $placelist[$j]['icon'] = ''; } @@ -4364,11 +4364,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $placelistUniq[$j]['icon'] = $place['icon']; $j = $j + 1; } elseif (($place['place'] == $prevPlace) && (($place['lati'] != $prevLati) || ($place['long'] != $prevLong))) { - if (($placelistUniq[$j-1]['lati'] == 0) || ($placelistUniq[$j-1]['long'] == 0)) { - $placelistUniq[$j-1]['lati'] = $place['lati']; - $placelistUniq[$j-1]['long'] = $place['long']; - $placelistUniq[$j-1]['zoom'] = $place['zoom']; - $placelistUniq[$j-1]['icon'] = $place['icon']; + if (($placelistUniq[$j - 1]['lati'] == 0) || ($placelistUniq[$j - 1]['long'] == 0)) { + $placelistUniq[$j - 1]['lati'] = $place['lati']; + $placelistUniq[$j - 1]['long'] = $place['long']; + $placelistUniq[$j - 1]['zoom'] = $place['zoom']; + $placelistUniq[$j - 1]['icon'] = $place['icon']; } elseif (($place['lati'] != '0') || ($place['long'] != '0')) { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>'; } @@ -4386,42 +4386,42 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu foreach ($placelistUniq as $k=>$place) { $parent = explode(',', $place['place']); $parent = array_reverse($parent); - $parent_id=0; - for ($i=0; $i<count($parent); $i++) { - $escparent=$parent[$i]; + $parent_id = 0; + for ($i = 0; $i < count($parent); $i++) { + $escparent = $parent[$i]; if ($escparent == '') { $escparent = 'Unknown'; } - $row= + $row = WT_DB::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place") ->execute(array($i, $parent_id, $escparent)) ->fetchOneRow(); if (empty($row)) { // this name does not yet exist: create entry if (!isset($_POST['updateonly'])) { $highestIndex = $highestIndex + 1; - if (($i+1) == count($parent)) { + if (($i + 1) == count($parent)) { $zoomlevel = $place['zoom']; } elseif (isset($default_zoom_level[$i])) { $zoomlevel = $default_zoom_level[$i]; } else { $zoomlevel = $this->getSetting('GM_MAX_ZOOM'); } - if (($place['lati'] == '0') || ($place['long'] == '0') || (($i+1) < count($parent))) { + if (($place['lati'] == '0') || ($place['long'] == '0') || (($i + 1) < count($parent))) { WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?)") ->execute(array($highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon'])); } else { //delete leading zero - $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.') , $place['lati']); - $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.') , $place['long']); + $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place['lati']); + $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $place['long']); if ($pl_lati >= 0) { - $place['lati'] = 'N'.abs($pl_lati); + $place['lati'] = 'N' . abs($pl_lati); } elseif ($pl_lati < 0) { - $place['lati'] = 'S'.abs($pl_lati); + $place['lati'] = 'S' . abs($pl_lati); } if ($pl_long >= 0) { - $place['long'] = 'E'.abs($pl_long); + $place['long'] = 'E' . abs($pl_long); } elseif ($pl_long < 0) { - $place['long'] = 'W'.abs($pl_long); + $place['long'] = 'W' . abs($pl_long); } WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)") ->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon'])); @@ -4430,7 +4430,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } else { $parent_id = $row->pl_id; - if ((isset($_POST['overwritedata'])) && ($i+1 == count($parent))) { + if ((isset($_POST['overwritedata'])) && ($i + 1 == count($parent))) { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?") ->execute(array($place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id)); } else { @@ -4446,11 +4446,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } } } - $parent=0; + $parent = 0; } - if ($action=='DeleteRecord') { - $exists= + if ($action == 'DeleteRecord') { + $exists = WT_DB::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?") ->execute(array($deleteRecord)) ->fetchOne(); @@ -4466,7 +4466,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ?> <script> function updateList(inactive) { - window.location.href='<?php if (strstr($_SERVER['REQUEST_URI'], '&inactive', true)) { $uri=strstr($_SERVER['REQUEST_URI'], '&inactive', true);} else { $uri=$_SERVER['REQUEST_URI']; } echo $uri, '&inactive='; ?>'+inactive; + window.location.href='<?php if (strstr($_SERVER['REQUEST_URI'], '&inactive', true)) { $uri = strstr($_SERVER['REQUEST_URI'], '&inactive', true); } else { $uri = $_SERVER['REQUEST_URI']; } echo $uri, '&inactive='; ?>'+inactive; } function edit_place_location(placeid) { @@ -4488,9 +4488,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu </script> <?php echo '<div id="gm_breadcrumb">'; - $where_am_i=$this->placeIdToHierarchy($parent); + $where_am_i = $this->placeIdToHierarchy($parent); foreach (array_reverse($where_am_i, true) as $id=>$place) { - if ($id==$parent) { + if ($id == $parent) { if ($place != 'Unknown') { echo WT_Filter::escapeHtml($place); } else { @@ -4512,9 +4512,9 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu echo '<input type="checkbox" name="inactive" id="inactive"'; if ($inactive) echo ' checked="checked"'; echo ' onclick="updateList(this.checked)"'; - echo '>', help_link('PLE_ACTIVE','googlemap'), '</div></form>'; + echo '>', help_link('PLE_ACTIVE', 'googlemap'), '</div></form>'; - $placelist=$this->getPlaceListLocation($parent, $inactive); + $placelist = $this->getPlaceListLocation($parent, $inactive); echo '<div class="gm_plac_edit">'; echo '<table class="gm_plac_edit"><tr>'; echo '<th>', WT_Gedcom_Tag::getLabel('PLAC'), '</th>'; @@ -4548,11 +4548,11 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu } echo '</td>'; echo '<td class="narrow"><a href="#" onclick="edit_place_location(', $place['place_id'], ');return false;" class="icon-edit" title="', WT_I18N::translate('Edit'), '"></a></td>'; - $noRows= + $noRows = WT_DB::prepare("SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id=?") ->execute(array($place['place_id'])) ->fetchOne(); - if ($noRows==0) { ?> + if ($noRows == 0) { ?> <td><a href="#" onclick="delete_place(<?php echo $place['place_id']?>);return false;" class="icon-delete" title="<?php echo WT_I18N::translate('Remove'); ?>"></a></td> <?php } else { ?> <td><i class="icon-delete-grey"></i></td> |
