diff options
81 files changed, 1083 insertions, 1140 deletions
@@ -49,7 +49,7 @@ if (!isset($action)) $action=""; print_header(i18n::translate('Administration')); $pending_changes=WT_DB::prepare("SELECT 1 FROM `##change` WHERE status='pending' LIMIT 1")->fetchOne(); if ($pending_changes) { - $d_wt_changes = "<a href=\"javascript:;\" onclick=\"window.open('edit_changes.php','_blank','width=600,height=500,resizable=1,scrollbars=1'); return false;\">".i18n::translate('Accept / Reject Changes').help_link('edit_changes.php')."</a>\n"; + $d_wt_changes = "<a href=\"javascript:;\" onclick=\"window.open('edit_changes.php','_blank','width=600,height=500,resizable=1,scrollbars=1'); return false;\">".i18n::translate('Accept / Reject Changes').help_link('edit_changes.php')."</a>"; } else { $d_wt_changes = ' '; } @@ -89,12 +89,12 @@ echo WT_JS_START, 'function showchanges() {window.location.reload();}', WT_JS_EN if (WT_USER_IS_ADMIN) { if ($verify_msg) { echo "<br />"; - echo "<a href=\"".encode_url("useradmin.php?action=listusers&filter=admunver")."\" class=\"error\">".i18n::translate('User accounts awaiting verification by admin')."</a>"; + echo "<a href=\"useradmin.php?action=listusers&filter=admunver"."\" class=\"error\">".i18n::translate('User accounts awaiting verification by admin')."</a>"; echo "<br /><br />"; } if ($warn_msg) { echo "<br />"; - echo "<a href=\"".encode_url("useradmin.php?action=listusers&filter=warnings")."\" class=\"error\" >".i18n::translate('One or more user accounts have warnings')."</a>"; + echo "<a href=\"useradmin.php?action=listusers&filter=warnings"."\" class=\"error\" >".i18n::translate('One or more user accounts have warnings')."</a>"; echo "<br /><br />"; } } diff --git a/branches.php b/branches.php index 534e9063ab..8499e606ca 100644 --- a/branches.php +++ b/branches.php @@ -104,7 +104,7 @@ if ($surn) { echo "</fieldset>"; if ($rootid) { $person = Person::getInstance($rootid); - echo "<p class=\"center\">", i18n::translate('Pedigree chart root person'), " : <a title=\"", $person->getXref(), "\" href=\"{$person->getLinkUrl()}\">{$person->getFullName()}</a>"; + echo "<p class=\"center\">", i18n::translate('Pedigree chart root person'), " : <a title=\"", $person->getXref(), "\" href=\"{$person->getHtmlUrl()}\">{$person->getFullName()}</a>"; echo "<br />".i18n::translate('Direct line ancestors')." : ", count($_SESSION['user_ancestors']), "</p>"; } } @@ -143,7 +143,7 @@ function print_fams($person, $famid=null) { $sosa = "<a dir=$TEXT_DIRECTION target=\"_blank\" class=\"details1 {$person->getBoxStyle()}\" title=\"Sosa\" href=\"relationship.php?pid2=".WT_USER_ROOT_ID."&pid1=".$person->getXref()."\"> {$sosa} </a>".sosa_gen($sosa); } $current = $person->getSexImage(). - "<a target=\"_blank\" class=\"{$class}\" title=\"".$person->getXref()."\" href=\"{$person->getLinkUrl()}\">".PrintReady($person_name)."</a> ". + "<a target=\"_blank\" class=\"{$class}\" title=\"".$person->getXref()."\" href=\"{$person->getHtmlUrl()}\">".PrintReady($person_name)."</a> ". $person->getBirthDeathYears()." {$sosa}"; if ($famid && $person->getChildFamilyPedigree($famid)) { $sex = $person->getSex(); @@ -188,7 +188,7 @@ function print_fams($person, $famid=null) { } list($surn2, $givn2) = explode(", ", $spouse_name.", x"); $txt .= $spouse->getSexImage(). - "<a target=\"_blank\" class=\"{$class}\" title=\"".$family->getXref()."\" href=\"{$family->getLinkUrl()}\">".PrintReady($givn2)."</a> ". + "<a target=\"_blank\" class=\"{$class}\" title=\"".$family->getXref()."\" href=\"{$family->getHtmlUrl()}\">".PrintReady($givn2)."</a> ". "<a class=\"{$class}\" title=\"{$surn2}\" href=\"javascript:document.surnlist.surn.value='{$surn2}';document.surnlist.submit();\">".PrintReady($surn2)."</a> ". $spouse->getBirthDeathYears()." {$sosa2}"; } diff --git a/calendar.php b/calendar.php index 14e2057603..632dcc7a21 100644 --- a/calendar.php +++ b/calendar.php @@ -140,7 +140,7 @@ for($d=1; $d<=$days_in_month; $d++) { if ($d==$cal_date->d) echo "<span class=\"error\">{$d_fmt}</span>"; else - echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day={$d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\">{$d_fmt}</a>"; + echo "<a href=\"calendar.php?cal={$cal}&day={$d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}"."\">{$d_fmt}</a>"; echo ' | '; } $tmp=new GedcomDate($today->Format('%@ %A %O %E')); // Need a GedcomDate object to get localisation @@ -154,18 +154,18 @@ for ($n=1; $n<=$cal_date->NUM_MONTHS(); ++$n) { $m=$cal_date->NUM_TO_GEDCOM_MONTH($n, $cal_date->IsLeapYear()); if ($n==$cal_date->m) $month_name="<span class=\"error\">{$month_name}</span>"; - echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$m}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\">{$month_name}</a>"; + echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$m}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}\">{$month_name}</a>"; echo ' | '; } -echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day=".min($cal_date->d, $today->DaysInMonth())."&month={$today_month}&year={$today->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\"><b>".$today->Format('%F %Y').'</b></a></td></tr>'; +echo "<a href=\"calendar.php?cal={$cal}&day=".min($cal_date->d, $today->DaysInMonth())."&month={$today_month}&year={$today->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}\"><b>".$today->Format('%F %Y').'</b></a></td></tr>'; // Year selector echo '<tr><td class="descriptionbox vmiddle">'; echo i18n::translate('Year'), help_link('annivers_year_select'), '</td>'; echo "<td class=\"optionbox vmiddle\">"; -echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year=".($cal_date->y==1?-1:$cal_date->y-1)."&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\">-1</a>"; +echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year=".($cal_date->y==1?-1:$cal_date->y-1)."&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}\">-1</a>"; echo " <input type=\"text\" name=\"year\" value=\"{$year}\" size=\"7\" /> "; -echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year=".($cal_date->y==-1?1:$cal_date->y+1)."&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\">+1</a>"; -echo " | <a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$today->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\"><b>".$today->Format('%Y')."</b></a>"; +echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year=".($cal_date->y==-1?1:$cal_date->y+1)."&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}\">+1</a>"; +echo " | <a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$today->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}\"><b>".$today->Format('%Y')."</b></a>"; echo "</td> "; // Filtering options echo "<td class=\"descriptionbox vmiddle\">"; @@ -193,20 +193,20 @@ if ($filtersx=="") { echo Person::sexImage('M', 'large', 'vertical-align: middle', i18n::translate('All People')); echo Person::sexImage('F', 'large', 'vertical-align: middle', i18n::translate('All People')), ' | '; } else { - echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx=&action={$action}")."\">"; + echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx=&action={$action}\">"; echo Person::sexImage('M', 'small', 'vertical-align: middle', i18n::translate('All People')); echo Person::sexImage('F', 'small', 'vertical-align: middle', i18n::translate('All People')), '</a> | '; } if ($filtersx=="M") { echo Person::sexImage('M', 'large', 'vertical-align: middle', i18n::translate('Males')), ' | '; } else { - echo "<a href=\"", encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx=M&action={$action}"), "\">"; + echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx=M&action={$action}\">"; echo Person::sexImage('M', 'small', 'vertical-align: middle', i18n::translate('Males')), '</a> | '; } if ($filtersx=="F") echo Person::sexImage('F', 'large', 'vertical-align: middle', i18n::translate('Females')), ' | '; else { - echo "<a href=\"", encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx=F&action={$action}"), "\">"; + echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx=F&action={$action}\">"; echo Person::sexImage('F', 'small', 'vertical-align: middle', i18n::translate('Females')), '</a>'; } echo "</td>"; @@ -267,17 +267,17 @@ echo '<tr><td class="topbottombar" colspan="4">'; if ($action=='today') { echo "<span class=\"error\">", i18n::translate('View Day'), "</span>"; } else { - echo "<a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action=today")."\">", i18n::translate('View Day'), "</a>"; + echo "<a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action=today\">", i18n::translate('View Day'), "</a>"; } if ($action=='calendar') { echo " | <span class=\"error\">", i18n::translate('View Month'), "</span>"; } else { - echo " | <a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action=calendar")."\">", i18n::translate('View Month'), "</a>"; + echo " | <a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action=calendar\">", i18n::translate('View Month'), "</a>"; } if ($action=='year') { echo " | <span class=\"error\">", i18n::translate('View Year'), "</span>"; } else { - echo " | <a href=\"".encode_url("calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action=year")."\">", i18n::translate('View Year'), "</a>"; + echo " | <a href=\"calendar.php?cal={$cal}&day={$cal_date->d}&month={$cal_month}&year={$cal_date->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action=year\">", i18n::translate('View Year'), "</a>"; } echo help_link('day_month'); echo '</td><td class="topbottombar" colspan="4">'; @@ -299,12 +299,12 @@ foreach (array( } else { $newcalesc=urlencode($tmp->CALENDAR_ESCAPE()); $tmpmonth=$tmp->FormatGedcomMonth(); - echo "<a href=\"".encode_url("calendar.php?cal={$newcalesc}&day={$tmp->d}&month={$tmpmonth}&year={$tmp->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}")."\">{$cal_name}</a>"; + echo "<a href=\"calendar.php?cal={$newcalesc}&day={$tmp->d}&month={$tmpmonth}&year={$tmp->y}&filterev={$filterev}&filterof={$filterof}&filtersx={$filtersx}&action={$action}\">{$cal_name}</a>"; } } } echo "</td></tr>"; -echo "</table>\n</form>\n"; +echo "</table></form>"; // Convert event filter option to a list of gedcom event codes if ($filterev=='all') { @@ -570,7 +570,7 @@ function calendar_list_text($list, $tag1, $tag2, $show_sex_symbols) { foreach ($list as $id=>$facts) { $tmp=GedcomRecord::GetInstance($id); - echo "{$tag1}<a href=\"".encode_url($tmp->getLinkUrl())."\">".PrintReady($tmp->getFullName())."</a> "; + echo $tag1, '<a href="', $tmp->getHtmlUrl(), '">', PrintReady($tmp->getFullName()), '</a> '; if ($show_sex_symbols && $tmp->getType()=='INDI') switch ($tmp->getSex()) { case 'M': @@ -585,8 +585,6 @@ function calendar_list_text($list, $tag1, $tag2, $show_sex_symbols) { echo Person::sexImage('U', 'small', 'vertical-align: middle', i18n::translate_c('unknown gender', 'Unknown')); break; } - echo "<div class=\"indent\">".$facts."</div>{$tag2}"; + echo '<div class="indent">', $facts, '</div>', $tag2; } } - -?> diff --git a/downloadgedcom.php b/downloadgedcom.php index e88d759941..4bb7e3012b 100644 --- a/downloadgedcom.php +++ b/downloadgedcom.php @@ -94,7 +94,7 @@ if ($action == "download" && $zip == "yes") { else { unlink(filename_decode($gedname)); if ($removeTempDir) rmdir(filename_decode($temppath)); - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url("downloadbackup.php?fname={$zipname}", false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH."downloadbackup.php?fname=".$zipname); exit; } exit; diff --git a/edit_changes.php b/edit_changes.php index b796357dfa..4a5966e5d1 100644 --- a/edit_changes.php +++ b/edit_changes.php @@ -169,7 +169,7 @@ if ($changed_gedcoms) { $record=new GedcomRecord($change->gedcom); } $output.='<b>'.PrintReady($record->getFullName()).'</b> '.getLRM().'('.$record->getXref().')'.getLRM().'<br />'; - $output.='<a href="javascript:;" onclick="return show_diff(\''.encode_url($record->getLinkUrl().'&show_changes=yes').'\');">'.i18n::translate('View Change Diff').'</a> | '; + $output.='<a href="javascript:;" onclick="return show_diff(\''.$record->getHtmlUrl().'&show_changes=yes'.'\');">'.i18n::translate('View Change Diff').'</a> | '; $output.="<a href=\"javascript:show_gedcom_record('".$change->xref."');\">".i18n::translate('View GEDCOM Record')."</a> | "; $output.="<a href=\"javascript:;\" onclick=\"return edit_raw('".$change->xref."');\">".i18n::translate('Edit raw GEDCOM record').'</a><br />'; $output.='<div class="indent">'; @@ -183,7 +183,7 @@ if ($changed_gedcoms) { $output.='<td class="list_label">'.i18n::translate('Undo').'</td>'; $output.='</tr>'; } - $output .= '<td class="list_value"><a href="'.encode_url("edit_changes.php?action=accept&change_id={$change->change_id}").'">'.i18n::translate('Accept').'</a></td>'; + $output .= '<td class="list_value"><a href="edit_changes.php?action=accept&ged='.rawurlencode($change->gedcom_name).'&change_id='.$change->change_id.'">'.i18n::translate('Accept').'</a></td>'; $output .= '<td class="list_value"><b>'; if ($change->old_gedcom=='') { $output.=i18n::translate('Append record'); @@ -195,10 +195,10 @@ if ($changed_gedcoms) { echo '</b></td>'; $output .= "<td class=\"list_value\"><a href=\"javascript:;\" onclick=\"return reply('".$change->user_name."', '".i18n::translate('Review GEDCOM Changes')."')\" alt=\"".i18n::translate('Send Message')."\">"; $output .= PrintReady($change->real_name); - $output .= PrintReady(" (".$change->user_name.")")."</a></td>"; - $output .= "<td class=\"list_value\">".$change->change_time."</td>"; - $output .= "<td class=\"list_value\">".$change->gedcom_name."</td>"; - $output .= "<td class=\"list_value\"><a href=\"".encode_url("edit_changes.php?action=undo&change_id={$change->change_id}")."\">".i18n::translate('Undo')."</a></td>"; + $output .= PrintReady(' ('.$change->user_name.')').'</a></td>'; + $output .= '<td class="list_value">'.$change->change_time.'</td>'; + $output .= '<td class="list_value">'.$change->gedcom_name.'</td>'; + $output .= '<td class="list_value"><a href="edit_changes.php?action=undo&ged='.rawurlencode($change->gedcom_name).'&change_id='.$change->change_id.'">'.i18n::translate('Undo').'</a></td>'; $output.='</tr>'; } $output .= '</table></td></tr></td></tr></table>'; @@ -217,7 +217,7 @@ if ($changed_gedcoms) { $count = 0; foreach ($changed_gedcoms as $gedcom_name) { if ($count!=0) $output2.='<br />'; - $output2 .= '<a href="'.encode_url("edit_changes.php?action=acceptall&ged={$gedcom_name}")."\">$gedcom_name - ".i18n::translate('Accept all changes').'</a>'; + $output2 .= '<a href="edit_changes.php?action=acceptall&ged='.rawurlencode($gedcom_name).'">'.$gedcom_name.' - '.i18n::translate('Accept all changes').'</a>'; $count ++; } $output2 .= '</td>'; @@ -230,7 +230,7 @@ if ($changed_gedcoms) { if ($count!=0) { $output2.='<br />'; } - $output2 .= '<a href="'.encode_url("edit_changes.php?action=undoall&ged={$gedcom_name}")."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to undo all of the changes for this GEDCOM?')."');\">$gedcom_name - ".i18n::translate('Undo all changes').'</a>'; + $output2 .= '<a href="edit_changes.php?action=undoall&ged='.rawurlencode($gedcom_name)."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to undo all of the changes for this GEDCOM?')."');\">$gedcom_name - ".i18n::translate('Undo all changes').'</a>'; $count++; } $output2 .= '</td></tr></table>'; diff --git a/editgedcoms.php b/editgedcoms.php index bf6c01cc9c..901bb61701 100644 --- a/editgedcoms.php +++ b/editgedcoms.php @@ -255,11 +255,11 @@ foreach ($gedcoms as $gedcom) { echo '<tr align="center">', // configuration - '<td><a href="editconfig_gedcom.php?ged=', urlencode($gedcom->gedcom_name), '">', i18n::translate('Configuration'), '</a>', + '<td><a href="editconfig_gedcom.php?ged=', rawurlencode($gedcom->gedcom_name), '">', i18n::translate('Configuration'), '</a>', help_link('gedcom_configfile'), '</td>', // export - '<td><a href="javascript:" onclick="window.open(\'', encode_url("export_gedcom.php?export={$gedcom->gedcom_name}"), '\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');">', i18n::translate('Export'), '</a>', + '<td><a href="javascript:" onclick="window.open(\'', "export_gedcom.php?export=", rawurlencode($gedcom->gedcom_name), '\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');">', i18n::translate('Export'), '</a>', help_link('export_gedcom'), '</td>', // import @@ -267,7 +267,7 @@ foreach ($gedcoms as $gedcom) { help_link('import_gedcom'), '</td>', // download - '<td><a href="downloadgedcom.php?ged=', urlencode($gedcom->gedcom_name),'">', i18n::translate('Download'), '</a>', + '<td><a href="downloadgedcom.php?ged=', rawurlencode($gedcom->gedcom_name),'">', i18n::translate('Download'), '</a>', help_link('download_gedcom'), '</td>', // upload @@ -275,7 +275,7 @@ foreach ($gedcoms as $gedcom) { help_link('upload_gedcom'), '</td>', // delete - '<td><a href="editgedcoms.php?action=delete&ged=', urlencode($gedcom->gedcom_name), '" onclick="return confirm(\''.htmlspecialchars(i18n::translate('Permanently delete the GEDCOM %s and all its settings?', $gedcom->gedcom_name)),'\');">', i18n::translate('Delete'), '</a>', + '<td><a href="editgedcoms.php?action=delete&ged=', rawurlencode($gedcom->gedcom_name), '" onclick="return confirm(\''.htmlspecialchars(i18n::translate('Permanently delete the GEDCOM %s and all its settings?', $gedcom->gedcom_name)),'\');">', i18n::translate('Delete'), '</a>', help_link('delete_gedcom'), '</td></tr></table></td></tr></table><br />'; } diff --git a/expand_view.php b/expand_view.php index 1cb1485eea..6bbf3c7adf 100644 --- a/expand_view.php +++ b/expand_view.php @@ -6,7 +6,7 @@ * Copyright (C) 2010 webtrees development team. * * Derived from PhpGedView - * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved. + * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,12 +15,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @package webtrees * @version $Id$ @@ -44,37 +44,31 @@ $f2 = 0; /* @var $event Event */ foreach($subfacts as $indexval => $event) { if ($event->canShow()) { - if ($f2>0) print "<br />\n"; - $f2++; - // handle ASSO record + if ($f2>0) print "<br />"; + $f2++; + // handle ASSO record if ($event->getTag()=='ASSO') { print_asso_rela_record($pid, $event->getGedComRecord(), false); - continue; - } + continue; + } $fact = $event->getTag(); $details = $event->getDetail(); - print "<span class=\"details_label\">"; - print $event->getLabel(); - print "</span> "; + echo '<span class="details_label">', $event->getLabel(), '</span> '; $details = $event->getDetail(); if ($details!="Y" && $details!="N") print PrintReady($details); echo format_fact_date($event, false, false, $fact, $pid, $person->getGedcomRecord()); - //-- print spouse name for marriage events + //-- print spouse name for marriage events $famid = $event->getFamilyId(); $spouseid = $event->getSpouseId(); if (!empty($spouseid)) { $spouse = Person::getInstance($spouseid); if (!is_null($spouse)) { - print " <a href=\"".encode_url("individual.php?pid={$spouseid}&ged=$GEDCOM")."\">"; - print PrintReady($spouse->getFullName()); - print "</a>"; - print " - "; - } + echo ' <a href="', $spouse->getHtmlUrl().'">', PrintReady($spouse->getFullName()), '</a> - '; } + } if (!empty($famid)) { - print "<a href=\"family.php?famid=$famid\">[".i18n::translate('View Family')."]</a>\n"; - } - echo format_fact_place($event, true, true); + echo "<a href=\"family.php?famid=$famid\">[".i18n::translate('View Family')."]</a>"; } + echo format_fact_place($event, true, true); } -?> +} diff --git a/fanchart.php b/fanchart.php index 242358f570..534ccc6921 100644 --- a/fanchart.php +++ b/fanchart.php @@ -278,7 +278,7 @@ function print_fan_chart($treeid, $fanw=640, $fandeg=270) { $ty=round($cy - $mr * -sin($rad)); $imagemap .= "$tx, $ty"; // add action url - $tempURL = $person->getLinkUrl(); + $tempURL = $person->getHtmlUrl(); $imagemap .= "\" href=\"$tempURL\" "; $tempURL = "fanchart.php?rootid={$pid}&PEDIGREE_GENERATIONS={$PEDIGREE_GENERATIONS}&fan_width={$fan_width}&fan_style={$fan_style}"; $count=0; @@ -294,12 +294,12 @@ function print_fan_chart($treeid, $fanw=640, $fandeg=270) { echo "<br /><a href=\"module.php?mod=googlemap&mod_action=pedigree_map&rootid=".$pid."\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Pedigree Map')."</a>"; } if (WT_USER_GEDCOM_ID && WT_USER_GEDCOM_ID!=$pid) { - echo "<br /><a href=\"".encode_url("relationship.php?pid1=".WT_USER_GEDCOM_ID."&pid2={$pid}&ged={$GEDCOM}")."\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Relationship to me')."</a>"; + echo "<br /><a href=\"relationship.php?pid1=".WT_USER_GEDCOM_ID."&pid2={$pid}&ged={$GEDCOM}"."\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Relationship to me')."</a>"; } echo "<br /><a href=\"descendancy.php?pid=$pid\" >".i18n::translate('Descendancy chart')."</a>"; echo "<br /><a href=\"ancestry.php?rootid=$pid\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Ancestry chart')."</a>"; echo "<br /><a href=\"compact.php?rootid=$pid\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Compact Chart')."</a>"; - echo "<br /><a href=\"".encode_url($tempURL)."\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Circle diagram')."</a>"; + echo "<br /><a href=\"".$tempURL."\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Circle diagram')."</a>"; echo "<br /><a href=\"hourglass.php?pid=$pid\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Hourglass chart')."</a>"; echo "<br /><a href=\"treenav.php?rootid=$pid\" onmouseover=\"clear_family_box_timeout('".$pid.".".$count."');\" onmouseout=\"family_box_timeout('".$pid.".".$count."');\">".i18n::translate('Interactive tree')."</a>"; if ($sosa>=1) { @@ -322,14 +322,14 @@ function print_fan_chart($treeid, $fanw=640, $fandeg=270) { else $spid=$parents["WIFE"]; $person=Person::getInstance($spid); if ($person) { - echo '<br /><a href="', $person->getLinkUrl(), '" class="name1">', $person->getFullName(), '</a>'; + echo '<br /><a href="', $person->getHtmlUrl(), '" class="name1">', $person->getFullName(), '</a>'; } } $num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch,PREG_SET_ORDER); for ($i=0; $i<$num; $i++) { $person=Person::getInstance($smatch[$i][1]); if ($person) { - echo '<br /> <a href="', $person->getLinkUrl(), '" class="name1">< ', $person->getFullName(), '</a>'; + echo '<br /> <a href="', $person->getHtmlUrl(), '" class="name1">< ', $person->getFullName(), '</a>'; } } } @@ -346,7 +346,7 @@ function print_fan_chart($treeid, $fanw=640, $fandeg=270) { if ($cpid!=$pid) { $person=Person::getInstance($cpid); if ($person) { - echo '<br /> <a href="', $person->getLinkUrl(), '" class="name1"> ', $person->getFullName(), '</a>'; + echo '<br /> <a href="', $person->getHtmlUrl(), '" class="name1"> ', $person->getFullName(), '</a>'; } } } @@ -697,7 +697,7 @@ if ($action=="filter") { $levels = explode("/", $thumbdir); $pthumb = ""; for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; - $uplink = "<a href=\"".encode_url("find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}")."\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; + $uplink = "<a href=\"find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; } // Start of media directory table @@ -720,11 +720,11 @@ if ($action=="filter") { echo $uplink, "</td></tr>"; } echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\">"; - echo "<a href=\"", encode_url("find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}"), "\">", i18n::translate('External objects'), "</a>"; + echo "<a href=\"find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}\">", i18n::translate('External objects'), "</a>"; echo "</td></tr>"; foreach ($dirs as $indexval => $dir) { echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">"; - echo "<a href=\"", encode_url("find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}"), "\"><span dir=\"ltr\">", $dir, "</span></a>"; + echo "<a href=\"find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}\"><span dir=\"ltr\">", $dir, "</span></a>"; echo "</td></tr>"; } } @@ -800,7 +800,7 @@ if ($action=="filter") { foreach ($media["LINKS"] as $indi => $type_record) { if ($type_record!='INDI' && $type_record!='FAM' && $type_record!='SOUR' && $type_record!='OBJE') continue; $record=GedcomRecord::getInstance($indi); - echo '<br /><a href="', encode_url($record->getLinkUrl()), '">'; + echo '<br /><a href="', $record->getHtmlUrl(), '">'; switch($type_record) { case 'INDI': echo i18n::translate('View Person'), ' - '; @@ -879,7 +879,7 @@ if ($action=="filter") { if ($repo_list) { echo "<td class=\"list_value_wrap\"><ul>"; foreach ($repo_list as $repo) { - echo '<li><a href="', $repo->getLinkUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; + echo '<li><a href="', $repo->getHtmlUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; } echo "</ul></td></tr>"; echo "<tr><td class=\"list_label\">", i18n::translate('Repositories found'), " ", count($repo_list); @@ -905,7 +905,7 @@ if ($action=="filter") { usort($mynotelist, array('GedcomRecord', 'Compare')); echo '<tr><td class="list_value_wrap"><ul>'; foreach ($mynotelist as $note) { - echo '<li><a href="', $note->getLinkUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; + echo '<li><a href="', $note->getHtmlUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Shared Notes found'), ' ', count($mynotelist), '</td></tr>'; } @@ -927,7 +927,7 @@ if ($action=="filter") { usort($mysourcelist, array('GedcomRecord', 'Compare')); echo '<tr><td class="list_value_wrap"><ul>'; foreach ($mysourcelist as $source) { - echo '<li><a href="', $source->getLinkUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; + echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total Sources'), ' ', count($mysourcelist), '</td></tr>'; } diff --git a/gedcheck.php b/gedcheck.php index 067bf809fd..02e1b055c4 100644 --- a/gedcheck.php +++ b/gedcheck.php @@ -132,7 +132,7 @@ if (!isset($_POST['action'])) { // If we're checking a gedcom that is imported into the database, check that the file is synchronised if ($ged==WT_GEDCOM) { - $ged_link='href="javascript:" onclick="window.open(\''.encode_url("export_gedcom.php?export={$ged}").'\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');"'; + $ged_link='href="javascript:" onclick="window.open(\''."export_gedcom.php?export=".rawurlencode($ged).'\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');"'; echo '<div class="error">', i18n::translate('Edits made to the database are not synchronized to the file %s. The file contents may be out-of-date. You can synchronize it with the database now by performing an <b><a "%s">export</a></b>.', $ged, $ged_link), '</div><hr/>'; } diff --git a/includes/classes/class_date.php b/includes/classes/class_date.php index e0f95ca430..6119b8d3e7 100644 --- a/includes/classes/class_date.php +++ b/includes/classes/class_date.php @@ -604,30 +604,31 @@ class CalendarDate { // Create a URL that links this date to the WT calendar function CalendarURL($date_fmt="") { global $DATE_FORMAT; - if (empty($date_fmt)) + if (empty($date_fmt)) { $date_fmt=$DATE_FORMAT; + } $URL='calendar.php?cal='.$this->CALENDAR_ESCAPE(); $action="year"; if (strpos($date_fmt, "Y")!==false || strpos($date_fmt, "y")!==false) { - $URL.='&year='.$this->FormatGedcomYear(); + $URL.='&year='.$this->FormatGedcomYear(); } if (strpos($date_fmt, "F")!==false || strpos($date_fmt, "M")!==false || strpos($date_fmt, "m")!==false || strpos($date_fmt, "n")!==false) { - $URL.='&month='.$this->FormatGedcomMonth(); + $URL.='&month='.$this->FormatGedcomMonth(); if ($this->m>0) $action="calendar"; } if (strpos($date_fmt, "d")!==false || strpos($date_fmt, "D")!==false || strpos($date_fmt, "j")!==false) { - $URL.='&day='.$this->FormatGedcomDay(); + $URL.='&day='.$this->FormatGedcomDay(); if ($this->d>0) $action="today"; } - return encode_url($URL.'&action='.$action); + return $URL.'&action='.$action; } } // class CalendarDate diff --git a/includes/classes/class_family.php b/includes/classes/class_family.php index 252de5d8fb..0354a4d090 100644 --- a/includes/classes/class_family.php +++ b/includes/classes/class_family.php @@ -371,9 +371,13 @@ class Family extends GedcomRecord { return array(); } - // Generate a URL that links to this record - public function getLinkUrl() { - return parent::_getLinkUrl('family.php?famid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return parent::_getLinkUrl('family.php?famid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return parent::_getLinkUrl('family.php?famid=', '&'); } // Get an array of structures containing all the names in the record diff --git a/includes/classes/class_gedcomrecord.php b/includes/classes/class_gedcomrecord.php index 8c4bbba4c8..df529b8d9f 100644 --- a/includes/classes/class_gedcomrecord.php +++ b/includes/classes/class_gedcomrecord.php @@ -292,18 +292,22 @@ class GedcomRecord { return !is_null($obj) && $this->xref==$obj->getXref(); } - // Generate a URL that links to this record - public function getLinkUrl() { - return $this->_getLinkUrl('gedcomrecord.php?pid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return self::_getLinkUrl('gedcomrecord.php?famid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return self::_getLinkUrl('gedcomrecord.php?famid=', '&'); } - protected function _getLinkUrl($link) { + protected function _getLinkUrl($link, $separator) { if ($this->ged_id) { // If the record was created from the database, we know the gedcom - $url = $link.$this->getXref().'&ged='.get_gedcom_from_id($this->ged_id); + $url=$link.rawurlencode($this->getXref()).$separator.'ged='.rawurlencode(get_gedcom_from_id($this->ged_id)); } else { // If the record was created from a text string, assume the current gedcom - $url = $link.$this->getXref().'&ged='.WT_GEDCOM; + $url=$link.rawurlencode($this->getXref()).$separator.'ged='.rawurlencode(WT_GEDCOM); } if ($this->isRemote()) { list($servid, $aliaid)=explode(':', $this->rfn); @@ -321,7 +325,7 @@ class GedcomRecord { } $gedcom = $serviceClient->getGedfile(); if ($gedcom) { - $url .= "&ged={$gedcom}"; + $url .= $separator.'ged='.rawurlencode($gedcom); } } } @@ -358,7 +362,7 @@ class GedcomRecord { if ($target) { $target='target="'.$target.'"'; } - return '<a href="'.encode_url($this->getLinkUrl()).'#content" name="'.preg_replace('/\D/','',$this->getXref()).'" '.$target.'>'.$this->getXref().'</a>'; + return '<a href="'.$this->getHtmlUrl().'#content" name="'.preg_replace('/\D/','',$this->getXref()).'" '.$target.'>'.$this->getXref().'</a>'; } else { return $this->getXref(); } @@ -369,7 +373,7 @@ class GedcomRecord { * */ public function getAbsoluteLinkUrl() { - return WT_SERVER_NAME.WT_SCRIPT_PATH.$this->getLinkUrl(); + return WT_SERVER_NAME.WT_SCRIPT_PATH.$this->getHtmlUrl(); } /** @@ -630,7 +634,7 @@ class GedcomRecord { $name=($tag=='li') ? $this->getListName() : $this->getFullName(); } $dir=begRTLText($name) ? 'rtl' : 'ltr'; - $html='<a href="'.$this->getLinkUrl().'"'; + $html='<a href="'.$this->getHtmlUrl().'"'; if ($find) { $html.=' onclick="pasteid(\''.$this->getXref().'\');"'; } @@ -915,7 +919,7 @@ class GedcomRecord { $text=strip_tags($d->Display(false, "{$DATE_FORMAT}", array())); } if ($add_url) { - $text='<a name="'.$sort.'" href="'.encode_url($this->getLinkUrl()).'">'.$text.'</a>'; + $text='<a name="'.$sort.'" href="'.$this->getHtmlUrl().'">'.$text.'</a>'; } return $text; } @@ -937,4 +941,3 @@ class GedcomRecord { return $chan_user; } } -?> diff --git a/includes/classes/class_media.php b/includes/classes/class_media.php index 95986e2a3f..eafc23f754 100644 --- a/includes/classes/class_media.php +++ b/includes/classes/class_media.php @@ -250,9 +250,13 @@ class Media extends GedcomRecord { $this->filepropset = true; } - // Generate a URL that links to this record - public function getLinkUrl() { - return parent::_getLinkUrl('mediaviewer.php?mid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return parent::_getLinkUrl('mediaviewer.php?mid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return parent::_getLinkUrl('mediaviewer.php?mid=', '&'); } /** @@ -306,6 +310,4 @@ class Media extends GedcomRecord { print_media_links('1 OBJE @'.$this->getXref().'@', 1, $this->getXref()); return ob_get_clean(); } - } -?> diff --git a/includes/classes/class_menubar.php b/includes/classes/class_menubar.php index 2888e8b8a2..4bbe432bc8 100644 --- a/includes/classes/class_menubar.php +++ b/includes/classes/class_menubar.php @@ -56,7 +56,7 @@ class MenuBar { $gedcom_titles=get_gedcom_titles(); if (count($gedcom_titles)>1 && get_site_setting('ALLOW_CHANGE_GEDCOM')) { foreach ($gedcom_titles as $gedcom_title) { - $submenu = new Menu(PrintReady($gedcom_title->gedcom_title, true), encode_url('index.php?ctype=gedcom&ged='.$gedcom_title->gedcom_name)); + $submenu = new Menu(PrintReady($gedcom_title->gedcom_title, true), 'index.php?ctype=gedcom&ged='.$gedcom_title->gedcom_name); if (!empty($WT_IMAGES['gedcom'])) { $submenu->addIcon('gedcom'); } @@ -109,7 +109,7 @@ class MenuBar { } if (WT_USER_GEDCOM_ID) { //-- my_pedigree submenu - $submenu = new Menu(i18n::translate('My Pedigree'), encode_url("pedigree.php?rootid=".WT_USER_GEDCOM_ID."&show_full={$showFull}&talloffset={$showLayout}")); + $submenu = new Menu(i18n::translate('My Pedigree'), "pedigree.php?rootid=".WT_USER_GEDCOM_ID."&show_full={$showFull}&talloffset={$showLayout}"); if (!empty($WT_IMAGES["pedigree"])) $submenu->addIcon('pedigree'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_pedigree"); @@ -185,9 +185,9 @@ class MenuBar { $showLayout = ($PEDIGREE_LAYOUT) ? 1 : 0; //-- main charts menu item - $link = "pedigree.php?ged=".WT_GEDCOM."&show_full={$showFull}&talloffset={$showLayout}"; - if ($rootid) $link .= "&rootid={$rootid}"; - $menu = new Menu(i18n::translate('Charts'), encode_url($link), "down"); + $link = "pedigree.php?ged=".WT_GEDCOM."&show_full={$showFull}&talloffset={$showLayout}"; + if ($rootid) $link .= "&rootid={$rootid}"; + $menu = new Menu(i18n::translate('Charts'), $link, "down"); $menu->addIcon('charts'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_pedigree"); @@ -215,9 +215,9 @@ class MenuBar { switch ($menuType) { case "pedigree": //-- pedigree - $link = "pedigree.php?ged=".WT_GEDCOM."&show_full={$showFull}&talloffset={$showLayout}"; - if ($rootid) $link .= "&rootid={$rootid}"; - $submenu = new Menu(i18n::translate('Pedigree Chart'), encode_url($link)); + $link = "pedigree.php?ged=".WT_GEDCOM."&show_full={$showFull}&talloffset={$showLayout}"; + if ($rootid) $link .= "&rootid={$rootid}"; + $submenu = new Menu(i18n::translate('Pedigree Chart'), $link); $submenu->addIcon('pedigree'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_pedigree"); $menu->addSubmenu($submenu); @@ -226,8 +226,8 @@ class MenuBar { case "descendancy": //-- descendancy $link = "descendancy.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&pid={$rootid}&show_full={$showFull}"; - $submenu = new Menu(i18n::translate('Descendancy chart'), encode_url($link)); + if ($rootid) $link .= "&pid={$rootid}&show_full={$showFull}"; + $submenu = new Menu(i18n::translate('Descendancy chart'), $link); $submenu->addIcon('descendant'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_descendant"); $menu->addSubmenu($submenu); @@ -236,8 +236,8 @@ class MenuBar { case "ancestry": //-- ancestry $link = "ancestry.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&rootid={$rootid}&show_full={$showFull}"; - $submenu = new Menu(i18n::translate('Ancestry chart'), encode_url($link)); + if ($rootid) $link .= "&rootid={$rootid}&show_full={$showFull}"; + $submenu = new Menu(i18n::translate('Ancestry chart'), $link); $submenu->addIcon('ancestry'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_ancestry"); $menu->addSubmenu($submenu); @@ -246,8 +246,8 @@ class MenuBar { case "compact": //-- compact $link = "compact.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&rootid=".$rootid; - $submenu = new Menu(i18n::translate('Compact Chart'), encode_url($link)); + if ($rootid) $link .= "&rootid=".$rootid; + $submenu = new Menu(i18n::translate('Compact Chart'), $link); $submenu->addIcon('ancestry'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_ancestry"); $menu->addSubmenu($submenu); @@ -256,8 +256,8 @@ class MenuBar { case "fanchart": //-- fan chart $link = "fanchart.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&rootid=".$rootid; - $submenu = new Menu(i18n::translate('Circle diagram'), encode_url($link)); + if ($rootid) $link .= "&rootid=".$rootid; + $submenu = new Menu(i18n::translate('Circle diagram'), $link); $submenu->addIcon('fanchart'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_fanchart"); $menu->addSubmenu($submenu); @@ -266,8 +266,8 @@ class MenuBar { case "hourglass": //-- hourglass $link = "hourglass.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&pid={$rootid}&show_full={$showFull}"; - $submenu = new Menu(i18n::translate('Hourglass chart'), encode_url($link)); + if ($rootid) $link .= "&pid={$rootid}&show_full={$showFull}"; + $submenu = new Menu(i18n::translate('Hourglass chart'), $link); $submenu->addIcon('hourglass'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_hourglass"); $menu->addSubmenu($submenu); @@ -276,8 +276,8 @@ class MenuBar { case "familybook": //-- familybook $link = "familybook.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&pid={$rootid}&show_full={$showFull}"; - $submenu = new Menu(i18n::translate('Family book chart'), encode_url($link)); + if ($rootid) $link .= "&pid={$rootid}&show_full={$showFull}"; + $submenu = new Menu(i18n::translate('Family book chart'), $link); $submenu->addIcon('fambook'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_fambook"); $menu->addSubmenu($submenu); @@ -304,7 +304,7 @@ class MenuBar { switch ($menuType) { case "parentTimeLine": // charts / parents_timeline - $submenu = new Menu(i18n::translate('Show couple on timeline chart'), encode_url('timeline.php?pids[0]='.$controller->getHusband().'&pids[1]='.$controller->getWife())); + $submenu = new Menu(i18n::translate('Show couple on timeline chart'), 'timeline.php?pids[0]='.$controller->getHusband().'&pids[1]='.$controller->getWife()); if (!empty($WT_IMAGES["timeline"])) { $submenu->addIcon('timeline'); } @@ -314,7 +314,7 @@ class MenuBar { case "childTimeLine": // charts / children_timeline - $submenu = new Menu(i18n::translate('Show children on timeline chart'), encode_url('timeline.php?'.$controller->getChildrenUrlTimeline())); + $submenu = new Menu(i18n::translate('Show children on timeline chart'), 'timeline.php?'.$controller->getChildrenUrlTimeline()); if (!empty($WT_IMAGES["timeline"])) { $submenu->addIcon('timeline'); } @@ -324,7 +324,7 @@ class MenuBar { case "familyTimeLine": // charts / family_timeline - $submenu = new Menu(i18n::translate('Show family on timeline chart'), encode_url('timeline.php?pids[0]='.$controller->getHusband().'&pids[1]='.$controller->getWife().'&'.$controller->getChildrenUrlTimeline(2))); + $submenu = new Menu(i18n::translate('Show family on timeline chart'), 'timeline.php?pids[0]='.$controller->getHusband().'&pids[1]='.$controller->getWife().'&'.$controller->getChildrenUrlTimeline(2)); if (!empty($WT_IMAGES["timeline"])) { $submenu->addIcon('timeline'); } @@ -341,8 +341,8 @@ class MenuBar { case "lifespan": //-- lifespan $link = "lifespan.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&pids[]={$rootid}&addFamily=1"; - $submenu = new Menu(i18n::translate('Lifespan chart'), encode_url($link)); + if ($rootid) $link .= "&pids[]={$rootid}&addFamily=1"; + $submenu = new Menu(i18n::translate('Lifespan chart'), $link); $submenu->addIcon('timeline'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_timeline"); $menu->addSubmenu($submenu); @@ -374,12 +374,12 @@ class MenuBar { if ($person instanceof Person) { $submenu = new Menu( i18n::translate('Relationship Chart').': '.PrintReady($person->getFullName()), - encode_url("relationship.php?pid1={$pid2}&pid2={$pid1}&pretty=2&followspouse=1&ged=".WT_GEDCOM) + "relationship.php?pid1={$pid2}&pid2={$pid1}&pretty=2&followspouse=1&ged=".WT_GEDCOM ); } else { $submenu = new Menu( i18n::translate('Relationship Chart'), - encode_url("relationship.php?pid1={$pid1}&pretty=2&followspouse=1&ged=".WT_GEDCOM) + "relationship.php?pid1={$pid1}&pretty=2&followspouse=1&ged=".WT_GEDCOM ); } $submenu->addIcon('relationship'); @@ -387,9 +387,9 @@ class MenuBar { $menu->addSubmenu($submenu); } else { $submenu = new Menu( - i18n::translate('Relationship Chart'), - encode_url("relationship.php?pid1={$pid1}&pretty=2&followspouse=1&ged=".WT_GEDCOM) - ); + i18n::translate('Relationship Chart'), + "relationship.php?pid1={$pid1}&pretty=2&followspouse=1&ged=".WT_GEDCOM + ); $submenu->addIcon('relationship'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_relationship"); $menu->addSubmenu($submenu); @@ -402,7 +402,7 @@ class MenuBar { case "statistics": //-- statistics plot - $submenu = new Menu(i18n::translate('Statistics'), encode_url("statistics.php?ged=".WT_GEDCOM)); + $submenu = new Menu(i18n::translate('Statistics'), "statistics.php?ged=".WT_GEDCOM); $submenu->addIcon('statistic'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_statistic"); $menu->addSubmenu($submenu); @@ -411,8 +411,8 @@ class MenuBar { case "treenav": //-- interactive tree $link = "treenav.php?ged=".WT_GEDCOM; - if ($rootid) $link .= "&rootid=".$rootid; - $submenu = new Menu(i18n::translate('Interactive tree'), encode_url($link)); + if ($rootid) $link .= "&rootid=".$rootid; + $submenu = new Menu(i18n::translate('Interactive tree'), $link); $submenu->addIcon('tree'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_gedcom"); $menu->addSubmenu($submenu); @@ -421,9 +421,9 @@ class MenuBar { //added for pedigree_map case "pedigree_map": //-- pedigree map - $link = "module.php?ged=".WT_GEDCOM."&mod=googlemap&mod_action=pedigree_map"; - if ($rootid) $link .= "&rootid=".$rootid; - $submenu = new Menu(i18n::translate('Pedigree Map'), encode_url($link)); + $link = "module.php?ged=".WT_GEDCOM."&mod=googlemap&mod_action=pedigree_map"; + if ($rootid) $link .= "&rootid=".$rootid; + $submenu = new Menu(i18n::translate('Pedigree Map'), $link); global $WT_IMAGES; $WT_IMAGES['pedigree_map']='modules/googlemap/images/pedigree_map.gif'; $submenu->addIcon('pedigree_map'); @@ -463,13 +463,12 @@ class MenuBar { //-- main lists menu item $link = "indilist.php?ged=".WT_GEDCOM; if ($style=="sub") { - $link .= "&surname={$surname}"; - $menu = new Menu(i18n::translate('Lists'), encode_url($link)); + $link .= "&surname={$surname}"; + $menu = new Menu(i18n::translate('Lists'), $link); $menu->addIcon('lists'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_small_indis"); - } - else { - $menu = new Menu(i18n::translate('Lists'), encode_url($link), "down"); + } else { + $menu = new Menu(i18n::translate('Lists'), $link, "down"); $menu->addIcon('lists'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_indis"); } @@ -477,7 +476,7 @@ class MenuBar { //-- gedcom list if (get_site_setting('ALLOW_CHANGE_GEDCOM')) { foreach (get_all_gedcoms() as $ged_id=>$gedcom) { - $submenu = new Menu(i18n::translate('Individuals')." - ".PrintReady(get_gedcom_setting($ged_id, 'title')), encode_url('indilist.php?ged='.$gedcom)); + $submenu = new Menu(i18n::translate('Individuals')." - ".PrintReady(get_gedcom_setting($ged_id, 'title')), 'indilist.php?ged='.$gedcom); $submenu->addIcon('gedcom'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_gedcom"); $menu->addSubmenu($submenu); @@ -488,12 +487,11 @@ class MenuBar { //-- main lists menu item $link = "indilist.php?ged=".WT_GEDCOM; if ($style=="sub") { - $link .= "&surname=".$surname; - $menu = new Menu(i18n::translate('Lists'), encode_url($link)); + $link .= "&surname=".$surname; + $menu = new Menu(i18n::translate('Lists'), $link); $menu->addIcon('lists'); $menu->addClass("submenuitem$ff", "submenuitem_hover$ff", "submenu$ff", "icon_small_indis"); - } - else { + } else { $menu = new Menu(i18n::translate('Lists'), $link, "down"); $menu->addIcon('lists'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_indis"); @@ -518,8 +516,8 @@ class MenuBar { case "individual": //-- indi list sub menu $link = "indilist.php?ged=".WT_GEDCOM; - if ($surname) $link .= "&surname=".$surname; - $submenu = new Menu(i18n::translate('Individuals'), encode_url($link)); + if ($surname) $link .= "&surname=".$surname; + $submenu = new Menu(i18n::translate('Individuals'), $link); $submenu->addIcon('indis'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_indis"); $menu->addSubmenu($submenu); @@ -547,7 +545,7 @@ class MenuBar { case "source": //-- source - $submenu = new Menu(i18n::translate('Sources'), encode_url('sourcelist.php?ged='.WT_GEDCOM)); + $submenu = new Menu(i18n::translate('Sources'), 'sourcelist.php?ged='.WT_GEDCOM); $submenu->addIcon('menu_source'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_menu_source"); $menu->addSubmenu($submenu); @@ -555,7 +553,7 @@ class MenuBar { case "note": //-- shared note - $submenu = new Menu(i18n::translate('Shared Notes'), encode_url('notelist.php?ged='.WT_GEDCOM)); + $submenu = new Menu(i18n::translate('Shared Notes'), 'notelist.php?ged='.WT_GEDCOM); $submenu->addIcon('menu_note'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_notes"); $menu->addSubmenu($submenu); @@ -571,7 +569,7 @@ class MenuBar { case "places": //-- places - $submenu = new Menu(i18n::translate('Place hierarchy'), encode_url('placelist.php?ged='.WT_GEDCOM)); + $submenu = new Menu(i18n::translate('Place hierarchy'), 'placelist.php?ged='.WT_GEDCOM); $submenu->addIcon('place'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_place"); $menu->addSubmenu($submenu); @@ -579,7 +577,7 @@ class MenuBar { case "media": //-- medialist - $submenu = new Menu(i18n::translate('Multimedia'), encode_url('medialist.php?ged='.WT_GEDCOM)); + $submenu = new Menu(i18n::translate('Multimedia'), 'medialist.php?ged='.WT_GEDCOM); $submenu->addIcon('menu_media'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_menu_media"); $menu->addSubmenu($submenu); @@ -603,21 +601,21 @@ class MenuBar { return $menu; } //-- main calendar menu item - $menu = new Menu(i18n::translate('Calendar'), encode_url('calendar.php?ged='.WT_GEDCOM), "down"); + $menu = new Menu(i18n::translate('Calendar'), 'calendar.php?ged='.WT_GEDCOM, "down"); $menu->addIcon('calendar'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_calendar"); //-- viewday sub menu - $submenu = new Menu(i18n::translate('View Day'), encode_url('calendar.php?ged='.WT_GEDCOM)); + $submenu = new Menu(i18n::translate('View Day'), 'calendar.php?ged='.WT_GEDCOM); $submenu->addIcon('calendar'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_calendar"); $menu->addSubmenu($submenu); //-- viewmonth sub menu - $submenu = new Menu(i18n::translate('View Month'), encode_url("calendar.php?ged=".WT_GEDCOM."&action=calendar")); + $submenu = new Menu(i18n::translate('View Month'), "calendar.php?ged=".WT_GEDCOM."&action=calendar"); $submenu->addIcon('calendar'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_calendar"); $menu->addSubmenu($submenu); //-- viewyear sub menu - $submenu = new Menu(i18n::translate('View Year'), encode_url("calendar.php?ged=".WT_GEDCOM."&action=year")); + $submenu = new Menu(i18n::translate('View Year'), "calendar.php?ged=".WT_GEDCOM."&action=year"); $submenu->addIcon('calendar'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_calendar"); $menu->addSubmenu($submenu); @@ -642,7 +640,7 @@ class MenuBar { $ff=""; } - $menu = new Menu(i18n::translate('Reports'), encode_url('reportengine.php?ged='.WT_GEDCOM), "down"); + $menu = new Menu(i18n::translate('Reports'), 'reportengine.php?ged='.WT_GEDCOM, "down"); $menu->addIcon('reports'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_reports"); @@ -666,27 +664,27 @@ class MenuBar { return null; } //-- main search menu item - $menu = new Menu(i18n::translate('Search'), encode_url('search.php?ged='.WT_GEDCOM), "down"); + $menu = new Menu(i18n::translate('Search'), 'search.php?ged='.WT_GEDCOM, "down"); $menu->addIcon('search'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_search"); //-- search_general sub menu - $submenu = new Menu(i18n::translate('General Search'), encode_url("search.php?ged=".WT_GEDCOM."&action=general")); + $submenu = new Menu(i18n::translate('General Search'), "search.php?ged=".WT_GEDCOM."&action=general"); $submenu->addIcon('search'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search"); $menu->addSubmenu($submenu); //-- search_soundex sub menu - $submenu = new Menu(i18n::translate('Soundex Search'), encode_url("search.php?ged=".WT_GEDCOM."&action=soundex")); + $submenu = new Menu(i18n::translate('Soundex Search'), "search.php?ged=".WT_GEDCOM."&action=soundex"); $submenu->addIcon('search'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search"); $menu->addSubmenu($submenu); //-- advanced search - $submenu = new Menu(i18n::translate('Advanced search'), encode_url("search_advanced.php?ged=".WT_GEDCOM)); + $submenu = new Menu(i18n::translate('Advanced search'), "search_advanced.php?ged=".WT_GEDCOM); $submenu->addIcon('search'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search"); $menu->addSubmenu($submenu); //-- search_replace sub menu if (WT_USER_CAN_EDIT) { - $submenu = new Menu(i18n::translate('Search and replace'), encode_url("search.php?ged=".WT_GEDCOM."&action=replace")); + $submenu = new Menu(i18n::translate('Search and replace'), "search.php?ged=".WT_GEDCOM."&action=replace"); $submenu->addIcon('search'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search"); $menu->addSubmenu($submenu); @@ -696,7 +694,7 @@ class MenuBar { if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) { $sitelist = get_server_list(); if (count($sitelist)>0) { - $submenu = new Menu(i18n::translate('Multi Site Search'), encode_url("search.php?ged=".WT_GEDCOM."&action=multisite")); + $submenu = new Menu(i18n::translate('Multi Site Search'), "search.php?ged=".WT_GEDCOM."&action=multisite"); $submenu->addIcon('search'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search"); $menu->addSubmenu($submenu); @@ -804,7 +802,7 @@ class MenuBar { $menu=new Menu(i18n::translate('Theme')); $menu->addClass('thememenuitem', 'thememenuitem_hover', 'themesubmenu', "icon_small_theme"); foreach (get_theme_names() as $themename=>$themedir) { - $submenu=new Menu($themename, $url.'&theme='.$themedir); + $submenu=new Menu($themename, $url.'&theme='.rawurlencode($themedir)); if ($themedir==WT_THEME_DIR) { $submenu->addClass('favsubmenuitem_selected', 'favsubmenuitem_hover'); } else { @@ -822,24 +820,11 @@ class MenuBar { * @return Menu the menu item */ public static function getColorMenu($COLOR_THEME_LIST) { - isset($_SERVER["QUERY_STRING"]) == true?$tqstring = "?".$_SERVER["QUERY_STRING"]:$tqstring = ""; - $frompage = WT_SCRIPT_NAME.decode_url($tqstring); - if (isset($_REQUEST['mod'])) { - if (!strstr($frompage, "?")) { - if (!strstr($frompage, "%3F")) ; - else $frompage .= "?"; - } - if (!strstr($frompage, "&mod") || !strstr($frompage, "?mod")) $frompage .= "&mod=".$_REQUEST['mod']; - } - if (substr($frompage,-1) == "?") $frompage = substr($frompage,0,-1); - if (substr($frompage,-1) == "&") $frompage = substr($frompage,0,-1); - // encode frompage address in other case we lost the all variables on theme change - $frompage = base64_encode($frompage); + $url=WT_SCRIPT_NAME.'?'.get_query_string(); $menu=new Menu(i18n::translate('Color Palette')); $menu->addClass('thememenuitem', 'thememenuitem_hover', 'themesubmenu', "icon_small_theme"); foreach ($COLOR_THEME_LIST as $colorChoice=>$colorName) { - //$submenu=new Menu($colorName, encode_url("colorchange.php?frompage={$frompage}&mycolor={$colorChoice}")); - $submenu=new Menu($colorName, encode_url(WT_SCRIPT_NAME.'?'.$_SERVER['QUERY_STRING']."&themecolor={$colorChoice}")); + $submenu=new Menu($colorName, $url.'&themecolor='.rawurlencode($colorChoice)); $menu->addSubMenu($submenu); } return $menu; @@ -944,7 +929,7 @@ class MenuBar { case 'OBJE': $obj=GedcomRecord::getInstance($fav['gid']); if ($obj && $obj->canDisplayName()) { - $submenu=new Menu(PrintReady($obj->getFullName()), encode_url($obj->getLinkUrl())); + $submenu=new Menu(PrintReady($obj->getFullName()), $obj->getHtmlUrl()); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } @@ -976,7 +961,7 @@ class MenuBar { case 'OBJE': $obj=GedcomRecord::getInstance($fav['gid']); if ($obj && $obj->canDisplayName()) { - $submenu=new Menu(PrintReady($obj->getFullName()), encode_url($obj->getLinkUrl())); + $submenu=new Menu(PrintReady($obj->getFullName()), $obj->getHtmlUrl()); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } diff --git a/includes/classes/class_note.php b/includes/classes/class_note.php index 14ea2c9791..19bece1771 100644 --- a/includes/classes/class_note.php +++ b/includes/classes/class_note.php @@ -37,9 +37,13 @@ define('WT_CLASS_NOTE_PHP', ''); require_once WT_ROOT.'includes/classes/class_gedcomrecord.php'; class Note extends GedcomRecord { - // Generate a URL that links to this record - public function getLinkUrl() { - return parent::_getLinkUrl('note.php?nid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return parent::_getLinkUrl('note.php?nid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return parent::_getLinkUrl('note.php?nid=', '&'); } // The 'name' of a note record is the first line. This can be @@ -59,4 +63,3 @@ class Note extends GedcomRecord { return parent::_getAllNames('NOTE', '0 @'.WT_REGEX_XREF.'@'); } } -?> diff --git a/includes/classes/class_person.php b/includes/classes/class_person.php index 845f9a5741..455a629edd 100644 --- a/includes/classes/class_person.php +++ b/includes/classes/class_person.php @@ -1563,9 +1563,13 @@ class Person extends GedcomRecord { return $txt; } - // Generate a URL that links to this record - public function getLinkUrl() { - return parent::_getLinkUrl('individual.php?pid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return parent::_getLinkUrl('individual.php?pid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return parent::_getLinkUrl('individual.php?pid=', '&'); } // If this object has no name, what do we call it? diff --git a/includes/classes/class_repository.php b/includes/classes/class_repository.php index 082a6c5a27..725524c6b4 100644 --- a/includes/classes/class_repository.php +++ b/includes/classes/class_repository.php @@ -37,9 +37,13 @@ define('WT_CLASS_REPOSITORY_PHP', ''); require_once WT_ROOT.'includes/classes/class_gedcomrecord.php'; class Repository extends GedcomRecord { - // Generate a URL that links to this record - public function getLinkUrl() { - return parent::_getLinkUrl('repo.php?rid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return parent::_getLinkUrl('repo.php?rid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return parent::_getLinkUrl('repo.php?rid=', '&'); } // Get an array of structures containing all the names in the record @@ -47,4 +51,3 @@ class Repository extends GedcomRecord { return parent::_getAllNames('NAME', 1); } } -?> diff --git a/includes/classes/class_source.php b/includes/classes/class_source.php index c93a7998a0..b761c2af7d 100644 --- a/includes/classes/class_source.php +++ b/includes/classes/class_source.php @@ -45,9 +45,13 @@ class Source extends GedcomRecord { return get_gedcom_value('AUTH', 1, $this->gedrec, '', false); } - // Generate a URL that links to this record - public function getLinkUrl() { - return parent::_getLinkUrl('source.php?sid='); + // Generate a URL to this record, suitable for use in HTML + public function getHtmlUrl() { + return parent::_getLinkUrl('source.php?sid=', '&'); + } + // Generate a URL to this record, suitable for use in javascript, HTTP headers, etc. + public function getRawUrl() { + return parent::_getLinkUrl('source.php?sid=', '&'); } // Get an array of structures containing all the names in the record @@ -55,4 +59,3 @@ class Source extends GedcomRecord { return parent::_getAllNames('TITL', 1); } } -?> diff --git a/includes/classes/class_stats.php b/includes/classes/class_stats.php index 9b4dbb4729..830ab8357f 100644 --- a/includes/classes/class_stats.php +++ b/includes/classes/class_stats.php @@ -64,7 +64,7 @@ class stats { function _setGedcom($gedcom) { $this->_gedcom = $gedcom; $this->_ged_id = PrintReady(get_id_from_gedcom($gedcom)); - $this->_gedcom_url = encode_url($gedcom); + $this->_gedcom_url = rawurlencode($gedcom); } /** @@ -300,7 +300,7 @@ class stats { } if (!$highlight) {return '';} $imgsize=findImageSize($highlight); - return "<a href=\"".encode_url("{$this->_server_url}index.php?ctype=gedcom&ged={$this->_gedcom_url}")."\" style=\"border-style:none;\"><img src=\"{$highlight}\" {$imgsize[3]} style=\"border:none; padding:2px 6px 2px 2px;\" class=\"gedcom_highlight\" alt=\"\" /></a>"; + return "<a href=\"{$this->_server_url}index.php?ctype=gedcom&ged={$this->_gedcom_url}\" style=\"border-style:none;\"><img src=\"{$highlight}\" {$imgsize[3]} style=\"border:none; padding:2px 6px 2px 2px;\" class=\"gedcom_highlight\" alt=\"\" /></a>"; } function gedcomHighlightLeft() { @@ -316,7 +316,7 @@ class stats { return ''; } $imgsize=findImageSize($highlight); - return "<a href=\"".encode_url("{$this->_server_url}index.php?ctype=gedcom&ged={$this->_gedcom_url}")."\" style=\"border-style:none;\"><img src=\"{$highlight}\" {$imgsize[3]} style=\"border:none; padding:2px 6px 2px 2px;\" align=\"left\" class=\"gedcom_highlight\" alt=\"\" /></a>"; + return "<a href=\"{$this->_server_url}index.php?ctype=gedcom&ged={$this->_gedcom_url}\" style=\"border-style:none;\"><img src=\"{$highlight}\" {$imgsize[3]} style=\"border:none; padding:2px 6px 2px 2px;\" align=\"left\" class=\"gedcom_highlight\" alt=\"\" /></a>"; } function gedcomHighlightRight() { @@ -332,7 +332,7 @@ class stats { return ''; } $imgsize=findImageSize($highlight); - return "<a href=\"".encode_url("{$this->_server_url}index.php?ctype=gedcom&ged={$this->_gedcom_url}")."\" style=\"border-style:none;\"><img src=\"{$highlight}\" {$imgsize[3]} style=\"border:none; padding:2px 6px 2px 2px;\" align=\"right\" class=\"gedcom_highlight\" alt=\"\" /></a>"; + return "<a href=\"{$this->_server_url}index.php?ctype=gedcom&ged={$this->_gedcom_url}\" style=\"border-style:none;\"><img src=\"{$highlight}\" {$imgsize[3]} style=\"border:none; padding:2px 6px 2px 2px;\" align=\"right\" class=\"gedcom_highlight\" alt=\"\" /></a>"; } /////////////////////////////////////////////////////////////////////////////// @@ -406,7 +406,7 @@ class stats { i18n::translate('Without sources').' - '.round($tot_indi_per,1).'%'; $chart_title = i18n::translate('With sources').' ['.round($tot_sindi_per,1).'%], '. i18n::translate('Without sources').' ['.round($tot_indi_per,1).'%]'; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } function totalIndividualsPercentage() { @@ -445,7 +445,7 @@ class stats { i18n::translate('Without sources').' - '.round($tot_fam_per,1).'%'; $chart_title = i18n::translate('With sources').' ['.round($tot_sfam_per,1).'%], '. i18n::translate('Without sources').' ['.round($tot_fam_per,1).'%]'; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } function totalFamiliesPercentage() { @@ -654,7 +654,7 @@ class stats { i18n::translate('Males').' ['.round($tot_m,1).'%], '. i18n::translate('Females').' ['.round($tot_f,1).'%], '. i18n::translate_c('unknown people', 'Unknown').' ['.round($tot_u,1).'%]'; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_unknown},{$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_unknown},{$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } else { $chd = self::_array_to_extended_encoding(array($tot_f, $tot_m)); $chl = @@ -662,7 +662,7 @@ class stats { i18n::translate('Males').' - '.round($tot_m,1).'%'; $chart_title = i18n::translate('Males').' ['.round($tot_m,1).'%], '. i18n::translate('Females').' ['.round($tot_f,1).'%]'; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } } @@ -728,7 +728,7 @@ class stats { i18n::translate('Living').' ['.round($tot_l,1).'%], '. i18n::translate('Dead').' ['.round($tot_d,1).'%], '. i18n::translate_c('unknown people', 'Unknown').' ['.round($tot_u,1).'%]'; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_unknown},{$color_living},{$color_dead}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_unknown},{$color_living},{$color_dead}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } else { $chd = self::_array_to_extended_encoding(array($tot_l, $tot_d)); $chl = @@ -736,7 +736,7 @@ class stats { i18n::translate('Dead').' - '.round($tot_d,1).'%|'; $chart_title = i18n::translate('Living').' ['.round($tot_l,1).'%], '. i18n::translate('Dead').' ['.round($tot_d,1).'%]'; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_living},{$color_dead}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_living},{$color_dead}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } } @@ -863,7 +863,7 @@ class stats { $chart_title = substr($chart_title,0,-2); $chd = self::_array_to_extended_encoding($mediaCounts); $chl = substr($mediaTypes,0,-1); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } /////////////////////////////////////////////////////////////////////////////// @@ -951,7 +951,7 @@ class stats { $result=$date->Display(true); break; case 'name': - $result="<a href=\"".$record->getLinkUrl()."\">".$record->getFullName()."</a>"; + $result="<a href=\"".$record->getHtmlUrl()."\">".$record->getFullName()."</a>"; break; case 'place': $fact=GedcomRecord::getInstance($row['d_gid'])->getFactByType($row['d_fact']); @@ -1215,7 +1215,7 @@ class stats { foreach ($all_db_countries as $country_code=>$country) { $top10[]="\t<li>"; foreach ($country as $country_name=>$tot) { - $place = '<a href="'.encode_url(get_place_url($country_name)).'" class="list_item">'.$all_countries[$country_code].'</a>'; + $place = '<a href="'.get_place_url($country_name).'" class="list_item">'.$all_countries[$country_code].'</a>'; $top10[].=$place." ".PrintReady("[".$tot."]"); } $top10[].="</li>\n"; @@ -1232,7 +1232,7 @@ class stats { $i = 1; arsort($places); foreach ($places as $place=>$count) { - $place = '<a href="'.encode_url(get_place_url($place)).'" class="list_item">'.PrintReady($place).'</a>'; + $place = '<a href="'.get_place_url($place).'" class="list_item">'.PrintReady($place).'</a>'; $top10[]="\t<li>".$place." ".PrintReady("[".$count."]")."</li>\n"; if ($i++==10) break; } @@ -1247,7 +1247,7 @@ class stats { $i = 1; arsort($places); foreach ($places as $place=>$count) { - $place = '<a href="'.encode_url(get_place_url($place)).'" class="list_item">'.PrintReady($place).'</a>'; + $place = '<a href="'.get_place_url($place).'" class="list_item">'.PrintReady($place).'</a>'; $top10[]="\t<li>".$place." ".PrintReady("[".$count."]")."</li>\n"; if ($i++==10) break; } @@ -1262,7 +1262,7 @@ class stats { $i = 1; arsort($places); foreach ($places as $place=>$count) { - $place = '<a href="'.encode_url(get_place_url($place)).'" class="list_item">'.PrintReady($place).'</a>'; + $place = '<a href="'.get_place_url($place).'" class="list_item">'.PrintReady($place).'</a>'; $top10[]="\t<li>".$place." ".PrintReady("[".$count."]")."</li>\n"; if ($i++==10) break; } @@ -1322,7 +1322,7 @@ class stats { } $chd = self::_array_to_extended_encoding($counts); $chl = substr($centuries,0,-1); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Births by century')."\" title=\"".i18n::translate('Births by century')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Births by century')."\" title=\"".i18n::translate('Births by century')."\" />"; } if (!isset($rows)) return 0; return $rows; @@ -1380,7 +1380,7 @@ class stats { } $chd = self::_array_to_extended_encoding($counts); $chl = substr($centuries,0,-1); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Deaths by century')."\" title=\"".i18n::translate('Deaths by century')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Deaths by century')."\" title=\"".i18n::translate('Deaths by century')."\" />"; } if (!isset($rows)) {return 0;} return $rows; @@ -1511,7 +1511,7 @@ class stats { $result=floor($row['age']/365.25); break; case 'name': - $result="<a href=\"".encode_url($person->getLinkUrl())."\">".$person->getFullName()."</a>"; + $result="<a href=\"".$person->getHtmlUrl()."\">".$person->getFullName()."</a>"; break; } return str_replace('<a href="', '<a href="'.$this->_server_url, $result); @@ -1568,9 +1568,9 @@ class stats { $age = get_age_at_event($age, true); if ($person->canDisplayDetails()) { if ($type == 'list') { - $top10[]="\t<li><a href=\"".encode_url($person->getLinkUrl())."\">".PrintReady($person->getFullName()."</a> [".$age."]")."</li>\n"; + $top10[]="\t<li><a href=\"".$person->getHtmlUrl()."\">".PrintReady($person->getFullName()."</a> [".$age."]")."</li>\n"; } else { - $top10[]="<a href=\"".encode_url($person->getLinkUrl())."\">".PrintReady($person->getFullName()."</a> [".$age."]"); + $top10[]="<a href=\"".$person->getHtmlUrl()."\">".PrintReady($person->getFullName()."</a> [".$age."]"); } } } @@ -1635,9 +1635,9 @@ class stats { } $age = get_age_at_event($age, true); if ($type == 'list') { - $top10[]="\t<li><a href=\"".encode_url($person->getLinkUrl())."\">".PrintReady($person->getFullName()."</a> [".$age."]")."</li>\n"; + $top10[]="\t<li><a href=\"".$person->getHtmlUrl()."\">".PrintReady($person->getFullName()."</a> [".$age."]")."</li>\n"; } else { - $top10[]="<a href=\"".encode_url($person->getLinkUrl())."\">".PrintReady($person->getFullName()."</a> [".$age."]"); + $top10[]="<a href=\"".$person->getHtmlUrl()."\">".PrintReady($person->getFullName()."</a> [".$age."]"); } } if ($type == 'list') { @@ -1769,7 +1769,7 @@ class stats { $half = floor(count($counter)/2); $chtt = substr_replace($title, '|', $counter[$half], 1); } - return '<img src="'.encode_url("http://chart.apis.google.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={$chtt}&chd={$chd}&chco=0000FF,FFA0CB,FF0000&chbh=20,3&chxt=x,x,y,y&chxl={$chxl}&chdl=".i18n::translate('Males').'|'.i18n::translate('Females').'|'.i18n::translate('Average age at death'))."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Average age related to death century')."\" title=\"".i18n::translate('Average age related to death century')."\" />"; + return '<img src="'."http://chart.apis.google.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(i18n::translate('Males').'|'.i18n::translate('Females').'|'.i18n::translate('Average age at death'))."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Average age related to death century')."\" title=\"".i18n::translate('Average age related to death century')."\" />"; } else { $sex_search = ''; $years = ''; @@ -1908,7 +1908,7 @@ class stats { } break; case 'name': - $result="<a href=\"".encode_url($record->getLinkUrl())."\">".PrintReady($record->getFullName())."</a>"; + $result="<a href=\"".$record->getHtmlUrl()."\">".PrintReady($record->getFullName())."</a>"; break; case 'place': $fact=$record->getFactByType($row['fact']); @@ -2056,7 +2056,7 @@ class stats { } break; case 'name': - $result="<a href=\"".encode_url($family->getLinkUrl())."\">".$person->getFullName().'</a>'; + $result="<a href=\"".$family->getHtmlUrl()."\">".$person->getFullName().'</a>'; break; case 'age': $age = $row['age']; @@ -2187,9 +2187,9 @@ class stats { if (($husb->getAllDeathDates() && $wife->getAllDeathDates()) || !$husb->isDead() || !$wife->isDead()) { if ($family->canDisplayDetails()) { if ($type == 'list') { - $top10[] = "\t<li><a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [".$age."]")."</li>\n"; + $top10[] = "\t<li><a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [".$age."]")."</li>\n"; } else { - $top10[] = "<a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [".$age."]"); + $top10[] = "<a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [".$age."]"); } } if (++$i==$total) break; @@ -2260,9 +2260,9 @@ class stats { $age = get_age_at_event($age, true); if ($family->canDisplayDetails()) { if ($type == 'list') { - $top10[] = "\t<li><a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [".$age."]")."</li>\n"; + $top10[] = "\t<li><a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [".$age."]")."</li>\n"; } else { - $top10[] = "<a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [".$age."]"); + $top10[] = "<a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [".$age."]"); } } } @@ -2322,7 +2322,7 @@ class stats { } break; case 'name': - $result="<a href=\"".encode_url($person->getLinkUrl())."\">".$person->getFullName().'</a>'; + $result="<a href=\"".$person->getHtmlUrl()."\">".$person->getFullName().'</a>'; break; case 'age': $age = $row['age']; @@ -2414,7 +2414,7 @@ class stats { } $chd = self::_array_to_extended_encoding($counts); $chl = substr($centuries,0,-1); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Marriages by century')."\" title=\"".i18n::translate('Marriages by century')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Marriages by century')."\" title=\"".i18n::translate('Marriages by century')."\" />"; } return $rows; } @@ -2490,7 +2490,7 @@ class stats { } $chd = self::_array_to_extended_encoding($counts); $chl = substr($centuries,0,-1); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Divorces by century')."\" title=\"".i18n::translate('Divorces by century')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Divorces by century')."\" title=\"".i18n::translate('Divorces by century')."\" />"; } return $rows; } @@ -2613,7 +2613,7 @@ class stats { $half = floor(count($counter)/2); $chtt = substr_replace(i18n::translate('Average age in century of marriage'), '|', $counter[$half], 1); } - return "<img src=\"".encode_url("http://chart.apis.google.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={$chtt}&chd={$chd}&chco=0000FF,FFA0CB,FF0000&chbh=20,3&chxt=x,x,y,y&chxl={$chxl}&chdl=".i18n::translate('Males')."|".i18n::translate('Females')."|".i18n::translate('Average age'))."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Average age in century of marriage')."\" title=\"".i18n::translate('Average age in century of marriage')."\" />"; + return "<img src=\""."http://chart.apis.google.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(i18n::translate('Males')."|".i18n::translate('Females')."|".i18n::translate('Average age'))."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Average age in century of marriage')."\" title=\"".i18n::translate('Average age in century of marriage')."\" />"; } else { $years = ''; if ($year1>=0 && $year2>=0) { @@ -2780,7 +2780,7 @@ class stats { $result=$row['tot']; break; case 'name': - $result="<a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()).'</a>'; + $result="<a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()).'</a>'; break; } // Statistics are used by RSS feeds, etc., so need absolute URLs. @@ -2809,9 +2809,9 @@ class stats { $family=Family::getInstance($rows[$c]['id']); if ($family->canDisplayDetails()) { if ($type == 'list') { - $top10[] = "\t<li><a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [{$rows[$c]['tot']} ".i18n::translate('children')."]")."</li>\n"; + $top10[] = "\t<li><a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [{$rows[$c]['tot']} ".i18n::translate('children')."]")."</li>\n"; } else { - $top10[] = "<a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [{$rows[$c]['tot']} ".i18n::translate('children')."]"); + $top10[] = "<a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [{$rows[$c]['tot']} ".i18n::translate('children')."]"); } } } @@ -2873,9 +2873,9 @@ class stats { $child2 = Person::getInstance($fam['ch2']); if ($type == 'name') { if ($child1->canDisplayDetails() && $child2->canDisplayDetails()) { - $return = "<a href=\"".encode_url($child2->getLinkUrl())."\">".PrintReady($child2->getFullName())."</a> "; + $return = "<a href=\"".$child2->getHtmlUrl()."\">".PrintReady($child2->getFullName())."</a> "; $return .= i18n::translate('and')." "; - $return .= "<a href=\"".encode_url($child1->getLinkUrl())."\">".PrintReady($child1->getFullName())."</a>"; + $return .= "<a href=\"".$child1->getHtmlUrl()."\">".PrintReady($child1->getFullName())."</a>"; $return .= " <a href=\"family.php?famid=".$fam['family']."\">[".i18n::translate('View Family')."]</a>\n"; } else { $return = i18n::translate('This information is private and cannot be shown.'); @@ -2898,9 +2898,9 @@ class stats { if ($one && !in_array($fam['family'], $dist)) { if ($child1->canDisplayDetails() && $child2->canDisplayDetails()) { $return = "\t<li>"; - $return .= "<a href=\"".encode_url($child2->getLinkUrl())."\">".PrintReady($child2->getFullName())."</a> "; + $return .= "<a href=\"".$child2->getHtmlUrl()."\">".PrintReady($child2->getFullName())."</a> "; $return .= i18n::translate('and')." "; - $return .= "<a href=\"".encode_url($child1->getLinkUrl())."\">".PrintReady($child1->getFullName())."</a>"; + $return .= "<a href=\"".$child1->getHtmlUrl()."\">".PrintReady($child1->getFullName())."</a>"; $return .= " [".$age."]"; $return .= " <a href=\"family.php?famid=".$fam['family']."\">[".i18n::translate('View Family')."]</a>"; $return .= "\t</li>\n"; @@ -2909,9 +2909,9 @@ class stats { } } else if (!$one && $child1->canDisplayDetails() && $child2->canDisplayDetails()) { $return = "\t<li>"; - $return .= "<a href=\"".encode_url($child2->getLinkUrl())."\">".PrintReady($child2->getFullName())."</a> "; + $return .= "<a href=\"".$child2->getHtmlUrl()."\">".PrintReady($child2->getFullName())."</a> "; $return .= i18n::translate('and')." "; - $return .= "<a href=\"".encode_url($child1->getLinkUrl())."\">".PrintReady($child1->getFullName())."</a>"; + $return .= "<a href=\"".$child1->getHtmlUrl()."\">".PrintReady($child1->getFullName())."</a>"; $return .= " [".$age."]"; $return .= " <a href=\"family.php?famid=".$fam['family']."\">[".i18n::translate('View Family')."]</a>"; $return .= "\t</li>\n"; @@ -2981,13 +2981,12 @@ class stats { $per = round(100 * $row['tot'] / $tot, 0); } $chd .= self::_array_to_extended_encoding(array($per)); - $chl[] = strip_tags(unhtmlentities($family->getFullName())).' - '.$row['tot']; + $chl[] = rawurlencode(strip_tags(unhtmlentities($family->getFullName())).' - '.$row['tot']); } } $chl = join('|', $chl); - // the following does not print Arabic letters in names - encode_url shows still the letters - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Largest families')."\" title=\"".i18n::translate('Largest families')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Largest families')."\" title=\"".i18n::translate('Largest families')."\" />"; } function totalChildren() { @@ -3042,7 +3041,7 @@ class stats { $chm = substr($chm,0,-1); if ($max<=5) $chxl .= "1:||".i18n::translate('century')."|2:|0|1|2|3|4|5|3:||".i18n::translate('Number of children')."|"; else $chxl .= "1:||".i18n::translate('century')."|2:|0|1|2|3|4|5|6|7|8|9|10|3:||".i18n::translate('Number of children')."|"; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=bvg&chs={$sizes[0]}x{$sizes[1]}&chf=bg,s,ffffff00|c,s,ffffff00&chm=D,FF0000,0,0,3,1|{$chm}&chd=e:{$chd}&chco=0000FF&chbh=30,3&chxt=x,x,y,y&chxl={$chxl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Average number of children per family')."\" title=\"".i18n::translate('Average number of children per family')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=bvg&chs={$sizes[0]}x{$sizes[1]}&chf=bg,s,ffffff00|c,s,ffffff00&chm=D,FF0000,0,0,3,1|{$chm}&chd=e:{$chd}&chco=0000FF&chbh=30,3&chxt=x,x,y,y&chxl=".rawurlencode($chxl)."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Average number of children per family')."\" title=\"".i18n::translate('Average number of children per family')."\" />"; } else { if ($sex=='M') { $sql = "SELECT num, COUNT(*) AS total FROM " @@ -3119,9 +3118,9 @@ class stats { $family=Family::getInstance($row['family']); if ($family->canDisplayDetails()) { if ($type == 'list') { - $top10[] = "\t<li><a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName())."</a></li>\n"; + $top10[] = "\t<li><a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName())."</a></li>\n"; } else { - $top10[] = "<a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName())."</a>"; + $top10[] = "<a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName())."</a>"; } } } @@ -3203,7 +3202,7 @@ class stats { $chxl .= $n."|"; } $chxl .= "3:||".i18n::translate('Total families')."|"; - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=bvg&chs={$sizes[0]}x{$sizes[1]}&chf=bg,s,ffffff00|c,s,ffffff00&chm=D,FF0000,0,0:".($i-1).",3,1|{$chm}&chd=e:{$chd}&chco=0000FF,ffffff00&chbh=30,3&chxt=x,x,y,y&chxl={$chxl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Number of families without children')."\" title=\"".i18n::translate('Number of families without children')."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=bvg&chs={$sizes[0]}x{$sizes[1]}&chf=bg,s,ffffff00|c,s,ffffff00&chm=D,FF0000,0,0:".($i-1).",3,1|{$chm}&chd=e:{$chd}&chco=0000FF,ffffff00&chbh=30,3&chxt=x,x,y,y&chxl=".rawurlencode($chxl)."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".i18n::translate('Number of families without children')."\" title=\"".i18n::translate('Number of families without children')."\" />"; } function _topTenGrandFamilyQuery($type='list', $params=null) { @@ -3241,9 +3240,9 @@ class stats { $family=Family::getInstance($row['id']); if ($family->canDisplayDetails()) { if ($type == 'list') { - $top10[] = "\t<li><a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [{$row['tot']} ".i18n::translate('grandchildren')."]")."</li>\n"; + $top10[] = "\t<li><a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [{$row['tot']} ".i18n::translate('grandchildren')."]")."</li>\n"; } else { - $top10[] = "<a href=\"".encode_url($family->getLinkUrl())."\">".PrintReady($family->getFullName()."</a> [{$row['tot']} ".i18n::translate('grandchildren')."]"); + $top10[] = "<a href=\"".$family->getHtmlUrl()."\">".PrintReady($family->getFullName()."</a> [{$row['tot']} ".i18n::translate('grandchildren')."]"); } } } @@ -3367,7 +3366,7 @@ class stats { $chart_title .= i18n::translate('Other').' - '.($tot_indi-$tot); $chl = join('|', $chl); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl=".rawurlencode($chl)."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } @@ -3530,7 +3529,7 @@ class stats { $chart_title .= i18n::translate('Other').' - '.($tot_indi-$tot); $chl = join('|', $chl); - return "<img src=\"".encode_url("http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl={$chl}")."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; + return "<img src=\"http://chart.apis.google.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_from},{$color_to}&chf=bg,s,ffffff00&chl=".rawurlencode($chl)."\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; } /////////////////////////////////////////////////////////////////////////////// diff --git a/includes/classes/class_treenav.php b/includes/classes/class_treenav.php index ece0f6f2c3..46cc240170 100644 --- a/includes/classes/class_treenav.php +++ b/includes/classes/class_treenav.php @@ -114,9 +114,9 @@ class TreeNav { $fam = null; $this->drawPerson($father, 2, 1, $fam); } - else print "<br />\n"; + else print "<br />"; } - else print "<br />\n"; + else print "<br />"; } else { $spouse = $person->getCurrentSpouse(); @@ -128,11 +128,11 @@ class TreeNav { $fam = null; $this->drawPerson($mother, 2, 1, $fam); } - else print "<br />\n"; + else print "<br />"; } - else print "<br />\n"; + else print "<br />"; } - else print "<br />\n"; + else print "<br />"; } } else { @@ -307,7 +307,7 @@ class TreeNav { $thumbnail .="\" class=\"".$class."\" border=\"none\" alt=\"\" />"; echo $thumbnail; } ?> - <a href="<?php print $person->getLinkUrl(); ?>" onclick="if (!<?php print $this->name;?>.collapseBox) return false;"><?php print $person->getSexImage().PrintReady($name); ?></a> + <a href="<?php print $person->getHtmlUrl(); ?>" onclick="if (!<?php print $this->name;?>.collapseBox) return false;"><?php print $person->getSexImage().PrintReady($name); ?></a> <img src="<?php print WT_SERVER_NAME.WT_SCRIPT_PATH.$WT_IMAGES["tree"];?>" border="0" width="15" onclick="<?php print $this->name;?>.newRoot('<?php print $person->getXref();?>', <?php print $this->name;?>.innerPort, '<?php echo htmlspecialchars($GEDCOM); ?>');" /> </span><br /> <div class="details1 indent"> @@ -345,7 +345,7 @@ class TreeNav { $thumbnail .="\" class=\"".$class."\" border=\"none\" alt=\"\" />"; echo $thumbnail; } ?> - <a href="<?php print $spouse->getLinkUrl(); ?>" onclick="if (!<?php print $this->name;?>.collapseBox) return false;"> + <a href="<?php print $spouse->getHtmlUrl(); ?>" onclick="if (!<?php print $this->name;?>.collapseBox) return false;"> <?php print $spouse->getSexImage().PrintReady($name); ?></a> <img src="<?php print WT_SERVER_NAME.WT_SCRIPT_PATH.$WT_IMAGES["tree"];?>" border="0" width="15" onclick="<?php print $this->name;?>.newRoot('<?php print $spouse->getXref();?>', <?php print $this->name;?>.innerPort, '<?php echo htmlspecialchars($GEDCOM); ?>');" /> <br /> @@ -428,7 +428,7 @@ class TreeNav { $imgheight = $imgsize[1]+150; if (!empty($object['mid']) && $USE_MEDIA_VIEWER) { - $thumbnail .= "<a href=\"".encode_url("mediaviewer.php?mid=".$object['mid'])."\" >"; + $thumbnail .= "<a href=\"mediaviewer.php?mid=".$object['mid']."\" >"; } else { $thumbnail .= "<a href=\"javascript:;\" onclick=\"return openImage('".rawurlencode($object["file"])."',$imgwidth, $imgheight);\">"; } @@ -516,8 +516,8 @@ class TreeNav { if (!is_null($spouse)) { $name = $spouse->getFullName(); print PrintReady($spouse->getSexImage('small', $style)." ".$name); - print "<br />\n"; - } else print "<br />\n"; + print "<br />"; + } else print "<br />"; } ?> </div> @@ -540,7 +540,7 @@ class TreeNav { <tr> <?php /* there is a IE JavaScript bug where the "id" has to be the same as the "name" in order to use the document.getElementsByName() function */ ?> <td <?php if ($gen==0 && !empty($father)) print 'id="'.$this->name.'_pload" name="'.$this->name.'_pload" onclick="'.$this->name.'.loadParent(this, \''.$person->getXref().'\', \'f\');"'; ?>> - <?php if (!empty($father)) $this->drawPerson($father, $gen-1, 1, $cfamily); else print "<br />\n";?> + <?php if (!empty($father)) $this->drawPerson($father, $gen-1, 1, $cfamily); else print "<br />";?> </td> </tr> <?php @@ -558,7 +558,7 @@ class TreeNav { ?> <tr> <td <?php if ($gen==0 && !empty($mother)) print 'id="'.$this->name.'_pload" name="'.$this->name.'_pload" onclick="'.$this->name.'.loadParent(this, \''.$person->getXref().'\', \'m\');"'; ?>> - <?php if (!empty($mother)) $this->drawPerson($mother, $gen-1, 1, $mcfamily); else print"<br />\n";?> + <?php if (!empty($mother)) $this->drawPerson($mother, $gen-1, 1, $mcfamily); else print"<br />";?> </td> </tr> <?php } } ?> @@ -643,7 +643,7 @@ class TreeNav { ?><br /> <?php if (!is_null($spouse)) {$name = $spouse->getFullName(); print PrintReady($spouse->getSexImage('small', $style)." ".$name); - } else print "<br />\n"; ?> + } else print "<br />"; ?> </div> </td> @@ -665,13 +665,13 @@ class TreeNav { <tr> <?php /* there is a IE JavaScript bug where the "id" has to be the same as the "name" in order to use the document.getElementsByName() function */ ?> <td <?php if ($gen==0 && !empty($father)) print 'id="'.$this->name.'_pload" name="'.$this->name.'_pload" onclick="'.$this->name.'.loadParent(this, \''.$person->getXref().'\', \'f\');"'; ?>> - <?php if (!empty($father)) $this->drawPerson($father, $gen-1, 1, $cfamily); else print "<br />\n";?> + <?php if (!empty($father)) $this->drawPerson($father, $gen-1, 1, $cfamily); else print "<br />";?> </td> </tr> <tr> <?php /* print the mother */ ?> <td <?php if ($gen==0 && !empty($mother)) print 'id="'.$this->name.'_pload" name="'.$this->name.'_pload" onclick="'.$this->name.'.loadParent(this, \''.$person->getXref().'\', \'m\');"'; ?>> - <?php if (!empty($mother)) $this->drawPerson($mother, $gen-1, 1, $mcfamily); else print"<br />\n";?> + <?php if (!empty($mother)) $this->drawPerson($mother, $gen-1, 1, $mcfamily); else print"<br />";?> </td> </tr> </tbody> diff --git a/includes/controllers/ancestry_ctrl.php b/includes/controllers/ancestry_ctrl.php index c587a349d8..559aae04ed 100644 --- a/includes/controllers/ancestry_ctrl.php +++ b/includes/controllers/ancestry_ctrl.php @@ -104,13 +104,13 @@ class AncestryController extends BaseController { $person = Person::getInstance($pid); // child - print "\r\n<li>"; + print "<li>"; print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a name=\"sosa".$sosa."\"></a>"; $new=($pid=="" or !isset($pidarr["$pid"])); - if ($sosa==1) print "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"3\" width=\"$Dindent\" border=\"0\" alt=\"\" /></td><td>\n"; + if ($sosa==1) print "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"3\" width=\"$Dindent\" border=\"0\" alt=\"\" /></td><td>"; else { print "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"3\" width=\"2\" border=\"0\" alt=\"\" />"; - print "<img src=\"".$WT_IMAGES["hline"]."\" height=\"3\" width=\"".($Dindent-2)."\" border=\"0\" alt=\"\" /></td><td>\n"; + print "<img src=\"".$WT_IMAGES["hline"]."\" height=\"3\" width=\"".($Dindent-2)."\" border=\"0\" alt=\"\" /></td><td>"; } print_pedigree_person($pid, 1); print "</td>"; @@ -120,7 +120,7 @@ class AncestryController extends BaseController { } else { $label = $pid." :".i18n::translate('Ancestry chart'); } - if ($sosa>1) print_url_arrow($pid, encode_url("?rootid={$pid}&PEDIGREE_GENERATIONS={$OLD_PGENS}&show_full={$this->show_full}&box_width={$box_width}&chart_style={$this->chart_style}"), $label, 3); + if ($sosa>1) print_url_arrow($pid, "?rootid={$pid}&PEDIGREE_GENERATIONS={$OLD_PGENS}&show_full={$this->show_full}&box_width={$box_width}&chart_style={$this->chart_style}", $label, 3); print "</td>"; print "<td class=\"details1\"> <span dir=\"ltr\" class=\"person_box". (($sosa==1)?"NN":(($sosa%2)?"F":"")) . "\"> $sosa </span> "; print "</td><td class=\"details1\">"; @@ -160,11 +160,11 @@ class AncestryController extends BaseController { } print "</span>"; // display parents recursively - print "\r\n<ul style=\"list-style: none; display: block;\" id=\"sosa_$sosa\">"; + print "<ul style=\"list-style: none; display: block;\" id=\"sosa_$sosa\">"; $this->print_child_ascendancy($parents["HUSB"], $sosa*2, $depth-1); $this->print_child_ascendancy($parents["WIFE"], $sosa*2+1, $depth-1); - print "</ul>\r\n"; + print "</ul>"; } - print "</li>\r\n"; + print "</li>"; } } diff --git a/includes/controllers/descendancy_ctrl.php b/includes/controllers/descendancy_ctrl.php index 757086f455..980440624b 100644 --- a/includes/controllers/descendancy_ctrl.php +++ b/includes/controllers/descendancy_ctrl.php @@ -110,7 +110,7 @@ class DescendancyController extends BaseController { //-- if the person is from another gedcom then forward to the correct site /* if ($this->indi->isRemote()) { - header('Location: '.encode_url(decode_url($this->indi->getLinkUrl(), false))); + header('Location: '.$this->indi->getRawUrl()); exit; } */ @@ -152,10 +152,10 @@ function print_child_descendancy(&$person, $depth) { //print_r($person); print "<li>"; print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>"; - if ($depth==$this->generations) print "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"3\" width=\"$Dindent\" border=\"0\" alt=\"\" /></td><td>\n"; + if ($depth==$this->generations) print "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"3\" width=\"$Dindent\" border=\"0\" alt=\"\" /></td><td>"; else { print "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"3\" width=\"3\" border=\"0\" alt=\"\" />"; - print "<img src=\"".$WT_IMAGES["hline"]."\" height=\"3\" width=\"".($Dindent-3)."\" border=\"0\" alt=\"\" /></td><td>\n"; + print "<img src=\"".$WT_IMAGES["hline"]."\" height=\"3\" width=\"".($Dindent-3)."\" border=\"0\" alt=\"\" /></td><td>"; } print_pedigree_person($person->getXref(), 1, 0, $personcount); print "</td>"; @@ -170,7 +170,7 @@ function print_child_descendancy(&$person, $depth) { $parid=$parents["HUSB"]; if ($parid=="") $parid=$parents["WIFE"]; if ($parid!="") { - print_url_arrow($parid.$personcount.$person->getXref(), encode_url("?pid={$parid}&generations={$this->generations}&chart_style={$this->chart_style}&show_full={$this->show_full}&box_width={$this->box_width}"), i18n::translate('Start at parents'), 2); + print_url_arrow($parid.$personcount.$person->getXref(), "?pid={$parid}&generations={$this->generations}&chart_style={$this->chart_style}&show_full={$this->show_full}&box_width={$this->box_width}", i18n::translate('Start at parents'), 2); $personcount++; } } @@ -194,7 +194,7 @@ function print_child_descendancy(&$person, $depth) { print "</span>"; print "</td></tr>"; print "</table>"; - print "</li>\r\n"; + print "</li>"; // loop for each spouse $sfam = $person->getSpouseFamilies(); @@ -233,7 +233,7 @@ function print_family_descendancy(&$person, &$family, $depth) { print "<a href=\"#\" onclick=\"expand_layer('".$famid.$personcount."'); return false;\" class=\"top\"><img id=\"".$famid.$personcount."_img\" src=\"".$WT_IMAGES["minus"]."\" align=\"middle\" hspace=\"0\" vspace=\"3\" border=\"0\" alt=\"".i18n::translate('View Family')."\" /></a>"; $marriage = $family->getMarriage(); if ($marriage->canShow()) { - echo ' <a href="', encode_url($family->getLinkUrl()), '" class="details1">'; + echo ' <a href="', $family->getHtmlUrl(), '" class="details1">'; $marriage->print_simple_fact(); echo '</a>'; } @@ -256,7 +256,7 @@ function print_family_descendancy(&$person, &$family, $depth) { $parid=$parents["HUSB"]; if ($parid=="") $parid=$parents["WIFE"]; if ($parid!="") { - print_url_arrow($parid.$personcount.$person->getXref(), encode_url("?pid={$parid}&generations={$this->generations}&show_full={$this->show_full}&box_width={$this->box_width}"), i18n::translate('Start at parents'), 2); + print_url_arrow($parid.$personcount.$person->getXref(), "?pid={$parid}&generations={$this->generations}&show_full={$this->show_full}&box_width={$this->box_width}", i18n::translate('Start at parents'), 2); $personcount++; } } @@ -279,13 +279,13 @@ function print_family_descendancy(&$person, &$family, $depth) { } } print "</td></tr></table>"; - print "</li>\r\n"; + print "</li>"; if ($depth>1) foreach ($children as $child) { $personcount++; $this->print_child_descendancy($child, $depth-1); } - print "</ul>\r\n"; - print "</li>\r\n"; + print "</ul>"; + print "</li>"; } } } diff --git a/includes/controllers/family_ctrl.php b/includes/controllers/family_ctrl.php index d82297846f..92c573848a 100644 --- a/includes/controllers/family_ctrl.php +++ b/includes/controllers/family_ctrl.php @@ -235,7 +235,7 @@ class FamilyController extends BaseController { $link .= 'pids[0]='.$husb; $c++; if ($wife) { - $link .= '&pids[1]='.$wife; + $link .= '&pids[1]='.$wife; $c++; } } else if ($wife) { @@ -244,7 +244,7 @@ class FamilyController extends BaseController { } // charts menu - $menu = new Menu(i18n::translate('Charts'), encode_url('timeline.php?'.$link)); + $menu = new Menu(i18n::translate('Charts'), 'timeline.php?'.$link); $menu->addIcon('timeline'); $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); // Build a sortable list of submenu items and then sort it in localized name order @@ -260,7 +260,7 @@ class FamilyController extends BaseController { switch ($menuType) { case "parentTimeLine": // charts / parents_timeline - $submenu = new Menu(i18n::translate('Show couple on timeline chart'), encode_url('timeline.php?'.$link)); + $submenu = new Menu(i18n::translate('Show couple on timeline chart'), 'timeline.php?'.$link); $submenu->addIcon('timeline'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -268,7 +268,7 @@ class FamilyController extends BaseController { case "childTimeLine": // charts / children_timeline - $submenu = new Menu(i18n::translate('Show children on timeline chart'), encode_url('timeline.php?'.$this->getChildrenUrlTimeline())); + $submenu = new Menu(i18n::translate('Show children on timeline chart'), 'timeline.php?'.$this->getChildrenUrlTimeline()); $submenu->addIcon('timeline'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -276,7 +276,7 @@ class FamilyController extends BaseController { case "familyTimeLine": // charts / family_timeline - $submenu = new Menu(i18n::translate('Show family on timeline chart'), encode_url('timeline.php?'.$link.'&'.$this->getChildrenUrlTimeline($c))); + $submenu = new Menu(i18n::translate('Show family on timeline chart'), 'timeline.php?'.$link.'&'.$this->getChildrenUrlTimeline($c)); $submenu->addIcon('timeline'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -336,22 +336,22 @@ class FamilyController extends BaseController { if (find_updated_record($this->getFamilyID(), WT_GED_ID)!==null) { if (!$this->show_changes) { $label = i18n::translate('This record has been updated. Click here to show changes.'); - $link = $this->family->getLinkUrl().'&show_changes=yes'; + $link = $this->family->getHtmlUrl().'&show_changes=yes'; } else { $label = i18n::translate('Click here to hide changes.'); - $link = $this->family->getLinkUrl().'&show_changes=no'; + $link = $this->family->getHtmlUrl().'&show_changes=no'; } - $submenu = new Menu($label, encode_url($link)); + $submenu = new Menu($label, $link); $submenu->addIcon('edit_fam'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); if (WT_USER_CAN_ACCEPT) { - $submenu = new Menu(i18n::translate('Undo all changes'), encode_url("family.php?famid={$this->famid}&action=undo")); + $submenu = new Menu(i18n::translate('Undo all changes'), "family.php?famid={$this->famid}&action=undo"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $submenu->addIcon('edit_fam'); $menu->addSubmenu($submenu); - $submenu = new Menu(i18n::translate('Accept all changes'), encode_url("family.php?famid={$this->famid}&action=accept")); + $submenu = new Menu(i18n::translate('Accept all changes'), "family.php?famid={$this->famid}&action=accept"); $submenu->addIcon('edit_fam'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -389,7 +389,7 @@ class FamilyController extends BaseController { } // add to favorites - $submenu = new Menu(i18n::translate('Add to My Favorites'), encode_url('family.php?action=addfav&famid='.$this->getFamilyID().'&gid='.$this->getFamilyID())); + $submenu = new Menu(i18n::translate('Add to My Favorites'), 'family.php?action=addfav&famid='.$this->getFamilyID().'&gamp;id='.$this->getFamilyID()); $submenu->addIcon('favorites'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); diff --git a/includes/controllers/hourglass_ctrl.php b/includes/controllers/hourglass_ctrl.php index fddef1a811..17af2861fc 100644 --- a/includes/controllers/hourglass_ctrl.php +++ b/includes/controllers/hourglass_ctrl.php @@ -136,7 +136,7 @@ class HourglassController extends BaseController { //-- calculate how tall the lines should be $lh = ($bhalfheight+3) * pow(2, ($this->generations-$count-1)); foreach($families as $famid => $family) { - print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"empty-cells: show;\">\n"; + print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"empty-cells: show;\">"; $parents = find_parents($famid); $height="100%"; print "<tr>"; @@ -156,7 +156,7 @@ class HourglassController extends BaseController { //-- recursively get the father's family $this->print_person_pedigree($parents["HUSB"], $count+1); print "</td>"; - print "</tr>\n<tr>\n"; + print "</tr><tr>"; print "<td valign=\"top\"><img name=\"pvline\" src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"$lh\" alt=\"\" /></td>"; print "<td><img src=\"".$WT_IMAGES["hline"]."\" width=\"7\" height=\"3\" alt=\"\" /></td>"; print "<td>"; @@ -211,7 +211,7 @@ class HourglassController extends BaseController { print "<table id=\"table_$pid\" align=\"".$tablealign."\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"; print "<tr>"; - print "<td align=\"$tablealign\" width=\"100%\">\n"; + print "<td align=\"$tablealign\" width=\"100%\">"; $numkids = 0; $families = $person->getSpouseFamilies(); $famcount = count($families); @@ -262,10 +262,10 @@ class HourglassController extends BaseController { print "</tr>"; } - print "</table>\n"; + print "</table>"; } - print "</td>\n"; + print "</td>"; print "<td width=\"$bwidth\">"; } @@ -274,14 +274,14 @@ class HourglassController extends BaseController { $numkids = 1; $tbwidth = $bwidth+16; for($j=$count; $j<$this->dgenerations; $j++) { - print "<div style=\"width: ".($tbwidth)."px;\"><br /></div>\n</td>\n<td width=\"$bwidth\">"; + print "<div style=\"width: ".($tbwidth)."px;\"><br /></div></td><td width=\"$bwidth\">"; } $kcount = 0; foreach($families as $famid=>$family) $kcount+=$family->getNumberOfChildren(); if ($kcount==0) { - print "<div style=\"width: ".($this->arrwidth)."px;\"><br /></div>\n</td>\n<td width=\"$bwidth\">"; + print "<div style=\"width: ".($this->arrwidth)."px;\"><br /></div></td><td width=\"$bwidth\">"; } else { - print "<div style=\"width: ".($this->arrwidth)."px;\"><a href=\"$pid\" onclick=\"return ChangeDis('td_".$pid."','".$pid."','".$this->show_full."','".$this->show_spouse."','".$this->box_width."')\"><img src=\"".$WT_IMAGES["larrow"]."\" border=\"0\" alt=\"\" /></a></div>\n"; + print "<div style=\"width: ".($this->arrwidth)."px;\"><a href=\"$pid\" onclick=\"return ChangeDis('td_".$pid."','".$pid."','".$this->show_full."','".$this->show_spouse."','".$this->box_width."')\"><img src=\"".$WT_IMAGES["larrow"]."\" border=\"0\" alt=\"\" /></a></div>"; //-- move the arrow up to line up with the correct box if ($this->show_spouse) { foreach($families as $famid => $family) { @@ -294,7 +294,7 @@ class HourglassController extends BaseController { } } } - print "</td>\n<td width=\"$bwidth\">"; + print "</td><td width=\"$bwidth\">"; } } @@ -344,20 +344,20 @@ class HourglassController extends BaseController { } // NOTE: If statement OK if ($num>0) { - print "\n\t\t<div class=\"center\" id=\"childarrow\" dir=\"".$TEXT_DIRECTION."\""; + print "<div class=\"center\" id=\"childarrow\" dir=\"".$TEXT_DIRECTION."\""; print " style=\"position:absolute; width:".$bwidth."px; \">"; print "<a href=\"javascript: ".i18n::translate('Show')."\" onclick=\"togglechildrenbox(); return false;\" onmouseover=\"swap_image('larrow',3);\" onmouseout=\"swap_image('larrow',3);\">"; print "<img id=\"larrow\" src=\"".$WT_IMAGES["darrow"]."\" border=\"0\" alt=\"\" />"; print "</a><br />"; - print "\n\t\t<div id=\"childbox\" dir=\"".$TEXT_DIRECTION."\" style=\"width:".$bwidth."px; height:".$bheight."px; visibility: hidden;\">"; - print "\n\t\t\t<table class=\"person_box\"><tr><td>"; + print "<div id=\"childbox\" dir=\"".$TEXT_DIRECTION."\" style=\"width:".$bwidth."px; height:".$bheight."px; visibility: hidden;\">"; + print "<table class=\"person_box\"><tr><td>"; foreach($famids as $famid=>$family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); if (!empty($spouse)) { $spid = $spouse->getXref(); - print "\n\t\t\t\t<a href=\"".encode_url("hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}")."\"><span "; + print "<a href=\"hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; $name = $spouse->getFullName(); $name = rtrim($name); if (hasRTLText($name)) @@ -371,7 +371,7 @@ class HourglassController extends BaseController { $children = $family->getChildren(); foreach($children as $id=>$child) { $cid = $child->getXref(); - print "\n\t\t\t\t <a href=\"".encode_url("hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}")."\"><span "; + print " <a href=\"hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; $name = $child->getFullName(); $name = rtrim($name); if (hasRTLText($name)) @@ -395,7 +395,7 @@ class HourglassController extends BaseController { $husb = $family->getHusband(); if (!empty($husb)) { $spid = $husb->getXref(); - print "\n\t\t\t\t <a href=\"".encode_url("hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}")."\"><span "; + print " <a href=\"hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; $name = $husb->getFullName(); $name = rtrim($name); if (hasRTLText($name)) @@ -407,7 +407,7 @@ class HourglassController extends BaseController { $husb = $family->getWife(); if (!empty($husb)) { $spid = $husb->getXref(); - print "\n\t\t\t\t <a href=\"".encode_url("hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}")."\"><span "; + print " <a href=\"hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; $name = $husb->getFullName(); $name = rtrim($name); if (hasRTLText($name)) @@ -424,7 +424,7 @@ class HourglassController extends BaseController { foreach($children as $id=>$child) { $cid = $child->getXref(); if ($cid!=$pid) { - print "\n\t\t\t\t <a href=\"".encode_url("hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}")."\"><span "; + print " <a href=\"hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\"><span "; $name = $child->getFullName(); $name = rtrim($name); if (hasRTLText($name)) @@ -437,9 +437,9 @@ class HourglassController extends BaseController { } } } - print "\n\t\t\t</td></tr></table>"; - print "\n\t\t</div>"; - print "\n\t\t</div>"; + print "</td></tr></table>"; + print "</div>"; + print "</div>"; } } } diff --git a/includes/controllers/individual_ctrl.php b/includes/controllers/individual_ctrl.php index 4b18161dec..0558848c2c 100644 --- a/includes/controllers/individual_ctrl.php +++ b/includes/controllers/individual_ctrl.php @@ -318,7 +318,7 @@ class IndividualController extends BaseController { $name = $this->indi->getFullName(); if (WT_USE_LIGHTBOX) { - print "<a href=\"" . $firstmediarec["file"] . "\" rel=\"clearbox[general_1]\" rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">" . "\n"; + print "<a href=\"" . $firstmediarec["file"] . "\" rel=\"clearbox[general_1]\" rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">"; } else if (!$USE_MEDIA_VIEWER && $imgsize) { $result .= "<a href=\"javascript:;\" onclick=\"return openImage('".urlencode($firstmediarec["file"])."', $imgwidth, $imgheight);\">"; } else { @@ -457,7 +457,7 @@ class IndividualController extends BaseController { echo "<a class=\"font9\" href=\"javascript:;\" onclick=\"add_new_record('".$this->pid."', 'SEX'); return false;\">".i18n::translate('Edit')."</a>"; } else { echo "<a class=\"font9\" href=\"javascript:;\" onclick=\"edit_record('".$this->pid."', ".$event->getLineNumber()."); return false;\">".i18n::translate('Edit')."</a> | "; - echo "<a class=\"font9\" href=\"javascript:;\" onclick=\"delete_record('".$this->pid."', ".$event->getLineNumber()."); return false;\">".i18n::translate('Delete')."</a>\n"; + echo "<a class=\"font9\" href=\"javascript:;\" onclick=\"delete_record('".$this->pid."', ".$event->getLineNumber()."); return false;\">".i18n::translate('Delete')."</a>"; } } } @@ -530,22 +530,22 @@ class IndividualController extends BaseController { if (find_updated_record($this->pid, WT_GED_ID)!==null) { if (!$this->show_changes) { $label = i18n::translate('This record has been updated. Click here to show changes.'); - $link = $this->indi->getLinkUrl().'&show_changes=yes'; + $link = $this->indi->getHtmlUrl().'&show_changes=yes'; } else { $label = i18n::translate('Click here to hide changes.'); - $link = $this->indi->getLinkUrl().'&show_changes=no'; + $link = $this->indi->getHtmlUrl().'&show_changes=no'; } - $submenu = new Menu($label, encode_url($link)); + $submenu = new Menu($label, $link); $submenu->addIcon('edit_indi'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); if (WT_USER_CAN_ACCEPT) { - $submenu = new Menu(i18n::translate('Undo all changes'), encode_url($this->indi->getLinkUrl()."&action=undo")); + $submenu = new Menu(i18n::translate('Undo all changes'), $this->indi->getHtmlUrl()."&action=undo"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $submenu->addIcon('edit_indi'); $menu->addSubmenu($submenu); - $submenu = new Menu(i18n::translate('Accept all changes'), encode_url($this->indi->getLinkUrl()."&action=accept")); + $submenu = new Menu(i18n::translate('Accept all changes'), $this->indi->getHtmlUrl()."&action=accept"); $submenu->addIcon('edit_indi'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -583,7 +583,7 @@ class IndividualController extends BaseController { } // add to favorites - $submenu = new Menu(i18n::translate('Add to My Favorites'), encode_url($this->indi->getLinkUrl()."&action=addfav&gid={$this->pid}")); + $submenu = new Menu(i18n::translate('Add to My Favorites'), $this->indi->getHtmlUrl()."&action=addfav&gid=".$this->pid); $submenu->addIcon('favorites'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); diff --git a/includes/controllers/lifespan_ctrl.php b/includes/controllers/lifespan_ctrl.php index 1d3b883781..59598974d0 100644 --- a/includes/controllers/lifespan_ctrl.php +++ b/includes/controllers/lifespan_ctrl.php @@ -455,9 +455,9 @@ class LifespanController extends BaseController { $place = $val->getPlace(); $trans = translate_fact($fact); if (isset($eventinformation[$evntwdth])) { - $eventinformation[$evntwdth] .= "<br />\n".$trans."<br />\n".strip_tags($date->Display(false, '', NULL, false))." ".$place; + $eventinformation[$evntwdth] .= "<br />".$trans."<br />".strip_tags($date->Display(false, '', NULL, false))." ".$place; } else { - $eventinformation[$evntwdth]= $fact."-fact, ".$trans."<br />\n".strip_tags($date->Display(false, '', NULL, false))." ".$place; + $eventinformation[$evntwdth]= $fact."-fact, ".$trans."<br />".strip_tags($date->Display(false, '', NULL, false))." ".$place; } } } @@ -465,7 +465,7 @@ class LifespanController extends BaseController { $bdate=$value->getEstimatedBirthDate(); $ddate=$value->getEstimatedDeathDate(); if ($width > ($minlength +110)) { - echo "\n<div id=\"bar_", $value->getXref(), "\" style=\"position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">"; + echo "<div id=\"bar_", $value->getXref(), "\" style=\"position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">"; foreach($eventinformation as $evtwidth=>$val){ echo "<div style=\"position:absolute; left:", $evtwidth, ";\"><a class=\"showit\" href=\"#\" style=\"top:-2px; font-size:10px;\"><b>"; $text = explode("-fact, ", $val); @@ -475,11 +475,11 @@ class LifespanController extends BaseController { echo "</b><span>", PrintReady($val), "</span></a></div>"; } $indiName = PrintReady(str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $value->getFullName())); - echo "\n\t<table><tr>\n\t\t<td width=\"15\"><a class=\"showit\" href=\"#\"><b>"; + echo "<table><tr><td width=\"15\"><a class=\"showit\" href=\"#\"><b>"; echo abbreviate_fact('BIRT'); echo "</b><span>", $value->getSexImage(), $indiName, "<br/>", translate_fact('BIRT'), " ", strip_tags($bdate->Display(false)), " ", PrintReady($value->getBirthPlace()), "</span></a></td>" , - "\n\t\t<td align=\"left\" width=\"100%\"><a href=\"", encode_url($value->getLinkUrl()), "\">", $value->getSexImage(), $indiName, ": $lifespan </a></td>" , - "\n\t\t<td width=\"15\">"; + "<td align=\"left\" width=\"100%\"><a href=\"", $value->getHtmlUrl(), "\">", $value->getSexImage(), $indiName, ": $lifespan </a></td>" , + "<td width=\"15\">"; if ($value->isDead()) { if ($deathReal || $value->isDead()) { print "<a class=\"showit\" href=\"#\"><b>"; @@ -493,7 +493,7 @@ class LifespanController extends BaseController { } else { if ($width > $minlength +5) { - echo "\n<div style=\"text-align: left; position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">"; + echo "<div style=\"text-align: left; position: absolute; top:", $Y, "px; left:", $startPos, "px; width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">"; foreach($eventinformation as $evtwidth=>$val){ print "<div style=\"position:absolute; left:".$evtwidth." \"><a class=\"showit\" href=\"#\" style=\"top:-2px; font-size:10px;\"><b>"; $text = explode("-fact,", $val); @@ -503,12 +503,12 @@ class LifespanController extends BaseController { print "</b><span>".PrintReady($val)."</span></a></div>"; } $indiName = PrintReady(str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $value->getFullName())); - print "\n\t<table dir=\"ltr\"><tr>\n\t\t<td width=\"15\"><a class=\"showit\" href=\"#\"><b>"; + print "<table dir=\"ltr\"><tr><td width=\"15\"><a class=\"showit\" href=\"#\"><b>"; echo abbreviate_fact('BIRT'); if (!$birthReal) print "*"; print "</b><span>".$value->getSexImage().$indiName."<br/>".translate_fact('BIRT')." ".strip_tags($bdate->Display(false))." ".PrintReady($value->getBirthPlace())."</span></a></td>" . - "<td align=\"left\" width=\"100%\"><a href=\"".encode_url($value->getLinkUrl())."\">".$value->getSexImage().$indiName."</a></td>" . - "\n\t\t<td width=\"15\">"; + "<td align=\"left\" width=\"100%\"><a href=\"".$value->getHtmlUrl()."\">".$value->getSexImage().$indiName."</a></td>" . + "<td width=\"15\">"; if ($value->isDead()) { if ($deathReal || $value->isDead()) { print "<a class=\"showit\" href=\"#\"><b>"; @@ -520,16 +520,16 @@ class LifespanController extends BaseController { print "</td></tr></table>"; echo '</div>'; } else { - echo "\n<div style=\"text-align: left; position: absolute;top:", $Y, "px; left:", $startPos, "px;width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">" ; + echo "<div style=\"text-align: left; position: absolute;top:", $Y, "px; left:", $startPos, "px;width:", $width, "px; height:", $height, "px; background-color:", $this->color, "; border: solid blue 1px; z-index:$Z;\">" ; $indiName = PrintReady(str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $value->getFullName())); - print "<a class=\"showit\" href=\"".encode_url($value->getLinkUrl())."\"><b>"; + print "<a class=\"showit\" href=\"".$value->getHtmlUrl()."\"><b>"; echo abbreviate_fact('BIRT'); print "</b><span>".$value->getSexImage().$indiName."<br/>".translate_fact('BIRT')." ".strip_tags($bdate->Display(false))." ".PrintReady($value->getBirthPlace())."<br/>"; foreach($eventinformation as $evtwidth=>$val){ $text = explode("-fact,", $val); $val = $text[1]; - print $val."<br />\n"; + print $val."<br />"; } if ($value->isDead() && $deathReal) print translate_fact('DEAT')." ".strip_tags($ddate->Display(false))." ".PrintReady($value->getDeathPlace()); print "</span></a>"; @@ -554,7 +554,7 @@ class LifespanController extends BaseController { if (!$this->people[$i]->canDisplayDetails()) { if ($this->people[$i]->canDisplayName()) { $indiName = PrintReady(str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $this->people[$i]->getFullName())); - print " <a href=\"".encode_url($this->people[$i]->getLinkUrl())."\">".$indiName."</a>"; + print " <a href=\"".$this->people[$i]->getHtmlUrl()."\">".$indiName."</a>"; print_privacy_error(); print "<br />"; $printed = true; diff --git a/includes/controllers/media_ctrl.php b/includes/controllers/media_ctrl.php index 506443daee..a860df4fb6 100644 --- a/includes/controllers/media_ctrl.php +++ b/includes/controllers/media_ctrl.php @@ -231,21 +231,21 @@ class MediaController extends BaseController{ if (find_updated_record($this->pid, WT_GED_ID)!==null) { if (!$this->show_changes) { $label = i18n::translate('This record has been updated. Click here to show changes.'); - $link = "mediaviewer.php?mid={$this->pid}&show_changes=yes"; + $link = "mediaviewer.php?mid={$this->pid}&show_changes=yes"; } else { $label = i18n::translate('Click here to hide changes.'); - $link = "mediaviewer.php?mid={$this->pid}&show_changes=no"; + $link = "mediaviewer.php?mid={$this->pid}&samp;how_changes=no"; } - $submenu = new Menu($label, encode_url($link)); + $submenu = new Menu($label, $link); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); if (WT_USER_CAN_ACCEPT) { - $submenu = new Menu(i18n::translate('Undo all changes'), encode_url("mediaviewer.php?mid={$this->pid}&action=undo")); + $submenu = new Menu(i18n::translate('Undo all changes'), "mediaviewer.php?mid={$this->pid}&action=undo"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $submenu->addIcon('notes'); $menu->addSubmenu($submenu); - $submenu = new Menu(i18n::translate('Accept all changes'), encode_url("mediaviewer.php?mid={$this->pid}&action=accept")); + $submenu = new Menu(i18n::translate('Accept all changes'), "mediaviewer.php?mid={$this->pid}&action=accept"); $submenu->addIcon('notes'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -275,8 +275,7 @@ class MediaController extends BaseController{ // delete if (WT_USER_GEDCOM_ADMIN) { - $submenu = new Menu(i18n::translate('Remove object')); - $submenu->addLink(encode_url("media.php?action=removeobject&xref=".$this->pid)); + $submenu = new Menu(i18n::translate('Remove object'), "media.php?action=removeobject&xref=".$this->pid); $submenu->addOnclick("return confirm('".i18n::translate('Are you sure you want to remove this object from the database?')."')"); $submenu->addIcon('edit_media'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); @@ -284,7 +283,7 @@ class MediaController extends BaseController{ } // add to favorites - $submenu = new Menu(i18n::translate('Add to My Favorites'), encode_url("mediaviewer.php?action=addfav&mid={$this->mid}&gid={$this->mid}")); + $submenu = new Menu(i18n::translate('Add to My Favorites'), "mediaviewer.php?action=addfav&mid={$this->mid}&gid={$this->mid}"); $submenu->addIcon('favorites'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); diff --git a/includes/controllers/note_ctrl.php b/includes/controllers/note_ctrl.php index a63d0ff816..a37395bafa 100644 --- a/includes/controllers/note_ctrl.php +++ b/includes/controllers/note_ctrl.php @@ -179,21 +179,21 @@ class NoteController extends BaseController { // show/hide changes if (find_updated_record($this->nid, WT_GED_ID)!==null) { if (!$this->show_changes) { - $submenu = new Menu(i18n::translate('This record has been updated. Click here to show changes.'), encode_url("note.php?nid={$this->nid}&show_changes=yes")); + $submenu = new Menu(i18n::translate('This record has been updated. Click here to show changes.'), "note.php?nid={$this->nid}&show_changes=yes"); $submenu->addIcon('edit_note'); } else { - $submenu = new Menu(i18n::translate('Click here to hide changes.'), encode_url("note.php?nid={$this->nid}&show_changes=no")); + $submenu = new Menu(i18n::translate('Click here to hide changes.'), "note.php?nid={$this->nid}&show_changes=no"); $submenu->addIcon('edit_note'); } $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); if (WT_USER_CAN_ACCEPT) { - $submenu = new Menu(i18n::translate('Undo all changes'), encode_url("note.php?nid={$this->nid}&action=undo")); + $submenu = new Menu(i18n::translate('Undo all changes'), "note.php?nid={$this->nid}&action=undo"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $submenu->addIcon('notes'); $menu->addSubmenu($submenu); - $submenu = new Menu(i18n::translate('Accept all changes'), encode_url("note.php?nid={$this->nid}&action=accept")); + $submenu = new Menu(i18n::translate('Accept all changes'), "note.php?nid={$this->nid}&action=accept"); $submenu->addIcon('notes'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -231,7 +231,7 @@ class NoteController extends BaseController { } // add to favorites - $submenu = new Menu(i18n::translate('Add to My Favorites'), encode_url("note.php?action=addfav&nid={$this->nid}&gid={$this->nid}")); + $submenu = new Menu(i18n::translate('Add to My Favorites'), "note.php?action=addfav&nid={$this->nid}&gid={$this->nid}"); $submenu->addIcon('favorites'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); diff --git a/includes/controllers/repository_ctrl.php b/includes/controllers/repository_ctrl.php index 41ca9345f8..662f065c1a 100644 --- a/includes/controllers/repository_ctrl.php +++ b/includes/controllers/repository_ctrl.php @@ -173,21 +173,21 @@ class RepositoryController extends BaseController { // show/hide changes if (find_updated_record($this->rid, WT_GED_ID)!==null) { if (!$this->show_changes) { - $submenu = new Menu(i18n::translate('This record has been updated. Click here to show changes.'), encode_url("repo.php?rid={$this->rid}&show_changes=yes")); + $submenu = new Menu(i18n::translate('This record has been updated. Click here to show changes.'), "repo.php?rid={$this->rid}&show_changes=yes"); $submenu->addIcon('edit_repo'); } else { - $submenu = new Menu(i18n::translate('Click here to hide changes.'), encode_url("repo.php?rid={$this->rid}&show_changes=no")); + $submenu = new Menu(i18n::translate('Click here to hide changes.'), "repo.php?rid={$this->rid}&show_changes=no"); $submenu->addIcon('edit_repo'); } $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); if (WT_USER_CAN_ACCEPT) { - $submenu = new Menu(i18n::translate('Undo all changes'), encode_url("repo.php?rid={$this->rid}&action=undo")); + $submenu = new Menu(i18n::translate('Undo all changes'), "repo.php?rid={$this->rid}&action=undo"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $submenu->addIcon('edit_repo'); $menu->addSubmenu($submenu); - $submenu = new Menu(i18n::translate('Accept all changes'), encode_url("repo.php?rid={$this->rid}&action=accept")); + $submenu = new Menu(i18n::translate('Accept all changes'), "repo.php?rid={$this->rid}&action=accept"); $submenu->addIcon('edit_repo'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -225,7 +225,7 @@ class RepositoryController extends BaseController { } // add to favorites - $submenu = new Menu(i18n::translate('Add to My Favorites'), encode_url("repo.php?action=addfav&rid={$this->rid}&gid={$this->rid}")); + $submenu = new Menu(i18n::translate('Add to My Favorites'), "repo.php?action=addfav&rid={$this->rid}&gid={$this->rid}"); $submenu->addIcon('favorites'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); diff --git a/includes/controllers/search_ctrl.php b/includes/controllers/search_ctrl.php index 34eadec4ae..22f624df72 100644 --- a/includes/controllers/search_ctrl.php +++ b/includes/controllers/search_ctrl.php @@ -357,7 +357,7 @@ class SearchController extends BaseController { if (isset ($this->query)) { $record=GedcomRecord::getInstance($this->query); if ($record && $record->canDisplayDetails()) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($record->getLinkUrl(), false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$record->getRawUrl()); exit; } } @@ -429,28 +429,28 @@ class SearchController extends BaseController { if (count($this->myindilist)==1 && !$this->myfamlist && !$this->mysourcelist && !$this->mynotelist) { $indi=$this->myindilist[0]; if (!count_linked_indi($indi->getXref(), 'ASSO', $indi->getGedId()) && !count_linked_fam($indi->getXref(), 'ASSO', $indi->getGedId()) && $indi->canDisplayName()) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($indi->getLinkUrl(), false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$indi->getRawUrl()); exit; } } if (!$this->myindilist && count($this->myfamlist)==1 && !$this->mysourcelist && !$this->mynotelist) { $fam=$this->myfamlist[0]; if ($fam->canDisplayName()) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($fam->getLinkUrl(), false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$fam->getRawUrl()); exit; } } if (!$this->myindilist && !$this->myfamlist && count($this->mysourcelist)==1 && !$this->mynotelist) { $sour=$this->mysourcelist[0]; if ($sour->canDisplayName()) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($sour->getLinkUrl(), false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$sour->getRawUrl()); exit; } } if (!$this->myindilist && !$this->myfamlist && !$this->mysourcelist && count($this->mynotelist)==1) { $note=$this->mynotelist[0]; if ($note->canDisplayName()) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($note->getLinkUrl(), false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$note->getRawUrl()); exit; } } @@ -636,7 +636,7 @@ class SearchController extends BaseController { //-- if only 1 item is returned, automatically forward to that item if (count($this->myindilist)==1 && $this->action!="replace") { $indi=$this->myindilist[0]; - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($indi->getLinkUrl(), false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$indi->getRawUrl()); exit; } usort($this->myindilist, array('GedcomRecord', 'Compare')); @@ -860,11 +860,11 @@ class SearchController extends BaseController { print "<tr><td><table id=\"multiResultsInTbl\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" ><tr>"; } $displayed_once = true; - print "<td class=\"list_label\" colspan=\"2\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >".i18n::translate('Site: ')."<a href=\"".encode_url($siteURL)."\" target=\"_blank\">".$siteName."</a>".i18n::translate(' contained the following')."</td></tr>"; + print "<td class=\"list_label\" colspan=\"2\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >".i18n::translate('Site: ')."<a href=\"".$siteURL."\" target=\"_blank\">".$siteName."</a>".i18n::translate(' contained the following')."</td></tr>"; } print "<tr><td class=\"list_value $TEXT_DIRECTION\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" valign=\"center\" ><ul>"; print "<li class=\"$TEXT_DIRECTION\" dir=\"$TEXT_DIRECTION\">"; - print "<a href=\"".encode_url("{$siteURL}/individual.php?pid={$person->PID}&ged={$serviceClient->gedfile}")."\" target=\"_blank\">"; + print "<a href=\"{$siteURL}/individual.php?pid={$person->PID}&ged={$serviceClient->gedfile}\" target=\"_blank\">"; $pageResultsNum += 1; print "<b>".$person->getFullName()."</b>"; if (!empty ($person->PID)) { @@ -884,14 +884,14 @@ class SearchController extends BaseController { /******************************* Remote Links Per Result *************************************************/ if (WT_USER_CAN_EDIT) { - print "<td class=\"list_value $TEXT_DIRECTION\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >"."<ul style=\"list-style: NONE\"><li><a href=\"javascript:;\" "."onclick=\"return open_link('".$key."', '".$person->PID."', '".$person->getFullName()."');\">"."<b>".i18n::translate('Add Local Link')."</b></a></ul></li></td></tr>\n"; + print "<td class=\"list_value $TEXT_DIRECTION\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >"."<ul style=\"list-style: NONE\"><li><a href=\"javascript:;\" "."onclick=\"return open_link('".$key."', '".$person->PID."', '".$person->getFullName()."');\">"."<b>".i18n::translate('Add Local Link')."</b></a></ul></li></td></tr>"; } } } print "</table>"; - print "\n\t\t </td></tr></table>"; + print " </td></tr></table>"; } if ($this->multiTotalResults > 0) { print "</tr><tr><td align=\"left\">Displaying individuals "; @@ -1012,15 +1012,15 @@ class SearchController extends BaseController { foreach ($inputFieldNames as $key => $value) { $controllerVar = $this->getValue($value); if (!empty ($controllerVar)) { - $tempURL .= "&{$value}={$controllerVar}"; + $tempURL .= "&{$value}={$controllerVar}"; } } - $tempURL .= "&resultsPageNum={$pageNum}"; + $tempURL .= "&resultsPageNum={$pageNum}"; foreach($this->sgeds as $i=>$key) { $str = str_replace(array (".", "-", " "), array ("_", "_", "_"), $key); - $tempURL .= "&{$str}=yes"; + $tempURL .= "&{$str}=yes"; } - print encode_url($tempURL); + print $tempURL; } function getValue($varName) { diff --git a/includes/controllers/source_ctrl.php b/includes/controllers/source_ctrl.php index 804018f73a..d950c6f773 100644 --- a/includes/controllers/source_ctrl.php +++ b/includes/controllers/source_ctrl.php @@ -179,21 +179,21 @@ class SourceController extends BaseController { // show/hide changes if (find_updated_record($this->sid, WT_GED_ID)!==null) { if (!$this->show_changes) { - $submenu = new Menu(i18n::translate('This record has been updated. Click here to show changes.'), encode_url("source.php?sid={$this->sid}&show_changes=yes")); + $submenu = new Menu(i18n::translate('This record has been updated. Click here to show changes.'), "source.php?sid={$this->sid}&show_changes=yes"); $submenu->addIcon('edit_sour'); } else { - $submenu = new Menu(i18n::translate('Click here to hide changes.'), encode_url("source.php?sid={$this->sid}&show_changes=no")); + $submenu = new Menu(i18n::translate('Click here to hide changes.'), "source.php?sid={$this->sid}&show_changes=no"); $submenu->addIcon('edit_sour'); } $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); if (WT_USER_CAN_ACCEPT) { - $submenu = new Menu(i18n::translate('Undo all changes'), encode_url("source.php?sid={$this->sid}&action=undo")); + $submenu = new Menu(i18n::translate('Undo all changes'), "source.php?sid={$this->sid}&action=undo"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $submenu->addIcon('edit_sour'); $menu->addSubmenu($submenu); - $submenu = new Menu(i18n::translate('Accept all changes'), encode_url("source.php?sid={$this->sid}&action=accept")); + $submenu = new Menu(i18n::translate('Accept all changes'), "source.php?sid={$this->sid}&action=accept"); $submenu->addIcon('edit_sour'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); @@ -231,7 +231,7 @@ class SourceController extends BaseController { } // add to favorites - $submenu = new Menu(i18n::translate('Add to My Favorites'), encode_url("source.php?action=addfav&sid={$this->sid}&gid={$this->sid}")); + $submenu = new Menu(i18n::translate('Add to My Favorites'), "source.php?action=addfav&sid={$this->sid}&gid={$this->sid}"); $submenu->addIcon('favorites'); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); $menu->addSubmenu($submenu); diff --git a/includes/controllers/timeline_ctrl.php b/includes/controllers/timeline_ctrl.php index e423115514..bc8e43d9af 100644 --- a/includes/controllers/timeline_ctrl.php +++ b/includes/controllers/timeline_ctrl.php @@ -152,7 +152,7 @@ class TimelineController extends BaseController { if (!is_null($this->people[$i])) { if (!$this->people[$i]->canDisplayDetails()) { if ($this->people[$i]->canDisplayName()) { - print " <a href=\"".encode_url($this->people[$i]->getLinkUrl())."\">".PrintReady($this->people[$i]->getFullName())."</a>"; + print " <a href=\"".$this->people[$i]->getHtmlUrl()."\">".PrintReady($this->people[$i]->getFullName())."</a>"; print_privacy_error(); print "<br />"; $printed = true; @@ -213,14 +213,14 @@ class TimelineController extends BaseController { $xoffset += abs($tyoffset); $placements[$place] = $yoffset; - print "\n\t\t<div id=\"fact$factcount\" style=\"position:absolute; ".($TEXT_DIRECTION =="ltr"?"left: ".($xoffset):"right: ".($xoffset))."px; top:".($yoffset)."px; font-size: 8pt; height: ".($this->bheight)."px; \" onmousedown=\"factMD(this, '".$factcount."', ".($yoffset-$tyoffset).");\">\n"; - print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"cursor: hand;\"><tr><td>\n"; + print "<div id=\"fact$factcount\" style=\"position:absolute; ".($TEXT_DIRECTION =="ltr"?"left: ".($xoffset):"right: ".($xoffset))."px; top:".($yoffset)."px; font-size: 8pt; height: ".($this->bheight)."px; \" onmousedown=\"factMD(this, '".$factcount."', ".($yoffset-$tyoffset).");\">"; + print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"cursor: hand;\"><tr><td>"; print "<img src=\"".$WT_IMAGES["hline"]."\" name=\"boxline$factcount\" id=\"boxline$factcount\" height=\"3\" align=\"left\" hspace=\"0\" width=\"10\" vspace=\"0\" alt=\"\" style=\"padding-"; if ($TEXT_DIRECTION=="ltr") print "left"; else print "right"; - print ": 3px;\" />\n"; + print ": 3px;\" />"; $col = $event->temp % 6; - print "</td><td valign=\"top\" class=\"person".$col."\">\n"; + print "</td><td valign=\"top\" class=\"person".$col."\">"; if (count($this->pids) > 6) print $event->getParentObject()->getFullName()." - "; $indi=$event->getParentObject(); print $event->getLabel(); @@ -286,19 +286,19 @@ class TimelineController extends BaseController { if ($p==count($this->pids)) $p = $event->temp; $col = $p % 6; if ($spouse->getXref()!=$this->pids[$p]) { - echo ' <a href="', $spouse->getLinkUrl(), '">', $spouse->getFullName(), '</a>'; + echo ' <a href="', $spouse->getHtmlUrl(), '">', $spouse->getFullName(), '</a>'; } else { $ct = preg_match("/2 _WTFS @(.*)@/", $factrec, $match); if ($ct>0) { - print " <a href=\"".encode_url("family.php?famid={$match[1]}&ged={$GEDCOM}")."\">"; + print " <a href=\"family.php?famid={$match[1]}&ged={$GEDCOM}\">"; if ($event->getParentObject()->canDisplayName()) print $event->getParentObject()->getFullName(); else print i18n::translate('Private'); print "</a>"; } } } - print "</td></tr></table>\n"; + print "</td></tr></table>"; print "</div>"; if ($TEXT_DIRECTION=='ltr') { $img = "dline2"; @@ -321,9 +321,9 @@ class TimelineController extends BaseController { } } //-- print the diagnal line - print "\n\t\t<div id=\"dbox$factcount\" style=\"position:absolute; ".($TEXT_DIRECTION =="ltr"?"left: ".($basexoffset+25):"right: ".($basexoffset+25))."px; top:".($dyoffset)."px; font-size: 8pt; height: ".(abs($tyoffset))."px; width: ".(abs($tyoffset))."px;"; + print "<div id=\"dbox$factcount\" style=\"position:absolute; ".($TEXT_DIRECTION =="ltr"?"left: ".($basexoffset+25):"right: ".($basexoffset+25))."px; top:".($dyoffset)."px; font-size: 8pt; height: ".(abs($tyoffset))."px; width: ".(abs($tyoffset))."px;"; print " background-image: url('".$WT_IMAGES[$img]."');"; - print " background-position: 0% $ypos; \" >\n"; - print "</div>\n"; + print " background-position: 0% $ypos; \" >"; + print "</div>"; } } diff --git a/includes/family_nav.php b/includes/family_nav.php index 391ddc21eb..68695bc4ed 100644 --- a/includes/family_nav.php +++ b/includes/family_nav.php @@ -80,7 +80,7 @@ if (isset($_COOKIE['lastclick'])) { <tr> <td style="padding-bottom: 4px;" align="center" colspan="2"> <?php - echo '<a href="', encode_url($family->getLinkUrl()), '">'; + echo '<a href="', $family->getHtmlUrl(), '">'; echo "<b>", i18n::translate('Parents Family'), "</b>"; echo "</a>"; ?> @@ -88,7 +88,7 @@ if (isset($_COOKIE['lastclick'])) { </tr> <?php if (isset($people["husb"])) { - $menu = new Menu(" " . $people["husb"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["husb"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -108,7 +108,7 @@ if (isset($_COOKIE['lastclick'])) { </td> <td align="center" class="<?php print $this->getPersonStyle($people["husb"]); ?>"> <?php - print "<a href=\"".encode_url($people["husb"]->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$people["husb"]->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -119,7 +119,7 @@ if (isset($_COOKIE['lastclick'])) { } if (isset($people["wife"])) { - $menu = new Menu(" " . $people["wife"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["wife"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -139,7 +139,7 @@ if (isset($_COOKIE['lastclick'])) { </td> <td align="center" class="<?php print $this->getPersonStyle($people["wife"]); ?>"> <?php - print "<a href=\"".encode_url($people["wife"]->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$people["wife"]->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -154,7 +154,7 @@ if (isset($_COOKIE['lastclick'])) { foreach($people["children"] as $key=>$child) { if ($pid == $child->getXref() ){ }else{ - $menu = new Menu($child->getLabel() . "\n"); + $menu = new Menu($child->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -185,7 +185,7 @@ if (isset($_COOKIE['lastclick'])) { print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; }else{ - print "<a href=\"".encode_url($child->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$child->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -212,7 +212,7 @@ if (isset($_COOKIE['lastclick'])) { <tr> <td style="padding-bottom: 4px;" align="center" colspan="2"> <?php - echo '<a href="', encode_url($family->getLinkUrl()), '">'; + echo '<a href="', $family->getHtmlUrl(), '">'; echo "<b>", i18n::translate('Step-Parent Family'), "</b>"; echo "</a>"; ?> @@ -224,9 +224,9 @@ if (isset($_COOKIE['lastclick'])) { if (isset($people["husb"]) ) { $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { - $menu->addLabel(" " . i18n::translate('Step-Father') . " ". "\n"); + $menu->addLabel(" " . i18n::translate('Step-Father')); }else{ - $menu->addLabel(" " . $people["husb"]->getLabel() . " ". "\n"); + $menu->addLabel(" " . $people["husb"]->getLabel()); } if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); @@ -248,7 +248,7 @@ if (isset($_COOKIE['lastclick'])) { </td> <td align="center" class="<?php print $this->getPersonStyle($people["husb"]); ?>" > <?php - print "<a href=\"".encode_url($people["husb"]->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$people["husb"]->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -264,9 +264,9 @@ if (isset($_COOKIE['lastclick'])) { if (isset($people["wife"]) ) { $menu = new Menu(); if ($people["wife"]->getLabel() == ".") { - $menu->addLabel(" " . i18n::translate('Step-Mother') . " ". "\n"); + $menu->addLabel(" " . i18n::translate('Step-Mother')); }else{ - $menu->addLabel(" " . $people["wife"]->getLabel() . " ". "\n"); + $menu->addLabel(" " . $people["wife"]->getLabel()); } if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); @@ -287,7 +287,7 @@ if (isset($_COOKIE['lastclick'])) { </td> <td align="center" class="<?php print $this->getPersonStyle($people["wife"]); ?>"> <?php - print "<a href=\"".encode_url($people["wife"]->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$people["wife"]->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -301,7 +301,7 @@ if (isset($_COOKIE['lastclick'])) { if (isset($people["children"])) { $elderdate = $family->getMarriageDate(); foreach($people["children"] as $key=>$child) { - $menu = new Menu($child->getLabel() . "\n"); + $menu = new Menu($child->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -321,7 +321,7 @@ if (isset($_COOKIE['lastclick'])) { </td> <td align="center" class="<?php print $this->getPersonStyle($child); ?>"> <?php - print "<a href=\"".encode_url($child->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$child->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -342,7 +342,7 @@ if (isset($_COOKIE['lastclick'])) { <tr> <td style="padding-bottom: 4px;" align="center" colspan="2"> <?php - echo '<a href="', encode_url($family->getLinkUrl()), '">'; + echo '<a href="', $family->getHtmlUrl(), '">'; echo "<b>", i18n::translate('Immediate Family'), "</b>"; echo "</a>"; ?> @@ -359,7 +359,7 @@ if (isset($_COOKIE['lastclick'])) { } $styleadd = ""; if ( isset($people["husb"]) && $spousetag == 'HUSB' ) { - $menu = new Menu(" " . $people["husb"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["husb"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -383,7 +383,7 @@ if (isset($_COOKIE['lastclick'])) { print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; }else{ - print "<a href=\"".encode_url($people["husb"]->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$people["husb"]->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -395,7 +395,7 @@ if (isset($_COOKIE['lastclick'])) { } if ( isset($people["wife"]) && $spousetag == 'WIFE') { - $menu = new Menu(" " . $people["wife"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["wife"]->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -419,7 +419,7 @@ if (isset($_COOKIE['lastclick'])) { print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; }else{ - print "<a href=\"".encode_url($people["wife"]->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$people["wife"]->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -433,7 +433,7 @@ if (isset($_COOKIE['lastclick'])) { $styleadd = ""; if (isset($people["children"])) { foreach($people["children"] as $key=>$child) { - $menu = new Menu(" " . $child->getLabel() . " ". "\n"); + $menu = new Menu(" " . $child->getLabel()); if ($TEXT_DIRECTION=="ltr") { $menu->addClass("", "", "submenu flyout"); }else{ @@ -453,7 +453,7 @@ if (isset($_COOKIE['lastclick'])) { </td> <td align="center" class="<?php print $this->getPersonStyle($child); ?>"> <?php - print "<a href=\"".encode_url($child->getLinkUrl()."&tab={$tabno}")."\">"; + print "<a href=\"".$child->getHtmlUrl()."&tab={$tabno}"."\">"; print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -546,7 +546,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($husb || $num>0) { if ($husb) { $person_parent="Yes"; - $parentlinks .= "<a href=\"".encode_url($husb->getLinkUrl()."&tab={$tabno}")."\">"; + $parentlinks .= "<a href=\"".$husb->getHtmlUrl()."&tab={$tabno}"."\">"; $parentlinks .= " ".PrintReady($husb->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -558,7 +558,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($wife || $num>0) { if ($wife) { $person_parent="Yes"; - $parentlinks .= "<a href=\"".encode_url($wife->getLinkUrl()."&tab={$tabno}")."\">"; + $parentlinks .= "<a href=\"".$wife->getHtmlUrl()."&tab={$tabno}"."\">"; $parentlinks .= " ".PrintReady($wife->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -584,7 +584,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($husb || $num>0) { if ($husb) { $person_step="Yes"; - $parentlinks .= "<a href=\"".encode_url($husb->getLinkUrl()."&tab={$tabno}")."\">"; + $parentlinks .= "<a href=\"".$husb->getHtmlUrl()."&tab={$tabno}"."\">"; $parentlinks .= " ".PrintReady($husb->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -598,7 +598,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($wife || $num>0) { if ($wife) { $person_step="Yes"; - $parentlinks .= "<a href=\"".encode_url($wife->getLinkUrl()."&tab={$tabno}")."\">"; + $parentlinks .= "<a href=\"".$wife->getHtmlUrl()."&tab={$tabno}"."\">"; $parentlinks .= " ".PrintReady($wife->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -619,7 +619,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { // Spouse ------------------------------ if ($spouse || $num>0) { if ($spouse) { - $spouselinks .= "<a href=\"".encode_url($spouse->getLinkUrl()."&tab={$tabno}")."\">"; + $spouselinks .= "<a href=\"".$spouse->getHtmlUrl()."&tab={$tabno}"."\">"; $spouselinks .= " ".PrintReady($spouse->getFullName()); $spouselinks .= "</a>"; if ($spouse->getFullName() != "") { @@ -627,16 +627,16 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { } } } - $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">\n"; + $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; // Children ------------------------------ @var $child Person foreach($children as $c=>$child) { if ($child) { $persons="Yes"; $spouselinks .= "<li>"; - $spouselinks .= "<a href=\"".encode_url($child->getLinkUrl()."&tab={$tabno}")."\">"; + $spouselinks .= "<a href=\"".$child->getHtmlUrl()."&tab={$tabno}"."\">"; $spouselinks .= PrintReady($child->getFullName()); $spouselinks .= "</a>"; - $spouselinks .= "</li>\n"; + $spouselinks .= "</li>"; } } $spouselinks .= "</ul>"; @@ -644,13 +644,13 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { } if ($persons != "Yes") { - $spouselinks .= " (".i18n::translate('none').")\n\t\t"; + $spouselinks .= " (".i18n::translate('none').")"; } if ($person_parent != "Yes") { - $parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")\n\t\t"; + $parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")"; } if ($person_step != "Yes") { - $step_parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")\n\t\t"; + $step_parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")"; } } } diff --git a/includes/functions/functions.php b/includes/functions/functions.php index 0a85f59150..d1f4432c14 100644 --- a/includes/functions/functions.php +++ b/includes/functions/functions.php @@ -110,23 +110,6 @@ function safe_REQUEST($arr, $var, $regex=WT_REGEX_NOSCRIPT, $default=null) { } } -function encode_url($url, $entities=true) { - $url = decode_url($url, $entities); // Make sure we don't do any double conversions - $url = str_replace(array(' ', '+', '@#', '"', "'"), array('%20', '%2b', '@%23', '%22', '%27'), $url); - if ($entities) { - $url = htmlspecialchars($url); - } - return $url; -} - -function decode_url($url, $entities=true) { - if ($entities) { - $url = html_entity_decode($url, ENT_COMPAT, 'UTF-8'); - } - $url = rawurldecode($url); // GEDCOM names can legitimately contain " " and "+" - return $url; -} - function preg_match_recursive($regex, $var) { if (is_scalar($var)) { return preg_match($regex, $var); @@ -315,7 +298,7 @@ function wt_error_handler($errno, $errstr, $errfile, $errline) { if (stristr($errstr, "by reference")==true) { return; } - $fmt_msg="\n<br />ERROR {$errno}: {$errstr}<br />\n"; + $fmt_msg="<br />ERROR {$errno}: {$errstr}<br />"; $log_msg="ERROR {$errno}: {$errstr};"; // Although debug_backtrace should always exist in PHP5, without this check, PHP sometimes crashes. // Possibly calling it generates an error, which causes infinite recursion?? @@ -341,7 +324,7 @@ function wt_error_handler($errno, $errstr, $errfile, $errline) { $fmt_msg.=" in function <b>".$backtrace[$i+1]['function']."</b>"; $log_msg.=" in function ".$backtrace[$i+1]['function']; } - $fmt_msg.="<br />\n"; + $fmt_msg.="<br />"; } } echo $fmt_msg; @@ -366,7 +349,6 @@ function wt_error_handler($errno, $errstr, $errfile, $errline) { */ function get_first_tag($level, $tag, $gedrec, $num=1) { $temp = get_sub_record($level, $level." ".$tag, $gedrec, $num)."\n"; - $temp = str_replace("\r\n", "\n", $temp); $length = strpos($temp, "\n"); if ($length===false) { $length = strlen($temp); @@ -405,7 +387,7 @@ function get_sub_record($level, $tag, $gedrec, $num=1) { $pos1=0; $subrec = ""; $tag = trim($tag); - $searchTarget = "~[\r\n]".$tag."[\s]~"; + $searchTarget = "~[\n]".$tag."[\s]~"; $ct = preg_match_all($searchTarget, $gedrec, $match, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); if ($ct==0) { $tag = preg_replace('/(\w+)/', "_$1", $tag); @@ -713,7 +695,7 @@ function breakConts($newline) { } $newged = ""; - $newlines = preg_split("/\r?\n/", rtrim(stripLRMRLM($newline))); + $newlines = preg_split("/\n/", rtrim(stripLRMRLM($newline))); for ($k=0; $k<count($newlines); $k++) { if ($k>0) { $newlines[$k] = "{$level} CONT ".$newlines[$k]; @@ -3075,10 +3057,10 @@ function get_query_string() { foreach ($_GET as $key => $value) { if ($key != "view") { if (!is_array($value)) { - $qstring .= "{$key}={$value}&"; + $qstring .= "&{$key}={$value}"; } else { foreach ($value as $k=>$v) { - $qstring .= "{$key}[{$k}]={$v}&"; + $qstring .= "&{$key}[{$k}]={$v}"; } } } @@ -3088,11 +3070,11 @@ function get_query_string() { foreach ($_POST as $key => $value) { if ($key != "view") { if (!is_array($value)) { - $qstring .= "{$key}={$value}&"; + $qstring .= "&{$key}={$value}"; } else { foreach ($value as $k=>$v) { if (!is_array($v)) { - $qstring .= "{$key}[{$k}]={$v}&"; + $qstring .= "&{$key}[{$k}]={$v}"; } } } @@ -3100,8 +3082,8 @@ function get_query_string() { } } } - $qstring = rtrim($qstring, "&"); // Remove trailing "&" - return encode_url($qstring); + $qstring = substr($qstring, 5); // Remove leading "&" + return $qstring; } //This function works with a specified generation limit. It will completely fill @@ -3363,28 +3345,28 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi require_once WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; switch ($type) { case 'url_flv': - $url = encode_url('js/jw_player/flvVideo.php?flvVideo='.($fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); + $url = 'js/jw_player/flvVideo.php?flvVideo='.rawurlencode($fileName) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); break 2; case 'local_flv': - $url = encode_url('js/jw_player/flvVideo.php?flvVideo='.(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); + $url = 'js/jw_player/flvVideo.php?flvVideo='.rawurlencode(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); break 2; case 'url_wmv': - $url = encode_url('js/jw_player/wmvVideo.php?wmvVideo='.($fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); + $url = 'js/jw_player/wmvVideo.php?wmvVideo='.rawurlencode($fileName) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); break 2; case 'local_audio': case 'local_wmv': - $url = encode_url('js/jw_player/wmvVideo.php?wmvVideo='.(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); + $url = 'js/jw_player/wmvVideo.php?wmvVideo='.rawurlencode(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); break 2; case 'url_image': case 'local_image': - $url = encode_url($fileName) . "\" rel=\"clearbox[general]\" rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); + $url = $fileName . "\" rel=\"clearbox[general]\" rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); break 2; case 'url_picasa': case 'url_page': case 'url_other': case 'local_page': // case 'local_other': - $url = encode_url($fileName) . "\" rel='clearbox({$LB_URL_WIDTH}, {$LB_URL_HEIGHT}, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); + $url = $fileName . "\" rel='clearbox({$LB_URL_WIDTH}, {$LB_URL_HEIGHT}, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes); break 2; case 'url_streetview': if (WT_SCRIPT_NAME != "media.php") { @@ -3397,32 +3379,32 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi // Lightbox is not installed or Lightbox is not appropriate for this media type switch ($type) { case 'url_flv': - $url = "javascript:;\" onclick=\" var winflv = window.open('".encode_url('js/jw_player/flvVideo.php?flvVideo='.($fileName)) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; + $url = "javascript:;\" onclick=\" var winflv = window.open('".'js/jw_player/flvVideo.php?flvVideo='.rawurlencode($fileName) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; break 2; case 'local_flv': - $url = "javascript:;\" onclick=\" var winflv = window.open('".encode_url('js/jw_player/flvVideo.php?flvVideo='.(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName)) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; + $url = "javascript:;\" onclick=\" var winflv = window.open('".'js/jw_player/flvVideo.php?flvVideo='.rawurlencode(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; break 2; case 'url_wmv': - $url = "javascript:;\" onclick=\" var winwmv = window.open('".encode_url('js/jw_player/wmvVideo.php?wmvVideo='.($fileName)) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; + $url = "javascript:;\" onclick=\" var winwmv = window.open('".'js/jw_player/wmvVideo.php?wmvVideo='.rawurlencode($fileName) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; break 2; case 'local_wmv': case 'local_audio': - $url = "javascript:;\" onclick=\" var winwmv = window.open('".encode_url('js/jw_player/wmvVideo.php?wmvVideo='.(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName)) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; + $url = "javascript:;\" onclick=\" var winwmv = window.open('".'js/jw_player/wmvVideo.php?wmvVideo='.rawurlencode(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; break 2; case 'url_image': $imgsize = findImageSize($fileName); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; - $url = "javascript:;\" onclick=\"var winimg = window.open('".encode_url($fileName)."', 'winimg', 'width=".$imgwidth.", height=".$imgheight.", left=200, top=200'); if (window.focus) {winimg.focus();}"; + $url = "javascript:;\" onclick=\"var winimg = window.open('".$fileName."', 'winimg', 'width=".$imgwidth.", height=".$imgheight.", left=200, top=200'); if (window.focus) {winimg.focus();}"; break 2; case 'url_picasa': case 'url_page': case 'url_other': case 'local_other'; - $url = "javascript:;\" onclick=\"var winurl = window.open('".encode_url($fileName)."', 'winurl', 'width=900, height=600, left=200, top=200'); if (window.focus) {winurl.focus();}"; + $url = "javascript:;\" onclick=\"var winurl = window.open('".$fileName."', 'winurl', 'width=900, height=600, left=200, top=200'); if (window.focus) {winurl.focus();}"; break 2; case 'local_page': - $url = "javascript:;\" onclick=\"var winurl = window.open('".encode_url(WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName)."', 'winurl', 'width=900, height=600, left=200, top=200'); if (window.focus) {winurl.focus();}"; + $url = "javascript:;\" onclick=\"var winurl = window.open('".WT_SERVER_NAME.WT_SCRIPT_PATH.$fileName."', 'winurl', 'width=900, height=600, left=200, top=200'); if (window.focus) {winurl.focus();}"; break 2; case 'url_streetview': echo '<iframe style="float:left; padding:5px;" width="264" height="176" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="', $fileName, '&output=svembed"></iframe>'; @@ -3430,7 +3412,7 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi break 2; } if ($USE_MEDIA_VIEWER && $obeyViewerOption) { - $url = encode_url('mediaviewer.php?mid='.$mid); + $url = 'mediaviewer.php?mid='.$mid; } else { $imgsize = findImageSize($fileName); $imgwidth = $imgsize[0]+40; diff --git a/includes/functions/functions_mediadb.php b/includes/functions/functions_mediadb.php index 96019b2bc2..694ae0db8a 100644 --- a/includes/functions/functions_mediadb.php +++ b/includes/functions/functions_mediadb.php @@ -984,14 +984,14 @@ function process_uploadMedia_form() { } } // Let's see if there are any errors generated and print it - if (!empty($error)) echo '<span class="error">', $error, "</span><br />\n"; + if (!empty($error)) echo '<span class="error">', $error, "</span><br />"; // No errors found then tell the user all is successful else { print i18n::translate('Upload successful.')."<br /><br />"; $imgsize = findImageSize($folderName.$mediaFile); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; - print "<a href=\"#\" onclick=\"return openImage('".encode_url($folderName.$mediaFile)."', $imgwidth, $imgheight);\">".$mediaFile."</a>"; + print "<a href=\"#\" onclick=\"return openImage('".htmlspecialchars($folderName.$mediaFile)."', $imgwidth, $imgheight);\">".$mediaFile."</a>"; print"<br /><br />"; } } @@ -1028,7 +1028,7 @@ function show_mediaUpload_form($URL='media.php', $showthumb=false) { if (empty($filesize)) $filesize = "2M"; // Print the form - echo '<form name="uploadmedia" enctype="multipart/form-data" method="post" action="', encode_url($URL), '">'; + echo '<form name="uploadmedia" enctype="multipart/form-data" method="post" action="', $URL, '">'; echo '<input type="hidden" name="action" value="upload" />'; echo '<input type="hidden" name="showthumb" value="', $showthumb, '" />'; echo '<table class="list_table ', $TEXT_DIRECTION, ' width100">'; @@ -1083,20 +1083,20 @@ function show_mediaUpload_form($URL='media.php', $showthumb=false) { echo '</td>'; echo '<td class="optionbox ', $TEXT_DIRECTION, ' wrap">'; - echo '<span dir="ltr"><select name="folder_list', $i, '" onchange="document.uploadmedia.folder', $i, '.value=this.options[this.selectedIndex].value;">', "\n"; + echo '<span dir="ltr"><select name="folder_list', $i, '" onchange="document.uploadmedia.folder', $i, '.value=this.options[this.selectedIndex].value;">'; echo '<option'; echo ' value="/"> ', i18n::translate('Choose: '), ' </option>'; - if (WT_USER_IS_ADMIN) echo '<option value="other" disabled>', i18n::translate('Other folder... please type in'), "</option>\n"; + if (WT_USER_IS_ADMIN) echo '<option value="other" disabled>', i18n::translate('Other folder... please type in'), "</option>"; foreach ($mediaFolders as $f) { if (!strpos($f, ".svn")) { //Do not print subversion directories // Strip $MEDIA_DIRECTORY from the folder name if (substr($f, 0, strlen($MEDIA_DIRECTORY)) == $MEDIA_DIRECTORY) $f = substr($f, strlen($MEDIA_DIRECTORY)); if ($f == '') $f = '/'; echo '<option value="', $f, '"'; - echo '>', $f, "</option>\n"; + echo '>', $f, "</option>"; } } - print "</select></span>\n"; + print "</select></span>"; if (WT_USER_IS_ADMIN) { echo '<br /><span dir="ltr"><input name="folder', $i, '" type="text" size="40" value="" onblur="checkpath(this)" /></span>'; if ($i==1) echo '<br /><sub>', i18n::translate('You can enter up to %s folder names to follow the default «%s».<br />Do not enter the «%s» part of the destination folder name.', $MEDIA_DIRECTORY_LEVELS, $MEDIA_DIRECTORY, $MEDIA_DIRECTORY), '</sub>'; @@ -1135,15 +1135,15 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = $AUTO_GENERATE_THUMBS=get_gedcom_setting(WT_GED_ID, 'AUTO_GENERATE_THUMBS'); // NOTE: add a table and form to easily add new values to the table - echo "<form method=\"post\" name=\"newmedia\" action=\"addmedia.php\" enctype=\"multipart/form-data\">\n"; - echo "<input type=\"hidden\" name=\"action\" value=\"", $action, "\" />\n"; - echo "<input type=\"hidden\" name=\"ged\" value=\"", WT_GEDCOM, "\" />\n"; - echo "<input type=\"hidden\" name=\"pid\" value=\"", $pid, "\" />\n"; + echo "<form method=\"post\" name=\"newmedia\" action=\"addmedia.php\" enctype=\"multipart/form-data\">"; + echo "<input type=\"hidden\" name=\"action\" value=\"", $action, "\" />"; + echo "<input type=\"hidden\" name=\"ged\" value=\"", WT_GEDCOM, "\" />"; + echo "<input type=\"hidden\" name=\"pid\" value=\"", $pid, "\" />"; if (!empty($linktoid)) { - echo "<input type=\"hidden\" name=\"linktoid\" value=\"", $linktoid, "\" />\n"; + echo "<input type=\"hidden\" name=\"linktoid\" value=\"", $linktoid, "\" />"; } - echo "<input type=\"hidden\" name=\"level\" value=\"", $level, "\" />\n"; - echo "<table class=\"facts_table center ", $TEXT_DIRECTION, "\">\n"; + echo "<input type=\"hidden\" name=\"level\" value=\"", $level, "\" />"; + echo "<table class=\"facts_table center ", $TEXT_DIRECTION, "\">"; echo "<tr><td class=\"topbottombar\" colspan=\"2\">"; if ($action == "newentry") { echo i18n::translate('Add a new media item'); @@ -1159,7 +1159,7 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = print_findindi_link("gid", ""); print_findfamily_link("gid"); print_findsource_link("gid"); - echo "<br /><sub>", i18n::translate('Enter or search for the ID of the person, family, or source to which this media item should be linked.'), "</sub></td></tr>\n"; + echo "<br /><sub>", i18n::translate('Enter or search for the ID of the person, family, or source to which this media item should be linked.'), "</sub></td></tr>"; } $gedrec=find_gedcom_record($pid, WT_GED_ID, true); @@ -1233,11 +1233,11 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = $folder = $parts["dirname"] . "/"; } - echo "\n<tr>"; - echo "<td class=\"descriptionbox $TEXT_DIRECTION wrap width25\">\n"; + echo "<tr>"; + echo "<td class=\"descriptionbox $TEXT_DIRECTION wrap width25\">"; echo "<input name=\"oldFilename\" type=\"hidden\" value=\"" . htmlspecialchars($fileName) . "\" />"; echo i18n::translate('File name on server'), help_link('upload_server_file'); - echo "</td>\n"; + echo "</td>"; echo "<td class=\"optionbox wrap $TEXT_DIRECTION wrap\">"; if (WT_USER_GEDCOM_ADMIN) { echo "<input name=\"filename\" type=\"text\" value=\"" . htmlspecialchars($fileName) . "\" size=\"40\""; @@ -1273,11 +1273,11 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = //-- don't let regular users change the location of media items if ($action!='update' || WT_USER_GEDCOM_ADMIN) { $mediaFolders = get_media_folders(); - echo '<span dir="ltr"><select name="folder_list" onchange="document.newmedia.folder.value=this.options[this.selectedIndex].value;">', "\n"; + echo '<span dir="ltr"><select name="folder_list" onchange="document.newmedia.folder.value=this.options[this.selectedIndex].value;">'; echo '<option'; if ($folder == '/') echo ' selected="selected"'; echo ' value="/"> ', i18n::translate('Choose: '), ' </option>'; - if (WT_USER_IS_ADMIN) echo '<option value="other" disabled>', i18n::translate('Other folder... please type in'), "</option>\n"; + if (WT_USER_IS_ADMIN) echo '<option value="other" disabled>', i18n::translate('Other folder... please type in'), "</option>"; foreach ($mediaFolders as $f) { if (!strpos($f, ".svn")) { //Do not print subversion directories // Strip $MEDIA_DIRECTORY from the folder name @@ -1286,10 +1286,10 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = echo '<option value="', $f, '"'; if ($folder == $f && $f != '/') echo ' selected="selected"'; - echo '>', $f, "</option>\n"; + echo '>', $f, "</option>"; } } - print "</select></span>\n"; + print "</select></span>"; } else echo $folder; echo '<input name="oldFolder" type="hidden" value="', addslashes($folder), '" />'; @@ -1468,18 +1468,18 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = } if (WT_USER_IS_ADMIN) { echo "<tr><td class=\"descriptionbox ", $TEXT_DIRECTION, " wrap width25\">"; - echo i18n::translate('Admin Option'), help_link('no_update_CHAN'), "</td><td class=\"optionbox wrap\">\n"; + echo i18n::translate('Admin Option'), help_link('no_update_CHAN'), "</td><td class=\"optionbox wrap\">"; if ($NO_UPDATE_CHAN) { - echo "<input type=\"checkbox\" checked=\"checked\" name=\"preserve_last_changed\" />\n"; + echo "<input type=\"checkbox\" checked=\"checked\" name=\"preserve_last_changed\" />"; } else { - echo "<input type=\"checkbox\" name=\"preserve_last_changed\" />\n"; + echo "<input type=\"checkbox\" name=\"preserve_last_changed\" />"; } - echo i18n::translate('Do not update the CHAN (Last Change) record'), "<br />\n"; + echo i18n::translate('Do not update the CHAN (Last Change) record'), "<br />"; $event = new Event(get_sub_record(1, "1 CHAN", $gedrec)); echo format_fact_date($event, false, true); - echo "</td></tr>\n"; + echo "</td></tr>"; } - print "</table>\n"; + print "</table>"; ?> <script language="JavaScript" type="text/javascript"> var formid = '<?php echo $formid; ?>'; @@ -1502,7 +1502,7 @@ function show_media_form($pid, $action = "newentry", $filename = "", $linktoid = print_add_layer("SHARED_NOTE", 1); print_add_layer("RESN", 1); print "<input type=\"submit\" value=\"" . i18n::translate('Save') . "\" />"; - print "</form>\n"; + print "</form>"; } // looks in both the standard and protected media directories @@ -1583,7 +1583,7 @@ function PrintMediaLinks($links, $size = "small") { if ($prev_record && $prev_record->getType()!=$record->getType()) { echo '<br />'; } - echo '<br /><a href="', encode_url($record->getLinkUrl()), '">'; + echo '<br /><a href="', $record->getHtmlUrl(), '">'; switch ($record->getType()) { case 'INDI': echo i18n::translate('View Person'); diff --git a/includes/functions/functions_places.php b/includes/functions/functions_places.php index feae04b1bf..eada0cb502 100644 --- a/includes/functions/functions_places.php +++ b/includes/functions/functions_places.php @@ -289,7 +289,7 @@ function print_place_subfields($element_id) { $cols=40; print " <a href=\"javascript:;\" onclick=\"expand_layer('".$element_id."_div'); toggleplace('".$element_id."'); return false;\"><img id=\"".$element_id."_div_img\" src=\"".$WT_IMAGES["plus"]."\" border=\"0\" width=\"11\" height=\"11\" alt=\"\" title=\"\" /> </a>"; - print "<br /><div id=\"".$element_id."_div\" style=\"display: none; border-width:thin; border-style:none; padding:0px\">\n"; + print "<br /><div id=\"".$element_id."_div\" style=\"display: none; border-width:thin; border-style:none; padding:0px\">"; // subtags creation : _0 _1 _2 etc... $icountry=-1; $istate=-1; @@ -326,28 +326,28 @@ function print_place_subfields($element_id) { print " onblur=\"updatewholeplace('".$element_id."'); splitplace('".$element_id."');\" "; print " onchange=\"updatewholeplace('".$element_id."'); splitplace('".$element_id."');\" "; print " onmouseout=\"updatewholeplace('".$element_id."'); splitplace('".$element_id."');\" "; - if ($icountry<$i and $i<=$icity) print " acdropdown=\"true\" autocomplete_list=\"url:".encode_url("places/getdata.php?localized=".WT_LOCALE."&field={$subtagname}&s=")."\" autocomplete=\"off\" autocomplete_matchbegin=\"false\""; - print " />\n"; + if ($icountry<$i and $i<=$icity) print " acdropdown=\"true\" autocomplete_list=\"url:places/getdata.php?localized=".WT_LOCALE."&field={$subtagname}&s=\" autocomplete=\"off\" autocomplete_matchbegin=\"false\""; + print " />"; // country selector if ($i==$icountry) { print " <img id=\"".$element_id."_PLAC_CTRY_flag\" name=\"".$element_id."_PLAC_CTRY_flag\" src=\"places/flags/blank.gif\" class=\"brightflag border1\" style=\"vertical-align:bottom\" alt=\"\" /> "; print "<select id=\"".$subtagid."_select\" name=\"".$subtagname."_select\" class=\"submenuitem\""; print " onchange=\"setPlaceCountry(this.value, '".$element_id."');\""; - print " >\n"; - print "<option value=\"???\">??? : ".i18n::translate('???')."</option>\n"; + print " >"; + print "<option value=\"???\">??? : ".i18n::translate('???')."</option>"; foreach (array_keys($iso3166) as $alpha3) { if ($alpha3!="???") { $txt=$alpha3." : ".i18n::translate($alpha3); if (utf8_strlen($txt)>32) $txt = utf8_substr($txt, 0, 32).i18n::translate('…'); - print "<option value=\"".$alpha3."\">".$txt."</option>\n"; + print "<option value=\"".$alpha3."\">".$txt."</option>"; } } - print "</select>\n"; + print "</select>"; } else { print_specialchar_link($subtagid, false); } // clickable map - if ($i<$icountry or $i>$icounty) print "<br />\n"; + if ($i<$icountry or $i>$icounty) print "<br />"; else print "<div id='".$subtagname."_div' name='".$subtagname."_div' style='overflow:hidden; height:32px; width:auto; border-width:thin; border-style:none;'><img name='".$subtagname."_img' src='".$WT_IMAGES["spacer"]."' usemap='usemap' border='0' alt='' title='' style='height:inherit; width:inherit;' /></div>"; } print "</div>"; @@ -359,13 +359,13 @@ function print_place_subfields($element_id) { */ function get_place_url($gedcom_place) { global $GEDCOM; - $exp = explode(",", $gedcom_place); + $exp = explode(', ', $gedcom_place); $level = count($exp); - $url = "placelist.php?action=show&level=".$level; + $url = "placelist.php?action=show&level=".$level; for ($i=0; $i<$level; $i++) { - $url .= "&parent[".$i."]=".trim($exp[$level-$i-1]); + $url .= "&parent[".$i."]=".rawurlencode($exp[$level-$i-1]); } - $url .= "&ged=".$GEDCOM; + $url .= "&ged=".rawurlencode($GEDCOM); return $url; } diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php index c0e061cc89..a62fe6c2d0 100644 --- a/includes/functions/functions_print.php +++ b/includes/functions/functions_print.php @@ -104,35 +104,35 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { // NOTE: Start div I.$pid.$personcount.$count.links $personlinks .= "<table class=\"person_box$isF\"><tr><td class=\"details1\">"; // NOTE: Zoom - $personlinks .= "<a href=\"".encode_url("pedigree.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&PEDIGREE_GENERATIONS={$OLD_PGENS}&talloffset={$talloffset}&ged={$GEDCOM}")."\" $mouseAction1><b>".i18n::translate('Pedigree Tree')."</b></a>"; + $personlinks .= "<a href=\"pedigree.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&Pamp;EDIGREE_GENERATIONS={$OLD_PGENS}&talloffset={$talloffset}&ged={$GEDCOM}\" $mouseAction1><b>".i18n::translate('Pedigree Tree')."</b></a>"; if (file_exists(WT_ROOT.'modules/googlemap/pedigree_map.php')) { - $personlinks .= "<br /><a href=\"".encode_url("module.php?mod=googlemap&mod_action=pedigree_map&rootid={$pid}&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Pedigree Map')."</b></a>"; + $personlinks .= "<br /><a href=\"module.php?mod=googlemap&mod_action=pedigree_map&rootid={$pid}&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Pedigree Map')."</b></a>"; } $username = WT_USER_NAME; if (!empty($username)) { $myid=WT_USER_GEDCOM_ID; if ($myid && $myid!=$pid) { - $personlinks .= "<br /><a href=\"".encode_url("relationship.php?show_full={$PEDIGREE_FULL_DETAILS}&pid1={$myid}&pid2={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&pretty=2&followspouse=1&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Relationship to me')."</b></a>"; + $personlinks .= "<br /><a href=\"relationship.php?show_full={$PEDIGREE_FULL_DETAILS}&pid1={$myid}&pid2={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&pretty=2&followspouse=1&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Relationship to me')."</b></a>"; } } - $personlinks .= "<br /><a href=\"".encode_url("descendancy.php?pid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&generations={$generations}&box_width={$box_width}&ged={$GEDCOM}")."\" $mouseAction1><b>".i18n::translate('Descendancy chart')."</b></a><br />"; + $personlinks .= "<br /><a href=\"descendancy.php?pid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&generations={$generations}&box_width={$box_width}&ged={$GEDCOM}\" $mouseAction1><b>".i18n::translate('Descendancy chart')."</b></a><br />"; if (file_exists(WT_ROOT.'ancestry.php')) { - $personlinks .= "<a href=\"".encode_url("ancestry.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&chart_style={$chart_style}&PEDIGREE_GENERATIONS={$OLD_PGENS}&box_width={$box_width}&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Ancestry chart')."</b></a><br />"; + $personlinks .= "<a href=\"ancestry.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&chart_style={$chart_style}&PEDIGREE_GENERATIONS={$OLD_PGENS}&box_width={$box_width}&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Ancestry chart')."</b></a><br />"; } if (file_exists(WT_ROOT.'compact.php')) { - $personlinks .= "<a href=\"".encode_url("compact.php?rootid={$pid}&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Compact Chart')."</b></a><br />"; + $personlinks .= "<a href=\"compact.php?rootid={$pid}&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Compact Chart')."</b></a><br />"; } if (file_exists(WT_ROOT.'fanchart.php') and defined("IMG_ARC_PIE") and function_exists("imagettftext")) { - $personlinks .= "<a href=\"".encode_url("fanchart.php?rootid={$pid}&PEDIGREE_GENERATIONS={$OLD_PGENS}&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Circle diagram')."</b></a><br />"; + $personlinks .= "<a href=\"fanchart.php?rootid={$pid}&PEDIGREE_GENERATIONS={$OLD_PGENS}&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Circle diagram')."</b></a><br />"; } if (file_exists(WT_ROOT.'hourglass.php')) { - $personlinks .= "<a href=\"".encode_url("hourglass.php?pid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&chart_style={$chart_style}&PEDIGREE_GENERATIONS={$OLD_PGENS}&box_width={$box_width}&ged={$GEDCOM}&show_spouse={$show_spouse}")."\" ".$mouseAction1."><b>".i18n::translate('Hourglass chart')."</b></a><br />"; + $personlinks .= "<a href=\"hourglass.php?pid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&chart_style={$chart_style}&PEDIGREE_GENERATIONS={$OLD_PGENS}&box_width={$box_width}&ged={$GEDCOM}&show_spouse={$show_spouse}\" ".$mouseAction1."><b>".i18n::translate('Hourglass chart')."</b></a><br />"; } if (file_exists(WT_ROOT.'treenav.php')) { - $personlinks .= "<a href=\"".encode_url("treenav.php?rootid={$pid}&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Interactive tree')."</b></a><br />"; + $personlinks .= "<a href=\"treenav.php?rootid={$pid}&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Interactive tree')."</b></a><br />"; } $fams = $person->getSpouseFamilies(); @@ -144,9 +144,9 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { $children = $family->getChildren(); $num = count($children); if ((!empty($spouse))||($num>0)) { - $personlinks .= "<a href=\"".encode_url("family.php?famid={$famid}&show_full=1&ged={$GEDCOM}")."\" ".$mouseAction1."><b>".i18n::translate('Family with spouse')."</b></a><br />"; + $personlinks .= "<a href=\"family.php?famid={$famid}&show_full=1&ged={$GEDCOM}\" ".$mouseAction1."><b>".i18n::translate('Family with spouse')."</b></a><br />"; if (!empty($spouse)) { - $personlinks .= "<a href=\"".encode_url($spouse->getLinkUrl())."\" $mouseAction1>"; + $personlinks .= "<a href=\"".$spouse->getHtmlUrl()."\" $mouseAction1>"; if ($spouse->canDisplayName()) $personlinks .= PrintReady($spouse->getFullName()); else $personlinks .= i18n::translate('Private'); $personlinks .= "</a><br />"; @@ -154,7 +154,7 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { } /* @var $child Person */ foreach($children as $c=>$child) { - $personlinks .= " <a href=\"".encode_url($child->getLinkUrl())."\" $mouseAction1>"; + $personlinks .= " <a href=\"".$child->getHtmlUrl()."\" $mouseAction1>"; if ($child->canDisplayName()) $personlinks .= PrintReady($child->getFullName()); else $personlinks .= i18n::translate('Private'); $personlinks .= "<br /></a>"; @@ -183,32 +183,32 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { if ($LINK_ICONS!="disabled") { $click_link="javascript:;"; if (WT_SCRIPT_NAME=='pedigree.php') { - $click_link=encode_url("pedigree.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&PEDIGREE_GENERATIONS={$OLD_PGENS}&talloffset={$talloffset}&ged={$GEDCOM}"); + $click_link="pedigree.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&PEDIGREE_GENERATIONS={$OLD_PGENS}&talloffset={$talloffset}&ged={$GEDCOM}"; $whichID=$pid; } if (WT_SCRIPT_NAME=='hourglass.php') { - $click_link=encode_url("hourglass.php?pid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&generations={$generations}&box_width={$box_width}&ged={$GEDCOM}"); + $click_link="hourglass.php?pid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&generations={$generations}&box_width={$box_width}&ged={$GEDCOM}"; $whichID=$pid; } if (WT_SCRIPT_NAME=='ancestry.php') { - $click_link=encode_url("ancestry.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&chart_style={$chart_style}&PEDIGREE_GENERATIONS={$OLD_PGENS}&box_width={$box_width}&ged={$GEDCOM}"); + $click_link="ancestry.php?rootid={$pid}&show_full={$PEDIGREE_FULL_DETAILS}&chart_style={$chart_style}&PEDIGREE_GENERATIONS={$OLD_PGENS}&box_width={$box_width}&ged={$GEDCOM}"; $whichID=$pid; } if (WT_SCRIPT_NAME=='descendancy.php') { - $click_link=encode_url("descendancy.php?&show_full={$PEDIGREE_FULL_DETAILS}&pid={$pid}&agenerations={$generations}&box_width={$box_width}&ged={$GEDCOM}"); + $click_link="descendancy.php?show_full={$PEDIGREE_FULL_DETAILS}&pid={$pid}&generations={$generations}&box_width={$box_width}&ged={$GEDCOM}"; $whichID=$pid; } if (WT_SCRIPT_NAME=='family.php' && !empty($famid)) { - $click_link=encode_url("family.php?famid={$famid}&show_full=1&ged={$GEDCOM}"); + $click_link="family.php?famid={$famid}&show_full=1&ged={$GEDCOM}"; $whichID=$famid; } if (WT_SCRIPT_NAME=='individual.php') { - $click_link=encode_url("individual.php?pid={$pid}&ged={$GEDCOM}"); + $click_link="individual.php?pid={$pid}&ged={$GEDCOM}"; $whichID=$pid; } @@ -263,7 +263,7 @@ function print_pedigree_person($pid, $style=1, $count=0, $personcount="1") { if (WT_USE_LIGHTBOX) { $thumbnail .= "<a href=\"" . $object["file"] . "\" rel=\"clearbox[general_2]\" rev=\"" . $object['mid'] . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">"; } else if (!empty($object['mid']) && $USE_MEDIA_VIEWER) { - $thumbnail .= "<a href=\"".encode_url("mediaviewer.php?mid=".$object['mid'])."\" >"; + $thumbnail .= "<a href=\"mediaviewer.php?mid=".$object['mid']."\" >"; } else { $thumbnail .= "<a href=\"javascript:;\" onclick=\"return openImage('".rawurlencode($object["file"])."', $imgwidth, $imgheight);\">"; } @@ -786,7 +786,8 @@ function print_favorite_selector($option=0) { $menu->addSubMenu($submenu); if ($gid!='') { - $submenu = new Menu('<em>'.i18n::translate('Add to My Favorites').'</em>', encode_url(WT_SCRIPT_NAME.normalize_query_string($QUERY_STRING.'&action=addfav&gid='.$gid)), "right"); + $url=$url=WT_SCRIPT_NAME.'?'.get_query_string(array('action'=>'addfav', 'gid'=>$gid)); + $submenu = new Menu('<em>'.i18n::translate('Add to My Favorites').'</em>', $url, "right"); $submenu->addClass("favsubmenuitem", "favsubmenuitem_hover"); $menu->addSubMenu($submenu); } @@ -795,14 +796,14 @@ function print_favorite_selector($option=0) { $GEDCOM = $favorite["file"]; $submenu = new Menu(); if ($favorite["type"]=="URL" && !empty($favorite["url"])) { - $submenu->addLink(encode_url($favorite["url"])); + $submenu->addLink($favorite["url"]); $submenu->addLabel(PrintReady($favorite["title"]), "right"); $submenu->addClass("favsubmenuitem", "favsubmenuitem_hover"); $menu->addSubMenu($submenu); } else { $record=GedcomRecord::getInstance($favorite["gid"]); if ($record && $record->canDisplayName()) { - $submenu->addLink(encode_url($record->getLinkUrl())); + $submenu->addLink($record->getHtmlUrl()); $slabel = PrintReady($record->getFullName()); $submenu->addLabel($slabel, "right"); $submenu->addClass("favsubmenuitem", "favsubmenuitem_hover"); @@ -822,14 +823,14 @@ function print_favorite_selector($option=0) { $GEDCOM = $favorite["file"]; $submenu = new Menu(); if ($favorite["type"]=="URL" && !empty($favorite["url"])) { - $submenu->addLink(encode_url($favorite["url"])); + $submenu->addLink($favorite["url"]); $submenu->addLabel(PrintReady($favorite["title"]), "right"); $submenu->addClass("favsubmenuitem", "favsubmenuitem_hover"); $menu->addSubMenu($submenu); } else { $record=GedcomRecord::getInstance($favorite["gid"]); if ($record && $record->canDisplayName()) { - $submenu->addLink(encode_url($record->getLinkUrl())); + $submenu->addLink($record->getHtmlUrl()); $slabel = PrintReady($record->getFullName()); $submenu->addLabel($slabel, "right"); $submenu->addClass("favsubmenuitem", "favsubmenuitem_hover"); @@ -855,7 +856,7 @@ function print_favorite_selector($option=0) { foreach($userfavs as $key=>$favorite) { $GEDCOM = $favorite["file"]; if ($favorite["type"]=="URL" && !empty($favorite["url"])) { - echo "<option value=\"", encode_url($favorite["url"]), "\">", PrintReady($favorite["title"]); + echo "<option value=\"", $favorite["url"], "\">", PrintReady($favorite["title"]); echo "</option>"; } else { switch ($favorite['type']) { @@ -880,7 +881,7 @@ function print_favorite_selector($option=0) { } if ($record && $record->canDisplayName()) { $name=$record->getFullName(); - echo "<option value=\"", encode_url($record->getLinkUrl()), "\">", $name, "</option>"; + echo "<option value=\"", $record->getHtmlUrl(), "\">", $name, "</option>"; } } } @@ -892,13 +893,13 @@ function print_favorite_selector($option=0) { echo "<optgroup label=\"", i18n::translate('This GEDCOM\'s Favorites'), "\">"; foreach($gedcomfavs as $key=>$favorite) { if ($favorite["type"]=="URL" && !empty($favorite["url"])) { - echo "<option value=\"", encode_url($favorite["url"]), "\">", PrintReady($favorite["title"]); + echo "<option value=\"", $favorite["url"], "\">", PrintReady($favorite["title"]); echo "</option>"; } else { $record=GedcomRecord::getInstance($favorite["gid"]); if ($record && $record->canDisplayName()) { $name=$record->getFullName(); - echo "<option value=\"", encode_url($record->getLinkUrl()), "\">", $name, "</option>"; + echo "<option value=\"", $record->getHtmlUrl(), "\">", $name, "</option>"; } } } @@ -1437,7 +1438,7 @@ function print_asso_rela_record($pid, $factrec, $linebr=false, $type='INDI') { } else { $label=''; } - echo '<a href="', $person->getLinkUrl().'">', $name, $relationship, '</a><br />', $label; + echo '<a href="', $person->getHtmlUrl().'">', $name, $relationship, '</a><br />', $label; } // Level 2 ASSO @@ -1491,7 +1492,7 @@ function print_asso_rela_record($pid, $factrec, $linebr=false, $type='INDI') { } break; } - echo '<br/>', $label, '<a href="', $person->getLinkUrl().'">', $name, '</a>', $relationship; + echo '<br/>', $label, '<a href="', $person->getHtmlUrl().'">', $name, '</a>', $relationship; } else { echo '<br/>', $label, $amatch[1]; } @@ -1709,19 +1710,17 @@ function format_fact_place(&$eventObj, $anchor=false, $sub=false, $lds=false) { $ct = preg_match("/2 PLAC (.*)/", $factrec, $match); if ($ct>0) { $html.=' '; - $levels = explode(',', $match[1]); + $levels = explode(', ', $match[1]); if ($anchor && (empty($SEARCH_SPIDER))) { $place = trim($match[1]); // reverse the array so that we get the top level first $levels = array_reverse($levels); - $tempURL = "placelist.php?action=show&"; + $tempURL = "placelist.php?action=show&"; foreach($levels as $pindex=>$ppart) { - // routine for replacing ampersands - $ppart = preg_replace("/amp\%3B/", "", trim($ppart)); - $tempURL .= "parent[{$pindex}]=".PrintReady($ppart).'&'; + $tempURL .= "parent[{$pindex}]=".rawurlencode($ppart).'&'; } $tempURL .= 'level='.count($levels); - $html .= '<a href="'.encode_url($tempURL).'"> '.PrintReady($place).'</a>'; + $html .= '<a href="'.$tempURL.'"> '.PrintReady($place).'</a>'; } else { if (!$SEARCH_SPIDER) { $html.=' -- '; @@ -1771,10 +1770,10 @@ function format_fact_place(&$eventObj, $anchor=false, $sub=false, $lds=false) { if ($map_lati && $map_long && empty($SEARCH_SPIDER)) { $map_lati=trim(strtr($map_lati, "NSEW,�", " - -. ")); // S5,6789 ==> -5.6789 $map_long=trim(strtr($map_long, "NSEW,�", " - -. ")); // E3.456� ==> 3.456 - $html.=' <a target="_BLANK" href="'.encode_url("http://www.mapquest.com/maps/map.adp?searchtype=address&formtype=latlong&latlongtype=decimal&latitude={$map_lati}&longitude={$map_long}").'"><img src="images/mapq.gif" border="0" alt="Mapquest ©" title="Mapquest ©" /></a>'; - $html.=' <a target="_BLANK" href="'.encode_url("http://maps.google.com/maps?q={$map_lati},{$map_long}(".encode_url($place).")").'"><img src="images/bubble.gif" border="0" alt="Google Maps ©" title="Google Maps ©" /></a>'; - $html.=' <a target="_BLANK" href="'.encode_url("http://www.multimap.com/map/browse.cgi?lat={$map_lati}&lon={$map_long}&scale=&icon=x").'"><img src="images/multim.gif" border="0" alt="Multimap ©" title="Multimap ©" /></a>'; - $html.=' <a target="_BLANK" href="'.encode_url("http://www.terraserver.com/imagery/image_gx.asp?cpx={$map_long}&cpy={$map_lati}&res=30&provider_id=340").'"><img src="images/terrasrv.gif" border="0" alt="TerraServer ©" title="TerraServer ©" /></a>'; + $html.=' <a target="_BLANK" href="'."http://www.mapquest.com/maps/map.adp?searchtype=address&formtype=latlong&latlongtype=decimal&latitude={$map_lati}&longitude={$map_long}".'"><img src="images/mapq.gif" border="0" alt="Mapquest ©" title="Mapquest ©" /></a>'; + $html.=' <a target="_BLANK" href="'."http://maps.google.com/maps?q={$map_lati},{$map_long}(".rawurlencode($place).")".'"><img src="images/bubble.gif" border="0" alt="Google Maps ©" title="Google Maps ©" /></a>'; + $html.=' <a target="_BLANK" href="'."http://www.multimap.com/map/browse.cgi?lat={$map_lati}&lon={$map_long}&scale=&icon=x".'"><img src="images/multim.gif" border="0" alt="Multimap ©" title="Multimap ©" /></a>'; + $html.=' <a target="_BLANK" href="'."http://www.terraserver.com/imagery/image_gx.asp?cpx={$map_long}&cpy={$map_lati}&res=30&provider_id=340".'"><img src="images/terrasrv.gif" border="0" alt="TerraServer ©" title="TerraServer ©" /></a>'; } if (preg_match('/\d NOTE (.*)/', $placerec, $match)) { ob_start(); diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php index 39f7eefdbb..b287458f91 100644 --- a/includes/functions/functions_print_facts.php +++ b/includes/functions/functions_print_facts.php @@ -141,8 +141,8 @@ function print_fact(&$eventObj, $noedit=false) { $factref = $fact; if ($styleadd=="") $rowID = "row_".floor(microtime()*1000000); else $rowID = "row_".$styleadd; - echo "\n\t\t<tr class=\"", $rowID, "\">"; - echo "\n\t\t\t<td class=\"descriptionbox $styleadd width20\">"; + echo "<tr class=\"", $rowID, "\">"; + echo "<td class=\"descriptionbox $styleadd width20\">"; if ($SHOW_FACT_ICONS) echo $eventObj->Icon(), ' '; if (!$noedit && WT_USER_CAN_EDIT && $styleadd!="change_old" && $linenum>0 && $eventObj->canEdit()) { @@ -165,7 +165,7 @@ function print_fact(&$eventObj, $noedit=false) { else $factref = $fact; if ($styleadd=="") $rowID = "row_".floor(microtime()*1000000); else $rowID = "row_".$styleadd; - echo "\n\t\t<tr class=\"", $rowID, "\">"; + echo "<tr class=\"", $rowID, "\">"; echo "<td class=\"descriptionbox $styleadd width20\">"; if ($SHOW_FACT_ICONS) echo $eventObj->Icon(), ' '; @@ -215,7 +215,7 @@ function print_fact(&$eventObj, $noedit=false) { if (preg_match("/_WTS @(.*)@/", $factrec, $match)) { $spouse=Person::getInstance($match[1]); if ($spouse) { - echo " <a href=\"", encode_url($spouse->getLinkUrl()), "\">"; + echo " <a href=\"", $spouse->getHtmlUrl(), "\">"; if ($spouse->canDisplayName()) { echo PrintReady($spouse->getFullName()); } else { @@ -225,7 +225,7 @@ function print_fact(&$eventObj, $noedit=false) { } if ($spouse) echo " - "; if (empty($SEARCH_SPIDER)) { - echo "<a href=\"", encode_url("family.php?famid={$pid}"), "\">"; + echo "<a href=\"family.php?famid={$pid}\">"; echo i18n::translate('View Family'); echo "</a>"; echo "<br />"; @@ -241,7 +241,7 @@ function print_fact(&$eventObj, $noedit=false) { $gedrec=GedcomRecord::getInstance($match[1]); if (is_object($gedrec)) { if ($gedrec->getType()=='INDI') { - echo '<a href="', encode_url($gedrec->getLinkUrl()), '">', $gedrec->getFullName(), '</a><br />'; + echo '<a href="', $gedrec->getHtmlUrl(), '">', $gedrec->getFullName(), '</a><br />'; } elseif ($fact=='REPO') { print_repository_record($match[1]); } else { @@ -294,14 +294,14 @@ function print_fact(&$eventObj, $noedit=false) { if ($ct>0) echo PrintReady($match[1]); // -- print PLACe, TEMPle and STATus echo '<div class="place">', format_fact_place($eventObj, true, true, true), '</div>'; - if (preg_match("/ (PLAC)|(STAT)|(TEMP)|(SOUR) /", $factrec)>0 || ($event && $fact!="ADDR")) print "<br />\n"; + if (preg_match("/ (PLAC)|(STAT)|(TEMP)|(SOUR) /", $factrec)>0 || ($event && $fact!="ADDR")) print "<br />"; // -- print BURIal -> CEMEtery $ct = preg_match("/2 CEME (.*)/", $factrec, $match); if ($ct>0) { if ($SHOW_FACT_ICONS && file_exists(WT_THEME_DIR."images/facts/CEME.gif")) //echo $eventObj->Icon(), ' '; // echo incorrect fact icon !!! echo "<img src=\"".WT_THEME_DIR."images/facts/CEME.gif\" alt=\"".translate_fact('CEME')."\" title=\"".translate_fact('CEME')."\" align=\"middle\" /> "; - echo "<b>", translate_fact('CEME'), ":</b> ", $match[1], "<br />\n"; + echo "<b>", translate_fact('CEME'), ":</b> ", $match[1], "<br />"; } //-- print address structure if ($fact!="ADDR") { @@ -331,7 +331,7 @@ function print_fact(&$eventObj, $noedit=false) { echo "<br/><span class=\"label\">", translate_fact('FAMC'), ":</span> "; $family=Family::getInstance($match[1]); if ($family) { // May be a pointer to a non-existant record - echo '<a href="', $family->getLinkUrl(), '">', $family->getFullName(), '</a>'; + echo '<a href="', $family->getHtmlUrl(), '">', $family->getFullName(), '</a>'; } else { echo '<span class="error">', $match[1], '</span>'; } @@ -407,7 +407,7 @@ function print_fact(&$eventObj, $noedit=false) { } echo "<br />"; echo "</td>"; - echo "\n\t\t</tr>"; + echo "</tr>"; } //------------------- end print fact function @@ -438,7 +438,7 @@ function print_submitter_info($sid) { function print_repository_record($xref) { $repository=Repository::getInstance($xref); if ($repository && $repository->canDisplayDetails()) { - echo '<a class="field" href="', $repository->getLinkUrl(), '">', $repository->getFullName(), '</a><br />'; + echo '<a class="field" href="', $repository->getHtmlUrl(), '">', $repository->getFullName(), '</a><br />'; print_address_structure($repository->getGedcomRecord(), 1); print_fact_notes($repository->getGedcomRecord(), 1); } @@ -483,7 +483,7 @@ function print_fact_sources($factrec, $level, $return=false) { $srec = substr($factrec, $spos1, $spos2-$spos1); $lt = preg_match_all("/$nlevel \w+/", $srec, $matches); $data .= "<br />"; - $data .= "\n\t\t<span class=\"label\">"; + $data .= "<span class=\"label\">"; $elementID = $sid."-".floor(microtime()*1000000); if ($EXPAND_SOURCES) $plusminus="minus"; else $plusminus="plus"; if ($lt>0) { @@ -494,7 +494,7 @@ function print_fact_sources($factrec, $level, $return=false) { $data .= i18n::translate('Source').":</span> <span class=\"field\">"; $source=Source::getInstance($sid); if ($source) { - $data .= "<a href=\"".encode_url($source->getLinkUrl())."\">".PrintReady($source->getFullName())."</a>"; + $data .= "<a href=\"".$source->getHtmlUrl()."\">".PrintReady($source->getFullName())."</a>"; } else { $data .= $sid; } @@ -574,24 +574,24 @@ function print_media_links($factrec, $level, $pid='') { //LBox -------- change for Lightbox Album -------------------------------------------- if (WT_USE_LIGHTBOX && preg_match("/\.(jpe?g|gif|png)$/i", $mainMedia)) { $name = trim($row["m_titl"]); - echo "<a href=\"" . $mainMedia . "\" rel=\"clearbox[general_1]\" rev=\"" . $media_id . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">" . "\n"; + echo "<a href=\"" . $mainMedia . "\" rel=\"clearbox[general_1]\" rev=\"" . $media_id . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">"; } else if (WT_USE_LIGHTBOX && preg_match("/\.(pdf|avi|txt)$/i", $mainMedia)) { require_once WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; $name = trim($row["m_titl"]); - echo "<a href=\"" . $mainMedia . "\" rel='clearbox({$LB_URL_WIDTH}, {$LB_URL_HEIGHT}, click)' rev=\"" . $media_id . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">" . "\n"; + echo "<a href=\"" . $mainMedia . "\" rel='clearbox({$LB_URL_WIDTH}, {$LB_URL_HEIGHT}, click)' rev=\"" . $media_id . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "\">"; // extra for Streetview ---------------------------------------- } else if (WT_USE_LIGHTBOX && strpos($row["m_file"], 'http://maps.google.')===0) { echo '<iframe style="float:left; padding:5px;" width="264" height="176" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="', $row["m_file"], '&output=svembed"></iframe>'; // -------------------------------------------------------------------------------------- } else if ($USE_MEDIA_VIEWER) { - echo "<a href=\"", encode_url("mediaviewer.php?mid={$media_id}"), "\">"; + echo "<a href=\"mediaviewer.php?mid={$media_id}\">"; } else if (preg_match("/\.(jpe?g|gif|png)$/i", $mainMedia)) { echo "<a href=\"javascript:;\" onclick=\"return openImage('", rawurlencode($mainMedia), "', $imgwidth, $imgheight);\">"; // extra for Streetview ---------------------------------------- } else if (strpos($row["m_file"], 'http://maps.google.')===0) { echo '<iframe width="300" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="', $row["m_file"], '&output=svembed"></iframe>'; } else { - echo "<a href=\"", encode_url("mediaviewer.php?mid={$media_id}"), "\">"; + echo "<a href=\"mediaviewer.php?mid={$media_id}\">"; } echo "<img src=\"", $thumbnail, "\" border=\"0\" align=\"" , $TEXT_DIRECTION== "rtl"?"right": "left" , "\" class=\"thumbnail\""; @@ -613,7 +613,7 @@ function print_media_links($factrec, $level, $pid='') { } echo "</td><td>"; if(empty($SEARCH_SPIDER)) { - echo "<a href=\"", encode_url("mediaviewer.php?mid={$media_id}"), "\">"; + echo "<a href=\"mediaviewer.php?mid={$media_id}\">"; } if ($TEXT_DIRECTION=="rtl" && !hasRTLText($mediaTitle)) echo "<i>" , getLRM() , PrintReady($mediaTitle), "</i>"; else echo "<i>", PrintReady($mediaTitle), "</i><br />"; @@ -624,15 +624,15 @@ function print_media_links($factrec, $level, $pid='') { echo print_fact_notes($row["m_gedrec"], 1); // NOTE: echo the format of the media if (!empty($row["m_ext"])) { - echo "\n\t\t\t<br /><span class=\"label\">", translate_fact('FORM'), ": </span> <span class=\"field\">", $row["m_ext"], "</span>"; + echo "<br /><span class=\"label\">", translate_fact('FORM'), ": </span> <span class=\"field\">", $row["m_ext"], "</span>"; if($imgsize[2]!==false) { - echo "\n\t\t\t<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">" , $imgsize[0] , ($TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM() . " ") : " x ") , $imgsize[1] , "</span>"; + echo "<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">" , $imgsize[0] , ($TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM() . " ") : " x ") , $imgsize[1] , "</span>"; } } if (preg_match('/2 DATE (.+)/', get_sub_record("FILE", 1, $row["m_gedrec"]), $match)) { $media_date=new GedcomDate($match[1]); $md = $media_date->Display(true); - echo "\n\t\t\t<br /><span class=\"label\">", translate_fact('DATE'), ": </span> ", $md; + echo "<br /><span class=\"label\">", translate_fact('DATE'), ": </span> ", $md; } $ttype = preg_match("/".($nlevel+1)." TYPE (.*)/", $row["m_gedrec"], $match); if ($ttype>0) { @@ -643,16 +643,16 @@ function print_media_links($factrec, $level, $pid='') { } else { $mediaType = i18n::translate('Other'); } - echo "\n\t\t\t<br /><span class=\"label\">", i18n::translate('Type'), ": </span> <span class=\"field\">$mediaType</span>"; + echo "<br /><span class=\"label\">", i18n::translate('Type'), ": </span> <span class=\"field\">$mediaType</span>"; } //echo "</span>"; - echo "<br />\n"; + echo "<br />"; //-- print spouse name for marriage events $ct = preg_match("/WT_SPOUSE: (.*)/", $factrec, $match); if ($ct>0) { $spouse=Person::getInstance($match[1]); if ($spouse) { - echo "<a href=\"", encode_url($spouse->getLinkUrl()), "\">"; + echo "<a href=\"", $spouse->getHtmlUrl(), "\">"; if ($spouse->canDisplayName()) { echo PrintReady($spouse->getFullName()); } else { @@ -665,15 +665,15 @@ function print_media_links($factrec, $level, $pid='') { if ($ct>0) { $famid = trim($match[1]); if(empty($SEARCH_SPIDER)) { - echo "<a href=\"", encode_url("family.php?famid={$famid}"), "\">", i18n::translate('View Family'); - echo "</a>\n"; + echo "<a href=\"family.php?famid={$famid}\">", i18n::translate('View Family'); + echo "</a>"; } } } - echo "<br />\n"; + echo "<br />"; print_fact_notes($row["m_gedrec"], $nlevel); print_fact_sources($row["m_gedrec"], $nlevel); - echo "</td></tr></table>\n"; + echo "</td></tr></table>"; } $objectNum ++; } @@ -699,9 +699,9 @@ function print_address_structure($factrec, $level) { for($i=0; $i<$ct; $i++) { $arec = get_sub_record($level, "$level ADDR", $factrec, $i+1); $resultText = ""; - if ($level>1) $resultText .= "\n\t\t<span class=\"label\">".translate_fact('ADDR').": </span><br /><div class=\"indent\">"; + if ($level>1) $resultText .= "<span class=\"label\">".translate_fact('ADDR').": </span><br /><div class=\"indent\">"; $cn = preg_match("/$nlevel _NAME (.*)/", $arec, $cmatch); - if ($cn>0) $resultText .= str_replace("/", "", $cmatch[1])."<br />\n"; + if ($cn>0) $resultText .= str_replace("/", "", $cmatch[1])."<br />"; $resultText .= PrintReady(trim($omatch[$i][1])); $cont = get_cont($nlevel, $arec); if (!empty($cont)) $resultText .= str_replace(array(" ", "<br "), array(" ", "<br "), PrintReady($cont)); @@ -758,7 +758,7 @@ function print_address_structure($factrec, $level) { $resultText .= "<br />".PrintReady($cmatch[1]); } } - if ($level>1) $resultText .= "</div>\n"; + if ($level>1) $resultText .= "</div>"; // Here we can examine the resultant text and remove empty tags echo $resultText; } @@ -768,36 +768,36 @@ function print_address_structure($factrec, $level) { if ($ct>0) { for($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; - $resultText .= "\n\t\t<td><span class=\"label\"><b>".translate_fact('PHON').": </b></span></td><td><span class=\"field\">"; + $resultText .= "<td><span class=\"label\"><b>".translate_fact('PHON').": </b></span></td><td><span class=\"field\">"; $resultText .= getLRM() . $omatch[$i][1] . getLRM(); - $resultText .= "</span></td></tr>\n"; + $resultText .= "</span></td></tr>"; } } $ct = preg_match_all("/$level FAX (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { for($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; - $resultText .= "\n\t\t<td><span class=\"label\"><b>".translate_fact('FAX').": </b></span></td><td><span class=\"field\">"; + $resultText .= "<td><span class=\"label\"><b>".translate_fact('FAX').": </b></span></td><td><span class=\"field\">"; $resultText .= getLRM() . $omatch[$i][1] . getLRM(); - $resultText .= "</span></td></tr>\n"; + $resultText .= "</span></td></tr>"; } } $ct = preg_match_all("/$level EMAIL (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { for($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; - $resultText .= "\n\t\t<td><span class=\"label\"><b>".translate_fact('EMAIL').": </b></span></td><td><span class=\"field\">"; - $resultText .= "<a href=\"mailto:".$omatch[$i][1]."\">".$omatch[$i][1]."</a>\n"; - $resultText .= "</span></td></tr>\n"; + $resultText .= "<td><span class=\"label\"><b>".translate_fact('EMAIL').": </b></span></td><td><span class=\"field\">"; + $resultText .= "<a href=\"mailto:".$omatch[$i][1]."\">".$omatch[$i][1]."</a>"; + $resultText .= "</span></td></tr>"; } } $ct = preg_match_all("/$level (WWW|URL) (.*)/", $factrec, $omatch, PREG_SET_ORDER); if ($ct>0) { for($i=0; $i<$ct; $i++) { $resultText .= "<tr>"; - $resultText .= "\n\t\t<td><span class=\"label\"><b>".translate_fact($omatch[$i][1]).": </b></span></td><td><span class=\"field\">"; - $resultText .= "<a href=\"".$omatch[$i][2]."\" target=\"_blank\">".$omatch[$i][2]."</a>\n"; - $resultText .= "</span></td></tr>\n"; + $resultText .= "<td><span class=\"label\"><b>".translate_fact($omatch[$i][1]).": </b></span></td><td><span class=\"field\">"; + $resultText .= "<a href=\"".$omatch[$i][2]."\" target=\"_blank\">".$omatch[$i][2]."</a>"; + $resultText .= "</span></td></tr>"; } } $resultText .= "</table>"; @@ -856,11 +856,11 @@ function print_main_sources($factrec, $level, $pid, $linenum, $noedit=false) { echo "</div>"; } else {echo translate_fact($factname, $parent);} echo "</td>"; - echo "\n\t\t\t<td class=\"optionbox $styleadd wrap\">"; - //echo "\n\t\t\t<td class=\"facts_value$styleadd\">"; + echo "<td class=\"optionbox $styleadd wrap\">"; + //echo "<td class=\"facts_value$styleadd\">"; $source=Source::getInstance($sid); if ($source) { - echo "<a href=\"", encode_url($source->getLinkUrl()), "\">", PrintReady($source->getFullName()), "</a>"; + echo "<a href=\"", $source->getHtmlUrl(), "\">", PrintReady($source->getFullName()), "</a>"; // PUBL $text = get_gedcom_value("PUBL", "1", $source->getGedcomRecord()); if (!empty($text)) { @@ -879,7 +879,7 @@ function print_main_sources($factrec, $level, $pid, $linenum, $noedit=false) { if ($cs>0) { echo "<br /><span class=\"label\">", translate_fact('EVEN'), " </span><span class=\"field\">", $cmatch[1], "</span>"; $cs = preg_match("/".($nlevel+1)." ROLE (.*)/", $srec, $cmatch); - if ($cs>0) echo "\n\t\t\t<br /> <span class=\"label\">", translate_fact('ROLE'), " </span><span class=\"field\">$cmatch[1]</span>"; + if ($cs>0) echo "<br /> <span class=\"label\">", translate_fact('ROLE'), " </span><span class=\"field\">$cmatch[1]</span>"; } if ($source) { echo printSourceStructure(getSourceStructure($srec)); @@ -1093,7 +1093,7 @@ function print_main_notes($factrec, $level, $pid, $linenum, $noedit=false) { } $text .= get_cont(1, $noterec); $text = expand_urls($text); - $text = PrintReady($text)." <br />\n"; + $text = PrintReady($text)." <br />"; // If Census assistant installed, and if Formatted Shared Note (using pipe "|" as delimiter) ------- if ( strstr($text, "|") && file_exists(WT_ROOT.'modules/GEDFact_assistant/_CENS/census_note_decode.php') ) { require WT_ROOT.'modules/GEDFact_assistant/_CENS/census_note_decode.php'; @@ -1119,7 +1119,7 @@ function print_main_notes($factrec, $level, $pid, $linenum, $noedit=false) { echo '<img src="images/RESN_', $resn_value, '.gif" alt="', $RESN_CODES[$resn_value], '" title="', $RESN_CODES[$resn_value], '" />'; echo help_link('RESN'); } - echo "<br />\n"; + echo "<br />"; print_fact_sources($nrec, $nlevel); } echo "</td></tr>"; @@ -1347,7 +1347,7 @@ function print_main_media_row($rtype, $rowm, $pid) { $isExternal = isFileExternal($thumbnail); $linenum = 0; - echo "\n\t\t<tr><td class=\"descriptionbox $styleadd width20\">"; + echo "<tr><td class=\"descriptionbox $styleadd width20\">"; if ($rowm['mm_gid']==$pid && WT_USER_CAN_EDIT && (!FactEditRestricted($rowm['m_media'], $rowm['m_gedrec'])) && ($styleadd!="change_old")) { echo "<a onclick=\"return window.open('addmedia.php?action=editmedia&pid={$rowm['m_media']}&linktoid={$rowm['mm_gid']}', '_blank', 'top=50, left=50, width=600, height=500, resizable=1, scrollbars=1');\" href=\"javascript:;\" title=\"".i18n::translate('Edit')."\">"; echo "<img class=\"icon\" src=\"", $WT_IMAGES["media"], "\" alt=\"\" />". translate_fact('OBJE'). "</a>"; @@ -1411,7 +1411,7 @@ function print_main_media_row($rtype, $rowm, $pid) { } if(empty($SEARCH_SPIDER)) { - echo "<a href=\"", encode_url("mediaviewer.php?mid={$rowm['m_media']}"), "\">"; + echo "<a href=\"mediaviewer.php?mid={$rowm['m_media']}\">"; } if ($TEXT_DIRECTION=="rtl" && !hasRTLText($mediaTitle)) { echo "<i>", getLRM(), PrintReady(htmlspecialchars($mediaTitle)); @@ -1420,10 +1420,10 @@ function print_main_media_row($rtype, $rowm, $pid) { } $addtitle = get_gedcom_value("TITL:_HEB", 2, $rowm["m_gedrec"]); if (empty($addtitle)) $addtitle = get_gedcom_value("TITL:_HEB", 1, $rowm["m_gedrec"]); - if (!empty($addtitle)) echo "<br />\n", PrintReady(htmlspecialchars($addtitle)); + if (!empty($addtitle)) echo "<br />", PrintReady(htmlspecialchars($addtitle)); $addtitle = get_gedcom_value("TITL:ROMN", 2, $rowm["m_gedrec"]); if (empty($addtitle)) $addtitle = get_gedcom_value("TITL:ROMN", 1, $rowm["m_gedrec"]); - if (!empty($addtitle)) echo "<br />\n", PrintReady(htmlspecialchars($addtitle)); + if (!empty($addtitle)) echo "<br />", PrintReady(htmlspecialchars($addtitle)); echo "</i>"; if(empty($SEARCH_SPIDER)) { echo "</a>"; @@ -1431,15 +1431,15 @@ function print_main_media_row($rtype, $rowm, $pid) { // NOTE: echo the format of the media if (!empty($rowm["m_ext"])) { - echo "\n\t\t\t<br /><span class=\"label\">", translate_fact('FORM'), ": </span> <span class=\"field\">", $rowm["m_ext"], "</span>"; + echo "<br /><span class=\"label\">", translate_fact('FORM'), ": </span> <span class=\"field\">", $rowm["m_ext"], "</span>"; if(isset($imgsize) and $imgsize[2]!==false) { - echo "\n\t\t\t<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imgsize[0], $TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM(). " ") : " x ", $imgsize[1], "</span>"; + echo "<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imgsize[0], $TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM(). " ") : " x ", $imgsize[1], "</span>"; } } if (preg_match('/2 DATE (.+)/', get_sub_record("FILE", 1, $rowm["m_gedrec"]), $match)) { $media_date=new GedcomDate($match[1]); $md = $media_date->Display(true); - echo "\n\t\t\t<br /><span class=\"label\">", translate_fact('DATE'), ": </span> ", $md; + echo "<br /><span class=\"label\">", translate_fact('DATE'), ": </span> ", $md; } $ttype = preg_match("/\d TYPE (.*)/", $rowm["m_gedrec"], $match); if ($ttype>0) { @@ -1450,10 +1450,10 @@ function print_main_media_row($rtype, $rowm, $pid) { } else { $mediaType = i18n::translate('Other'); } - echo "\n\t\t\t<br /><span class=\"label\">", i18n::translate('Type'), ": </span> <span class=\"field\">$mediaType</span>"; + echo "<br /><span class=\"label\">", i18n::translate('Type'), ": </span> <span class=\"field\">$mediaType</span>"; } echo "</span>"; - echo "<br />\n"; + echo "<br />"; //-- print spouse name for marriage events if ($rowm['mm_gid']!=$pid) { $spouse=null; @@ -1467,7 +1467,7 @@ function print_main_media_row($rtype, $rowm, $pid) { } } if ($spouse) { - echo "<a href=\"", $spouse->getLinkUrl(), "\">"; + echo "<a href=\"", $spouse->getHtmlUrl(), "\">"; if ($spouse->canDisplayName()) { echo PrintReady($spouse->getFullName()); } else { @@ -1478,10 +1478,10 @@ function print_main_media_row($rtype, $rowm, $pid) { if(empty($SEARCH_SPIDER)) { if ($spouse) echo " - "; $famid = $rowm['mm_gid']; - echo "<a href=\"", encode_url("family.php?famid={$famid}"), "\">", i18n::translate('View Family'); - echo "</a>\n"; + echo "<a href=\"family.php?famid={$famid}\">", i18n::translate('View Family'); + echo "</a>"; } - echo "<br />\n"; + echo "<br />"; } //-- don't show _PRIM option to regular users if (WT_USER_GEDCOM_ADMIN) { @@ -1489,7 +1489,7 @@ function print_main_media_row($rtype, $rowm, $pid) { if (!empty($prim)) { echo "<span class=\"label\">", translate_fact('_PRIM'), ":</span> "; if ($prim=="Y") echo i18n::translate('Yes'); else echo i18n::translate('No'); - echo "<br />\n"; + echo "<br />"; } } //-- don't show _THUM option to regular users @@ -1498,7 +1498,7 @@ function print_main_media_row($rtype, $rowm, $pid) { if (!empty($thum)) { echo "<span class=\"label\">", translate_fact('_THUM'), ":</span> "; if ($thum=="Y") echo i18n::translate('Yes'); else echo i18n::translate('No'); - echo "<br />\n"; + echo "<br />"; } } print_fact_notes($rowm["m_gedrec"], 1); diff --git a/includes/functions/functions_print_lists.php b/includes/functions/functions_print_lists.php index d921e476d2..1170b50788 100644 --- a/includes/functions/functions_print_lists.php +++ b/includes/functions/functions_print_lists.php @@ -126,7 +126,7 @@ function print_indi_table($datalist, $legend="", $option="") { echo "<th class=\"list_label\" style=\"display:none\">BIRT</th>"; echo "<th class=\"list_label\" style=\"display:none\">DEAT</th>"; echo "<th class=\"list_label\" style=\"display:none\">TREE</th>"; - echo "</tr></thead>\n"; + echo "</tr></thead>"; //-- table body echo "<tbody>"; $hidden = 0; @@ -198,7 +198,7 @@ function print_indi_table($datalist, $legend="", $option="") { $class='list_item'; $sex_image=''; } - echo '<a ', $title, ' href="', encode_url($person->getLinkUrl()), '" class="', $class, '">', PrintReady($name['list']), '</a>', $sex_image, "<br/>"; + echo '<a ', $title, ' href="', $person->getHtmlUrl(), '" class="', $class, '">', PrintReady($name['list']), '</a>', $sex_image, "<br/>"; } // Indi parents echo $person->getPrimaryParentsNames("parents_$table_id details1", 'none'); @@ -210,7 +210,7 @@ function print_indi_table($datalist, $legend="", $option="") { if ($option=='sosa') { echo '<td class="list_value_wrap"><a href="', - encode_url('relationship.php?pid1='.$datalist[1].'&pid2='.$person->getXref()), + 'relationship.php?pid1=', $datalist[1], '&pid2=', $person->getXref(), '" title="', i18n::translate('Relationship Chart'), '"', ' name="', $key, '" class="list_item name2">', $key, '</a></td>'; } @@ -257,7 +257,7 @@ function print_indi_table($datalist, $legend="", $option="") { echo get_place_short($birth_place), ' '; } else { echo '<div align="', get_align($birth_place), '">'; - echo '<a href="', encode_url(get_place_url($birth_place)), '" class="list_item" title="', $birth_place, '">'; + echo '<a href="', get_place_url($birth_place), '" class="list_item" title="', $birth_place, '">'; echo PrintReady(get_place_short($birth_place)), '</a>'; echo '</div>'; } @@ -269,7 +269,7 @@ function print_indi_table($datalist, $legend="", $option="") { //-- Number of children if ($tiny) { echo "<td class=\"list_value_wrap\">"; - echo "<a href=\"", encode_url($person->getLinkUrl()), "\" class=\"list_item\" name=\"", $person->getNumberOfChildren(), "\">", $person->getNumberOfChildren(), "</a>"; + echo "<a href=\"", $person->getHtmlUrl(), "\" class=\"list_item\" name=\"", $person->getNumberOfChildren(), "\">", $person->getNumberOfChildren(), "</a>"; echo "</td>"; } //-- Death date @@ -328,7 +328,7 @@ function print_indi_table($datalist, $legend="", $option="") { echo get_place_short($death_place), ' '; } else { echo '<div align="', get_align($death_place), '">'; - echo '<a href="', encode_url(get_place_url($death_place)), '" class="list_item" title="', $death_place, '">'; + echo '<a href="', get_place_url($death_place), '" class="list_item" title="', $death_place, '">'; echo PrintReady(get_place_short($death_place)), '</a>'; echo '</div>'; } @@ -373,7 +373,7 @@ function print_indi_table($datalist, $legend="", $option="") { echo "L"; // leaves } echo "</td>"; - echo "</tr>\n"; + echo "</tr>"; $unique_indis[$person->getXref()]=true; } echo "</tbody>"; @@ -408,7 +408,7 @@ function print_indi_table($datalist, $legend="", $option="") { echo "<td style=\"display:none\">TREE</td>"; echo "</tr>"; echo "</tfoot>"; - echo "</table>\n"; + echo "</table>"; echo "</div>"; //-- charts echo "<div class=\"", $table_id, "-charts\" style=\"display:none\">"; @@ -421,7 +421,7 @@ function print_indi_table($datalist, $legend="", $option="") { print_chart_by_age($deat_by_age, i18n::translate('Age related to death year')); echo "</td></tr></table>"; echo "</div>"; - echo "</fieldset>\n"; + echo "</fieldset>"; } /** @@ -497,9 +497,9 @@ function print_fam_table($datalist, $legend="", $option="") { echo "<th style=\"display:none\">MARR</th>"; echo "<th style=\"display:none\">DEAT</th>"; echo "<th style=\"display:none\">TREE</th>"; - echo "</tr></thead>\n"; + echo "</tr></thead>"; //-- table body - echo "<tbody>\n"; + echo "<tbody>"; $hidden = 0; $num = 0; $d100y=new GedcomDate(date('Y')-100); // 100 years ago @@ -546,10 +546,10 @@ function print_fam_table($datalist, $legend="", $option="") { if (!$husb->isDead()) $tdclass .= " alive"; if (!$husb->getChildFamilyIds()) $tdclass .= " patriarch"; echo "<td class=\"", $tdclass, "\" align=\"", get_align($names[$n1]['list']), "\">"; - echo "<a href=\"", encode_url($family->getLinkUrl()), "\" class=\"list_item name2\" dir=\"", $TEXT_DIRECTION, "\">", PrintReady($names[$n1]['list']), "</a>"; + echo "<a href=\"", $family->getHtmlUrl(), "\" class=\"list_item name2\" dir=\"", $TEXT_DIRECTION, "\">", PrintReady($names[$n1]['list']), "</a>"; if ($tiny) echo $husb->getSexImage(); if ($n1!=$n2) { - echo "<br /><a href=\"", encode_url($family->getLinkUrl()), "\" class=\"list_item\">", PrintReady($names[$n2]['list']), "</a>"; + echo "<br /><a href=\"", $family->getHtmlUrl(), "\" class=\"list_item\">", PrintReady($names[$n2]['list']), "</a>"; } // Husband parents echo $husb->getPrimaryParentsNames("parents_$table_id details1", "none"); @@ -592,10 +592,10 @@ function print_fam_table($datalist, $legend="", $option="") { if (!$wife->isDead()) $tdclass .= " alive"; if (!$wife->getChildFamilyIds()) $tdclass .= " patriarch"; echo "<td class=\"", $tdclass, "\" align=\"", get_align($names[$n1]['list']), "\">"; - echo "<a href=\"", encode_url($family->getLinkUrl()), "\" class=\"list_item name2\" dir=\"", $TEXT_DIRECTION, "\">", PrintReady($names[$n1]['list']), "</a>"; + echo "<a href=\"", $family->getHtmlUrl(), "\" class=\"list_item name2\" dir=\"", $TEXT_DIRECTION, "\">", PrintReady($names[$n1]['list']), "</a>"; if ($tiny) echo $wife->getSexImage(); if ($n1!=$n2) { - echo "<br /><a href=\"", encode_url($family->getLinkUrl()), "\" class=\"list_item\">", PrintReady($names[$n2]['list']), "</a>"; + echo "<br /><a href=\"", $family->getHtmlUrl(), "\" class=\"list_item\">", PrintReady($names[$n2]['list']), "</a>"; } // Wife parents echo $wife->getPrimaryParentsNames("parents_$table_id details1", "none"); @@ -677,7 +677,7 @@ function print_fam_table($datalist, $legend="", $option="") { echo get_place_short($marriage_place), ' '; } else { echo '<div align="', get_align($marriage_place), '">'; - echo '<a href="', encode_url(get_place_url($marriage_place)), '" class="list_item" title="', $marriage_place, '">'; + echo '<a href="', get_place_url($marriage_place), '" class="list_item" title="', $marriage_place, '">'; echo PrintReady(get_place_short($marriage_place)), '</a>'; echo '</div>'; } @@ -689,7 +689,7 @@ function print_fam_table($datalist, $legend="", $option="") { //-- Number of children if ($tiny) { echo "<td class=\"list_value_wrap\">"; - echo "<a href=\"", encode_url($family->getLinkUrl()), "\" class=\"list_item\" name=\"", $family->getNumberOfChildren(), "\">", $family->getNumberOfChildren(), "</a>"; + echo "<a href=\"", $family->getHtmlUrl(), "\" class=\"list_item\" name=\"", $family->getNumberOfChildren(), "\">", $family->getNumberOfChildren(), "</a>"; echo "</td>"; } //-- Last change @@ -730,7 +730,7 @@ function print_fam_table($datalist, $legend="", $option="") { echo "L"; // leaves } echo "</td>"; - echo "</tr>\n"; + echo "</tr>"; } echo "</tbody>"; //-- table footer @@ -759,7 +759,7 @@ function print_fam_table($datalist, $legend="", $option="") { echo "<td style=\"display:none\">DEAT</td>"; echo "<td style=\"display:none\">TREE</td>"; echo "</tr></tfoot>"; - echo "</table>\n"; + echo "</table>"; echo "</div>"; //-- charts echo "<div class=\"", $table_id, "-charts\" style=\"display:none\">"; @@ -772,7 +772,7 @@ function print_fam_table($datalist, $legend="", $option="") { print_chart_by_age($marr_by_age, i18n::translate('Age in year of marriage')); echo "</td></tr></table>"; echo "</div>"; - echo "</fieldset>\n"; + echo "</fieldset>"; } /** @@ -837,7 +837,7 @@ function print_sour_table($datalist, $legend=null) { if (!$source || !$source->canDisplayDetails()) { continue; } - $link_url=encode_url($source->getLinkUrl()); + $link_url=$source->getHtmlUrl(); //-- Counter echo '<tr><td class="list_value_wrap rela list_item">', ++$n, '</td>'; //-- Source name(s) @@ -874,7 +874,7 @@ function print_sour_table($datalist, $legend=null) { if ($SHOW_LAST_CHANGE) { print '<td class="list_value_wrap rela">'.$source->LastChangeTimestamp(empty($SEARCH_SPIDER)).'</td>'; } - echo "</tr>\n"; + echo "</tr>"; } //-- table footer echo '<tr class="sortbottom"><td></td>'; @@ -945,7 +945,7 @@ function print_note_table($datalist, $legend=null) { if (!$note->canDisplayDetails()) { continue; } - $link_url=encode_url($note->getLinkUrl()); + $link_url=$note->getHtmlUrl(); //-- Counter echo '<tr><td class="list_value_wrap rela list_item">', ++$n, '</td>'; //-- Shared Note name(s) @@ -967,7 +967,7 @@ function print_note_table($datalist, $legend=null) { if ($SHOW_LAST_CHANGE) { print '<td class="list_value_wrap rela">'.$note->LastChangeTimestamp(empty($SEARCH_SPIDER)).'</td>'; } - echo "</tr>\n"; + echo "</tr>"; } //-- table footer echo '<tr class="sortbottom"><td></td>'; @@ -1016,15 +1016,15 @@ function print_repo_table($repos, $legend='') { echo '<tr><td class="list_value_wrap rela list_item">', ++$n, '</td>'; //-- Repository name(s) $name = $repo->getFullName(); - echo '<td class="list_value_wrap" align="', get_align($name), '"><a href="', encode_url($repo->getLinkUrl()), '" class="list_item name2">', PrintReady(htmlspecialchars($name)), '</a>'; + echo '<td class="list_value_wrap" align="', get_align($name), '"><a href="', $repo->getHtmlUrl(), '" class="list_item name2">', PrintReady(htmlspecialchars($name)), '</a>'; $addname=$repo->getAddName(); if ($addname) { - echo '<br /><a href="', encode_url($repo->getLinkUrl()), '" class="list_item">', PrintReady(htmlspecialchars($addname)), '</a>'; + echo '<br /><a href="', $repo->getHtmlUrl(), '" class="list_item">', PrintReady(htmlspecialchars($addname)), '</a>'; } echo '</td>'; //-- Linked SOURces $tmp=$repo->countLinkedSources(); - echo '<td class="list_value_wrap"><a href="', encode_url($repo->getLinkUrl()), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; + echo '<td class="list_value_wrap"><a href="', $repo->getHtmlUrl(), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; //-- Last change if ($SHOW_LAST_CHANGE) { echo '<td class="list_value_wrap rela">', $repo->LastChangeTimestamp(!$SEARCH_SPIDER), '</td>'; @@ -1060,7 +1060,7 @@ function print_media_table($datalist, $legend="") { echo "<th class=\"list_label\">", i18n::translate('Families'), "</th>"; echo "<th class=\"list_label\">", i18n::translate('Sources'), "</th>"; if ($SHOW_LAST_CHANGE) echo "<th class=\"list_label rela\">", translate_fact('CHAN'), "</th>"; - echo "</tr>\n"; + echo "</tr>"; //-- table body $n = 0; foreach ($datalist as $key => $value) { @@ -1077,12 +1077,12 @@ function print_media_table($datalist, $legend="") { //-- Object name(s) $name = $media->getFullName(); echo "<td class=\"list_value_wrap\" align=\"", get_align($name), "\">"; - echo "<a href=\"", encode_url($media->getLinkUrl()), "\" class=\"list_item name2\">"; + echo "<a href=\"", $media->getHtmlUrl(), "\" class=\"list_item name2\">"; if ($media->canDisplayDetails()) echo '<img src=', thumbnail_file($media->file, false), ' height="15" /> '; echo PrintReady($name), "</a>"; if ($SHOW_MEDIA_FILENAME || WT_USER_IS_ADMIN) - echo "<br /><a href=\"", encode_url($media->getLinkUrl()), "\">", basename($media->file), "</a>"; + echo "<br /><a href=\"", $media->getHtmlUrl(), "\">", basename($media->file), "</a>"; //echo "<br />", $media->getFiletype(); //echo " ", $media->width, "x", $media->height; //echo " ", $media->getFilesize(), "kB"; @@ -1091,13 +1091,13 @@ function print_media_table($datalist, $legend="") { //-- Linked INDIs $tmp=$media->countLinkedIndividuals(); - echo '<td class="list_value_wrap"><a href="', encode_url($media->getLinkUrl()), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; + echo '<td class="list_value_wrap"><a href="', $media->getHtmlUrl(), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; //-- Linked FAMs $tmp=$media->countLinkedfamilies(); - echo '<td class="list_value_wrap"><a href="', encode_url($media->getLinkUrl()), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; + echo '<td class="list_value_wrap"><a href="', $media->getHtmlUrl(), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; //-- Linked SOURces $tmp=$media->countLinkedSources(); - echo '<td class="list_value_wrap"><a href="', encode_url($media->getLinkUrl()), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; + echo '<td class="list_value_wrap"><a href="', $media->getHtmlUrl(), '" class="list_item" name="', $tmp, '">', $tmp, '</a></td>'; /* //-- Linked records foreach (array("INDI", "FAM", "SOUR") as $rectype) { @@ -1110,17 +1110,17 @@ function print_media_table($datalist, $legend="") { } sort($resu); echo "<td class=\"list_value_wrap\" align=\"", get_align(@$resu[0]), "\">"; - foreach ($resu as $txt) echo "<a href=\"", encode_url($record->getLinkUrl()), "\" class=\"list_item\">", PrintReady("• ".$txt), "</a><br />"; + foreach ($resu as $txt) echo "<a href=\"", $record->getHtmlUrl(), "\" class=\"list_item\">", PrintReady("• ".$txt), "</a><br />"; echo "</td>"; } */ //-- Last change if ($SHOW_LAST_CHANGE) print "<td class=\"list_value_wrap rela\">".$media->LastChangeTimestamp(empty($SEARCH_SPIDER))."</td>"; - echo "</tr>\n"; + echo "</tr>"; } - echo "</table>\n"; - echo "</fieldset>\n"; + echo "</table>"; + echo "</fieldset>"; } // Print a table of surnames. @@ -1345,7 +1345,7 @@ function print_changes_table($change_ids) { echo "<th style=\"display:none\">GIVN</th>"; echo "<th class=\"list_label\">", translate_fact('CHAN'), "</th>"; echo "<th class=\"list_label\">", translate_fact('_WT_USER'), "</th>"; - echo "</tr>\n"; + echo "</tr>"; //-- table body $n = 0; $NMAX = 1000; @@ -1362,20 +1362,20 @@ function print_changes_table($change_ids) { //-- Record name(s) $name = $record->getFullName(); echo "<td class=\"list_value_wrap\" align=\"", get_align($name), "\">"; - echo "<a href=\"", encode_url($record->getLinkUrl()), "\" class=\"list_item name2\" dir=\"", $TEXT_DIRECTION, "\">", PrintReady($name), "</a>"; + echo "<a href=\"", $record->getHtmlUrl(), "\" class=\"list_item name2\" dir=\"", $TEXT_DIRECTION, "\">", PrintReady($name), "</a>"; if ($record->getType()=="INDI") { echo $record->getSexImage(); $indi=true; } $addname=$record->getAddName(); if ($addname) { - echo "<br /><a href=\"", encode_url($record->getLinkUrl()), "\" class=\"list_item\">", PrintReady($addname), "</a>"; + echo "<br /><a href=\"", $record->getHtmlUrl(), "\" class=\"list_item\">", PrintReady($addname), "</a>"; } if ($record->getType()=='INDI') { if ($SHOW_MARRIED_NAMES) { foreach ($record->getAllNames() as $name) { if ($name['type']=='_MARNM') { - echo "<br /><a title=\"_MARNM\" href=\"", encode_url($record->getLinkUrl()), "\" class=\"list_item\">", PrintReady($name['full']), "</a>"; + echo "<br /><a title=\"_MARNM\" href=\"", $record->getHtmlUrl(), "\" class=\"list_item\">", PrintReady($name['full']), "</a>"; } } } @@ -1391,7 +1391,7 @@ function print_changes_table($change_ids) { print "<td class=\"list_value_wrap rela\">".$record->LastChangeTimestamp(empty($SEARCH_SPIDER))."</td>"; //-- Last change user print "<td class=\"list_value_wrap rela\">".$record->LastChangeUser(empty($SEARCH_SPIDER))."</td>"; - echo "</tr>\n"; + echo "</tr>"; } //-- table footer echo "<tr class=\"sortbottom\">"; @@ -1410,7 +1410,7 @@ function print_changes_table($change_ids) { echo "<td></td>"; echo "<td></td>"; echo "</tr>"; - echo "</table>\n"; + echo "</table>"; } /** @@ -1472,11 +1472,11 @@ function print_events_table($startjd, $endjd, $events='BIRT MARR DEAT', $only_li $return .= "<th class=\"list_label\">".translate_fact('DATE')."</th>"; $return .= "<th class=\"list_label\"><img src=\"".$WT_IMAGES["reminder"]."\" alt=\"".i18n::translate('Anniversary')."\" title=\"".i18n::translate('Anniversary')."\" border=\"0\" /></th>"; $return .= "<th class=\"list_label\">".translate_fact('EVEN')."</th>"; - $return .= "</tr>\n"; + $return .= "</tr>"; } $value['name'] = $record->getListName(); - $value['url'] = $record->getLinkUrl(); + $value['url'] = $record->getHtmlUrl(); if ($record->getType()=="INDI") { $value['sex'] = $record->getSexImage(); } else { @@ -1505,7 +1505,7 @@ function print_events_table($startjd, $endjd, $events='BIRT MARR DEAT', $only_li $name = implode("<div></div>", $exp); // <div></div> is better here than <br /> } $return .= "<td class=\"list_value_wrap\" align=\"".get_align($name)."\">"; - $return .= "<a href=\"".encode_url($value['url'])."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($name)."</a>"; + $return .= "<a href=\"".$value['url']."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($name)."</a>"; if ($value['record']->getType()=="INDI") { $return .= $value['sex']; $return .= $value['record']->getPrimaryParentsNames("parents_$table_id details1", "none"); @@ -1528,10 +1528,10 @@ function print_events_table($startjd, $endjd, $events='BIRT MARR DEAT', $only_li $return .= "</td>"; //-- Event name $return .= "<td class=\"list_value_wrap\">"; - $return .= "<a href=\"".encode_url($value['url'])."\" class=\"list_item\">".translate_fact($value['fact'])."</a>"; + $return .= "<a href=\"".$value['url']."\" class=\"list_item\">".translate_fact($value['fact'])."</a>"; $return .= " </td>"; - $return .= "</tr>\n"; + $return .= "</tr>"; } if ($output!=0) { @@ -1545,7 +1545,7 @@ function print_events_table($startjd, $endjd, $events='BIRT MARR DEAT', $only_li $return .= "<td></td>"; $return .= "<td></td>"; $return .= "</tr>"; - $return .= "</table>\n"; + $return .= "</table>"; } // Print a final summary message about restricted/filtered facts @@ -1631,7 +1631,7 @@ function print_events_list($startjd, $endjd, $events='BIRT MARR DEAT', $only_liv $output ++; $value['name'] = $record->getListName(); - $value['url'] = $record->getLinkUrl(); + $value['url'] = $record->getHtmlUrl(); if ($record->getType()=="INDI") { $value['sex'] = $record->getSexImage(); } else { @@ -1648,11 +1648,11 @@ function print_events_list($startjd, $endjd, $events='BIRT MARR DEAT', $only_liv } foreach($filtered_events as $value) { - $return .= "<a href=\"".encode_url($value['url'])."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($value['name'])."</a>".$value['sex']; + $return .= "<a href=\"".$value['url']."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($value['name'])."</a>".$value['sex']; $return .= "<br /><div class=\"indent\">"; $return .= translate_fact($value['fact']).' - '.$value['date']->Display(true); if ($value['anniv']!=0) $return .= " (" . i18n::translate('%s year anniversary', $value['anniv']).")"; - if (!empty($value['plac'])) $return .= " - <a href=\"".encode_url(get_place_url($value['plac']))."\">".$value['plac']."</a>"; + if (!empty($value['plac'])) $return .= " - <a href=\"".get_place_url($value['plac'])."\">".$value['plac']."</a>"; $return .= "</div>"; } @@ -178,13 +178,13 @@ if ($blocks['side']) { // Ensure there is always way to configure the blocks if ($ctype=='user' && !in_array('user_welcome', $blocks['main']) && !in_array('user_welcome', $blocks['side'])) { echo '<div align="center">'; - echo "<a href=\"javascript:;\" onclick=\"window.open('index_edit.php?name=".WT_USER_NAME."&ctype=user', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1');\">".i18n::translate('Customize My Page').'</a>'; + echo "<a href=\"javascript:;\" onclick=\"window.open('index_edit.php?name=".rawurlencode(WT_USER_NAME)."&ctype=user', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1');\">".i18n::translate('Customize My Page').'</a>'; echo help_link('mypage_customize'); echo '</div>'; } if (WT_USER_IS_ADMIN && $ctype=='gedcom' && !in_array('gedcom_block', $blocks['main']) && !in_array('gedcom_block', $blocks['side'])) { echo '<div align="center">'; - echo "<a href=\"javascript:;\" onclick=\"window.open('".encode_url("index_edit.php?name={$GEDCOM}&ctype=gedcom", false)."', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1');\">".i18n::translate('Customize this GEDCOM Home Page').'</a>'; + echo "<a href=\"javascript:;\" onclick=\"window.open('index_edit.php?name=".rawurlencode($GEDCOM)."&ctype=gedcom', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1');\">".i18n::translate('Customize this GEDCOM Home Page').'</a>'; echo '</div>'; } diff --git a/individual.php b/individual.php index 24f51de12f..54d5122e6f 100644 --- a/individual.php +++ b/individual.php @@ -80,7 +80,7 @@ function open_link_remote(pid){ } function showchanges() { - window.location = '<?php echo $controller->indi->getLinkUrl(); ?>&show_changes=yes'; + window.location = '<?php echo $controller->indi->getRawUrl(); ?>&show_changes=yes'; } <?php } ?> @@ -201,7 +201,7 @@ jQuery(document).ready(function(){ if ($controller->indi->isRemote()) { echo '<br />'; echo i18n::translate('The information for this individual was linked from a remote site.');//<br />--><!--take this out if you want break the remote site and the fact that it was remote into two separate lines - echo '<a href="', encode_url($controller->indi->getLinkUrl()), '">', $controller->indi->getLinkTitle(), '</a>'; + echo '<a href="', $controller->indi->getHtmlUrl(), '">', $controller->indi->getLinkTitle(), '</a>'; } // if indivual is not a remote individual // if information for this individual is based on this local site @@ -110,7 +110,7 @@ if ($action=='login') { $url .= "&ged=".$ged; $url = str_replace(array("&&", ".php&", ".php?&"), array("&", ".php?", ".php?"), $url); - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($url, false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$url); exit; } else { $message = i18n::translate('Unable to authenticate user.'); @@ -146,7 +146,7 @@ if ($type=="full") { } else { print_simple_header(i18n::translate('webtrees user login')); } -echo "<div class=\"center\">\n"; +echo "<div class=\"center\">"; echo "<table class=\"center width60 ltr\"><tr><td>"; switch ($WELCOME_TEXT_AUTH_MODE){ @@ -176,7 +176,7 @@ echo '</td></tr></table><br /><br />'; <input type="hidden" name="type" value="<?php print htmlspecialchars($type); ?>" /> <input type="hidden" name="usertime" value="" /> <?php - if (!empty($message)) print "<span class='error'><br /><b>$message</b><br /><br /></span>\r\n"; + if (!empty($message)) print "<span class='error'><br /><b>$message</b><br /><br /></span>"; ?> <!--table--> <table class="center facts_table width50"> diff --git a/login_register.php b/login_register.php index 7e9581ef3a..f024ba8229 100644 --- a/login_register.php +++ b/login_register.php @@ -314,7 +314,7 @@ switch ($action) { //-- check referer for possible spam attack if (!isset($_SERVER['HTTP_REFERER']) || stristr($_SERVER['HTTP_REFERER'],"login_register.php")===false) { - print "<center><br /><span class=\"error\">Invalid page referer.</span>\n"; + print "<center><br /><span class=\"error\">Invalid page referer.</span>"; print "<br /><br /></center>"; AddToLog('Invalid page referer while trying to register a user. Possible spam attack.', 'auth'); exit; @@ -547,7 +547,7 @@ switch ($action) { break; default : - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url($url)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.$url); break; } @@ -224,7 +224,7 @@ if (isset($_REQUEST['xref'])) $xref = $_REQUEST['xref']; if (count($_POST) == 0) $showthumb = true; $thumbget = ""; -if ($showthumb) $thumbget = "&showthumb=true"; +if ($showthumb) $thumbget = "&showthumb=true"; //-- prevent script from accessing an area outside of the media directory //-- and keep level consistency @@ -800,11 +800,11 @@ if (check_media_structure()) { } if ($MEDIA_DIRECTORY_LEVELS > 0) { $folders = get_media_folders(); - echo "<span dir=\"ltr\"><select name=\"directory\">\n"; + echo "<span dir=\"ltr\"><select name=\"directory\">"; foreach($folders as $f) { echo "<option value=\"".$f."\""; if ($directory==$f) echo " selected=\"selected\""; - echo ">{$f}</option>\n"; + echo ">{$f}</option>"; } echo "</select></span><br />"; } else echo "<input name=\"directory\" type=\"hidden\" value=\"ALL\" />"; @@ -828,12 +828,12 @@ if (check_media_structure()) { <!-- // NOTE: Row 3 right: Generate missing thumbnails --> <?php $tempURL = "media.php?"; - if (!empty($filter)) $tempURL .= "filter={$filter}&"; - if (!empty($subclick)) $tempURL .= "subclick={$subclick}&"; - $tempURL .= "action=thumbnail&sortby={$sortby}&all=yes&level={$level}&directory={$directory}".$thumbget; + if (!empty($filter)) $tempURL .= 'filter='.rawurlencode($filter).'&'; + if (!empty($subclick)) $tempURL .= "subclick={$subclick}&"; + $tempURL .= "action=thumbnail&sortby={$sortby}&all=yes&level={$level}&directory=".rawurlencode($directory).$thumbget; ?> <td class="descriptionbox wrap width25" <?php echo $legendAlign;?>><?php echo i18n::translate('Missing thumbnails'), help_link('gen_missing_thumbs'); ?></td> - <td class="optionbox wrap"><a href="<?php echo encode_url($tempURL);?>"><?php echo i18n::translate('Create missing thumbnails');?></a></td></tr> + <td class="optionbox wrap"><a href="<?php echo $tempURL; ?>"><?php echo i18n::translate('Create missing thumbnails');?></a></td></tr> </table> </form> <script type="text/javascript"> @@ -879,15 +879,15 @@ jQuery(document).ready(function(){ $pdir = ''; for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i].'/'; if ($pdir != '') { - $uplink = "<a href=\"".encode_url("media.php?directory={$pdir}&sortby={$sortby}&level=".($level-1).$thumbget)."\">"; + $uplink = "<a href=\"media.php?directory={$pdir}&amp;sortby={$sortby}&amp;level=".($level-1).$thumbget."\">"; if ($TEXT_DIRECTION=="rtl") $uplink .= getLRM(); $uplink .= $pdir; if ($TEXT_DIRECTION=="rtl") $uplink .= getLRM(); - $uplink .= "</a>\n"; + $uplink .= "</a>"; - $uplink2 = "<a href=\"".encode_url("media.php?directory={$pdir}&sortby={$sortby}&level=".($level-1).$thumbget)."\"><img class=\"icon\" src=\""; + $uplink2 = "<a href=\"media.php?directory={$pdir}&sortby={$sortby}&level=".($level-1).$thumbget."\"><img class=\"icon\" src=\""; $uplink2 .= $WT_IMAGES["larrow"]; - $uplink2 .= "\" alt=\"\" /></a>\n"; + $uplink2 .= "\" alt=\"\" /></a>"; } // Start of media directory table echo "<table class=\"list_table width50 $TEXT_DIRECTION\">"; @@ -1034,7 +1034,7 @@ jQuery(document).ready(function(){ echo "</form>"; echo "</td>"; echo "<td class=\"descriptionbox $TEXT_DIRECTION\">"; - echo "<a href=\"".encode_url("media.php?directory={$directory}{$dir}/&sortby={$sortby}&level=".($level+1).$thumbget)."\">"; + echo "<a href=\"media.php?directory=".rawurlencode($directory.$dir)."/&sortby={$sortby}&level=".($level+1).$thumbget."\">"; if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo $dir; if ($TEXT_DIRECTION=="rtl") echo getRLM(); @@ -1107,7 +1107,7 @@ jQuery(document).ready(function(){ // Edit File $tempURL = "addmedia.php?action="; if ($media["XREF"] != "") { - $tempURL .= "editmedia&pid={$media['XREF']}&linktoid="; + $tempURL .= "editmedia&pid={$media['XREF']}&linktoid="; if (!$media["LINKED"]) { $tempURL .= "new"; } else { @@ -1115,13 +1115,13 @@ jQuery(document).ready(function(){ $tempURL .= $linkToID; } } else { - $tempURL .= 'showmediaform&filename='.urlencode($media['FILE']).'&linktoid=new'; + $tempURL .= 'showmediaform&filename='.rawurlencode($media['FILE']).'&linktoid=new'; } - echo "<a href=\"javascript:", i18n::translate('Edit'), "\" onclick=\"window.open('", encode_url($tempURL, false), "', '_blank', 'top=50, left=50, width=600, height=500, resizable=1, scrollbars=1'); return false;\">", i18n::translate('Edit'), "</a><br />"; + echo "<a href=\"javascript:", i18n::translate('Edit'), "\" onclick=\"window.open('", $tempURL, "', '_blank', 'top=50, left=50, width=600, height=500, resizable=1, scrollbars=1'); return false;\">", i18n::translate('Edit'), "</a><br />"; // Edit Raw if ($media["XREF"] != "") { - echo "<a href=\"javascript:".i18n::translate('Edit raw GEDCOM record')."\" onclick=\"return edit_raw('".$media['XREF']."');\">".i18n::translate('Edit raw GEDCOM record')."</a><br />\n"; + echo "<a href=\"javascript:".i18n::translate('Edit raw GEDCOM record')."\" onclick=\"return edit_raw('".$media['XREF']."');\">".i18n::translate('Edit raw GEDCOM record')."</a><br />"; } // Delete File @@ -1136,17 +1136,17 @@ jQuery(document).ready(function(){ } if (!$isExternal && $objectCount<2) { $tempURL = "media.php?"; - if (!empty($filter)) $tempURL.= "filter={$filter}&"; - $tempURL .= "action=deletefile&showthumb={$showthumb}&sortby={$sortby}&filter={$filter}&subclick={$subclick}&filename=".urlencode($media['FILE'])."&directory={$directory}&level={$level}&xref={$media['XREF']}&gedfile={$media['GEDFILE']}"; - echo "<a href=\"".encode_url($tempURL)."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this file?')."');\">".i18n::translate('Delete file')."</a><br />"; + if (!empty($filter)) $tempURL.= "filter=".rawurlencode($filter)."&"; + $tempURL .= "action=deletefile&showthumb={$showthumb}&sortby={$sortby}&filter={$filter}&subclick={$subclick}&filename=".rawurlencode($media['FILE'])."&directory={$directory}&level={$level}&xref={$media['XREF']}&gedfile={$media['GEDFILE']}"; + echo "<a href=\"".$tempURL."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this file?')."');\">".i18n::translate('Delete file')."</a><br />"; } // Remove Object if (!empty($media["XREF"])) { $tempURL = "media.php?"; - if (!empty($filter)) $tempURL .= "filter={$filter}&"; - $tempURL .= "action=removeobject&showthumb={$showthumb}&sortby={$sortby}&filter={$filter}&subclick={$subclick}&filename=".urlencode($media['FILE'])."&directory={$directory}&level={$level}&xref={$media['XREF']}&gedfile={$media['GEDFILE']}"; - echo "<a href=\"".encode_url($tempURL)."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this object from the database?')."');\">".i18n::translate('Remove object')."</a><br />"; + if (!empty($filter)) $tempURL .= "filter={$filter}&"; + $tempURL .= "action=removeobjectamp;&showthumb={$showthumb}amp;&sortby={$sortby}amp;&filter={$filter}amp;&subclick={$subclick}amp;&filename=".rawurlencode($media['FILE'])."amp;&directory={$directory}amp;&level={$level}amp;&xref={$media['XREF']}amp;&gedfile={$media['GEDFILE']}"; + echo "<a href=\"".$tempURL."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this object from the database?')."');\">".i18n::translate('Remove object')."</a><br />"; } // Remove links @@ -1174,8 +1174,8 @@ jQuery(document).ready(function(){ $tempURL .= "action=movestandard"; $message=i18n::translate('Move to standard directory'); } - $tempURL .= "&showthumb={$showthumb}&sortby={$sortby}&filename=".urlencode($media['FILE'])."&directory={$directory}&level={$level}&xref={$media['XREF']}&gedfile=".$media["GEDFILE"]; - echo "<a href=\"".encode_url($tempURL)."\">".$message."</a><br />"; + $tempURL .= "&showthumb={$showthumb}&sortby={$sortby}&filename=".rawurlencode($media['FILE'])."&directory=".rawurlencode($directory)."&level={$level}&xref={$media['XREF']}&gedfile=".rawurlencode($media["GEDFILE"]); + echo "<a href=\"".$tempURL."\">".$message."</a><br />"; } // Generate thumbnail @@ -1184,9 +1184,9 @@ jQuery(document).ready(function(){ if ($ct>0) $ext = strtolower(trim($match[1])); if ($ext=="jpg" || $ext=="jpeg" || $ext=="gif" || $ext=="png") { $tempURL = "media.php?"; - if (!empty($filter)) $tempURL .= "filter={$filter}&"; - $tempURL .= "action=thumbnail&all=no&sortby={$sortby}&level={$level}&directory={$directory}&filename=".urlencode($media["FILE"]).$thumbget; - echo "<a href=\"".encode_url($tempURL)."\">".i18n::translate('Create thumbnail')."</a>"; + if (!empty($filter)) $tempURL .= "filter={$filter}&"; + $tempURL .= "action=thumbnail&all=no&sortby={$sortby}&level={$level}&directory=".rawurlencode($directory)."&filename=".rawurlencode($media["FILE"]).$thumbget; + echo "<a href=\"".$tempURL."\">".i18n::translate('Create thumbnail')."</a>"; } } @@ -1210,7 +1210,7 @@ jQuery(document).ready(function(){ //-- Thumbnail field if ($showthumb) { - echo "\n\t\t\t<td class=\"optionbox $changeClass $TEXT_DIRECTION width10\">"; + echo "<td class=\"optionbox $changeClass $TEXT_DIRECTION width10\">"; // if Streetview object if (strpos($media["FILE"], 'http://maps.google.')===0) { echo '<iframe style="float:left; padding:5px;" width="264" height="176" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="', $media["FILE"], '&output=svembed"></iframe>'; @@ -1223,7 +1223,7 @@ jQuery(document).ready(function(){ } //-- name and size field - echo "\n\t\t\t<td class=\"optionbox $changeClass $TEXT_DIRECTION wrap\">"; + echo "<td class=\"optionbox $changeClass $TEXT_DIRECTION wrap\">"; if ($media["TITL"]!="" && begRTLText($media["TITL"]) && $TEXT_DIRECTION=="ltr") { if (!empty($media["XREF"])) { echo "(".$media["XREF"].")"; @@ -1293,7 +1293,7 @@ jQuery(document).ready(function(){ } } - echo "\n\t\t\t</td></tr>"; + echo "</td></tr>"; break; } } diff --git a/medialist.php b/medialist.php index 6292eed742..b8e01dcb00 100644 --- a/medialist.php +++ b/medialist.php @@ -135,7 +135,7 @@ if (isset($_SESSION['Medialist'])) { // if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; print_header(i18n::translate('MultiMedia Objects')); -echo "\n\t<div class=\"center\"><h2>", i18n::translate('MultiMedia Objects'), "</h2></div>\n\t"; +echo "<div class=\"center\"><h2>", i18n::translate('MultiMedia Objects'), "</h2></div>"; // Get Javascript variables from lb_config.php --------------------------- if (WT_USE_LIGHTBOX) { @@ -221,14 +221,14 @@ $_SESSION['Medialist'] = $medialist; else $folder = "ALL"; } $folders = array_merge(array("ALL"), get_media_folders()); - echo "<span dir=\"ltr\"><select name=\"folder\">\n"; + echo "<span dir=\"ltr\"><select name=\"folder\">"; foreach($folders as $f) { echo "<option value=\"", $f, "\""; if ($folder==$f) echo " selected=\"selected\""; echo ">"; if ($f=="ALL") echo i18n::translate('All'); else echo $f; - echo "</option>\n"; + echo "</option>"; } echo "</select></span><br />"; //} else echo $MEDIA_DIRECTORY, "<input name=\"folder\" type=\"hidden\" value=\"ALL\" />"; @@ -419,7 +419,7 @@ if ($show == "yes") { if ($start+$count > $ct) $count = $ct-$start; } else $ct = "0"; - echo "\n\t<div align=\"center\">", i18n::translate('Media Objects found'), " ", $ct, " <br /><br />"; + echo "<div align=\"center\">", i18n::translate('Media Objects found'), " ", $ct, " <br /><br />"; if ($ct>0) { $currentPage = ((int) ($start / $max)) + 1; @@ -429,37 +429,37 @@ if ($show == "yes") { $IconRDarrow = "<img src=\"".$WT_IMAGES["rdarrow"]."\" width=\"20\" height=\"20\" border=\"0\" alt=\"\" />"; $IconLDarrow = "<img src=\"".$WT_IMAGES["ldarrow"]."\" width=\"20\" height=\"20\" border=\"0\" alt=\"\" />"; - print"\n\t<table class=\"list_table\">\n"; + print"<table class=\"list_table\">"; // echo page back, page number, page forward controls - echo "\n<tr><td colspan=\"2\">\n"; - echo "\n\t<table class=\"list_table width100\">\n"; + echo "<tr><td colspan=\"2\">"; + echo "<table class=\"list_table width100\">"; - echo "\n<tr>\n"; + echo "<tr>"; echo "<td class=\"width30\" align=\"", $TEXT_DIRECTION == "ltr"?"left":"right", "\">"; if ($TEXT_DIRECTION=="ltr") { if ($ct>$max) { if ($currentPage > 1) { - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}"), "\">", $IconLDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}\">", $IconLDarrow, "</a>"; } if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconLarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconLarrow, "</a>"; } } } else { if ($ct>$max) { if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}"), "\">", $IconRDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}\">", $IconRDarrow, "</a>"; } if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconRarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconRarrow, "</a>"; } } } @@ -474,11 +474,11 @@ if ($show == "yes") { if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconRarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconRarrow, "</a>"; } if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}"), "\">", $IconRDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}\">", $IconRDarrow, "</a>"; } } } else { @@ -486,20 +486,20 @@ if ($show == "yes") { if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconLarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconLarrow, "</a>"; } if ($currentPage > 1) { $lastStart = ((int) ($ct / $max)) * $max; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}"), "\">", $IconLDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}\">", $IconLDarrow, "</a>"; } } } echo "</td>"; - echo "</tr>\n</table></td></tr>"; + echo "</tr></table></td></tr>"; // -- echo the array - echo "\n<tr>\n"; + echo "<tr>"; for ($i=0; $i<$count; $i++) { @@ -516,10 +516,10 @@ if ($show == "yes") { else $name = basename($media["FILE"]); } - if ($columns == "1") echo "\n\t\t\t<td class=\"list_value_wrap\" width=\"80%\">"; - if ($columns == "2") echo "\n\t\t\t<td class=\"list_value_wrap\" width=\"50%\">"; + if ($columns == "1") echo "<td class=\"list_value_wrap\" width=\"80%\">"; + if ($columns == "2") echo "<td class=\"list_value_wrap\" width=\"50%\">"; - echo "<table class=\"$TEXT_DIRECTION\">\n\t<tr>\n\t\t<td valign=\"top\" style=\"white-space: normal;\">"; + echo "<table class=\"$TEXT_DIRECTION\"><tr><td valign=\"top\" style=\"white-space: normal;\">"; //Get media item Notes $haystack = $media["GEDCOM"]; @@ -539,7 +539,7 @@ if ($show == "yes") { echo '<img src="', $mediaInfo['thumb'], '" align="center" class="thumbnail" border="none"', $mediaInfo['width']; echo ' alt="', PrintReady(htmlspecialchars($name)), '" title="', PrintReady(htmlspecialchars($name)), '" /></a>'; - echo "</td>\n\t\t", '<td class="list_value_wrap" style="border: none;" width="100%">'; + echo "</td>", '<td class="list_value_wrap" style="border: none;" width="100%">'; if (WT_USE_LIGHTBOX) { if (WT_USER_CAN_EDIT) { @@ -559,7 +559,7 @@ if ($show == "yes") { if ($LB_ML_THUMB_LINKS == "both" || $LB_ML_THUMB_LINKS == "text") { echo i18n::translate('Edit Details') ; } - echo "</a>" . "\n"; + echo "</a>"; echo "</td>"; // ---------- Link Media to person, family or source --------------- @@ -581,7 +581,7 @@ Plus other Media Options - MediaViewer page') . "\" />"; if ($LB_ML_THUMB_LINKS == "both" || $LB_ML_THUMB_LINKS == "text") { echo i18n::translate('View Details') ; } - echo "</a>" . "\n" ; + echo "</a>"; echo "</td>"; echo "</tr></table>"; @@ -624,11 +624,11 @@ Plus other Media Options - MediaViewer page') . "\" />"; if (!$isExternal && $media["EXISTS"]) { $imageTypes = array("", "GIF", "JPG", "PNG", "SWF", "PSD", "BMP", "TIFF", "TIFF", "JPC", "JP2", "JPX", "JB2", "SWC", "IFF", "WBMP", "XBM"); if (!empty($imgsize[2])) { - echo "\n\t\t\t<span class=\"label\"><br />", i18n::translate('Media Format'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imageTypes[$imgsize[2]], "</span>"; + echo "<span class=\"label\"><br />", i18n::translate('Media Format'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imageTypes[$imgsize[2]], "</span>"; } else if (empty($imgsize[2])) { $path_end=substr($media["FILE"], strlen($media["FILE"])-5); $imageType = strtoupper(substr($path_end, strpos($path_end, ".")+1)); - echo "\n\t\t\t<span class=\"label\"><br />", i18n::translate('Media Format'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imageType, "</span>"; + echo "<span class=\"label\"><br />", i18n::translate('Media Format'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imageType, "</span>"; } $fileSize = media_filesize($media["FILE"]); @@ -636,7 +636,7 @@ Plus other Media Options - MediaViewer page') . "\" />"; echo " <span class=\"field\" style=\"direction: ltr;\">", $sizeString, "</span>"; if ($imgsize[2]!==false) { - echo "\n\t\t\t<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imgsize[0], $TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM() . " ") : " x ", $imgsize[1], "</span>"; + echo "<span class=\"label\"><br />", i18n::translate('Image Dimensions'), ": </span> <span class=\"field\" style=\"direction: ltr;\">", $imgsize[0], $TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM() . " ") : " x ", $imgsize[1], "</span>"; } } echo "<div style=\"white-space: normal; width: 95%;\">"; @@ -646,41 +646,41 @@ Plus other Media Options - MediaViewer page') . "\" />"; PrintMediaLinks($media["LINKS"], "small"); - echo "</td></tr></table>\n"; + echo "</td></tr></table>"; echo "</td>"; - if ($columns == "1") echo "\n\t\t</tr>\n\t\t<tr>"; + if ($columns == "1") echo "</tr><tr>"; if (($columns == "2") && ($i%2 == 1 && $i < ($count-1))) - echo "\n\t\t</tr>\n\t\t<tr>"; + echo "</tr><tr>"; } - echo "\n\t\t</tr>"; + echo "</tr>"; // echo page back, page number, page forward controls - echo "\n<tr><td colspan=\"2\">\n"; + echo "<tr><td colspan=\"2\">"; - print"\n\t<table class=\"list_table width100\">\n"; - echo "\n<tr>\n"; + print"<table class=\"list_table width100\">"; + echo "<tr>"; echo "<td class=\"width30\" align=\"", $TEXT_DIRECTION == "ltr"?"left":"right", "\">"; if ($TEXT_DIRECTION=="ltr") { if ($ct>$max) { if ($currentPage > 1) { - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}"), "\">", $IconLDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}\">", $IconLDarrow, "</a>"; } if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconLarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconLarrow, "</a>"; } } } else { if ($ct>$max) { if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}"), "\">", $IconRDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}\">", $IconRDarrow, "</a>"; } if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconRarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconRarrow, "</a>"; } } } @@ -692,11 +692,11 @@ Plus other Media Options - MediaViewer page') . "\" />"; if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconRarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconRarrow, "</a>"; } if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}"), "\">", $IconRDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$lastStart}&max={$max}\">", $IconRDarrow, "</a>"; } } } else { @@ -704,19 +704,19 @@ Plus other Media Options - MediaViewer page') . "\" />"; if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}"), "\">", $IconLarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start={$newstart}&max={$max}\">", $IconLarrow, "</a>"; } if ($currentPage > 1) { $lastStart = ((int) ($ct / $max)) * $max; - echo "<a href=\"", encode_url("medialist.php?action=no&search=no&folder={$folder}&sortby={$sortby}&subdirs={$subdirs}&filter1={$filter1}&filter_type={$filter_type}&filter2={$filter2}&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}"), "\">", $IconLDarrow, "</a>\n"; + echo "<a href=\"medialist.php?action=no&search=no&folder=", rawurlencode($folder), "&sortby={$sortby}&subdirs={$subdirs}&filter1=", rawurlencode($filter1), "&filter_type={$filter_type}&filter2=", rawurlencode($filter2), "&columns={$columns}&thumbnail={$thumbnail}&apply_filter={$apply_filter}&start=0&max={$max}\">", $IconLDarrow, "</a>"; } } } echo "</td>"; - echo "</tr>\n</table></td></tr>"; + echo "</tr></table></td></tr>"; echo "</table><br />"; } -echo "\n</div>\n"; +echo "</div>"; } // ************************ END = 'Print the medialist array' ************************ print_footer(); diff --git a/modules/GEDFact_assistant/_CENS/census_3_find.php b/modules/GEDFact_assistant/_CENS/census_3_find.php index 558f8079ff..f4dbbcff10 100644 --- a/modules/GEDFact_assistant/_CENS/census_3_find.php +++ b/modules/GEDFact_assistant/_CENS/census_3_find.php @@ -812,7 +812,7 @@ if ($action=="filter") { $levels = explode("/", $thumbdir); $pthumb = ""; for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; - $uplink = "<a href=\"".encode_url("find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}")."\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; + $uplink = "<a href=\"find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; } // Start of media directory table @@ -835,11 +835,11 @@ if ($action=="filter") { echo $uplink, "</td></tr>"; } echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\">"; - echo "<a href=\"", encode_url("find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}"), "\">", i18n::translate('External objects'), "</a>"; + echo "<a href=\"find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}\">", i18n::translate('External objects'), "</a>"; echo "</td></tr>"; foreach ($dirs as $indexval => $dir) { echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">"; - echo "<a href=\"", encode_url("find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}"), "\"><span dir=\"ltr\">", $dir, "</span></a>"; + echo "<a href=\"find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}\"><span dir=\"ltr\">", $dir, "</span></a>"; echo "</td></tr>"; } } @@ -915,7 +915,7 @@ if ($action=="filter") { foreach ($media["LINKS"] as $indi => $type_record) { if ($type_record!='INDI' && $type_record!='FAM' && $type_record!='SOUR' && $type_record!='OBJE') continue; $record=GedcomRecord::getInstance($indi); - echo '<br /><a href="', encode_url($record->getLinkUrl()), '">'; + echo '<br /><a href="', $record->getHtmlUrl(), '">'; switch($type_record) { case 'INDI': echo i18n::translate('View Person'), ' - '; @@ -994,7 +994,7 @@ if ($action=="filter") { if ($repo_list) { echo "<td class=\"list_value_wrap\"><ul>"; foreach ($repo_list as $repo) { - echo '<li><a href="', $repo->getLinkUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; + echo '<li><a href="', $repo->getHtmlUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; } echo "</ul></td></tr>"; echo "<tr><td class=\"list_label\">", i18n::translate('Repositories found'), " ", count($repo_list); @@ -1020,7 +1020,7 @@ if ($action=="filter") { usort($mynotelist, array('GedcomRecord', 'Compare')); echo '<tr><td class="list_value_wrap"><ul>'; foreach ($mynotelist as $note) { - echo '<li><a href="', $note->getLinkUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; + echo '<li><a href="', $note->getHtmlUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Shared Notes found'), ' ', count($mynotelist), '</td></tr>'; } @@ -1042,7 +1042,7 @@ if ($action=="filter") { usort($mysourcelist, array('GedcomRecord', 'Compare')); echo '<tr><td class="list_value_wrap"><ul>'; foreach ($mysourcelist as $source) { - echo '<li><a href="', $source->getLinkUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; + echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total Sources'), ' ', count($mysourcelist), '</td></tr>'; } diff --git a/modules/GEDFact_assistant/_CENS/census_3_search_add.php b/modules/GEDFact_assistant/_CENS/census_3_search_add.php index 07827f6af7..79b8e3338c 100644 --- a/modules/GEDFact_assistant/_CENS/census_3_search_add.php +++ b/modules/GEDFact_assistant/_CENS/census_3_search_add.php @@ -164,7 +164,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[$i]['givn'],'*')." ".$nam[$i]['surname']; } } - $menu = new Menu($people["husb"]->getLabel()."\n"); + $menu = new Menu($people["husb"]->getLabel()); $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $people["husb"]->getLabel(), $censdate); $slabel .= $parentlinks; $submenu = new Menu($slabel); @@ -180,7 +180,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" style="text-decoration:none;" > <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -249,8 +249,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["husb"]->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -299,7 +299,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[$i]['givn'],'*')." ".$husbnam; } } - $menu = new Menu($people["wife"]->getLabel()."\n"); + $menu = new Menu($people["wife"]->getLabel()); $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $people["wife"]->getLabel(), $censyear); $slabel .= $parentlinks; $submenu = new Menu($slabel); @@ -314,7 +314,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -383,8 +383,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["wife"]->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -439,7 +439,7 @@ if (!defined('WT_WEBTREES')) { } } - $menu = new Menu($child->getLabel()."\n"); + $menu = new Menu($child->getLabel()); $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $child->getLabel(), $censyear); $slabel .= $spouselinks; $submenu = new Menu($slabel); @@ -464,7 +464,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -539,8 +539,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($child->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -613,9 +613,9 @@ if (!defined('WT_WEBTREES')) { } $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { - $menu->addLabel(i18n::translate('Step-Father')."\n"); + $menu->addLabel(i18n::translate('Step-Father')); }else{ - $menu->addLabel($people["husb"]->getLabel()."\n"); + $menu->addLabel($people["husb"]->getLabel()); } $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $people["husb"]->getLabel(), $censyear); $slabel .= $parentlinks; @@ -633,7 +633,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -706,8 +706,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["husb"]->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -760,9 +760,9 @@ if (!defined('WT_WEBTREES')) { } $menu = new Menu(); if ($people["wife"]->getLabel() == ".") { - $menu->addLabel(i18n::translate('Step-Mother')."\n"); + $menu->addLabel(i18n::translate('Step-Mother')); }else{ - $menu->addLabel($people["wife"]->getLabel()."\n"); + $menu->addLabel($people["wife"]->getLabel()); } $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $people["wife"]->getLabel(), $censyear); $slabel .= $parentlinks; @@ -780,7 +780,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -853,8 +853,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["wife"]->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -900,7 +900,7 @@ if (!defined('WT_WEBTREES')) { $chfulmn = rtrim($chnam[$i]['givn'],'*')." ".$chnam[$i]['surname']; } } - $menu = new Menu($child->getLabel()."\n"); + $menu = new Menu($child->getLabel()); $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $child->getLabel(), $censyear); $slabel .= $spouselinks; $submenu = new Menu($slabel); @@ -917,7 +917,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -982,8 +982,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($child->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -1054,7 +1054,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[$i]['givn'],'*')." ".$nam[$i]['surname']; } } - $menu = new Menu($people["husb"]->getLabel()."\n"); + $menu = new Menu($people["husb"]->getLabel()); $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $people["husb"]->getLabel(), $censyear); $slabel .= $parentlinks; $submenu = new Menu($slabel); @@ -1077,7 +1077,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -1150,8 +1150,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["husb"]->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -1201,7 +1201,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[$i]['givn'],'*')." ".$husbnam; } } - $menu = new Menu($people["wife"]->getLabel()."\n"); + $menu = new Menu($people["wife"]->getLabel()); $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $people["wife"]->getLabel(), $censyear); $slabel .= $parentlinks; $submenu = new Menu($slabel); @@ -1224,7 +1224,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -1297,8 +1297,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["wife"]->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -1349,7 +1349,7 @@ if (!defined('WT_WEBTREES')) { $chfulmn = rtrim($chnam[$i]['givn'],'*')." ".$chnam[$i]['surname']; } } - $menu = new Menu($child->getLabel()."\n"); + $menu = new Menu($child->getLabel()); $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $child->getLabel(), $censyear); $slabel .= $spouselinks; $submenu = new Menu($slabel); @@ -1364,7 +1364,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted¬eid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}\">"; print $headImg2; print "</a>"; ?> @@ -1435,8 +1435,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($child->getFullName()); // Full Name (Link) ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -1509,18 +1509,18 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", //-- draw a box for the family popup if ($TEXT_DIRECTION=="rtl") { - $spouselinks .= "\n\t\t\t<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; + $spouselinks .= "<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; - $parentlinks .= "\n\t\t\t<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; + $parentlinks .= "<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - $step_parentlinks .= "\n\t\t\t<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; + $step_parentlinks .= "<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; }else{ - $spouselinks .= "\n\t\t\t<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; + $spouselinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; - $parentlinks .= "\n\t\t\t<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; + $parentlinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - $step_parentlinks .= "\n\t\t\t<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; + $step_parentlinks .= "<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">"; $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; } @@ -1645,7 +1645,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "\n"; $natdad = "yes"; } } @@ -1751,7 +1750,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "\n"; $natmom = "yes"; } } @@ -1877,7 +1875,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "\n"; } } } @@ -1986,7 +1983,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "\n"; } } } @@ -2123,7 +2119,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $spouselinks .= i18n::translate('Private'); } - $spouselinks .= "</a>\n"; + $spouselinks .= "</a>"; if ($spouse->getFullName() != "") { $persons = "Yes"; } @@ -2131,7 +2127,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", } // Children ------------------------------------- - $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">\n"; + $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; foreach($children as $c=>$child) { $cpid = $child->getXref(); if ($child) { @@ -2180,8 +2176,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", } // Childs Details ------------------------- $title = i18n::translate('Individual information').": ".$cpid; - // $spouselinks .= "\n\t\t\t\to "; - $spouselinks .= "<li>\n"; + $spouselinks .= "<li>"; if ($child->canDisplayName()) { $nam = $child->getAllNames(); $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; @@ -2262,31 +2257,31 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $spouselinks .= ");\">"; $spouselinks .= PrintReady($child->getFullName()); // Full Name (Link) $spouselinks .= "</a>"; - $spouselinks .= "</li>\n"; + $spouselinks .= "</li>"; }else{ $spouselinks .= i18n::translate('Private'); } } } - $spouselinks .= "</ul>\n"; + $spouselinks .= "</ul>"; } } if ($persons != "Yes") { - $spouselinks .= "(" . i18n::translate('none') . ")</td></tr></table>\n\t\t"; + $spouselinks .= "(" . i18n::translate('none') . ")</td></tr></table>"; }else{ - $spouselinks .= "</td></tr></table>\n\t\t"; + $spouselinks .= "</td></tr></table>"; } if ($person_parent != "Yes") { - $parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>\n\t\t"; + $parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; }else{ - $parentlinks .= "</td></tr></table>\n\t\t"; + $parentlinks .= "</td></tr></table>"; } if ($person_step != "Yes") { - $step_parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>\n\t\t"; + $step_parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; }else{ - $step_parentlinks .= "</td></tr></table>\n\t\t"; + $step_parentlinks .= "</td></tr></table>"; } } } diff --git a/modules/GEDFact_assistant/_MEDIA/media_3_find.php b/modules/GEDFact_assistant/_MEDIA/media_3_find.php index 3ab19d6176..6f4201fb06 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_3_find.php +++ b/modules/GEDFact_assistant/_MEDIA/media_3_find.php @@ -510,7 +510,7 @@ if ($action=="filter") { $levels = explode("/", $thumbdir); $pthumb = ""; for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/"; - $uplink = "<a href=\"".encode_url("find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}")."\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; + $uplink = "<a href=\"find.php?directory=".rawurlencode($pdir)."&thumbdir=".rawurlencode($pthumb)."&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </a><br />"; } // Start of media directory table @@ -533,11 +533,11 @@ if ($action=="filter") { echo $uplink, "</td></tr>"; } echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\">"; - echo "<a href=\"", encode_url("find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}"), "\">", i18n::translate('External objects'), "</a>"; + echo "<a href=\"find.php?directory=".rawurlencode($directory)."&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}"\">", i18n::translate('External objects'), "</a>"; echo "</td></tr>"; foreach ($dirs as $indexval => $dir) { echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">"; - echo "<a href=\"", encode_url("find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}"), "\"><span dir=\"ltr\">", $dir, "</span></a>"; + echo "<a href=\"find.php?directory=".rawurlencode($directory.$dir)."/&thumbdir=".rawurlencode($directory.$dir)."/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}\"><span dir=\"ltr\">", $dir, "</span></a>"; echo "</td></tr>"; } } @@ -613,7 +613,7 @@ if ($action=="filter") { foreach ($media["LINKS"] as $indi => $type_record) { if ($type_record!='INDI' && $type_record!='FAM' && $type_record!='SOUR' && $type_record!='OBJE') continue; $record=GedcomRecord::getInstance($indi); - echo '<br /><a href="', encode_url($record->getLinkUrl()), '">'; + echo '<br /><a href="', $record->getHtmlUrl(), '">'; switch($type_record) { case 'INDI': echo i18n::translate('View Person'), ' - '; @@ -692,7 +692,7 @@ if ($action=="filter") { if ($repo_list) { echo "<td class=\"list_value_wrap\"><ul>"; foreach ($repo_list as $repo) { - echo '<li><a href="', $repo->getLinkUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; + echo '<li><a href="', $repo->getHtmlUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; } echo "</ul></td></tr>"; echo "<tr><td class=\"list_label\">", i18n::translate('Repositories found'), " ", count($repo_list); @@ -718,7 +718,7 @@ if ($action=="filter") { usort($mynotelist, array('GedcomRecord', 'Compare')); echo '<tr><td class="list_value_wrap"><ul>'; foreach ($mynotelist as $note) { - echo '<li><a href="', $note->getLinkUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; + echo '<li><a href="', $note->getHtmlUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Shared Notes found'), ' ', count($mynotelist), '</td></tr>'; } @@ -740,7 +740,7 @@ if ($action=="filter") { usort($mysourcelist, array('GedcomRecord', 'Compare')); echo '<tr><td class="list_value_wrap"><ul>'; foreach ($mysourcelist as $source) { - echo '<li><a href="', $source->getLinkUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; + echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; } echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total Sources'), ' ', count($mysourcelist), '</td></tr>'; } diff --git a/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php b/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php index 7decd141cf..98a29229e4 100644 --- a/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php +++ b/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php @@ -130,7 +130,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; } - $menu = new Menu(" " . $people["husb"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["husb"]->getLabel()); // $menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $parentlinks; @@ -149,7 +149,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" > <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -189,8 +189,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["husb"]->getFullName()); // Name ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -214,7 +214,7 @@ if (!defined('WT_WEBTREES')) { $marn = $surn; } - $menu = new Menu(" " . $people["wife"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["wife"]->getLabel()); //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $parentlinks; @@ -230,7 +230,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -279,8 +279,8 @@ if (!defined('WT_WEBTREES')) { //} ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -308,7 +308,7 @@ if (!defined('WT_WEBTREES')) { $marn = $nam[1]['surname']; } - $menu = new Menu(" " . $child->getLabel() . " ". "\n"); + $menu = new Menu(" " . $child->getLabel()); //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $spouselinks; @@ -334,7 +334,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -388,9 +388,9 @@ if (!defined('WT_WEBTREES')) { // } ?> </a> - <?php print "\n" ; - }else{ - print i18n::translate('Private'); + <?php + } else { + print i18n::translate('Private'); } ?> </font> @@ -427,9 +427,9 @@ if (!defined('WT_WEBTREES')) { } $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { - $menu->addLabel(" " . i18n::translate('Step-Father') . " ". "\n"); + $menu->addLabel(" " . i18n::translate('Step-Father')); }else{ - $menu->addLabel(" " . $people["husb"]->getLabel() . " ". "\n"); + $menu->addLabel(" " . $people["husb"]->getLabel()); } //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); @@ -448,7 +448,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -492,8 +492,8 @@ if (!defined('WT_WEBTREES')) { <?php print PrintReady($people["husb"]->getFullName()); // Name ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -518,9 +518,9 @@ if (!defined('WT_WEBTREES')) { } $menu = new Menu(); if ($people["husb"]->getLabel() == ".") { - $menu->addLabel(" " . i18n::translate('Step-Mother') . " ". "\n"); + $menu->addLabel(" " . i18n::translate('Step-Mother')); }else{ - $menu->addLabel(" " . $people["wife"]->getLabel() . " ". "\n"); + $menu->addLabel(" " . $people["wife"]->getLabel()); } //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); @@ -539,7 +539,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -592,8 +592,8 @@ if (!defined('WT_WEBTREES')) { //} ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -616,7 +616,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; } - $menu = new Menu(" " . $child->getLabel() . "\n"); + $menu = new Menu(" " . $child->getLabel()); //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $spouselinks; @@ -633,7 +633,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" > <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -669,8 +669,8 @@ if (!defined('WT_WEBTREES')) { <?php print PrintReady($child->getFullName()); // Name ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -708,7 +708,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; } - $menu = new Menu(" " . $people["husb"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["husb"]->getLabel()); //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $parentlinks; @@ -732,7 +732,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value" > <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -777,8 +777,8 @@ if (!defined('WT_WEBTREES')) { print PrintReady($people["husb"]->getFullName()); // Name ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -804,7 +804,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = $fulln; $marn = $surn; } - $menu = new Menu(" " . $people["wife"]->getLabel() . " ". "\n"); + $menu = new Menu(" " . $people["wife"]->getLabel()); //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); $slabel .= $parentlinks; @@ -828,7 +828,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -881,8 +881,8 @@ if (!defined('WT_WEBTREES')) { //} ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -910,7 +910,7 @@ if (!defined('WT_WEBTREES')) { $fulmn = $fulln; $marn = $surn; } - $menu = new Menu(" " . $child->getLabel() . " ". "\n"); + $menu = new Menu(" " . $child->getLabel()); //$menu->addClass("", "", "submenu"); $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $child->getLabel(), $censyear); $slabel .= $spouselinks; @@ -926,7 +926,7 @@ if (!defined('WT_WEBTREES')) { <td align="left" class="facts_value"> <font size=1> <?php - print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links¬eid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">"; + print "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}\">"; echo $headImg2; print "</a>"; ?> @@ -977,8 +977,8 @@ if (!defined('WT_WEBTREES')) { // } ?> </a> - <?php print "\n" ; - }else{ + <?php + } else { print i18n::translate('Private'); } ?> @@ -1044,18 +1044,18 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($LINK_ICONS!="disabled") { //-- draw a box for the family popup if ($TEXT_DIRECTION=="rtl") { - $spouselinks .= "\n\t\t\t<table id=\"flyoutFamRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; + $spouselinks .= "<table id=\"flyoutFamRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; - $parentlinks .= "\n\t\t\t<table id=\"flyoutParRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; + $parentlinks .= "<table id=\"flyoutParRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - $step_parentlinks .= "\n\t\t\t<table id=\"flyoutStepRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; + $step_parentlinks .= "<table id=\"flyoutStepRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; }else{ - $spouselinks .= "\n\t\t\t<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; + $spouselinks .= "<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; - $parentlinks .= "\n\t\t\t<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; + $parentlinks .= "<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - $step_parentlinks .= "\n\t\t\t<table id=\"flyoutStep\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; + $step_parentlinks .= "<table id=\"flyoutStep\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; } $persons = ""; @@ -1125,7 +1125,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "\n"; $natdad = "yes"; } } @@ -1194,7 +1193,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "<br />\n"; + $parentlinks .= "<br />"; $natmom = "yes"; } } @@ -1240,13 +1239,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $marn = $nam[1]['surname']; } - $parentlinks .= "<a href=\"".encode_url("individual.php?pid={$tmp}&tab={$tabno}&gedcom={$GEDCOM}")."\">"; + $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom={$GEDCOM}\">"; $parentlinks .= PrintReady($husb->getFullName()); $parentlinks .= "</a>"; }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "<br />\n"; + $parentlinks .= "<br />"; } } } @@ -1278,13 +1277,13 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; $marn = $nam[1]['surname']; } - $parentlinks .= "<a href=\"".encode_url("individual.php?pid={$tmp}&tab={$tabno}&gedcom={$GEDCOM}")."\">"; + $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom={$GEDCOM}\">"; $parentlinks .= PrintReady($wife->getFullName()); $parentlinks .= "</a>"; }else{ $parentlinks .= i18n::translate('Private'); } - $parentlinks .= "<br />\n"; + $parentlinks .= "<br />"; } } } @@ -1376,7 +1375,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", // Children ------------------------------ @var $child Person $spouselinks .= "<div id='spouseFam'>"; - $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">\n"; + $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; foreach($children as $c=>$child) { $cpid = $child->getXref(); if ($child) { @@ -1426,30 +1425,30 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", }else{ $spouselinks .= i18n::translate('Private'); } - $spouselinks .= "</li>\n"; + $spouselinks .= "</li>"; } } - $spouselinks .= "</ul>\n"; + $spouselinks .= "</ul>"; $spouselinks .= "</div>"; } } if ($persons != "Yes") { - $spouselinks .= "(" . i18n::translate('none') . ")</td></tr></table>\n\t\t"; + $spouselinks .= "(" . i18n::translate('none') . ")</td></tr></table>"; }else{ - $spouselinks .= "</td></tr></table>\n\t\t"; + $spouselinks .= "</td></tr></table>"; } if ($person_parent != "Yes") { - $parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>\n\t\t"; + $parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; }else{ - $parentlinks .= "</td></tr></table>\n\t\t"; + $parentlinks .= "</td></tr></table>"; } if ($person_step != "Yes") { - $step_parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>\n\t\t"; + $step_parentlinks .= "(" . i18n::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; }else{ - $step_parentlinks .= "</td></tr></table>\n\t\t"; + $step_parentlinks .= "</td></tr></table>"; } } } diff --git a/modules/batch_update/batch_update.php b/modules/batch_update/batch_update.php index 14ef1afa13..4e8ed60c93 100644 --- a/modules/batch_update/batch_update.php +++ b/modules/batch_update/batch_update.php @@ -108,7 +108,7 @@ class batch_update { '</table><br/><table class="list_table width100"><tr valign="middle"><td class="list_label center width20">'. self::createSubmitButton(i18n::translate('< Previous'), $this->prev_xref). self::createSubmitButton(i18n::translate('Next >'), $this->next_xref). - '</td><td class="optionbox width80"><h1><a href="'.$object->getLinkUrl().'">'.$object->getFullName().'</a>'. + '</td><td class="optionbox width80"><h1><a href="'.$object->getHtmlUrl().'">'.$object->getFullName().'</a>'. '</h1></td>'. '</tr><tr><td valign="top" class="list_label center width20">'. '<br/>'.implode('<br/>',$this->PLUGIN->getActionButtons($this->curr_xref, $this->record)).'<br/>'. @@ -371,8 +371,8 @@ class base_plugin { // Default previewer for plugins with no custom preview. function getActionPreview($xref, $gedrec) { - $old_lines=preg_split('/[\r\n]+/', $gedrec); - $new_lines=preg_split('/[\r\n]+/', $this->updateRecord($xref, $gedrec)); + $old_lines=preg_split('/[\n]+/', $gedrec); + $new_lines=preg_split('/[\n]+/', $this->updateRecord($xref, $gedrec)); // Find matching lines using longest-common-subsequence algorithm. $lcs=self::LCS($old_lines, $new_lines, 0, count($old_lines)-1, 0, count($new_lines)-1); diff --git a/modules/clippings/index.php b/modules/clippings/index.php index acc75154b4..8acaf64ad6 100644 --- a/modules/clippings/index.php +++ b/modules/clippings/index.php @@ -111,7 +111,7 @@ if ($controller->action=='add') { $ct = count($cart); if ($controller->privCount>0) { - print "<span class=\"error\">".i18n::translate('Some items could not be added due to privacy restrictions')."</span><br /><br />\n"; + print "<span class=\"error\">".i18n::translate('Some items could not be added due to privacy restrictions')."</span><br /><br />"; } if ($ct==0) { @@ -154,7 +154,7 @@ if ($ct==0) { } // -- end new lines - print "\r\n\t\t<br /><br />".i18n::translate('Your Clippings Cart is empty.')."<br /><br />"; + print "<br /><br />".i18n::translate('Your Clippings Cart is empty.')."<br /><br />"; } else { if ($controller->action != 'download' && $controller->action != 'add') { ?> <table><tr><td class="width33" valign="top" rowspan="3"> @@ -301,7 +301,7 @@ if ($ct==0) { <td class="list_value"> <?php $record=GedcomRecord::getInstance($clipping['id']); - if ($record) echo '<a href="', encode_url($record->getLinkUrl()), '">', PrintReady($record->getListName()), '</a>'; + if ($record) echo '<a href="', $record->getHtmlUrl(), '">', PrintReady($record->getListName()), '</a>'; ?> </td> <td class="list_value center vmiddle"><a href="module.php?mod=clippings&mod_action=index&action=remove&item=<?php echo $i;?>"><img src="<?php echo $WT_IMAGES["remove"];?>" border="0" alt="<?php echo i18n::translate('Remove')?>" title="<?php echo i18n::translate('Remove');?>" /></a></td> @@ -316,4 +316,3 @@ if ($ct==0) { } if (isset($_SESSION["cart"])) $_SESSION["cart"]=$cart; print_footer(); -?> diff --git a/modules/clippings/module.php b/modules/clippings/module.php index f4e7a44df7..b6513fd44a 100644 --- a/modules/clippings/module.php +++ b/modules/clippings/module.php @@ -74,36 +74,36 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module return new Menu("", "", ""); } //-- main clippings menu item - $menu = new Menu($this->getTitle(), encode_url('module.php?mod=clippings&mod_action=index&ged='.$GEDCOM), "down"); + $menu = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged='.$GEDCOM, "down"); $menu->addIcon('clippings'); $menu->addClass("menuitem$ff", "menuitem_hover$ff", "submenu$ff", "icon_large_clippings"); if (isset($controller->indi) && $controller->indi->canDisplayDetails()) { - $submenu = new Menu(i18n::translate('Add to Clippings Cart'), encode_url("module.php?mod=clippings&mod_action=index&action=add&id={$controller->pid}&type=indi")); + $submenu = new Menu(i18n::translate('Add to Clippings Cart'), "module.php?mod=clippings&mod_action=index&action=add&id={$controller->pid}&type=indi"); $submenu->addIcon('clippings'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff"); $menu->addSubmenu($submenu); } else if (isset($controller->family) && $controller->family->canDisplayDetails()) { - $submenu = new Menu(i18n::translate('Add to Clippings Cart'), encode_url("module.php?mod=clippings&mod_action=index&action=add&id={$controller->famid}&type=fam")); + $submenu = new Menu(i18n::translate('Add to Clippings Cart'), "module.php?mod=clippings&mod_action=index&action=add&id={$controller->famid}&type=fam"); $submenu->addIcon('clippings'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff"); $menu->addSubmenu($submenu); } else if (isset($controller->mediaobject) && $controller->mediaobject->canDisplayDetails()) { - $submenu = new Menu(i18n::translate('Add to Clippings Cart'), encode_url("module.php?mod=clippings&mod_action=index&action=add&id={$controller->mid}&type=obje")); + $submenu = new Menu(i18n::translate('Add to Clippings Cart'), "module.php?mod=clippings&mod_action=index&action=add&id={$controller->mid}&type=obje"); $submenu->addIcon('clippings'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff"); $menu->addSubmenu($submenu); } else if (isset($controller->source) && $controller->source->canDisplayDetails()) { - $submenu = new Menu(i18n::translate('Add to Clippings Cart'), encode_url("module.php?mod=clippings&mod_action=index&action=add&id={$controller->sid}&type=sour")); + $submenu = new Menu(i18n::translate('Add to Clippings Cart'), "module.php?mod=clippings&mod_action=index&action=add&id={$controller->sid}&type=sour"); $submenu->addIcon('clippings'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff"); $menu->addSubmenu($submenu); } else if (isset($controller->note) && $controller->note->canDisplayDetails()) { - $submenu = new Menu(i18n::translate('Add to Clippings Cart'), encode_url("module.php?mod=clippings&mod_action=index&action=add&id={$controller->nid}&type=note")); + $submenu = new Menu(i18n::translate('Add to Clippings Cart'), "module.php?mod=clippings&mod_action=index&action=add&id={$controller->nid}&type=note"); $submenu->addIcon('clippings'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff"); $menu->addSubmenu($submenu); } else if (isset($controller->repository) && $controller->repository->canDisplayDetails()) { - $submenu = new Menu(i18n::translate('Add to Clippings Cart'), encode_url("module.php?mod=clippings&mod_action=index&action=add&id={$controller->rid}&type=repo")); + $submenu = new Menu(i18n::translate('Add to Clippings Cart'), "module.php?mod=clippings&mod_action=index&action=add&id={$controller->rid}&type=repo"); $submenu->addIcon('clippings'); $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff"); $menu->addSubmenu($submenu); @@ -315,7 +315,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module } $record=GedcomRecord::getInstance($clipping['id']); if ($record) { - $out .= '<a href="'.encode_url($record->getLinkUrl()).'">'; + $out .= '<a href="'.$record->getHtmlUrl().'">'; if ($record->getType()=="INDI") $out .=$record->getSexImage(); $out .= ' '.$record->getFullName().' '; if ($record->getType()=="INDI" && $record->canDisplayDetails()) { diff --git a/modules/descendancy/module.php b/modules/descendancy/module.php index ce49bc52a8..7af9f18909 100644 --- a/modules/descendancy/module.php +++ b/modules/descendancy/module.php @@ -152,7 +152,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $bd = $person->getBirthDeathYears(false,''); if (!empty($bd)) $out .= PrintReady(' ('.$bd.')'); } - $out .= '</a> <a href="'.encode_url($person->getLinkUrl()).'"><img src="'.$WT_IMAGES['button_indi'].'" border="0" alt="indi" /></a>'; + $out .= '</a> <a href="'.$person->getHtmlUrl().'"><img src="'.$WT_IMAGES['button_indi'].'" border="0" alt="indi" /></a>'; if ($generations>0) { $out .= '<div class="desc_tree_div_visible">'; $out .= $this->loadSpouses($person->getXref()); @@ -177,8 +177,8 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { if (!empty($marryear)) { $out .= ' ('.translate_fact('MARR').' '.$marryear.')'; } - $out .= '</a> <a href="'.encode_url($person->getLinkUrl()).'"><img src="'.$WT_IMAGES['button_indi'].'" border="0" alt="indi" /></a>'; - $out .= '<a href="'.encode_url($family->getLinkUrl()).'"><img src="'.$WT_IMAGES['button_family'].'" border="0" alt="family" /></a>'; + $out .= '</a> <a href="'.$person->getHtmlUrl().'"><img src="'.$WT_IMAGES['button_indi'].'" border="0" alt="indi" /></a>'; + $out .= '<a href="'.$family->getHtmlUrl().'"><img src="'.$WT_IMAGES['button_family'].'" border="0" alt="family" /></a>'; $out .= '<div class="desc_tree_div_visible">'; $out .= $this->loadChildren($family->getXref(), $generations); $out .= '</div><script type="text/javascript">dloadedNames["'.$family->getXref().'"]=2;</script>'; diff --git a/modules/families/module.php b/modules/families/module.php index 3f41bb45b9..68832a5c3c 100644 --- a/modules/families/module.php +++ b/modules/families/module.php @@ -190,7 +190,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { $private_count = 0; foreach($families as $family) { if ($family->canDisplayName()) { - $out .= '<li><a href="'.encode_url($family->getLinkUrl()).'">'.$family->getFullName().' '; + $out .= '<li><a href="'.$family->getHtmlUrl().'">'.$family->getFullName().' '; if ($family->canDisplayDetails()) { $bd = $family->getMarriageYear(); if (!empty($bd)) $out .= PrintReady(' ('.$bd.')'); @@ -244,7 +244,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { foreach ($rows as $row) { $family=Family::getInstance($row); if ($family->canDisplayName()) { - $out .= '<li><a href="'.encode_url($family->getLinkUrl()).'">'.$family->getFullName().' '; + $out .= '<li><a href="'.$family->getHtmlUrl().'">'.$family->getFullName().' '; if ($family->canDisplayDetails()) { $bd = $family->getMarriageYear(); if (!empty($bd)) $out .= PrintReady(' ('.$bd.')'); diff --git a/modules/family_nav/module.php b/modules/family_nav/module.php index a9cbe068df..6189950f62 100644 --- a/modules/family_nav/module.php +++ b/modules/family_nav/module.php @@ -90,10 +90,6 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { return ""; } - public function getLinkUrl(&$person) { - - } - // TODO: These functions aren't really part of the WT_Module_Tab interface, as // this module no longer provides a tab. public function hasTabContent() { @@ -168,7 +164,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { </td> <td align="center" class="<?php print $this->controller->getPersonStyle($people["husb"]);?> nam"> <?php - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($people["husb"]->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($people['husb']->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["husb"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['husb']->getHtmlUrl()."');\">"; print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -200,7 +196,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { </td> <td align="center" class="<?php print $this->controller->getPersonStyle($people["wife"]); ?> nam"> <?php - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($people["wife"]->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($people['wife']->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["wife"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['wife']->getHtmlUrl()."');\">"; print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -247,7 +243,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { print "<span style=\"font: 12px tahoma, arial, helvetica, sans-serif;\">".PrintReady($child->getFullName())."</span>"; print "<br /><span style=\"font:9px tahoma, arial, helvetica, sans-serif;\">" . $BirthYr . " - " . $DeathYr . "</span>"; }else{ - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($child->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($child->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$child->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$child->getHtmlUrl()."');\">"; print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -311,7 +307,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { </td> <td align="center" class="<?php print $this->controller->getPersonStyle($people["husb"]); ?> nam"> <?php - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($people["husb"]->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($people['husb']->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["husb"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['husb']->getHtmlUrl()."');\">"; print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -351,7 +347,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { </td> <td align="center" class="<?php print $this->controller->getPersonStyle($people["wife"]); ?> nam"> <?php - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($people["wife"]->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($people['wife']->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["wife"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['wife']->getHtmlUrl()."');\">"; print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -386,7 +382,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { </td> <td align="center" class="<?php print $this->controller->getPersonStyle($child); ?> nam"> <?php - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($child->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($child->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$child->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$child->getHtmlUrl()."');\">"; print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -449,7 +445,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; }else{ - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($people["husb"]->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($people['husb']->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["husb"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['husb']->getHtmlUrl()."');\">"; print PrintReady($people["husb"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -486,7 +482,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; }else{ - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($people["wife"]->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($people['wife']->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$people["wife"]->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$people['wife']->getHtmlUrl()."');\">"; print PrintReady($people["wife"]->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -521,7 +517,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { </td> <td align="center" class="<?php print $this->controller->getPersonStyle($child); ?> nam"> <?php - print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".encode_url($child->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($child->getLinkUrl())."');\">"; + print "<a style=\"font:12px tahoma, arial, helvetica, sans-serif; padding:0px; width:100%;\" href=\"".$child->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$child->getHtmlUrl()."');\">"; print PrintReady($child->getFullName()); print "<font size=\"1\"><br />" . $BirthYr . " - " . $DeathYr . "</font>"; print "</a>"; @@ -619,7 +615,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { }else{ $title = $husb->getXref()." :".i18n::translate('Individual information'); } - $parentlinks .= "<a id=\"phusb\" href=\"".encode_url($husb->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($husb->getLinkUrl())."');\">"; + $parentlinks .= "<a id=\"phusb\" href=\"".$husb->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$husb->getHtmlUrl()."');\">"; $parentlinks .= " ".PrintReady($husb->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -641,7 +637,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { }else{ $title = $wife->getXref()." :".i18n::translate('Individual information'); } - $parentlinks .= "<a id=\"pwife\" href=\"".encode_url($wife->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($wife->getLinkUrl())."');\">"; + $parentlinks .= "<a id=\"pwife\" href=\"".$wife->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$wife->getHtmlUrl()."');\">"; $parentlinks .= " ".PrintReady($wife->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -677,7 +673,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { }else{ $title = $husb->getXref()." :".i18n::translate('Individual information'); } - $parentlinks .= "<a id=\"shusb\" href=\"".encode_url($husb->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($husb->getLinkUrl())."');\">"; + $parentlinks .= "<a id=\"shusb\" href=\"".$husb->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$husb->getHtmlUrl()."');\">"; $parentlinks .= " ".PrintReady($husb->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -701,7 +697,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { }else{ $title = $wife->getXref()." :".i18n::translate('Individual information'); } - $parentlinks .= "<a id=\"swife\" href=\"".encode_url($wife->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($wife->getLinkUrl())."');\">"; + $parentlinks .= "<a id=\"swife\" href=\"".$wife->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$wife->getHtmlUrl()."');\">"; $parentlinks .= " ".PrintReady($wife->getFullName()); $parentlinks .= "</a>"; $parentlinks .= "<br />"; @@ -732,7 +728,7 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { }else{ $title = $spouse->getXref()." :".i18n::translate('Individual information'); } - $spouselinks .= "<a id=\"spouse\" href=\"".encode_url($spouse->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($spouse->getLinkUrl())."');\">"; + $spouselinks .= "<a id=\"spouse\" href=\"".$spouse->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$spouse->getHtmlUrl()."');\">"; $spouselinks .= " ".PrintReady($spouse->getFullName()); $spouselinks .= "</a>"; $spouselinks .= "<br />"; @@ -748,18 +744,18 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { if ($child) { if ($hasChildren == 'No') { $hasChildren = 'Yes'; - $spouselinks .= "\n<ul class=\"clist ".$TEXT_DIRECTION."\">"; + $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; } $persons="Yes"; $title = i18n::translate('Individual information').": ".$child->getXref(); - $spouselinks .= "\n<li id=\"flyout3\">"; - $spouselinks .= "<a href=\"".encode_url($child->getLinkUrl())."\" onclick=\"return familyNavLoad('".encode_url($child->getLinkUrl())."');\">"; + $spouselinks .= "<li id=\"flyout3\">"; + $spouselinks .= "<a href=\"".$child->getHtmlUrl()."\" onclick=\"return familyNavLoad('".$child->getHtmlUrl()."');\">"; $spouselinks .= PrintReady($child->getFullName()); $spouselinks .= "</a>"; } } if ($hasChildren == 'Yes') { - $spouselinks .= "\n</ul>"; + $spouselinks .= "</ul>"; } else { $spouselinks .= "<img src=\"images/small/childless.gif\" alt=\"".i18n::translate('This family remained childless')."\" height=\"15\" align=\"middle\"/> ".i18n::translate('This family remained childless')."<br />"; } @@ -767,17 +763,16 @@ function print_pedigree_person_nav($pid, $style=1, $count=0, $personcount="1") { } if ($persons != "Yes") { - $spouselinks .= " (".i18n::translate('none').")\n\t\t"; + $spouselinks .= " (".i18n::translate('none').")"; } if ($person_parent != "Yes") { - $parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")\n\t\t"; + $parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")"; } if ($person_step != "Yes") { - $step_parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")\n\t\t"; + $step_parentlinks .= " (".i18n::translate_c('unknown family', 'unknown').")"; } } } } } - } diff --git a/modules/gedcom_block/module.php b/modules/gedcom_block/module.php index fff5474c3c..71ddd898df 100644 --- a/modules/gedcom_block/module.php +++ b/modules/gedcom_block/module.php @@ -50,12 +50,12 @@ class gedcom_block_WT_Module extends WT_Module implements WT_Module_Block { $id=$this->getName().$block_id; $title=get_gedcom_setting(WT_GED_ID, 'title'); $content = "<div class=\"center\">"; - $content .= "<br />".format_timestamp(client_time())."<br />\n"; + $content .= "<br />".format_timestamp(client_time())."<br />"; if ($SHOW_COUNTER) - $content .= i18n::translate('Hit Count:')." ".$hitCount."<br />\n"; - $content .= "\n<br />"; + $content .= i18n::translate('Hit Count:')." ".$hitCount."<br />"; + $content .= "<br />"; if (WT_USER_GEDCOM_ADMIN) { - $content .= "<a href=\"javascript:;\" onclick=\"window.open('".encode_url("index_edit.php?name=".WT_GEDCOM."&ctype=gedcom")."', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1'); return false;\">".i18n::translate('Customize this GEDCOM Home Page')."</a><br />\n"; + $content .= "<a href=\"javascript:;\" onclick=\"window.open('index_edit.php?name=".WT_GEDCOM."&ctype=gedcom', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1'); return false;\">".i18n::translate('Customize this GEDCOM Home Page')."</a><br />"; } $content .= "</div>"; diff --git a/modules/gedcom_favorites/module.php b/modules/gedcom_favorites/module.php index 16fbec9d81..14b380ce00 100644 --- a/modules/gedcom_favorites/module.php +++ b/modules/gedcom_favorites/module.php @@ -183,14 +183,14 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center $TEXT_DIRECTION\">"; foreach($userfavs as $key=>$favorite) { if (isset($favorite["id"])) $key=$favorite["id"]; - $removeFavourite = "<a class=\"font9\" href=\"".encode_url("index.php?ctype=$ctype&action=deletefav&fv_id={$key}")."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this item from your list of Favorites?')."');\">".i18n::translate('Remove')."</a><br />\n"; + $removeFavourite = "<a class=\"font9\" href=\"index.php?ctype=$ctype&action=deletefav&fv_id={$key}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this item from your list of Favorites?')."');\">".i18n::translate('Remove')."</a><br />"; $content .= "<tr><td>"; if ($favorite["type"]=="URL") { - $content .= "<div id=\"boxurl".$key.".0\" class=\"person_box\">\n"; + $content .= "<div id=\"boxurl".$key.".0\" class=\"person_box\">"; if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) $content .= $removeFavourite; $content .= "<a href=\"".$favorite["url"]."\"><b>".PrintReady($favorite["title"])."</b></a>"; $content .= "<br />".PrintReady($favorite["note"]); - $content .= "</div>\n"; + $content .= "</div>"; } else { $record=GedcomRecord::getInstance($favorite['gid']); if ($record && $record->canDisplayDetails()) { @@ -200,13 +200,13 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { if (strpos($indirec, "\n1 SEX F")!==false) $content .= "F"; elseif (strpos($indirec, "\n1 SEX M")!==false) $content .= ""; else $content .= "NN"; - $content .= "\">\n"; + $content .= "\">"; if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) $content .= $removeFavourite; ob_start(); print_pedigree_person($favorite["gid"], $style, 1, $key); $content .= ob_get_clean(); $content .= PrintReady($favorite["note"]); - $content .= "</div>\n"; + $content .= "</div>"; } else { $record=GedcomRecord::getInstance($favorite['gid']); $content .= "<div id=\"box".$favorite["gid"].".0\" class=\"person_box\">"; @@ -221,9 +221,9 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { } } } - $content .= "</td></tr>\n"; + $content .= "</td></tr>"; } - $content .= "</table>\n"; + $content .= "</table>"; } if (WT_USER_GEDCOM_ADMIN) { $content .= ' @@ -240,33 +240,33 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { $uniqueID = floor(microtime() * 1000000); $content .= "<b><a href=\"javascript://".i18n::translate('Add a new favorite')." \" onclick=\"expand_layer('add_ged_fav{$uniqueID}'); return false;\"><img id=\"add_ged_fav_img\" src=\"".$WT_IMAGES["plus"]."\" border=\"0\" alt=\"\" /> ".i18n::translate('Add a new favorite')."</a></b>"; $content .= help_link('index_add_favorites'); - $content .= "<br /><div id=\"add_ged_fav{$uniqueID}\" style=\"display: none;\">\n"; - $content .= "<form name=\"addgfavform\" method=\"get\" action=\"index.php\">\n"; - $content .= "<input type=\"hidden\" name=\"action\" value=\"addfav\" />\n"; - $content .= "<input type=\"hidden\" name=\"ctype\" value=\"$ctype\" />\n"; - $content .= "<input type=\"hidden\" name=\"favtype\" value=\"gedcom\" />\n"; - $content .= "<input type=\"hidden\" name=\"ged\" value=\"".WT_GEDCOM."\" />\n"; + $content .= "<br /><div id=\"add_ged_fav{$uniqueID}\" style=\"display: none;\">"; + $content .= "<form name=\"addgfavform\" method=\"get\" action=\"index.php\">"; + $content .= "<input type=\"hidden\" name=\"action\" value=\"addfav\" />"; + $content .= "<input type=\"hidden\" name=\"ctype\" value=\"$ctype\" />"; + $content .= "<input type=\"hidden\" name=\"favtype\" value=\"gedcom\" />"; + $content .= "<input type=\"hidden\" name=\"ged\" value=\"".WT_GEDCOM."\" />"; $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center {$TEXT_DIRECTION}\">"; $content .= "<tr><td>".i18n::translate('Enter a Person, Family, or Source ID')." <br />"; $content .= "<input class=\"pedigree_form\" type=\"text\" name=\"gid\" id=\"gid{$uniqueID}\" size=\"5\" value=\"\" />"; - $content .= print_findindi_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findfamily_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findsource_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findrepository_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findnote_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findmedia_link("gid{$uniqueID}",'1','',true)."\n"; + $content .= print_findindi_link("gid{$uniqueID}",'',true); + $content .= print_findfamily_link("gid{$uniqueID}",'',true); + $content .= print_findsource_link("gid{$uniqueID}",'',true); + $content .= print_findrepository_link("gid{$uniqueID}",'',true); + $content .= print_findnote_link("gid{$uniqueID}",'',true); + $content .= print_findmedia_link("gid{$uniqueID}",'1','',true); - $content .= "\n<br />".i18n::translate('OR<br />Enter a URL and a title'); - $content .= "\n<table><tr><td>".translate_fact('URL')."</td><td><input type=\"text\" name=\"url\" size=\"40\" value=\"\" /></td></tr>"; - $content .= "\n<tr><td>".i18n::translate('Title:')."</td><td><input type=\"text\" name=\"favtitle\" size=\"40\" value=\"\" /></td></tr></table>"; - if ($block) $content .= "\n</td></tr><tr><td><br />"; - else $content .= "\n</td><td>"; - $content .= "\n".i18n::translate('Enter an optional note about this favorite'); - $content .= "\n<br /><textarea name=\"favnote\" rows=\"6\" cols=\"50\"></textarea>"; - $content .= "</td></tr></table>\n"; - $content .= "\n<br /><input type=\"submit\" value=\"".i18n::translate('Add')."\" style=\"font-size: 8pt; \" />"; - $content .= "\n</form></div>\n"; + $content .= "<br />".i18n::translate('OR<br />Enter a URL and a title'); + $content .= "<table><tr><td>".translate_fact('URL')."</td><td><input type=\"text\" name=\"url\" size=\"40\" value=\"\" /></td></tr>"; + $content .= "<tr><td>".i18n::translate('Title:')."</td><td><input type=\"text\" name=\"favtitle\" size=\"40\" value=\"\" /></td></tr></table>"; + if ($block) $content .= "</td></tr><tr><td><br />"; + else $content .= "</td><td>"; + $content .= "".i18n::translate('Enter an optional note about this favorite'); + $content .= "<br /><textarea name=\"favnote\" rows=\"6\" cols=\"50\"></textarea>"; + $content .= "</td></tr></table>"; + $content .= "<br /><input type=\"submit\" value=\"".i18n::translate('Add')."\" style=\"font-size: 8pt; \" />"; + $content .= "</form></div>"; } if ($template) { diff --git a/modules/gedcom_news/module.php b/modules/gedcom_news/module.php index 9b4e2201de..dc602d1c15 100644 --- a/modules/gedcom_news/module.php +++ b/modules/gedcom_news/module.php @@ -122,11 +122,11 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block { break; } } - $content .= "<div class=\"news_box\" id=\"{$news['anchor']}\">\n"; + $content .= "<div class=\"news_box\" id=\"{$news['anchor']}\">"; // Look for $GLOBALS substitutions in the News title $newsTitle = embed_globals($news['title']); - $content .= "<div class=\"news_title\">".PrintReady($newsTitle)."</div>\n"; + $content .= "<div class=\"news_title\">".PrintReady($newsTitle)."</div>"; $content .= "<div class=\"news_date\">".format_timestamp($news['date'])."</div>"; if ($news["text"]==strip_tags($news["text"])) { // No HTML? @@ -137,9 +137,9 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block { if(WT_USER_GEDCOM_ADMIN) { $content .= "<hr size=\"1\" />" ."<a href=\"javascript:;\" onclick=\"editnews('".$news['id']."'); return false;\">".i18n::translate('Edit')."</a> | " - ."<a href=\"".encode_url("index.php?action=deletenews&news_id=".$news['id']."&ctype={$ctype}")."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this News entry?')."');\">".i18n::translate('Delete')."</a><br />"; + ."<a href=\"index.php?action=deletenews&news_id=".$news['id']."&ctype={$ctype}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this News entry?')."');\">".i18n::translate('Delete')."</a><br />"; } - $content .= "</div>\n"; + $content .= "</div>"; } $printedAddLink = false; if (WT_USER_GEDCOM_ADMIN) { @@ -148,7 +148,7 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block { } if ($limit=='date' || $limit=='count') { if ($printedAddLink) $content .= " | "; - $content .= "<a href=\"".encode_url("index.php?gedcom_news_archive=yes&ctype={$ctype}")."\">".i18n::translate('View archive')."</a>"; + $content .= "<a href=\"index.php?gedcom_news_archive=yes&ctype={$ctype}\">".i18n::translate('View archive')."</a>"; $content .= help_link('gedcom_news_archive').'<br />'; } diff --git a/modules/gedcom_stats/module.php b/modules/gedcom_stats/module.php index 6678904f77..51ce08688b 100644 --- a/modules/gedcom_stats/module.php +++ b/modules/gedcom_stats/module.php @@ -78,7 +78,7 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { $id=$this->getName().$block_id; $title=''; if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) { - $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('".encode_url("index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}")."', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; + $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $title .= "<img class=\"adminicon\" src=\"".$WT_IMAGES["admin"]."\" width=\"15\" height=\"15\" border=\"0\" alt=\"".i18n::translate('Configure')."\" /></a>"; } $title.=i18n::translate('GEDCOM Statistics').help_link('index_stats'); @@ -104,12 +104,12 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { $content .= '<br /><table><tr><td valign="top" class="width20"><table cellspacing="1" cellpadding="0">'; if ($stat_indi) { - $content.='<tr><td class="facts_label">'.i18n::translate('Individuals').'</td><td class="facts_value"><div dir="rtl"><a href="'.encode_url("indilist.php?surname_sublist=no&ged=".WT_GEDCOM).'">'.$stats->totalIndividuals().'</a></div></td></tr>'; + $content.='<tr><td class="facts_label">'.i18n::translate('Individuals').'</td><td class="facts_value"><div dir="rtl"><a href="'."indilist.php?surname_sublist=no&ged=".WT_GEDCOM.'">'.$stats->totalIndividuals().'</a></div></td></tr>'; $content.='<tr><td class="facts_label">'.i18n::translate('Males').'</td><td class="facts_value"><div dir="rtl">'.$stats->totalSexMales().'<br />'.$stats->totalSexMalesPercentage().'%</div></td></tr>'; $content.='<tr><td class="facts_label">'.i18n::translate('Females').'</td><td class="facts_value"><div dir="rtl">'.$stats->totalSexFemales().'<br />'.$stats->totalSexFemalesPercentage().'%</div></td></tr>'; } if ($stat_surname) { - $content .= '<tr><td class="facts_label">'.i18n::translate('Total surnames').'</td><td class="facts_value"><div dir="rtl"><a href="'.encode_url("indilist.php?show_all=yes&surname_sublist=yes&ged=".WT_GEDCOM).'">'.$stats->totalSurnames().'</a></div></td></tr>'; + $content .= '<tr><td class="facts_label">'.i18n::translate('Total surnames').'</td><td class="facts_value"><div dir="rtl"><a href="'."indilist.php?show_all=yes&surname_sublist=yes&ged=".WT_GEDCOM.'">'.$stats->totalSurnames().'</a></div></td></tr>'; } if ($stat_fam) { $content .= '<tr><td class="facts_label">'.i18n::translate('Families').'</td><td class="facts_value"><div dir="rtl"><a href="famlist.php">'.$stats->totalFamilies().'</a></div></td></tr>'; @@ -219,7 +219,7 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { if ($i>0) { $content .= ', '; } - $content .= '<a href="'.encode_url("indilist.php?ged=".WT_GEDCOM."&surname=".$surname['name']).'">'.PrintReady($surname['name']).'</a>'; + $content .= '<a href="'."indilist.php?ged=".WT_GEDCOM."&surname=".rawurlencode($surname['name']).'">'.PrintReady($surname['name']).'</a>'; $i++; } } diff --git a/modules/googlemap/googlemap.php b/modules/googlemap/googlemap.php index 1796d00632..e9f42b78b6 100644 --- a/modules/googlemap/googlemap.php +++ b/modules/googlemap/googlemap.php @@ -614,16 +614,16 @@ function build_indiv_map($indifacts, $famids) { } if ($i == 0) { - echo "<table class=\"facts_table\">\n"; + echo "<table class=\"facts_table\">"; echo "<tr><td colspan=\"2\" class=\"facts_value\">".i18n::translate('No map data for this person'); //echo "<script language=\"JavaScript\" type=\"text/javascript\">tabstyles[5]='tab_cell_inactive_empty'; document.getElementById('pagetab5').className='tab_cell_inactive_empty';</script>"; - echo "</td></tr>\n"; - echo "<script type=\"text/javascript\">\n"; - echo "function ResizeMap ()\n{\n}\n</script>\n"; + echo "</td></tr>"; + echo "<script type=\"text/javascript\">"; + echo "function ResizeMap(){}</script>"; if (WT_USER_IS_ADMIN) { - echo "<tr><td align=\"center\" colspan=\"2\">\n"; + echo "<tr><td align=\"center\" colspan=\"2\">"; echo "<a href=\"module.php?mod=googlemap&mod_action=editconfig\">", i18n::translate('Manage GoogleMap configuration'), "</a>"; - echo "</td></tr>\n"; + echo "</td></tr>"; } } else { ?> @@ -632,8 +632,8 @@ function build_indiv_map($indifacts, $famids) { var bounds = new GLatLngBounds(); <?php foreach ($markers as $marker) - echo "bounds.extend(new GLatLng({$marker["lati"]}, {$marker["lng"]}));\n"; - echo "SetBoundaries(bounds);\n"; + echo "bounds.extend(new GLatLng({$marker["lati"]}, {$marker["lng"]}));"; + echo "SetBoundaries(bounds);"; echo "var icon = new GIcon();"; echo "icon.image = \"http://maps.google.com/intl/pl_ALL/mapfiles/marker.png\";"; @@ -641,7 +641,7 @@ function build_indiv_map($indifacts, $famids) { echo "icon.iconAnchor = new GPoint(10, 34);"; echo "icon.infoWindowAnchor = new GPoint(5, 1);"; - echo "\nmarkers.clear();\n"; + echo "markers.clear();"; $indexcounter = 0; for ($j=1; $j<=$i; $j++) { // Use @ because some installations give warnings (but not errors?) about UTF-8 @@ -656,27 +656,27 @@ function build_indiv_map($indifacts, $famids) { if ($multimarker == 0) { // Only one location with this long/lati combination $markers[$j]["placed"] = "yes"; if (($markers[$j]["lati"] == NULL) || ($markers[$j]["lng"] == NULL) || (($markers[$j]["lati"] == "0") && ($markers[$j]["lng"] == "0"))) { - echo "var Marker{$j}_flag = new GIcon();\n"; - echo " Marker{$j}_flag.image = \"modules/googlemap/images/marker_yellow.png\";\n"; - echo " Marker{$j}_flag.shadow = \"modules/googlemap/images/shadow50.png\";\n"; - echo " Marker{$j}_flag.iconSize = new GSize(20, 34);\n"; - echo " Marker{$j}_flag.shadowSize = new GSize(37, 34);\n"; - echo " Marker{$j}_flag.iconAnchor = new GPoint(10, 34);\n"; - echo " Marker{$j}_flag.infoWindowAnchor = new GPoint(5, 1);\n"; - echo "var Marker{$j} = new GMarker(new GLatLng(0, 0), {icon:Marker{$j}_flag, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j}_flag = new GIcon();"; + echo " Marker{$j}_flag.image = \"modules/googlemap/images/marker_yellow.png\";"; + echo " Marker{$j}_flag.shadow = \"modules/googlemap/images/shadow50.png\";"; + echo " Marker{$j}_flag.iconSize = new GSize(20, 34);"; + echo " Marker{$j}_flag.shadowSize = new GSize(37, 34);"; + echo " Marker{$j}_flag.iconAnchor = new GPoint(10, 34);"; + echo " Marker{$j}_flag.infoWindowAnchor = new GPoint(5, 1);"; + echo "var Marker{$j} = new GMarker(new GLatLng(0, 0), {icon:Marker{$j}_flag, title:\"", addslashes($tooltip), "\"});"; } else if (empty($markers[$j]["icon"])) { - echo "var Marker{$j} = new GMarker(new GLatLng({$markers[$j]["lati"]}, {$markers[$j]["lng"]}), {icon:icon, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j} = new GMarker(new GLatLng({$markers[$j]["lati"]}, {$markers[$j]["lng"]}), {icon:icon, title:\"", addslashes($tooltip), "\"});"; } else { - echo "var Marker{$j}_flag = new GIcon();\n"; - echo " Marker{$j}_flag.image = \"", $markers[$j]["icon"], "\";\n"; - echo " Marker{$j}_flag.shadow = \"modules/googlemap/images/flag_shadow.png\";\n"; - echo " Marker{$j}_flag.iconSize = new GSize(25, 15);\n"; - echo " Marker{$j}_flag.shadowSize = new GSize(35, 45);\n"; - echo " Marker{$j}_flag.iconAnchor = new GPoint(1, 45);\n"; - echo " Marker{$j}_flag.infoWindowAnchor = new GPoint(5, 1);\n"; - echo "var Marker{$j} = new GMarker(new GLatLng(", $markers[$j]["lati"], ", ", $markers[$j]["lng"], "), {icon:Marker{$j}_flag, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j}_flag = new GIcon();"; + echo " Marker{$j}_flag.image = \"", $markers[$j]["icon"], "\";"; + echo " Marker{$j}_flag.shadow = \"modules/googlemap/images/flag_shadow.png\";"; + echo " Marker{$j}_flag.iconSize = new GSize(25, 15);"; + echo " Marker{$j}_flag.shadowSize = new GSize(35, 45);"; + echo " Marker{$j}_flag.iconAnchor = new GPoint(1, 45);"; + echo " Marker{$j}_flag.infoWindowAnchor = new GPoint(5, 1);"; + echo "var Marker{$j} = new GMarker(new GLatLng(", $markers[$j]["lati"], ", ", $markers[$j]["lng"], "), {icon:Marker{$j}_flag, title:\"", addslashes($tooltip), "\"});"; } - echo "GEvent.addListener(Marker{$j}, \"click\", function() {\n"; + echo "GEvent.addListener(Marker{$j}, \"click\", function() {"; echo "Marker{$j}.openInfoWindowHtml(\"<div class='iwstyle'>"; echo PrintReady($markers[$j]["fact"]); if (!empty($markers[$j]['info'])) @@ -684,7 +684,7 @@ function build_indiv_map($indifacts, $famids) { if (!empty($markers[$j]["name"])) { $person=Person::getInstance($markers[$j]['name']); if ($person) { - echo ': <a href=\"', $person->getLinkUrl(), '\">', $person->canDisplayName() ? PrintReady(addcslashes($person->getFullName(), '"')) : i18n::translate('Private'), '</a>'; + echo ': <a href=\"', $person->getRawUrl(), '\">', $person->canDisplayName() ? PrintReady(addcslashes($person->getFullName(), '"')) : i18n::translate('Private'), '</a>'; } } echo "<br />"; @@ -701,20 +701,20 @@ function build_indiv_map($indifacts, $famids) { echo "<br /><br />", i18n::translate('This place has no coordinates'); if (WT_USER_IS_ADMIN) echo '<br /><a href=\"module.php?mod=googlemap&mod_action=places&display=inactive\">', i18n::translate('Edit geographic location'), '</a>'; - echo "\");\n"; + echo "\");"; } else if (!$GOOGLEMAP_COORD){ - echo "\");\n"; + echo "\");"; } else { echo "<br /><br />"; if ($markers[$j]["lati"]>'0'){echo "N", str_replace('-', '', $markers[$j]["lati"]);}else{ echo str_replace('-', 'S', $markers[$j]["lati"]);} echo ", "; if ($markers[$j]["lng"]>'0'){echo "E", str_replace('-', '', $markers[$j]["lng"]);}else{ echo str_replace('-', 'W', $markers[$j]["lng"]);} - echo "\");\n"; + echo "\");"; } - echo "});\n"; - echo "markers.push(Marker{$j});\n"; - echo "map.addOverlay(Marker{$j});\n"; + echo "});"; + echo "markers.push(Marker{$j});"; + echo "map.addOverlay(Marker{$j});"; $markers[$j]["index"] = $indexcounter; $markers[$j]["tabindex"] = 0; $indexcounter = $indexcounter + 1; @@ -723,18 +723,18 @@ function build_indiv_map($indifacts, $famids) { $markersindex = 0; $markers[$j]["placed"] = "yes"; if (empty($markers[$j]["icon"])) { - echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", $markers[$j]["lati"], ", ", $markers[$j]["lng"], "), {icon:icon, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", $markers[$j]["lati"], ", ", $markers[$j]["lng"], "), {icon:icon, title:\"", addslashes($tooltip), "\"});"; } else { - echo "var Marker{$j}_{$markersindex}_flag = new GIcon();\n"; - echo " Marker{$j}_{$markersindex}_flag.image = \"", $markers[$j]["icon"], "\";\n"; - echo " Marker{$j}_{$markersindex}_flag.shadow = \"modules/googlemap/images/flag_shadow.png\";\n"; - echo " Marker{$j}_{$markersindex}_flag.iconSize = new GSize(25, 15);\n"; - echo " Marker{$j}_{$markersindex}_flag.shadowSize = new GSize(35, 45);\n"; - echo " Marker{$j}_{$markersindex}_flag.iconAnchor = new GPoint(1, 45);\n"; - echo " Marker{$j}_{$markersindex}_flag.infoWindowAnchor = new GPoint(5, 1);\n"; - echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", $markers[$j]["lati"], ", ", $markers[$j]["lng"], "), {icon:Marker{$j}_{$markersindex}_flag, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j}_{$markersindex}_flag = new GIcon();"; + echo " Marker{$j}_{$markersindex}_flag.image = \"", $markers[$j]["icon"], "\";"; + echo " Marker{$j}_{$markersindex}_flag.shadow = \"modules/googlemap/images/flag_shadow.png\";"; + echo " Marker{$j}_{$markersindex}_flag.iconSize = new GSize(25, 15);"; + echo " Marker{$j}_{$markersindex}_flag.shadowSize = new GSize(35, 45);"; + echo " Marker{$j}_{$markersindex}_flag.iconAnchor = new GPoint(1, 45);"; + echo " Marker{$j}_{$markersindex}_flag.infoWindowAnchor = new GPoint(5, 1);"; + echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", $markers[$j]["lati"], ", ", $markers[$j]["lng"], "), {icon:Marker{$j}_{$markersindex}_flag, title:\"", addslashes($tooltip), "\"});"; } - echo "var Marker{$j}_{$markersindex}Info = [\n"; + echo "var Marker{$j}_{$markersindex}Info = ["; $markers[$j]["index"] = $indexcounter; $markers[$j]["tabindex"] = $tabcounter; $tabcounter = $tabcounter + 1; @@ -744,7 +744,7 @@ function build_indiv_map($indifacts, $famids) { if (!empty($markers[$j]["name"])) { $person=Person::getInstance($markers[$j]['name']); if ($person) { - echo ': <a href=\"', $person->getLinkUrl(), '\">', $person->canDisplayName() ? PrintReady(addcslashes($person->getFullName(), '"')) : i18n::translate('Private'), '</a>'; + echo ': <a href=\"', $person->getRawUrl(), '\">', $person->canDisplayName() ? PrintReady(addcslashes($person->getFullName(), '"')) : i18n::translate('Private'), '</a>'; } } echo "<br />"; @@ -773,34 +773,33 @@ function build_indiv_map($indifacts, $famids) { if ($tabcounter == 4) { // Use @ because some installations give warnings (but not errors?) about UTF-8 $tooltip=@html_entity_decode(strip_tags(tool_tip_text($markers[$k])), ENT_QUOTES, 'UTF-8'); - echo "\n"; - echo "];\n"; - echo "GEvent.addListener(Marker{$j}_{$markersindex}, \"click\", function(tabToSelect) {\n"; - echo "if (tabToSelect>0) \n"; - echo "Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info, {selectedTab: tabToSelect});\n"; - echo "else Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info);\n"; - echo "});\n"; - echo "markers.push(Marker{$j}_{$markersindex});\n"; - echo "map.addOverlay(Marker{$j}_{$markersindex});\n"; + echo "];"; + echo "GEvent.addListener(Marker{$j}_{$markersindex}, \"click\", function(tabToSelect) {"; + echo "if (tabToSelect>0) "; + echo "Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info, {selectedTab: tabToSelect});"; + echo "else Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info);"; + echo "});"; + echo "markers.push(Marker{$j}_{$markersindex});"; + echo "map.addOverlay(Marker{$j}_{$markersindex});"; $indexcounter = $indexcounter + 1; $tabcounter = 0; $markersindex = $markersindex + 1; if (empty($markers[$j]["icon"])) { - echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", ($markers[$j]["lati"]-(0.0015*$markersindex)), ", ", ($markers[$j]["lng"]+(0.0025*$markersindex)), "), {icon:icon, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", ($markers[$j]["lati"]-(0.0015*$markersindex)), ", ", ($markers[$j]["lng"]+(0.0025*$markersindex)), "), {icon:icon, title:\"", addslashes($tooltip), "\"});"; } else { - echo "var Marker{$j}_{$markersindex}_flag = new GIcon();\n"; - echo " Marker{$j}_{$markersindex}_flag.image = \"", $markers[$j]["icon"], "\";\n"; - echo " Marker{$j}_{$markersindex}_flag.shadow = \"modules/googlemap/images/flag_shadow.png\";\n"; - echo " Marker{$j}_{$markersindex}_flag.iconSize = new GSize(25, 15);\n"; - echo " Marker{$j}_{$markersindex}_flag.shadowSize = new GSize(35, 45);\n"; - echo " Marker{$j}_{$markersindex}_flag.iconAnchor = new GPoint(1, 45);\n"; - echo " Marker{$j}_{$markersindex}_flag.infoWindowAnchor = new GPoint(5, 1);\n"; - echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", ($markers[$j]["lati"]-(0.0015*$markersindex)), ", ", ($markers[$j]["lng"]+(0.0025*$markersindex)), "), {icon:Marker{$j}_{$markersindex}_flag, title:\"", addslashes($tooltip), "\"});\n"; + echo "var Marker{$j}_{$markersindex}_flag = new GIcon();"; + echo " Marker{$j}_{$markersindex}_flag.image = \"", $markers[$j]["icon"], "\";"; + echo " Marker{$j}_{$markersindex}_flag.shadow = \"modules/googlemap/images/flag_shadow.png\";"; + echo " Marker{$j}_{$markersindex}_flag.iconSize = new GSize(25, 15);"; + echo " Marker{$j}_{$markersindex}_flag.shadowSize = new GSize(35, 45);"; + echo " Marker{$j}_{$markersindex}_flag.iconAnchor = new GPoint(1, 45);"; + echo " Marker{$j}_{$markersindex}_flag.infoWindowAnchor = new GPoint(5, 1);"; + echo "var Marker{$j}_{$markersindex} = new GMarker(new GLatLng(", ($markers[$j]["lati"]-(0.0015*$markersindex)), ", ", ($markers[$j]["lng"]+(0.0025*$markersindex)), "), {icon:Marker{$j}_{$markersindex}_flag, title:\"", addslashes($tooltip), "\"});"; } - echo "var Marker{$j}_{$markersindex}Info = [\n"; + echo "var Marker{$j}_{$markersindex}Info = ["; } else { - echo ", \n"; + echo ", "; } $markers[$k]["index"] = $indexcounter; $markers[$k]["tabindex"] = $tabcounter; @@ -811,7 +810,7 @@ function build_indiv_map($indifacts, $famids) { if (!empty($markers[$k]["name"])) { $person=Person::getInstance($markers[$k]['name']); if ($person) { - echo ': <a href=\"', $person->getLinkUrl(), '\">', $person->canDisplayName() ? PrintReady(addcslashes($person->getFullName(), '"')) : i18n::translate('Private'), '</a>'; + echo ': <a href=\"', $person->getRawUrl(), '\">', $person->canDisplayName() ? PrintReady(addcslashes($person->getFullName(), '"')) : i18n::translate('Private'), '</a>'; } } echo "<br />"; @@ -835,15 +834,14 @@ function build_indiv_map($indifacts, $famids) { } } } - echo "\n"; - echo "];\n"; - echo "GEvent.addListener(Marker{$j}_{$markersindex}, \"click\", function(tabToSelect) {\n"; - echo "if (tabToSelect>0) \n"; - echo "Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info, {selectedTab: tabToSelect});\n"; - echo "else Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info);\n"; - echo "});\n"; - echo "markers.push(Marker{$j}_{$markersindex});\n"; - echo "map.addOverlay(Marker{$j}_{$markersindex});\n"; + echo "];"; + echo "GEvent.addListener(Marker{$j}_{$markersindex}, \"click\", function(tabToSelect) {"; + echo "if (tabToSelect>0) "; + echo "Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info, {selectedTab: tabToSelect});"; + echo "else Marker{$j}_{$markersindex}.openInfoWindowTabsHtml(Marker{$j}_{$markersindex}Info);"; + echo "});"; + echo "markers.push(Marker{$j}_{$markersindex});"; + echo "map.addOverlay(Marker{$j}_{$markersindex});"; $indexcounter = $indexcounter + 1; } } @@ -861,7 +859,7 @@ function build_indiv_map($indifacts, $famids) { if (!empty($marker["name"])) { $person=Person::getInstance($marker['name']); if ($person) { - echo '<a href="', $person->getLinkUrl(), '">', $person->canDisplayName() ? PrintReady($person->getFullName()) : i18n::translate('Private'), '</a>'; + echo '<a href="', $person->getHtmlUrl(), '">', $person->canDisplayName() ? PrintReady($person->getFullName()) : i18n::translate('Private'), '</a>'; } echo '<br />'; } @@ -878,7 +876,7 @@ function build_indiv_map($indifacts, $famids) { } echo "</table></div><br />"; } - echo "\n<br />"; + echo "<br />"; return $i; } diff --git a/modules/individuals/module.php b/modules/individuals/module.php index 8fde5f231a..c5f66e4200 100644 --- a/modules/individuals/module.php +++ b/modules/individuals/module.php @@ -191,7 +191,7 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { $private_count = 0; foreach($indis as $person) { if ($person->canDisplayName()) { - $out .= '<li><a href="'.encode_url($person->getLinkUrl()).'">'.$person->getSexImage().' '.$person->getListName().' '; + $out .= '<li><a href="'.$person->getHtmlUrl().'">'.$person->getSexImage().' '.$person->getListName().' '; if ($person->canDisplayDetails()) { $bd = $person->getBirthDeathYears(false,''); if (!empty($bd)) $out .= PrintReady(' ('.$bd.')'); @@ -226,7 +226,7 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { foreach ($rows as $row) { $person=Person::getInstance($row); if ($person->canDisplayName()) { - $out .= '<li><a href="'.encode_url($person->getLinkUrl()).'">'.$person->getSexImage().' '.$person->getListName().' '; + $out .= '<li><a href="'.$person->getHtmlUrl().'">'.$person->getSexImage().' '.$person->getListName().' '; if ($person->canDisplayDetails()) { $bd = $person->getBirthDeathYears(false,''); if (!empty($bd)) $out .= PrintReady(' ('.$bd.')'); diff --git a/modules/lightbox/functions/lb_head.php b/modules/lightbox/functions/lb_head.php index 9b65615b3b..23ca600a9d 100644 --- a/modules/lightbox/functions/lb_head.php +++ b/modules/lightbox/functions/lb_head.php @@ -100,7 +100,6 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print "</a>"; print "</td>"; // print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "text") { print "<td class=\"width15 center wrap\" valign=\"top\">"; print "<a href=\"javascript:goto_config_lightbox()\">"; @@ -108,13 +107,11 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print "</a>"; print "</td>"; // print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "icon") { print " "; print "<a href=\"javascript:goto_config_lightbox()\">"; print "<img src=\"modules/lightbox/images/image_edit.gif\" class=\"icon\" title=\"".i18n::translate('Lightbox-Album Configuration')."\" alt=\"".i18n::translate('Lightbox-Album Configuration')."\" />" ; print "</a>"; - print "\n"; } } @@ -128,7 +125,6 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print " </a> "; print "</td>"; //print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "text") { print "<td class=\"width15 center wrap\" valign=\"top\">"; print "<a href=\"javascript: album_add()\"> "; @@ -136,13 +132,11 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print " </a> "; print "</td>"; //print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "icon") { print " "; print "<a href=\"javascript: album_add()\"> "; print "<img src=\"modules/lightbox/images/image_add.gif\" class=\"icon\" title=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" alt=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" />" ; print "</a>"; - print "\n"; } } @@ -156,7 +150,6 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print " </a> "; print "</td>"; // print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "text") { print "<td class=\"width15 center wrap\" valign=\"top\">"; print "<a href=\"javascript: album_link()\"> "; @@ -169,7 +162,6 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print "<a href=\"javascript: album_link()\">"; print "<img src=\"modules/lightbox/images/image_link.gif\" class=\"icon\" title=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" alt=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" />" ; print "</a> "; - print "\n"; }else{ } } @@ -178,25 +170,23 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; if (WT_USER_CAN_EDIT) { if ($LB_AL_HEAD_LINKS == "both") { print "<td class=\"width15 center wrap\" valign=\"top\">"; - print "<a href=\"".encode_url(WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1")."\">" ; + print "<a href=\"".WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1\">" ; print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media')."\" alt=\"".i18n::translate('Re-order media')."\" /><br />" ; print "" . i18n::translate('Re-order media') . " "; print '</a>'; print "</td>"; // print "<input type=\"hidden\" name=\"reorder\" value=\"1\" />"; //print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "text") { print "<td class=\"width15 center wrap\" valign=\"top\">"; - print "<a href=\"".encode_url(WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1")."\">" ; + print "<a href=\"".WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1\">" ; print "" . i18n::translate('Re-order media') . " "; print '</a>'; print "</td>"; //print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "icon") { print " "; - print "<a href=\"".encode_url(WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1")."\">" ; + print "<a href=\"".WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1\">" ; print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media')."\" alt=\"".i18n::translate('Re-order media')."\" />" ; print '</a>'; //print "<td width=\"5%\"> </td>"; @@ -215,7 +205,6 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print '</a>'; print "</td>"; //print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "text") { print "<td class=\"width15 center wrap\" valign=\"top\">"; print "<a href=\"javascript: reorder_media()\">" ; @@ -224,14 +213,12 @@ require_once WT_ROOT.'includes/media_reorder_count.php'; print '</a>'; print "</td>"; //print "<td width=\"5%\"> </td>"; - print "\n"; }else if ($LB_AL_HEAD_LINKS == "icon") { print " "; print "<a href=\"javascript: reorder_media()\">" ; print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media (window)')."\" alt=\"".i18n::translate('Re-order media (window)')."\" /><br />" ; print '</a>'; //print "<td width=\"5%\"> </td>"; - print "\n"; } } diff --git a/modules/lightbox/lb_editconfig.php b/modules/lightbox/lb_editconfig.php index 59d1fec0b8..8943bb709e 100644 --- a/modules/lightbox/lb_editconfig.php +++ b/modules/lightbox/lb_editconfig.php @@ -73,7 +73,7 @@ if ($action=='update' && !isset($security_user)) { } ?> -<form method="post" name="configform" action="<?php echo encode_url("module.php?mod=lightbox&mod_action=lb_editconfig&pid={$pid}"); ?>"> +<form method="post" name="configform" action="module.php?mod=lightbox&mod_action=lb_editconfig&pid=<?php echo $pid; ?>"> <input type="hidden" name="action" value="update" /> <table class="facts_table"> diff --git a/modules/recent_changes/module.php b/modules/recent_changes/module.php index 88d8abbd6f..f6d36929da 100644 --- a/modules/recent_changes/module.php +++ b/modules/recent_changes/module.php @@ -72,7 +72,7 @@ class recent_changes_WT_Module extends WT_Module implements WT_Module_Block { } else { $name = WT_USER_NAME; } - $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('".encode_url("index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}")."', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; + $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $title .= "<img class=\"adminicon\" src=\"".$WT_IMAGES["admin"]."\" width=\"15\" height=\"15\" border=\"0\" alt=\"".i18n::translate('Configure')."\" /></a>"; } $title.= i18n::translate('Recent Changes').help_link('recent_changes', $this->getName()); @@ -154,4 +154,3 @@ class recent_changes_WT_Module extends WT_Module implements WT_Module_Block { echo '</td></tr>'; } } -?> diff --git a/modules/relatives/module.php b/modules/relatives/module.php index eb06b36a96..eb866f82aa 100644 --- a/modules/relatives/module.php +++ b/modules/relatives/module.php @@ -209,13 +209,12 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { if (!empty($place)) { $html=''; $levels = explode(',', $place); - $tempURL = "placelist.php?action=show&"; + $tempURL = "placelist.php?action=show&"; foreach(array_reverse($levels) as $pindex=>$ppart) { - $ppart = preg_replace("/amp\%3B/", "", trim($ppart)); - $tempURL .= "parent[{$pindex}]=".PrintReady($ppart).'&'; + $tempURL .= "parent[{$pindex}]=".rawurlencode($ppart).'&'; } $tempURL .= 'level='.count($levels); - $html .= '<a href="'.encode_url($tempURL).'"> '; + $html .= '<a href="'.$tempURL.'"> '; for ($level=0; $level<$SHOW_PEDIGREE_PLACES; $level++) { if (!empty($levels[$level])) { if ($level>0) { diff --git a/modules/review_changes/module.php b/modules/review_changes/module.php index bdae8c2121..b93488dcfc 100644 --- a/modules/review_changes/module.php +++ b/modules/review_changes/module.php @@ -134,7 +134,7 @@ class review_changes_WT_Module extends WT_Module implements WT_Module_Block { case 'SOUR': case 'OBJE': $content.=$block ? '<br />' : ' '; - $content.='<a href="'.encode_url($record->getLinkUrl().'&show_changes=yes').'">'.i18n::translate('View Change Diff').'</a>'; + $content.='<a href="'.$record->getHtmlUrl().'&show_changes=yes'.'">'.i18n::translate('View Change Diff').'</a>'; break; } $content.='<br />'; @@ -199,4 +199,3 @@ class review_changes_WT_Module extends WT_Module implements WT_Module_Block { echo '</td></tr>'; } } -?> diff --git a/modules/stories/module.php b/modules/stories/module.php index 36f99028a3..96f8bfa311 100644 --- a/modules/stories/module.php +++ b/modules/stories/module.php @@ -330,7 +330,7 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_ foreach ($stories as $story) { $indi=Person::getInstance($story->xref); if ($indi) { - $name="<a href=\"".$indi->getLinkUrl()."#stories\">".$indi->getFullName()."</a>"; + $name="<a href=\"".$indi->getHtmlUrl()."#stories\">".$indi->getFullName()."</a>"; } else { $name=$story->xref; } @@ -371,7 +371,7 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_ foreach ($stories as $story) { $indi=Person::getInstance($story->xref); if ($indi) { - $name="<a href=\"".$indi->getLinkUrl()."#stories\">".$indi->getFullName()."</a>"; + $name="<a href=\"".$indi->getHtmlUrl()."#stories\">".$indi->getFullName()."</a>"; } else { $name=$story->xref; } diff --git a/modules/todo/module.php b/modules/todo/module.php index 694162a00e..3c6a834133 100644 --- a/modules/todo/module.php +++ b/modules/todo/module.php @@ -97,7 +97,7 @@ class todo_WT_Module extends WT_Module implements WT_Module_Block { $content.='<tr valign="top">'; $content.='<td class="list_value_wrap">'.str_replace('<a', '<a name="'.$todo['date']->MinJD().'"', $todo['date']->Display(false)).'</td>'; $name=$record->getListName(); - $content.='<td class="list_value_wrap" align="'.get_align(WT_GEDCOM).'"><a href="'.encode_url($record->getLinkUrl()).'">'.PrintReady($name).'</a></td>'; + $content.='<td class="list_value_wrap" align="'.get_align(WT_GEDCOM).'"><a href="'.$record->getHtmlUrl().'">'.PrintReady($name).'</a></td>'; if ($show_unassigned || $show_other) { $content.='<td class="list_value_wrap">'.$user_name.'</td>'; } @@ -182,4 +182,3 @@ class todo_WT_Module extends WT_Module implements WT_Module_Block { echo '</td></tr>'; } } -?> diff --git a/modules/top10_pageviews/module.php b/modules/top10_pageviews/module.php index 4c0ef94860..5d1abc8e09 100644 --- a/modules/top10_pageviews/module.php +++ b/modules/top10_pageviews/module.php @@ -96,7 +96,7 @@ class top10_pageviews_WT_Module extends WT_Module implements WT_Module_Block { if ($count_placement=='before') { $content .= '<td dir="ltr" align="right">['.$count.']</td>'; } - $content .= '<td class="name2" ><a href="'.encode_url($record->getLinkUrl()).'">'.PrintReady($record->getFullName()).'</a></td>'; + $content .= '<td class="name2" ><a href="'.$record->getHtmlUrl().'">'.PrintReady($record->getFullName()).'</a></td>'; if ($count_placement=='after') { $content .= '<td dir="ltr" align="right">['.$count.']</td>'; } @@ -168,4 +168,3 @@ class top10_pageviews_WT_Module extends WT_Module implements WT_Module_Block { echo '</td></tr>'; } } -?> diff --git a/modules/top10_surnames/module.php b/modules/top10_surnames/module.php index 3b63e81036..929ebcc388 100644 --- a/modules/top10_surnames/module.php +++ b/modules/top10_surnames/module.php @@ -87,7 +87,7 @@ class top10_surnames_WT_Module extends WT_Module implements WT_Module_Block { } else { $name = WT_USER_NAME; } - $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('".encode_url("index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}")."', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; + $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $title .= "<img class=\"adminicon\" src=\"".$WT_IMAGES["admin"]."\" width=\"15\" height=\"15\" border=\"0\" alt=\"".i18n::translate('Configure')."\" /></a>"; } // I18N: There are separate lists of male/female names, containing %d names each diff --git a/modules/user_blog/module.php b/modules/user_blog/module.php index 43bbc0ed00..9d887ea782 100644 --- a/modules/user_blog/module.php +++ b/modules/user_blog/module.php @@ -92,7 +92,7 @@ class user_blog_WT_Module extends WT_Module implements WT_Module_Block { } $content .= embed_globals($news["text"])."<br /><br />"; $content .= "<a href=\"javascript:;\" onclick=\"editnews('$key'); return false;\">".i18n::translate('Edit')."</a> | "; - $content .= "<a href=\"".encode_url("index.php?action=deletenews&news_id={$key}&ctype={$ctype}")."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this Journal entry?')."');\">".i18n::translate('Delete')."</a><br />"; + $content .= "<a href=\"index.php?action=deletenews&news_id={$key}&ctype={$ctype}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this Journal entry?')."');\">".i18n::translate('Delete')."</a><br />"; $content .= "</div><br />"; } if (WT_USER_ID) { diff --git a/modules/user_favorites/module.php b/modules/user_favorites/module.php index 7ba65a9db0..0e9dc49a76 100644 --- a/modules/user_favorites/module.php +++ b/modules/user_favorites/module.php @@ -181,7 +181,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block { $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center $TEXT_DIRECTION\">"; foreach($userfavs as $key=>$favorite) { if (isset($favorite["id"])) $key=$favorite["id"]; - $removeFavourite = "<a class=\"font9\" href=\"".encode_url("index.php?ctype={$ctype}&action=deletefav&fv_id={$key}")."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this item from your list of Favorites?')."');\">".i18n::translate('Remove')."</a><br />"; + $removeFavourite = "<a class=\"font9\" href=\"index.php?ctype={$ctype}&action=deletefav&fv_id={$key}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to remove this item from your list of Favorites?')."');\">".i18n::translate('Remove')."</a><br />"; $current_gedcom = $GEDCOM; $GEDCOM = $favorite["file"]; $content .= "<tr><td>"; @@ -245,18 +245,18 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block { $content .= "<tr><td>".i18n::translate('Enter a Person, Family, or Source ID')." <br />"; $content .= "<input class=\"pedigree_form\" type=\"text\" name=\"gid\" id=\"gid{$uniqueID}\" size=\"5\" value=\"\" />"; - $content .= print_findindi_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findfamily_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findsource_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findrepository_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findnote_link("gid{$uniqueID}",'',true)."\n"; - $content .= print_findmedia_link("gid{$uniqueID}",'1','',true)."\n"; + $content .= print_findindi_link("gid{$uniqueID}",'',true); + $content .= print_findfamily_link("gid{$uniqueID}",'',true); + $content .= print_findsource_link("gid{$uniqueID}",'',true); + $content .= print_findrepository_link("gid{$uniqueID}",'',true); + $content .= print_findnote_link("gid{$uniqueID}",'',true); + $content .= print_findmedia_link("gid{$uniqueID}",'1','',true); $content .= "<br />".i18n::translate('OR<br />Enter a URL and a title'); $content .= "<table><tr><td>".translate_fact('URL')."</td><td><input type=\"text\" name=\"url\" size=\"40\" value=\"\" /></td></tr>"; $content .= "<tr><td>".i18n::translate('Title:')."</td><td><input type=\"text\" name=\"favtitle\" size=\"40\" value=\"\" /></td></tr></table>"; - if ($block) $content .= "\n</td></tr><tr><td><br />"; - else $content .= "\n</td><td>"; + if ($block) $content .= "</td></tr><tr><td><br />"; + else $content .= "</td><td>"; $content .= i18n::translate('Enter an optional note about this favorite'); $content .= "<br /><textarea name=\"favnote\" rows=\"6\" cols=\"50\"></textarea>"; $content .= "</td></tr></table>"; diff --git a/modules/user_messages/module.php b/modules/user_messages/module.php index 073cd3e59f..f2be92d461 100644 --- a/modules/user_messages/module.php +++ b/modules/user_messages/module.php @@ -163,7 +163,7 @@ class user_messages_WT_Module extends WT_Module implements WT_Module_Block { if ($user_id) { $content .= "<a href=\"javascript:;\" onclick=\"reply('".$user_id."', '".$message["subject"]."'); return false;\">".i18n::translate('Reply')."</a> | "; } - $content .= "<a href=\"".encode_url("index.php?action=deletemessage&message_id={$key}")."\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this message? It cannot be retrieved later.')."');\">".i18n::translate('Delete')."</a></div></td></tr>"; + $content .= "<a href=\"index.php?action=deletemessage&message_id={$key}\" onclick=\"return confirm('".i18n::translate('Are you sure you want to delete this message? It cannot be retrieved later.')."');\">".i18n::translate('Delete')."</a></div></td></tr>"; } $content .= "</table>"; $content .= "<input type=\"submit\" value=\"".i18n::translate('Delete Selected Messages')."\" /><br />"; diff --git a/modules/user_welcome/module.php b/modules/user_welcome/module.php index 994db4aad1..3707531f09 100644 --- a/modules/user_welcome/module.php +++ b/modules/user_welcome/module.php @@ -56,11 +56,11 @@ class user_welcome_WT_Module extends WT_Module implements WT_Module_Block { $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"edituser.php\"><img class=\"block\" src=\"".$WT_IMAGES["mypage"]."\" border=\"0\" alt=\"".i18n::translate('My account')."\" title=\"".i18n::translate('My account')."\" /><br />".i18n::translate('My account')."</a></td>"; } if (WT_USER_GEDCOM_ID) { - $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"".encode_url("pedigree.php?rootid=".WT_USER_GEDCOM_ID)."\"><img class=\"block\" src=\"".$WT_IMAGES["pedigree"]."\" border=\"0\" alt=\"".i18n::translate('My Pedigree')."\" title=\"".i18n::translate('My Pedigree')."\" /><br />".i18n::translate('My Pedigree')."</a></td>"; - $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"".encode_url("individual.php?pid=".WT_USER_GEDCOM_ID)."\"><img class=\"block\" src=\"".$WT_IMAGES["indis"]."\" border=\"0\" alt=\"".i18n::translate('My Individual Record')."\" title=\"".i18n::translate('My Individual Record')."\" /><br />".i18n::translate('My Individual Record')."</a></td>"; + $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"pedigree.php?rootid=".WT_USER_GEDCOM_ID."\"><img class=\"block\" src=\"".$WT_IMAGES["pedigree"]."\" border=\"0\" alt=\"".i18n::translate('My Pedigree')."\" title=\"".i18n::translate('My Pedigree')."\" /><br />".i18n::translate('My Pedigree')."</a></td>"; + $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"individual.php?pid=".WT_USER_GEDCOM_ID."\"><img class=\"block\" src=\"".$WT_IMAGES["indis"]."\" border=\"0\" alt=\"".i18n::translate('My Individual Record')."\" title=\"".i18n::translate('My Individual Record')."\" /><br />".i18n::translate('My Individual Record')."</a></td>"; } $content .= "</tr><tr><td class=\"center\" colspan=\"3\">"; - $content .= "<a href=\"javascript:;\" onclick=\"window.open('".encode_url("index_edit.php?name=".WT_USER_NAME."&ctype=user")."', '_blank', 'top=50,left=10,width=705,height=355,scrollbars=1,resizable=1');\">".i18n::translate('Customize My Page')."</a>"; + $content .= "<a href=\"javascript:;\" onclick=\"window.open('index_edit.php?name=".WT_USER_NAME."&ctype=user"."', '_blank', 'top=50,left=10,width=705,height=355,scrollbars=1,resizable=1');\">".i18n::translate('Customize My Page')."</a>"; $content .= help_link('mypage_customize'); $content .= "<br />".format_timestamp(client_time()); $content .= "</td></tr></table>"; diff --git a/modules/yahrzeit/module.php b/modules/yahrzeit/module.php index f795a37d3d..9e667799a2 100644 --- a/modules/yahrzeit/module.php +++ b/modules/yahrzeit/module.php @@ -116,7 +116,7 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { foreach ($yahrzeits as $yahrzeit) if ($yahrzeit['jd']>=$startjd && $yahrzeit['jd']<$startjd+$days) { $ind=person::GetInstance($yahrzeit['id']); - $content .= "<a href=\"".encode_url($ind->getLinkUrl())."\" class=\"list_item name2\">".$ind->getFullName()."</a>".$ind->getSexImage(); + $content .= "<a href=\"".$ind->getHtmlUrl()."\" class=\"list_item name2\">".$ind->getFullName()."</a>".$ind->getSexImage(); $content .= "<div class=\"indent\">"; $content .= $yahrzeit['date']->Display(true); $content .= ', '.i18n::translate('%s year anniversary', $yahrzeit['anniv']); @@ -145,13 +145,13 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { $content .= "<tr>"; // Record name(s) $name=$ind->getFullName(); - $url=$ind->getLinkUrl(); + $url=$ind->getHtmlUrl(); $content .= "<td class=\"list_value_wrap\" align=\"".get_align($name)."\">"; - $content .= "<a href=\"".encode_url($ind->getLinkUrl())."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($name)."</a>"; + $content .= "<a href=\"".$url."\" class=\"list_item name2\" dir=\"".$TEXT_DIRECTION."\">".PrintReady($name)."</a>"; $content .= $ind->getSexImage(); $addname=$ind->getAddName(); if ($addname) { - $content .= "<br /><a href=\"".encode_url($url)."\" class=\"list_item\">".PrintReady($addname)."</a>"; + $content .= "<br /><a href=\"".$url."\" class=\"list_item\">".PrintReady($addname)."</a>"; } $content .= "</td>"; @@ -260,4 +260,3 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { echo '</td></tr>'; } } -?> diff --git a/pedigree.php b/pedigree.php index 9a09beed2d..6431a83fec 100644 --- a/pedigree.php +++ b/pedigree.php @@ -239,14 +239,14 @@ for($i=($controller->treesize-1); $i>=0; $i--) { if (($curgen==1)&&(count(find_family_ids($controller->treeid[$i]))>0)) { $did = 1; if ($i > ($controller->treesize/2) + ($controller->treesize/4)-1) $did++; - echo '<a href="', encode_url("pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid={$controller->treeid[$did]}&show_full={$controller->show_full}&talloffset={$controller->talloffset}"), '" '; + echo '<a href=pedigree.php?PEDIGREE_GENERATIONS=', $controller->PEDIGREE_GENERATIONS, '&rootid=', $controller->treeid[$did], '&show_full=', $controller->show_full, '&talloffset=', $controller->talloffset, ' '; echo "onmouseover=\"swap_image('arrow$i', 2);\" onmouseout=\"swap_image('arrow$i', 2);\">"; echo "<img id=\"arrow$i\" src=\"", $WT_IMAGES["uarrow"], '" border="0" alt="" />'; echo '</a>'; } - echo "\n\t\t</div>"; + echo "</div>"; } - echo "\n\t\t<div id=\"box"; + echo "<div id=\"box"; if (empty($controller->treeid[$i])) echo "$iref"; else echo $controller->treeid[$i]; if ($TEXT_DIRECTION=="rtl") echo ".1.$iref\" style=\"position:absolute; right:"; @@ -257,11 +257,11 @@ for($i=($controller->treesize-1); $i>=0; $i--) { echo $xoffset, "px; top:", $yoffset, "px; width:", ($controller->pbwidth+$widthadd), "px; height:", $controller->pbheight, "px; "; echo "z-index: ", $zindex, ";\">"; - echo "\n\t\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" dir=\"$TEXT_DIRECTION\">"; + echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" dir=\"$TEXT_DIRECTION\">"; if (($talloffset < 2) && ($curgen > $talloffset) && ($curgen < $controller->PEDIGREE_GENERATIONS)) { echo "<tr><td>"; - echo "\n\t\t\t<img src=\"", $WT_IMAGES["hline"], "\" align=\"left\" hspace=\"0\" vspace=\"0\" alt=\"\" />"; - echo "\n\t\t\t</td><td width=\"100%\">"; + echo "<img src=\"", $WT_IMAGES["hline"], "\" align=\"left\" hspace=\"0\" vspace=\"0\" alt=\"\" />"; + echo "</td><td width=\"100%\">"; } else echo "<tr><td width=\"100%\">"; if (!isset($controller->treeid[$i])) $controller->treeid[$i] = false; @@ -270,14 +270,14 @@ for($i=($controller->treesize-1); $i>=0; $i--) { $did = 1; if ($i > ($controller->treesize/2) + ($controller->treesize/4)-1) $did++; if ($talloffset==3) { - echo "\n\t\t\t\t</td></tr><tr><td align=\"center\">"; - echo "<a href=\"", encode_url("pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid={$controller->treeid[$did]}&show_full={$controller->show_full}&talloffset={$controller->talloffset}"), "\" "; + echo "</td></tr><tr><td align=\"center\">"; + echo "<a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid={$controller->treeid[$did]}&show_full={$controller->show_full}&talloffset={$controller->talloffset}\" "; echo "onmouseover=\"swap_image('arrow$i', 3);\" onmouseout=\"swap_image('arrow$i', 3);\">"; echo "<img id=\"arrow$i\" src=\"", $WT_IMAGES["darrow"], "\" border=\"0\" alt=\"\" />"; } else if ($talloffset < 2) { - echo "\n\t\t\t\t</td><td valign=\"middle\">"; - echo "<a href=\"", encode_url("pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid={$controller->treeid[$did]}&show_full={$controller->show_full}&talloffset={$talloffset}"), "\" "; + echo "</td><td valign=\"middle\">"; + echo "<a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid={$controller->treeid[$did]}&show_full={$controller->show_full}&talloffset={$talloffset}\" "; if ($TEXT_DIRECTION=="rtl") { echo "onmouseover=\"swap_image('arrow$i', 0);\" onmouseout=\"swap_image('arrow$i', 0);\">"; echo "<img id=\"arrow$i\" src=\"", $WT_IMAGES["larrow"], "\" border=\"0\" alt=\"\" />"; @@ -289,7 +289,7 @@ for($i=($controller->treesize-1); $i>=0; $i--) { echo "</a>"; } } - echo "\n\t\t\t</td></tr></table>\n\t\t</div>"; + echo "</td></tr></table></div>"; } } @@ -335,13 +335,13 @@ if ($controller->rootPerson->canDisplayDetails()) { echo "<img id=\"darrow\" src=\"", $WT_IMAGES["darrow"], "\" border=\"0\" alt=\"\" />"; } echo "</a>"; - echo "\n\t\t</div>"; + echo "</div>"; $yoffset += ($controller->pbheight / 2)+10; - echo "\n\t\t<div id=\"childbox\" dir=\""; + echo "<div id=\"childbox\" dir=\""; if ($TEXT_DIRECTION=="rtl") echo "rtl\" style=\"position:absolute; right:"; else echo "ltr\" style=\"position:absolute; left:"; echo $xoffset, "px; top:", $yoffset, "px; width:", $controller->pbwidth, "px; height:", $controller->pbheight, "px; visibility: hidden;\">"; - echo "\n\t\t\t<table class=\"person_box\"><tr><td>"; + echo "<table class=\"person_box\"><tr><td>"; foreach($famids as $ind=>$family) { if ($family!=null) { $husb = $family->getHusbId(); @@ -349,7 +349,7 @@ if ($controller->rootPerson->canDisplayDetails()) { if($controller->rootid!=$husb) $spid=$family->getHusband(); else $spid=$family->getWife(); if (!empty($spid)) { - echo "\n\t\t\t\t<a href=\"", encode_url("pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$spid->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}"), "\"><span "; + echo "<a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$spid->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; if ($spid->canDisplayName()) { $name = $spid->getFullName(); $name = rtrim($name); @@ -362,7 +362,7 @@ if ($controller->rootPerson->canDisplayDetails()) { $children = $family->getChildren(); foreach($children as $ind2=>$child) { - echo "\n\t\t\t\t <a href=\"", encode_url("pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}"), "\"><span "; + echo " <a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; if ($child->canDisplayName()) { $name = $child->getFullName(); $name = rtrim($name); @@ -382,7 +382,7 @@ if ($controller->rootPerson->canDisplayDetails()) { if (count($children)==2) echo '<span class="name1"><br />', i18n::translate('Sibling'), '<br /></span>'; foreach($children as $ind2=>$child) { if (!$controller->rootPerson->equals($child) && !is_null($child)) { - echo "\n\t\t\t\t <a href=\"", encode_url("pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}"), "\"><span "; + echo " <a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; if ($child->canDisplayName()) { $name = $child->getFullName(); $name = rtrim($name); @@ -395,8 +395,8 @@ if ($controller->rootPerson->canDisplayDetails()) { } } } - echo "\n\t\t\t</td></tr></table>"; - echo "\n\t\t</div>"; + echo "</td></tr></table>"; + echo "</div>"; } } // -- print html footer diff --git a/relationship.php b/relationship.php index 7fc285440b..6436f191c9 100644 --- a/relationship.php +++ b/relationship.php @@ -212,7 +212,7 @@ function paste_id(value) { $new_path=false; } else { - print "<a href=\"".encode_url("relationship.php?pid1={$pid1}&pid2={$pid2}&path_to_find={$i}&followspouse={$followspouse}&show_full={$show_full}&asc={$asc}")."\">".($i+1)."</a>\n"; + print "<a href=\"relationship.php?pid1={$pid1}&pid2={$pid2}&path_to_find={$i}&followspouse={$followspouse}&show_full={$show_full}&asc={$asc}\">".($i+1)."</a>"; } $i++; } @@ -227,7 +227,7 @@ function paste_id(value) { } if ($disp) { echo i18n::translate('Show path'), ": </td>"; - echo "\n\t\t<td class=\"optionbox\">"; + echo "<td class=\"optionbox\">"; echo " <span class=\"error vmmiddle\">"; $check_node = get_relationship($pid1, $pid2, $followspouse, 0, true, $path_to_find); echo $check_node ? "1" : " ".i18n::translate('No results found.'), "</span></td>"; @@ -358,7 +358,7 @@ if ((!empty($pid1))&&(!empty($pid2))) { $lArrow = $WT_IMAGES["rarrow"]; } foreach($node["path"] as $index=>$pid) { - print "\r\n\r\n<!-- Node:{$index} -->\r\n"; + print "<!-- Node:{$index} -->"; $linex = $xoffset; $liney = $yoffset; $mfstyle = "NN"; @@ -392,11 +392,11 @@ if ((!empty($pid1))&&(!empty($pid2))) { if ($asc==-1) $liney=$yoffset+$Dbheight; else $liney=$yoffset-$lh; $joinx = $xoffset-$xs; $joiny = $liney-2-($asc-1)/2*$lh; - echo "<div id=\"joina", $index, "\" style=\"position:absolute; ", $TEXT_DIRECTION=="ltr"?"left":"right", ":", $joinx + $Dbxspacing, "px; top:", $joiny + $Dbyspacing, "px; z-index:-100; \" align=\"center\"><img src=\"", $WT_IMAGES["hline"], "\" align=\"left\" width=\"", $joinw, "\" height=\"", $joinh, "\" alt=\"\" /></div>\n"; + echo "<div id=\"joina", $index, "\" style=\"position:absolute; ", $TEXT_DIRECTION=="ltr"?"left":"right", ":", $joinx + $Dbxspacing, "px; top:", $joiny + $Dbyspacing, "px; z-index:-100; \" align=\"center\"><img src=\"", $WT_IMAGES["hline"], "\" align=\"left\" width=\"", $joinw, "\" height=\"", $joinh, "\" alt=\"\" /></div>"; $joinw = $xs/2+2; $joinx = $joinx+$xs/2; $joiny = $joiny+$asc*$lh; - echo "<div id=\"joinb", $index, "\" style=\"position:absolute; ", $TEXT_DIRECTION=="ltr"?"left":"right", ":", $joinx + $Dbxspacing, "px; top:", $joiny + $Dbyspacing, "px; z-index:-100; \" align=\"center\"><img src=\"", $WT_IMAGES["hline"], "\" align=\"left\" width=\"", $joinw, "\" height=\"", $joinh, "\" alt=\"\" /></div>\n"; + echo "<div id=\"joinb", $index, "\" style=\"position:absolute; ", $TEXT_DIRECTION=="ltr"?"left":"right", ":", $joinx + $Dbxspacing, "px; top:", $joiny + $Dbyspacing, "px; z-index:-100; \" align=\"center\"><img src=\"", $WT_IMAGES["hline"], "\" align=\"left\" width=\"", $joinw, "\" height=\"", $joinh, "\" alt=\"\" /></div>"; } $previous2=$previous; $previous="parent"; @@ -458,11 +458,11 @@ if ((!empty($pid1))&&(!empty($pid2))) { if ($asc==1) $liney=$yoffset+$Dbheight; else $liney=$yoffset-($lh+$Dbyspacing); $joinx = $xoffset-$xs; $joiny = $liney-2+($asc+1)/2*$lh; - print "<div id=\"joina$index\" style=\"position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".($joinx+$Dbxspacing)."px; top:".($joiny+$Dbyspacing)."px; z-index:-100; \" align=\"center\"><img src=\"".$WT_IMAGES["hline"]."\" align=\"left\" width=\"".$joinw."\" height=\"".$joinh."\" alt=\"\" /></div>\n"; + print "<div id=\"joina$index\" style=\"position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".($joinx+$Dbxspacing)."px; top:".($joiny+$Dbyspacing)."px; z-index:-100; \" align=\"center\"><img src=\"".$WT_IMAGES["hline"]."\" align=\"left\" width=\"".$joinw."\" height=\"".$joinh."\" alt=\"\" /></div>"; $joinw = $xs/2+2; $joinx = $joinx+$xs/2; $joiny = $joiny-$asc*$lh; - print "<div id=\"joinb$index\" style=\"position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".($joinx+$Dbxspacing)."px; top:".($joiny+$Dbyspacing)."px; z-index:-100; \" align=\"center\"><img src=\"".$WT_IMAGES["hline"]."\" align=\"left\" width=\"".$joinw."\" height=\"".$joinh."\" alt=\"\" /></div>\n"; + print "<div id=\"joinb$index\" style=\"position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".($joinx+$Dbxspacing)."px; top:".($joiny+$Dbyspacing)."px; z-index:-100; \" align=\"center\"><img src=\"".$WT_IMAGES["hline"]."\" align=\"left\" width=\"".$joinw."\" height=\"".$joinh."\" alt=\"\" /></div>"; } $previous2=$previous; $previous="child"; @@ -479,19 +479,19 @@ if ((!empty($pid1))&&(!empty($pid2))) { if ($index>0) { if ($TEXT_DIRECTION=="rtl" && $line!=$WT_IMAGES["hline"]) { print "<div id=\"line$index\" dir=\"ltr\" style=\"background:none; position:absolute; right:".($plinex+$Dbxspacing)."px; top:".($liney+$Dbyspacing)."px; width:".($lw+$lh*2)."px; z-index:-100; \" align=\"right\">"; - print "<img src=\"$line\" align=\"right\" width=\"$lw\" height=\"$lh\" alt=\"\" />\n"; + print "<img src=\"$line\" align=\"right\" width=\"$lw\" height=\"$lh\" alt=\"\" />"; print "<br />"; - print i18n::translate($node["relations"][$index])."\n"; - print "<img src=\"$arrow_img\" border=\"0\" align=\"middle\" alt=\"\" />\n"; + print i18n::translate($node["relations"][$index]).""; + print "<img src=\"$arrow_img\" border=\"0\" align=\"middle\" alt=\"\" />"; } else { - print "<div id=\"line$index\" style=\"background:none; position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".($plinex+$Dbxspacing)."px; top:".($liney+$Dbyspacing)."px; width:".($lw+$lh*2)."px; z-index:-100; \" align=\"".($lh==3?"center":"left")."\"><img src=\"$line\" align=\"left\" width=\"$lw\" height=\"$lh\" alt=\"\" />\n"; + print "<div id=\"line$index\" style=\"background:none; position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".($plinex+$Dbxspacing)."px; top:".($liney+$Dbyspacing)."px; width:".($lw+$lh*2)."px; z-index:-100; \" align=\"".($lh==3?"center":"left")."\"><img src=\"$line\" align=\"left\" width=\"$lw\" height=\"$lh\" alt=\"\" />"; print "<br />"; - print "<img src=\"$arrow_img\" border=\"0\" align=\"middle\" alt=\"\" />\n"; + print "<img src=\"$arrow_img\" border=\"0\" align=\"middle\" alt=\"\" />"; if ($lh == 3) print "<br />"; // note: $lh==3 means horiz arrow - print i18n::translate($node["relations"][$index])."\n"; + print i18n::translate($node["relations"][$index]).""; } - print "</div>\n"; + print "</div>"; } // Determine the z-index for this box $boxNum ++; @@ -503,7 +503,7 @@ if ((!empty($pid1))&&(!empty($pid2))) { print "<div id=\"box$pid.0\" style=\"position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":".$pxoffset."px; top:".$pyoffset."px; width:".$Dbwidth."px; height:".$Dbheight."px; z-index:".$zIndex."; \"><table><tr><td colspan=\"2\" width=\"$Dbwidth\" height=\"$Dbheight\">"; print_pedigree_person($pid, 1); - print "</td></tr></table></div>\n"; + print "</td></tr></table></div>"; } print "<div style=\"position:absolute; ".($TEXT_DIRECTION=="ltr"?"left":"right").":1px; top:".abs($Dbaseyoffset-70)."px; z-index:1;\">"; @@ -525,5 +525,3 @@ $maxyoffset += 100; </script> <?php print_footer(); - -?> diff --git a/search_engine.php b/search_engine.php index 905827c591..1f7689126f 100644 --- a/search_engine.php +++ b/search_engine.php @@ -55,19 +55,18 @@ $all_gedcoms=get_all_gedcoms(); if (get_site_setting('ALLOW_CHANGE_GEDCOM') && count($all_gedcoms)>1) { foreach ($all_gedcoms as $ged_id=>$gedcom) { $title=i18n::translate('Home page').' - '.PrintReady(get_gedcom_setting($ged_id, 'title')); - echo '<a href="', encode_url("index.php?ged={$gedcom}"), '"><b>', $title, '</b></a><br />'; + echo '<a href="index.php?ged=', rawurlencode($gedcom), '"><b>', $title, '</b></a><br />'; } echo '<br />'; foreach ($all_gedcoms as $ged_id=>$gedcom) { $title=i18n::translate('Individuals').' - '.PrintReady(get_gedcom_setting($ged_id, 'title')); - echo '<a href="', encode_url("indilist.php?ged={$gedcom}"), '"><b>', $title, '</b></a><br />'; + echo '<a href="indilist.php?ged=', rawurlencode($gedcom), '"><b>', $title, '</b></a><br />'; } } else { $title=i18n::translate('Home page'); - echo '<a href="', encode_url("index.php?ged={$GEDCOM}"), '"><b>', $title, '</b></a><br />'; + echo '<a href="index.php?ged=', rawurlencode($GEDCOM), '"><b>', $title, '</b></a><br />'; $title=i18n::translate('Individuals'); - echo '<a href="', encode_url("indilist.php?ged={$GEDCOM}"), '"><b>', $title, '</b></a><br />'; + echo '<a href="indilist.php?ged=', rawurlencode($GEDCOM), '"><b>', $title, '</b></a><br />'; } echo '</body></html>'; -?> diff --git a/statisticsplot.php b/statisticsplot.php index 8e481e4de6..bd63b66add 100644 --- a/statisticsplot.php +++ b/statisticsplot.php @@ -579,7 +579,7 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { $titleLength = strpos($mytitle."\n", "\n"); $title = substr($mytitle, 0, $titleLength); - $imgurl = "http://chart.apis.google.com/chart?cht=bvg&chs=950x300&chf=bg,s,ffffff00|c,s,ffffff00&chtt=".$title."&".$datastring."&".$colorstring."&chbh="; + $imgurl = "http://chart.apis.google.com/chart?cht=bvg&chs=950x300&chf=bg,s,ffffff00|c,s,ffffff00&chtt=".$title."&".$datastring."&".$colorstring."&chbh="; if (count($ydata) > 3) { $imgurl .= "5,1"; } elseif (count($ydata) < 2) { @@ -587,7 +587,7 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { } else { $imgurl .= "20,3"; } - $imgurl .= "&chxt=x,x,y,y&chxl=0:|"; + $imgurl .= "&chxt=x,x,y,y&chxl=0:|"; for($i=0; $i<count($xdata); $i++) { $imgurl .= $xdata[$i]."|"; } @@ -618,7 +618,7 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { } //only show legend if y-data is non-2-dimensional if (count($ydata) > 1) { - $imgurl .= "&chdl="; + $imgurl .= "&chdl="; for($i=0; $i<count($legend); $i++){ $imgurl .= $legend[$i]; if (!($i == (count($legend)-1))){ @@ -630,7 +630,7 @@ function myplot($mytitle, $n, $xdata, $xtitle, $ydata, $ytitle, $legend) { //$title = strstr($mytitle, '|', true); $title = substr($mytitle, 0, strpos($mytitle, '|')); echo "<center><div class=\"statistics_chart\">"; - echo "<img src=\"", encode_url($imgurl), "\" width=\"950\" height=\"300\" border=\"0\" alt=\"", $title, "\" title=\"", $title, "\"/>"; + echo "<img src=\"", $imgurl, "\" width=\"950\" height=\"300\" border=\"0\" alt=\"", $title, "\" title=\"", $title, "\"/>"; echo "</div></center><br /><br />"; } @@ -956,5 +956,5 @@ default: } echo "<br /><div class =\"center noprint\">"; echo "<input type=\"button\" value=\"", i18n::translate('Close Window'), "\" onclick=\"window.close()\" /><br /><br />"; -echo "</div>\n"; +echo "</div>"; print_simple_footer(); diff --git a/useradmin.php b/useradmin.php index dc770a3adf..58ad425329 100644 --- a/useradmin.php +++ b/useradmin.php @@ -201,7 +201,7 @@ if ($action=='createuser' || $action=='edituser2') { addMessage($message); */ } // Reload the form cleanly, to allow the user to verify their changes - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.encode_url("useradmin.php?action=edituser&username={$username}&ged={$ged}", false)); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH."useradmin.php?action=edituser&username=".rawurlencode($username)."&ged=".rawurlencode($ged)); exit; } } @@ -274,7 +274,7 @@ if ($action=="edituser") { <tr> <td class="topbottombar" colspan="2"> <input type="submit" value="<?php echo i18n::translate('Update user account'); ?>" /> - <input type="button" value="<?php echo i18n::translate('Back'); ?>" onclick="window.location='<?php echo encode_url("useradmin.php?action=listusers&filter={$filter}&usrlang={$usrlang}"); ?>';"/> + <input type="button" value="<?php echo i18n::translate('Back'); ?>" onclick="window.location='<?php echo "useradmin.php?action=listusers&filter={$filter}&usrlang={$usrlang}"; ?>';"/> </td> </tr> <tr> @@ -393,7 +393,7 @@ if ($action=="edituser") { $GEDCOM=$ged_name; // library functions use global variable instead of parameter. $person=Person::getInstance($pid); if ($person) { - echo '<div class="list_item"><a href="', encode_url("individual.php?pid={$pid}&ged={$ged_name}"), '">', PrintReady($person->getFullName()), '</a></div>'; + echo '<div class="list_item"><a href="', $person->getHtmlUrl(), '">', PrintReady($person->getFullName()), '</a></div>'; } echo '</td>', // GEDCOM INDI Record ID @@ -406,7 +406,7 @@ if ($action=="edituser") { $GEDCOM=$ged_name; // library functions use global variable instead of parameter. $person=Person::getInstance($pid); if ($person) { - echo ' <div class="list_item"><a href="', encode_url("individual.php?pid={$pid}&ged={$ged_name}"), '">', PrintReady($person->getFullName()), '</a></div>'; + echo ' <div class="list_item"><a href="', $person->getHtmlUrl(), '">', PrintReady($person->getFullName()), '</a></div>'; } echo '</td>', // Access level @@ -453,7 +453,7 @@ if ($action=="edituser") { <tr> <td class="topbottombar" colspan="2"> <input type="submit" value="<?php echo i18n::translate('Update user account'); ?>" /> - <input type="button" value="<?php echo i18n::translate('Back'); ?>" onclick="window.location='<?php echo encode_url("useradmin.php?action=listusers&filter={$filter}&usrlang={$usrlang}"); ?>';"/> + <input type="button" value="<?php echo i18n::translate('Back'); ?>" onclick="window.location='<?php echo "useradmin.php?action=listusers&filter={$filter}&usrlang={$usrlang}"; ?>';"/> </td> </tr> </table> @@ -565,7 +565,7 @@ jQuery(document).ready(function(){ } echo '</td>'; $userName = getUserFullName($user_id); - echo "<td class=\"optionbox\"><a class=\"edit_link\" href=\"", encode_url("useradmin.php?action=edituser&username={$user_name}&filter={$filter}&usrlang={$usrlang}&ged={$ged}"), "\" title=\"", i18n::translate('Edit'), "\">", $userName; + echo "<td class=\"optionbox\"><a class=\"edit_link\" href=\"useradmin.php?action=edituser&username={$user_name}&filter={$filter}&usrlang={$usrlang}&ged={$ged}\" title=\"", i18n::translate('Edit'), "\">", $userName; if ($TEXT_DIRECTION=="ltr") echo getLRM(); else echo getRLM(); echo "</a></td>"; @@ -1107,7 +1107,7 @@ echo '<p class="center"><input TYPE="button" VALUE="', i18n::translate('Return t $ind = 1; echo "<tr><td class=\"font11\"> "; if ($geds["number"] == 0) echo $geds["name"]; - else echo "<a href=\"", encode_url("useradmin.php?action=listusers&filter=gedadmin&ged=".$geds["ged"]), "\">", $geds["name"], "</a>"; + else echo "<a href=\"useradmin.php?action=listusers&filter=gedadmin&ged=", rawurlencode($geds["ged"]), "\">", $geds["name"], "</a>"; echo "</td><td class=\"font11\">", $geds["number"], "</td></tr>"; } echo "<tr><td class=\"font11\"></td></tr><tr><td class=\"font11\">"; |
