setPageTitle(WT_I18N::translate('Find an individual')); break; case "fam": $controller->setPageTitle(WT_I18N::translate('Find a family')); break; case "media": $controller->setPageTitle(WT_I18N::translate('Find a media object')); break; case "place": $controller->setPageTitle(WT_I18N::translate('Find a place')); break; case "repo": $controller->setPageTitle(WT_I18N::translate('Find a repository')); break; case "note": $controller->setPageTitle(WT_I18N::translate('Find a note')); break; case "source": $controller->setPageTitle(WT_I18N::translate('Find a source')); break; case "specialchar": $controller->setPageTitle(WT_I18N::translate('Find a special character')); $language_filter=safe_GET('language_filter'); if (WT_USER_ID) { // Users will probably always want the same language, so remember their setting if (!$language_filter) { $language_filter=get_user_setting(WT_USER_ID, 'default_language_filter'); } else { set_user_setting(WT_USER_ID, 'default_language_filter', $language_filter); } } require WT_ROOT.'includes/specialchars.php'; $action="filter"; break; case "facts": $controller ->setPageTitle(WT_I18N::translate('Find a fact or event')) ->addInlineJavascript('initPickFact();'); break; } $controller->pageHeader(); echo ''; $options = array(); $options["option"][]= "findindi"; $options["option"][]= "findfam"; $options["option"][]= "findmedia"; $options["option"][]= "findplace"; $options["option"][]= "findrepo"; $options["option"][]= "findnote"; $options["option"][]= "findsource"; $options["option"][]= "findspecialchar"; $options["option"][]= "findfact"; $options["form"][]= "formindi"; $options["form"][]= "formfam"; $options["form"][]= "formmedia"; $options["form"][]= "formplace"; $options["form"][]= "formrepo"; $options["form"][]= "formnote"; $options["form"][]= "formsource"; $options["form"][]= "formspecialchar"; echo '

', $controller->getPageTitle(), '

'; // Show indi and hide the rest if ($type == "indi") { echo '
', WT_I18N::translate('Name contains:'), ' 
'; } // Show fam and hide the rest if ($type == "fam") { echo '
', WT_I18N::translate('Name contains:'), ' 
'; } // Show media and hide the rest if ($type == 'media') { echo '
', WT_I18N::translate('Media contains:'), ' ', help_link('simple_filter'), '

 

'; } // Show place and hide the rest if ($type == "place") { echo '
', WT_I18N::translate('Place contains:'), '

 

'; } // Show repo and hide the rest if ($type == "repo") { echo '
', WT_I18N::translate('Repository contains:'), '

 

'; } // Show Shared Notes and hide the rest if ($type == "note") { echo '
', WT_I18N::translate('Shared Note contains:'), '

 

'; } // Show source and hide the rest if ($type == "source") { echo '
', WT_I18N::translate('Source contains:'), '

 

'; } // Show specialchar and hide the rest if ($type == 'specialchar') { echo '

'; } // Show facts if ($type == "facts") { echo '
' ; getPreselectedTags($preselDefault, $preselCustom); echo ''; echo '
  ', WT_I18N::translate('Tag'), ' ', WT_I18N::translate('Description'), '
', WT_I18N::translate('Show only selected tags'), ' () ', WT_I18N::translate('Show all tags'), '
', WT_I18N::translate('Filter'), ':
', WT_I18N::translate('Custom tags'), ':
'; } if ($action=="filter") { $filter = trim($filter); $filter_array=explode(' ', preg_replace('/ {2,}/', ' ', $filter)); // Output Individual if ($type == "indi") { echo '
'; $myindilist=search_indis_names($filter_array, array(WT_GED_ID), 'AND'); if ($myindilist) { echo '

', WT_I18N::translate('Total individuals: %s', count($myindilist)), '

'; } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
'; } // Output Family if ($type == "fam") { echo '
'; // Get the famrecs with hits on names from the family table // Get the famrecs with hits in the gedcom record from the family table $myfamlist = array_unique(array_merge( search_fams_names($filter_array, array(WT_GED_ID), 'AND'), search_fams($filter_array, array(WT_GED_ID), 'AND', true) )); if ($myfamlist) { $curged = $GEDCOM; echo '

', WT_I18N::translate('Total families: %s', count($myfamlist)), '

'; } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
'; } // Output Media if ($type == "media") { global $dirs; $medialist = WT_Query_Media::mediaList($directory, 'exclude', 'title', $filter); echo '
'; // Show link to previous folder if ($level>0) { $levels = explode("/", $directory); $pdir = ""; for ($i=0; $i   <-- '.$pdir.'   '; } // Start of media folder table // Tell the user where he is echo '
', WT_I18N::translate('Folder'), ' = ', $directory, '
'; // display the folder list if (count($dirs) || $level) { sort($dirs); if ($level) { echo '
', $uplink, '
'; } echo ''; foreach ($dirs as $indexval => $dir) { echo ''; } } // display the images if ($medialist) { foreach ($medialist as $media) { echo '
'; echo '
', $media->displayImage(), '
'; echo '
', $media->getFullName(), '
'; if (!$embed) { echo '

', $media->getFilename(), '

'; } else { echo '

', $media->getFilename(), '

'; } if ($media->fileExists()) { $imgsize = $media->getImageAttributes(); echo WT_Gedcom_Tag::getLabelValue('__IMAGE_SIZE__', $imgsize['WxH']); } echo '
    '; $found=false; foreach ($media->fetchLinkedIndividuals() as $indindividual) { echo '
  • ', $indindividual->getFullName(), '
  • '; $found=true; } foreach ($media->fetchLinkedFamilies() as $family) { echo '
  • ', $family->getFullName(), '
  • '; $found=true; } foreach ($media->fetchLinkedSources() as $source) { echo '
  • ', $source->getFullName(), '
  • '; $found=true; } foreach ($media->fetchLinkedNotes() as $note) { echo '
  • ', $note->getFullName(), '
  • '; $found=true; } foreach ($media->fetchLinkedRepositories() as $repository) { echo '
  • ', $repository->getFullName(), '
  • '; $found=true; } if (!$found) { echo '
  • ', WT_I18N::translate('This media object is not linked to any other record.'), '
  • '; } echo '
'; echo '
'; // close div="find-media-media" } } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
 
'; echo '
'; } // Output Places if ($type == "place") { echo '
'; if (!$filter || $all) { $places=WT_Place::allPlaces(WT_GED_ID); } else { $places=WT_Place::findPlaces($filter, WT_GED_ID); } if ($places) { echo '

', WT_I18N::translate('Places found'), ' ', count($places), '

'; } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
'; } // Output Repositories if ($type == "repo") { echo '
'; if ($filter) { $repo_list = search_repos($filter_array, array(WT_GED_ID), 'AND', true); } else { $repo_list = get_repo_list(WT_GED_ID); } if ($repo_list) { usort($repo_list, array('WT_GedcomRecord', 'Compare')); echo '

', WT_I18N::translate('Repositories found'), " ", count($repo_list), '

'; } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
'; } // Output Shared Notes if ($type=="note") { echo '
'; if ($filter) { $mynotelist = search_notes($filter_array, array(WT_GED_ID), 'AND', true); } else { $mynotelist = get_note_list(WT_GED_ID); } if ($mynotelist) { usort($mynotelist, array('WT_GedcomRecord', 'Compare')); echo '

', WT_I18N::translate('Shared Notes found'), ' ', count($mynotelist), '

'; } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
'; } // Output Sources if ($type=="source") { echo '
'; if ($filter) { $mysourcelist = search_sources($filter_array, array(WT_GED_ID), 'AND', true); } else { $mysourcelist = get_source_list(WT_GED_ID); } if ($mysourcelist) { usort($mysourcelist, array('WT_GedcomRecord', 'Compare')); echo '

', WT_I18N::translate('Total sources: %s', count($mysourcelist)), '

'; } else { echo '

', WT_I18N::translate('No results found.'), '

'; } echo '
'; } // Output Special Characters if ($type == "specialchar") { echo '

'; // lower case special characters foreach ($lcspecialchars as $key=>$value) { echo '', $key, ' '; } echo '

'; //upper case special characters foreach ($ucspecialchars as $key=>$value) { echo '', $key, ' '; } echo '

'; // other special characters (not letters) foreach ($otherspecialchars as $key=>$value) { echo '', $key, ' '; } echo '

'; } } echo ''; echo "
"; // Close div="find-page"