", $alpha = WT_Filter::get('alpha'); // All surnames beginning with this letter where "@"=unknown and ","=none $surname = WT_Filter::get('surname'); // All indis with this surname $show_all = WT_Filter::get('show_all', 'no|yes', 'no'); // All indis // Long lists can be broken down by given name $show_all_firstnames = WT_Filter::get('show_all_firstnames', 'no|yes', 'no'); if ($show_all_firstnames === 'yes') { $falpha = ''; } else { $falpha = WT_Filter::get('falpha'); // All first names beginning with this letter } $show_marnm = WT_Filter::get('show_marnm', 'no|yes'); switch ($show_marnm) { case 'no': case 'yes': Auth::user()->setPreference(WT_SCRIPT_NAME . '_show_marnm', $show_marnm); break; default: $show_marnm = Auth::user()->getPreference(WT_SCRIPT_NAME . '_show_marnm'); } // Make sure selections are consistent. // i.e. can’t specify show_all and surname at the same time. if ($show_all === 'yes') { if ($show_all_firstnames === 'yes') { $alpha = ''; $surname = ''; $legend = WT_I18N::translate('All'); $url = WT_SCRIPT_NAME . '?show_all=yes&ged=' . WT_GEDURL; $show = 'indi'; } elseif ($falpha) { $alpha = ''; $surname = ''; $legend = WT_I18N::translate('All') . ', ' . WT_Filter::escapeHtml($falpha) . '…'; $url = WT_SCRIPT_NAME . '?show_all=yes&ged=' . WT_GEDURL; $show = 'indi'; } else { $alpha = ''; $surname = ''; $legend = WT_I18N::translate('All'); $url = WT_SCRIPT_NAME . '?show_all=yes' . '&ged=' . WT_GEDURL; $show = WT_Filter::get('show', 'surn|indi', 'surn'); } } elseif ($surname) { $alpha = WT_Query_Name::initialLetter($surname); // so we can highlight the initial letter $show_all = 'no'; if ($surname === '@N.N.') { $legend = $UNKNOWN_NN; } else { $legend = WT_Filter::escapeHtml($surname); } $url = WT_SCRIPT_NAME . '?surname=' . rawurlencode($surname) . '&ged=' . WT_GEDURL; switch ($falpha) { case '': break; case '@': $legend .= ', ' . $UNKNOWN_PN; $url .= '&falpha=' . rawurlencode($falpha) . '&ged=' . WT_GEDURL; break; default: $legend .= ', ' . WT_Filter::escapeHtml($falpha) . '…'; $url .= '&falpha=' . rawurlencode($falpha) . '&ged=' . WT_GEDURL; break; } $show = 'indi'; // SURN list makes no sense here } elseif ($alpha === '@') { $show_all = 'no'; $legend = $UNKNOWN_NN; $url = WT_SCRIPT_NAME . '?alpha=' . rawurlencode($alpha) . '&ged=' . WT_GEDURL; $show = 'indi'; // SURN list makes no sense here } elseif ($alpha === ',') { $show_all = 'no'; $legend = WT_I18N::translate('None'); $url = WT_SCRIPT_NAME . '?alpha=' . rawurlencode($alpha) . '&ged=' . WT_GEDURL; $show = 'indi'; // SURN list makes no sense here } elseif ($alpha) { $show_all = 'no'; $legend = WT_Filter::escapeHtml($alpha) . '…'; $url = WT_SCRIPT_NAME . '?alpha=' . rawurlencode($alpha) . '&ged=' . WT_GEDURL; $show = WT_Filter::get('show', 'surn|indi', 'surn'); } else { $show_all = 'no'; $legend = '…'; $url = WT_SCRIPT_NAME . '?ged=' . WT_GEDURL; $show = 'none'; // Don't show lists until something is chosen } $legend = '' . $legend . ''; $controller ->setPageTitle(WT_I18N::translate('Families') . ' : ' . $legend) ->pageHeader(); echo '
', join(' | ', $list), '
'; // Search spiders don't get an option to show/hide the surname sublists, // nor does it make sense on the all/unknown/surname views if (!$SEARCH_SPIDER) { echo '';
if ($show !== 'none') {
if ($show_marnm === 'yes') {
echo '', WT_I18N::translate('Exclude individuals with “%s” as a married name', $legend), '';
} else {
echo '', WT_I18N::translate('Include individuals with “%s” as a married name', $legend), '';
}
if ($alpha !== '@' && $alpha !== ',' && !$surname) {
if ($show === 'surn') {
echo '
', WT_I18N::translate('Show the list of individuals'), '';
} else {
echo '
', WT_I18N::translate('Show the list of surnames'), '';
}
}
}
echo '
', join(' | ', $list), '
'; } } if ($show === 'indi') { echo format_fam_table(WT_Query_Name::families($surname, $alpha, $falpha, $show_marnm === 'yes', WT_GED_ID)); } } }