<tr><td>', I18N::translate('Custom tags'), ':</td><td><input type="text" id="tbxCustom" value="', addslashes(implode(",", $preselCustom)), '"></td></tr> <td><td></tbody></table> <table id="tabAction"><tbody><tr> <td colspan="2"><button id="btnOk" disabled onclick="if (!this.disabled) { DoOK(); }">', I18N::translate('save'), '</button></td> <tr></tbody></table> </td></tr></table> </form></div>'; } if ($action === 'filter') { $filter = trim($filter); $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); // Output Individual if ($type === 'indi') { echo '<div id="find-output">'; $myindilist = FunctionsDb::searchIndividualNames($filter_array, array($WT_TREE)); if ($myindilist) { echo '<ul>'; usort($myindilist, '\\Fisharebest\\Webtrees\\GedcomRecord::compare'); foreach ($myindilist as $indi) { echo $indi->formatList('li', true); } echo '</ul> <p>', I18N::translate('Total individuals: %s', count($myindilist)), '</p>'; } else { echo '<p>', I18N::translate('No results found.'), '</p>'; } echo '</div>'; } // Output Family if ($type == "fam") {
/** * Find a media object. */ private static function mediaFind() { global $WT_TREE; $controller = new SimpleController(); $filter = Filter::get('filter'); $multiple = Filter::getBool('multiple'); $controller->setPageTitle(I18N::translate('Find an individual'))->pageHeader(); ?> <script> function pasterow(id, name, gend, yob, age, bpl) { window.opener.opener.insertRowToTable(id, name, '', gend, '', yob, age, 'Y', '', bpl); } function pasteid(id, name, thumb) { if (thumb) { window.opener.paste_id(id, name, thumb); <?php if (!$multiple) { echo "window.close();"; } ?> } else { // GEDFact_assistant ======================== if (window.opener.document.getElementById('addlinkQueue')) { window.opener.insertRowToTable(id, name); } window.opener.paste_id(id); if (window.opener.pastename) { window.opener.pastename(name); } <?php if (!$multiple) { echo "window.close();"; } ?> } } 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("<?php echo I18N::translate('Please enter more than one character.'); ?> "); frm.filter.focus(); return false; } if (button=="all") { frm.filter.value = ""; } return true; } </script> <?php echo '<div>'; echo '<table class="list_table width90" border="0">'; echo '<tr><td style="padding: 10px;" class="facts_label03 width90">'; // start column for find text header echo $controller->getPageTitle(); echo '</td>'; echo '</tr>'; echo '</table>'; echo '<br>'; echo '<button onclick="window.close();">', I18N::translate('close'), '</button>'; echo '<br>'; $filter = trim($filter); $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); echo '<table class="tabs_table width90"><tr>'; $myindilist = FunctionsDb::searchIndividualNames($filter_array, array($WT_TREE)); if ($myindilist) { echo '<td class="list_value_wrap"><ul>'; usort($myindilist, '\\Fisharebest\\Webtrees\\GedcomRecord::compare'); foreach ($myindilist as $indi) { $nam = Filter::escapeHtml($indi->getFullName()); echo "<li><a href=\"#\" onclick=\"pasterow(\n\t\t\t\t\t'" . $indi->getXref() . "' ,\n\t\t\t\t\t'" . $nam . "' ,\n\t\t\t\t\t'" . $indi->getSex() . "' ,\n\t\t\t\t\t'" . $indi->getBirthYear() . "' ,\n\t\t\t\t\t'" . (1901 - $indi->getBirthYear()) . "' ,\n\t\t\t\t\t'" . $indi->getBirthPlace() . "'); return false;\">\n\t\t\t\t\t<b>" . $indi->getFullName() . "</b> "; $born = GedcomTag::getLabel('BIRT'); echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getBirthYear(), " ", $indi->getBirthPlace(), "</span></a></li>"; echo "<hr>"; } echo '</ul></td></tr><tr><td class="list_label">', I18N::translate('Total individuals: %s', count($myindilist)), '</tr></td>'; } else { echo "<td class=\"list_value_wrap\">"; echo I18N::translate('No results found.'); echo "</td></tr>"; } echo "</table>"; echo '</div>'; }