$MEDIA_DIRECTORY_LEVELS)){ $directory = $MEDIA_DIRECTORY; $level = 0; } elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){ $directory = $MEDIA_DIRECTORY; $level = 0; } // End variables for find media // Variables for Find Special Character if (empty($language_filter)) { if (!empty($_SESSION["language_filter"])) { $language_filter=$_SESSION["language_filter"]; } else { $language_filter=WT_LOCALE; } } require WT_ROOT.'includes/specialchars.php'; // End variables for Find Special Character switch ($type) { case "indi": print_simple_header(i18n::translate('Find individual ID')); break; case "fam": print_simple_header(i18n::translate('Find Family List')); break; case "media": print_simple_header(i18n::translate('Find media')); $action="filter"; break; case "place": print_simple_header(i18n::translate('Find Place')); $action="filter"; break; case "repo": print_simple_header(i18n::translate('Repositories')); $action="filter"; break; case "note": print_simple_header(i18n::translate('Find Shared Note')); $action="filter"; break; case "source": print_simple_header(i18n::translate('Find Source')); $action="filter"; break; case "specialchar": print_simple_header(i18n::translate('Find Special Characters')); $action="filter"; break; case "facts": $ONLOADFUNCTION = 'initPickFact();'; print_simple_header(i18n::translate('Find fact tags')); break; } echo WT_JS_START; ?> function pasteid(id, name, thumb) { if(thumb) { window.opener.(id, name, thumb); } else { // GEDFact_assistant ======================== if (window.opener.document.getElementById('addlinkQueue')) { window.opener.insertRowToTable(id, name); // Check if Indi, Fam or source =================== /* if (id.match("I")=="I") { var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links¬eid=newnote&pid='+id, 'win01', 'top=50, left=600, width=420, height=650, resizable=1, scrollbars=1'); if (window.focus) {win01.focus();} }else if (id.match("F")=="F") { // TODO --- alert('Opening Navigator with family id entered will come later'); } */ } window.opener.(id); if (window.opener.pastename) window.opener.pastename(name); } } var language_filter; function paste_char(selected_char, language_filter, magnify) { window.opener.paste_char(selected_char, language_filter, magnify); return false; } function setMagnify() { document.filterspecialchar.magnify.value = ''; document.filterspecialchar.submit(); } function checknames(frm) { if (document.forms[0].subclick) button = document.forms[0].subclick.value; else button = ""; if (frm.filter.value.length<2&button!="all") { alert(""); frm.filter.focus(); return false; } if (button=="all") { frm.filter.value = ""; } return true; } "; echo ""; echo ""; // close column for find text header // start column for find options echo ""; echo "
"; // start column for find text header switch ($type) { case "indi": echo i18n::translate('Find individual ID'); break; case "fam": echo i18n::translate('Find Family List'); break; case "media": echo i18n::translate('Find media'); break; case "place": echo i18n::translate('Find Place'); break; case "repo": echo i18n::translate('Repositories'); break; case "note": echo i18n::translate('Find Shared Note'); break; case "source": echo i18n::translate('Find Source'); break; case "specialchar": echo i18n::translate('Find Special Characters'); break; case "facts": echo i18n::translate('Find fact tags'); break; } echo "
"; // Show indi and hide the rest if ($type == "indi") { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo i18n::translate('Name contains:'), " "; echo "
"; echo "
"; echo "
"; echo "
"; } // Show fam and hide the rest if ($type == "fam") { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo i18n::translate('Name contains:'), " "; echo "
"; echo "
"; echo "
"; echo "
"; } // Show media and hide the rest if ($type == "media" && $MULTI_MEDIA) { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // This is for passing the name of which submit button was clicked echo ""; echo ""; echo ""; echo "
"; echo i18n::translate('Media contains:'), " "; echo help_link('simple_filter'); echo "
"; echo "", i18n::translate('Show thumbnails'); echo help_link('show_thumb'); echo "
"; echo " "; echo ""; echo "
"; echo "
"; } // Show place and hide the rest if ($type == "place") { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; // This is for passing the name of which submit button was clicked echo ""; echo ""; echo "
"; echo i18n::translate('Place contains:'), " "; echo "
"; echo " "; echo ""; echo "
"; echo "
"; } // Show repo and hide the rest if ($type == "repo" && $SHOW_SOURCES>=WT_USER_ACCESS_LEVEL) { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; // This is for passing the name of which submit button was clicked echo ""; echo ""; echo "
"; echo i18n::translate('Repository contains:'), " "; echo "
"; echo " "; echo ""; echo "
"; echo "
"; } // Show Shared Notes and hide the rest if ($type == "note") { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; // This is for passing the name of which submit button was clicked echo ""; echo ""; echo "
"; echo i18n::translate('Shared Note contains:'), " "; echo "
"; echo " "; echo ""; echo "
"; echo "
"; } // Show source and hide the rest if ($type == "source" && $SHOW_SOURCES>=WT_USER_ACCESS_LEVEL) { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; // This is for passing the name of which submit button was clicked echo ""; echo ""; echo "
"; echo i18n::translate('Source contains:'), " "; echo "
"; echo " "; echo ""; echo "
"; echo "
"; } // Show specialchar and hide the rest if ($type == "specialchar") { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
", i18n::translate('Magnify'), ""; echo "
"; echo "
"; } // Show facts if ($type == "facts") { echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; getPreselectedTags($preselDefault, $preselCustom); ?> // A class representing a default tag function DefaultTag(id, name, selected) { this.Id=id; this.Name=name; this.LowerName=name.toLowerCase(); this._counter=DefaultTag.prototype._newCounter++; this.selected=!!selected; } DefaultTag.prototype= { _newCounter:0 ,view:function() { var row=document.createElement("tr"),cell,o; row.appendChild(cell=document.createElement("td")); o=null; if(document.all) { //Old IEs handle the creation of a checkbox already checked, as far as I know, only in this way try { o=document.createElement(""); } catch(e) { o=null; } } if(!o) { o=document.createElement("input"); o.setAttribute("id","tag"+this._counter); o.setAttribute("type","checkbox"); if(this.selected) o.setAttribute("checked", "checked"); } o.DefaultTag=this; o.ParentRow=row; o.onclick=function() { this.DefaultTag.selected=!!this.checked; this.ParentRow.className=this.DefaultTag.selected?"sel":"unsel"; Lister.recount(); }; cell.appendChild(o); row.appendChild(cell=document.createElement("th")); cell.appendChild(o=document.createElement("label")); o.htmlFor="tag"+this._counter; o.appendChild(document.createTextNode(this.Id)); row.appendChild(cell=document.createElement("td")); cell.appendChild(document.createTextNode(this.Name)); TheList.appendChild(row); row.className=this.selected?"sel":"unsel"; } }; // Some global variable var DefaultTags=null /*The list of the default tag*/, TheList=null /* The body of the table that will show the default tabs */; // A single-instance class that manage the populating of the table var Lister= { _curFilter:null ,_timer:null ,clear:function() { var n=TheList.childNodes.length; while(n) TheList.removeChild(TheList.childNodes[--n]); } ,_clearTimer:function() { if(this._timer!=null) { clearTimeout(this._timer); this._timer=null; } } ,askRefresh:function() { this._clearTimer(); this._timer=setTimeout("Lister.refreshNow()",200); } ,refreshNow:function(force) { this._clearTimer(); var s=document.getElementById("tbxFilter").value.toLowerCase().replace(/\s+/g," ").replace(/^ | $/g,""),k; if(force||(typeof(this._curFilter)!="string")||(this._curFilter!=s)) { this._curFilter=s; this.clear(); for(k=0;k=0) DefaultTags[k].view(); } } } ,recount:function() { var k,n=0; for(k=0;k $factName) { if (preg_match('/^_?[A-Z0-9]+$/', $factId, $matches)) { if($firstFact) $firstFact=FALSE; else echo ','; echo 'new DefaultTag("'.addslashes($factId).'","'.addslashes($factName).'",preselectedDefaultTags.indexOf("\\x01'.addslashes($factId).'\\x01")>=0)'; } } ?>]; //Sort defined tags alphabetically by name n=DefaultTags.length for(i=0;i<(n-1);i++) { for(j=(i+1);jDefaultTags[j].LowerName) { tmp=DefaultTags[i]; DefaultTags[i]=DefaultTags[j]; DefaultTags[j]=tmp; } } } TheList=document.getElementById("tbDefinedTags"); i=document.getElementById("tbxFilter"); i.onkeypress=i.onchange=i.onkeyup=function() { Lister.askRefresh(); }; Lister.recount(); Lister.refreshNow(); document.getElementById("btnOk").disabled=false; } function DoOK() { var result=[],k,linearResult,custom; for(k=0;k
 
()
:
:
"; echo "
"; } // end column for find options echo "
"; // Close table with find options echo "
"; echo "", i18n::translate('Close Window'), "
"; echo "
"; 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 "'; } else { echo ""; } echo "
    "; usort($myindilist, array('GedcomRecord', 'Compare')); foreach($myindilist as $indi) { echo $indi->format_list('li', true); } echo '
', i18n::translate('Total individuals'), ' ', count($myindilist), '
"; echo 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 = pgv_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 "'; } else { echo ""; } echo "
    "; usort($myfamlist, array('GedcomRecord', 'Compare')); foreach($myfamlist as $family) { echo $family->format_list('li', true); } echo '
', i18n::translate('Total families'), ' ', count($myfamlist), '
"; echo i18n::translate('No results found.'); echo "
"; } // Output Media if ($type == "media") { global $dirs; $medialist = get_medialist(true, $directory); echo ""; // Show link to previous folder if ($level>0) { $levels = explode("/", $directory); $pdir = ""; for($i=0; $i   <-- ".$pdir."   
"; } // Start of media directory table echo "
"; // Tell the user where he is echo ""; echo ""; echo ""; // display the directory list if (count($dirs) || $level) { sort($dirs); if ($level){ echo ""; } echo ""; foreach ($dirs as $indexval => $dir) { echo ""; } } echo ""; /** * This action generates a thumbnail for the file * * @name $create->thumbnail */ if ($create=="thumbnail") { $filename = $_REQUEST["file"]; generate_thumbnail($directory.$filename, $thumbdir.$filename); } echo "
"; // display the images TODO x across if lots of files?? if (count($medialist) > 0) { foreach ($medialist as $indexval => $media) { // Check if the media belongs to the current folder preg_match_all("/\//", $media["FILE"], $hits); $ct = count($hits[0]); if (($ct <= $level+1 && $external_links != "http" && !isFileExternal($media["FILE"])) || (isFileExternal($media["FILE"]) && $external_links == "http")) { // simple filter to reduce the number of items to view $isvalid = filterMedia($media, $filter, 'http'); if ($isvalid && $chooseType!="all") { if ($chooseType=="0file" && !empty($media["XREF"])) $isvalid = false; // skip linked media files if ($chooseType=="media" && empty($media["XREF"])) $isvalid = false; // skip unlinked media files } if ($isvalid) { if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0){ $imgsize = findImageSize($media["FILE"]); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; } else { $imgwidth = 0; $imgheight = 0; } echo ""; //-- thumbnail field if ($showthumb) { echo ""; } } } } else { echo ""; } echo "
"; echo i18n::translate('Current directory'); echo "
"; echo substr($directory, 0, -1); echo "
"; echo $uplink, "
"; echo "", i18n::translate('External objects'), ""; echo "
"; echo "", $dir, ""; echo "
"; if (isset($media["THUMB"])) echo "\"\""; else echo " "; } //-- name and size field echo ""; if ($media["TITL"] != "") { echo "", PrintReady($media["TITL"]), "  "; if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo "(", $media["XREF"], ")"; if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo "
"; } if (!$embed){ echo "", $media["FILE"], " -- "; } else echo "", $media["FILE"], " -- "; echo "", i18n::translate('View'), "
"; if (!$media["EXISTS"] && !isFileExternal($media["FILE"])) echo $media["FILE"], "
", i18n::translate('The filename entered does not exist.'), "
"; else if (!isFileExternal($media["FILE"]) && !empty($imgsize[0])) { echo "
  ", i18n::translate('Image Dimensions'), " -- ", $imgsize[0], "x", $imgsize[1], "
"; } if ($media["LINKED"]) { echo i18n::translate('This media object is linked to the following:'), "
"; 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 '
'; switch($type_record) { case 'INDI': echo i18n::translate('View Person'), ' - '; break; case 'FAM': echo i18n::translate('View Family'), ' - '; break; case 'SOUR': echo i18n::translate('View Source'), ' - '; break; case 'OBJE': echo i18n::translate('View Object'), ' - '; break; } echo PrintReady($record->getFullName()), ''; } } else { echo i18n::translate('This media object is not linked to any GEDCOM record.'); } echo "
"; echo i18n::translate('No results found.'); echo "
"; } // Output Places if ($type == "place") { echo ""; $placelist = array(); if ($all || $filter) { $placelist=find_place_list($filter); $ctplace = count($placelist); if ($ctplace>0) { $revplacelist = array(); foreach ($placelist as $indexval => $place) { $levels = explode(',', $place); // -- split the place into comma seperated values $levels = array_reverse($levels); // -- reverse the array so that we get the top level first $placetext = ""; $j=0; foreach($levels as $indexval => $level) { if ($j>0) $placetext .= ", "; $placetext .= trim($level); $j++; } $revplacelist[] = $placetext; } uasort($revplacelist, "utf8_strcasecmp"); echo ""; echo ""; } else { echo ""; } } echo "
", i18n::translate('Places found'), " ", $ctplace; echo "
    "; echo i18n::translate('No results found.'); echo "
"; } // Output Repositories if ($type == "repo") { echo ""; $repo_list = get_repo_list(WT_GED_ID); if ($repo_list) { echo ""; echo ""; } else { echo ""; } echo "
", i18n::translate('Repositories found'), " ", count($repo_list); echo "
"; echo 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('GedcomRecord', 'Compare')); echo ''; } else { echo ''; } echo '
', i18n::translate('Shared Notes found'), ' ', count($mynotelist), '
', i18n::translate('No results found.'), '
'; } // 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('GedcomRecord', 'Compare')); echo ''; } else { echo ''; } echo '
', i18n::translate('Total Sources'), ' ', count($mysourcelist), '
', i18n::translate('No results found.'), '
'; } // Output Special Characters if ($type == "specialchar") { echo "

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

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

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

'; } } echo ""; // Close div that centers table // Set focus to the input field if ($type!='facts') echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END; print_simple_footer(); ?>