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; } <?php echo '</script>'; echo '<div id="find-page"><h3>', $controller->getPageTitle(), '</h3>'; // Show indi and hide the rest if ($type == "indi") { echo '<div id="find-header"> <form name="filterindi" method="get" onsubmit="return checknames(this);" action="find.php"> <input type="hidden" name="callback" value="' . $callback . '"> <input type="hidden" name="action" value="filter"> <input type="hidden" name="type" value="indi"> <span>', I18N::translate('Name contains'), '</span> <input type="text" name="filter" value="'; if ($filter) { echo $filter; } echo '" autofocus> <input type="submit" value="', I18N::translate('Filter'), '"> </form></div>';
default: throw new \Exception('Bad $action (' . $action . ') in addmedia.php'); } $controller->pageHeader(); echo '<div id="addmedia-page">'; //container for media edit pop-up 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_TREE->getNameHtml(), '">'; echo '<input type="hidden" name="pid" value="', $pid, '">'; if ($linktoid) { echo '<input type="hidden" name="linktoid" value="', $linktoid, '">'; } echo '<table class="facts_table">'; echo '<tr><td class="topbottombar" colspan="2">'; echo $controller->getPageTitle(), FunctionsPrint::helpLink('OBJE'); echo '</td></tr>'; if (!$linktoid && $action == 'create') { echo '<tr><td class="descriptionbox wrap width25">'; echo I18N::translate('Enter an individual, family, or source ID'); echo '</td><td class="optionbox wrap"><input type="text" data-autocomplete-type="IFS" name="linktoid" id="linktoid" size="6" value="">'; echo ' ', FunctionsPrint::printFindIndividualLink('linktoid'); echo ' ', FunctionsPrint::printFindFamilyLink('linktoid'); echo ' ', FunctionsPrint::printFindSourceLink('linktoid'); echo '<p class="small text-muted">', I18N::translate('Enter or search for the ID of the individual, family, or source to which this media object should be linked.'), '</p></td></tr>'; } if ($media) { $gedrec = $media->getGedcom(); } else { $gedrec = ''; }
require './includes/session.php'; $action = Filter::post('action', null, Filter::get('action')); $controller = new SimpleController(); $controller->restrictAccess(Auth::isEditor($WT_TREE))->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();')->addInlineJavascript('var locale_date_format="' . preg_replace('/[^DMY]/', '', str_replace(array('J', 'F'), array('D', 'M'), I18N::dateFormat())) . '";'); switch ($action) { //////////////////////////////////////////////////////////////////////////////// case 'editraw': $xref = Filter::get('xref', WT_REGEX_XREF); $record = GedcomRecord::getInstance($xref, $WT_TREE); check_record_access($record); $controller->setPageTitle($record->getFullName() . ' - ' . I18N::translate('Edit raw GEDCOM'))->pageHeader()->addInlineJavascript('jQuery("#raw-gedcom-list").sortable({opacity: 0.7, cursor: "move", axis: "y"});'); ?> <div id="edit_interface-page"> <h4> <?php echo $controller->getPageTitle(); ?> <?php echo FunctionsPrint::helpLink('edit_edit_raw'); ?> </h4> <pre> <?php echo '0 @' . $record->getXref() . '@ ' . $record::RECORD_TYPE; ?> </pre> <form method="post" action="edit_interface.php"> <input type="hidden" name="ged" value="<?php echo $WT_TREE->getNameHtml(); ?> "> <input type="hidden" name="action" value="updateraw">
/** * 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>'; }