public function __construct() { parent::__construct(); $PEDIGREE_FULL_DETAILS = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_FULL_DETAILS'); $MAX_DESCENDANCY_GENERATIONS = get_gedcom_setting(WT_GED_ID, 'MAX_DESCENDANCY_GENERATIONS'); // Extract the request parameters $this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS); $this->show_spouse = WT_Filter::getInteger('show_spouse', 0, 1); $this->descent = WT_Filter::getInteger('descent', 0, 9, 5); $this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 2); $this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100); // Box sizes are set globally in the theme. Modify them here. global $bwidth, $bheight, $cbwidth, $cbheight, $Dbwidth, $bhalfheight, $Dbheight; $Dbwidth = $this->box_width * $bwidth / 100; //$Dbheight=$this->box_width * $bheight / 100; $bwidth = $Dbwidth; $bheight = $Dbheight; // -- adjust size of the compact box if (!$this->show_full) { $bwidth = $this->box_width * $cbwidth / 100; $bheight = $cbheight; } $bhalfheight = $bheight / 2; if ($this->root && $this->root->canShowName()) { $this->setPageTitle(WT_I18N::translate('Family book of %s', $this->root->getFullName())); } else { $this->setPageTitle(WT_I18N::translate('Family book')); } //Checks how many generations of descendency is for the person for formatting purposes $this->dgenerations = $this->max_descendency_generations($this->pid, 0); if ($this->dgenerations < 1) { $this->dgenerations = 1; } }
/** * get edit menu */ function getEditMenu() { $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD'); if (!$this->record || $this->record->isOld()) { return null; } // edit menu $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-obje'); if (WT_USER_CAN_EDIT) { $submenu = new WT_Menu(WT_I18N::translate('Edit media object'), '#', 'menu-obje-edit'); $submenu->addOnclick("window.open('addmedia.php?action=editmedia&pid={$this->record->getXref()}', '_blank', edit_window_specs)"); $menu->addSubmenu($submenu); // main link displayed on page if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) { $submenu = new WT_Menu(WT_I18N::translate('Manage links'), '#', 'menu-obje-link'); $submenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','manage');"); } else { $submenu = new WT_Menu(WT_I18N::translate('Set link'), '#', 'menu-obje-link'); $ssubmenu = new WT_Menu(WT_I18N::translate('To individual'), '#', 'menu-obje-link-indi'); $ssubmenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','person');"); $submenu->addSubMenu($ssubmenu); $ssubmenu = new WT_Menu(WT_I18N::translate('To family'), '#', 'menu-obje-link-fam'); $ssubmenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','family');"); $submenu->addSubMenu($ssubmenu); $ssubmenu = new WT_Menu(WT_I18N::translate('To source'), '#', 'menu-obje-link-sour'); $ssubmenu->addOnclick("return ilinkitem('" . $this->record->getXref() . "','source');"); $submenu->addSubMenu($ssubmenu); } $menu->addSubmenu($submenu); } // delete if (WT_USER_CAN_EDIT) { $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-obje-del'); $submenu->addOnclick("return delete_media('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // edit raw if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) { $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-obje-editraw'); $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-obje-addfav'); $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})"); $menu->addSubmenu($submenu); } //-- get the link for the first submenu and set it as the link for the main menu if (isset($menu->submenus[0])) { $link = $menu->submenus[0]->onclick; $menu->addOnclick($link); } return $menu; }
public function __construct() { parent::__construct(); $default_generations = get_gedcom_setting(WT_GED_ID, 'DEFAULT_PEDIGREE_GENERATIONS'); // Extract the request parameters $this->fan_style = WT_Filter::getInteger('fan_style', 2, 4, 3); $this->fan_width = WT_Filter::getInteger('fan_width', 50, 300, 100); $this->generations = WT_Filter::getInteger('generations', 2, 9, $default_generations); if ($this->root && $this->root->canShowName()) { $this->setPageTitle(WT_I18N::translate('Fan chart of %s', $this->root->getFullName())); } else { $this->setPageTitle(WT_I18N::translate('Fan chart')); } }
function getOtherFields() { $ofields = array('ADDR', 'ADDR:CITY', 'ADDR:STAE', 'ADDR:CTRY', 'ADDR:POST', 'ADOP:DATE', 'ADOP:PLAC', 'AFN', 'BAPL:DATE', 'BAPL:PLAC', 'BAPM:DATE', 'BAPM:PLAC', 'BARM:DATE', 'BARM:PLAC', 'BASM:DATE', 'BASM:PLAC', 'BLES:DATE', 'BLES:PLAC', 'BURI:DATE', 'BURI:PLAC', 'CAST', 'CENS:DATE', 'CENS:PLAC', 'CHAN:DATE', 'CHAN:_WT_USER', 'CHR:DATE', 'CHR:PLAC', 'CREM:DATE', 'CREM:PLAC', 'DSCR', 'EMAIL', 'EMIG:DATE', 'EMIG:PLAC', 'ENDL:DATE', 'ENDL:PLAC', 'EVEN', 'EVEN:DATE', 'EVEN:PLAC', 'FAMS:CENS:DATE', 'FAMS:CENS:PLAC', 'FAMS:DIV:DATE', 'FAMS:NOTE', 'FAMS:SLGS:DATE', 'FAMS:SLGS:PLAC', 'FAX', 'FCOM:DATE', 'FCOM:PLAC', 'IMMI:DATE', 'IMMI:PLAC', 'NAME:NICK', 'NAME:_MARNM', 'NAME:_HEB', 'NAME:ROMN', 'NATI', 'NATU:DATE', 'NATU:PLAC', 'NOTE', 'OCCU', 'ORDN:DATE', 'ORDN:PLAC', 'RELI', 'RESI', 'RESI:DATE', 'RESI:PLAC', 'SLGC:DATE', 'SLGC:PLAC', 'TITL', '_BRTM:DATE', '_BRTM:PLAC', '_MILI'); // Allow (some of) the user-specified fields to be selected preg_match_all('/(' . WT_REGEX_TAG . ')/', get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_ADD'), $facts); foreach ($facts[1] as $fact) { if ($fact != 'BIRT' && $fact != 'DEAT' && $fact != 'ASSO' && !in_array($fact, $ofields) && !in_array("{$fact}:DATE", $ofields) && !in_array("{$fact}:PLAC", $ofields)) { $ofields[] = $fact; } } $fields = array(); foreach ($ofields as $field) { $fields[$field] = WT_Gedcom_Tag::GetLabel($field); } uksort($fields, array('WT_Controller_AdvancedSearch', 'tagSort')); return $fields; }
/** * get edit menu */ function getEditMenu() { $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD'); if (!$this->record || $this->record->isOld()) { return null; } // edit menu $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-repo'); if (WT_USER_CAN_EDIT) { $fact = $this->record->getFirstFact('NAME'); $submenu = new WT_Menu(WT_I18N::translate('Edit repository'), '#', 'menu-repo-edit'); if ($fact) { // Edit existing name $submenu->addOnclick('return edit_record(\'' . $this->record->getXref() . '\', \'' . $fact->getFactId() . '\');'); } else { // Add new name $submenu->addOnclick('return add_fact(\'' . $this->record->getXref() . '\', \'NAME\');'); } $menu->addSubmenu($submenu); } // delete if (WT_USER_CAN_EDIT) { $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-repo-del'); $submenu->addOnclick("return delete_repository('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // edit raw if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) { $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-repo-editraw'); $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-repo-addfav'); $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})"); $menu->addSubmenu($submenu); } //-- get the link for the first submenu and set it as the link for the main menu if (isset($menu->submenus[0])) { $link = $menu->submenus[0]->onclick; $menu->addOnclick($link); } return $menu; }
function print_gedcom_block($block = true, $config = "", $side, $index) { global $hitCount, $pgv_lang, $SHOW_COUNTER; $id = "gedcom_welcome"; $title = PrintReady(get_gedcom_setting(PGV_GED_ID, 'title')); $content = "<div class=\"center\">"; $content .= "<br />" . format_timestamp(client_time()) . "<br />\n"; if ($SHOW_COUNTER) { $content .= $pgv_lang["hit_count"] . " " . $hitCount . "<br />\n"; } $content .= "\n<br />"; if (PGV_USER_GEDCOM_ADMIN) { $content .= "<a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name=" . PGV_GEDCOM . "&ctype=gedcom") . "', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1'); return false;\">" . $pgv_lang["customize_gedcom_page"] . "</a><br />\n"; } $content .= "</div>"; global $THEME_DIR; require $THEME_DIR . 'templates/block_main_temp.php'; }
function updateRecord($xref, $gedrec) { $SURNAME_TRADITION = get_gedcom_setting(WT_GED_ID, 'SURNAME_TRADITION'); preg_match('/^1 NAME (.*)/m', $gedrec, $match); $wife_name = $match[1]; $married_names = array(); foreach (self::_surnames_to_add($xref, $gedrec) as $surname) { switch ($this->surname) { case 'add': $married_names[] = "\n2 _MARNM " . str_replace('/', '', $wife_name) . ' /' . $surname . '/'; break; case 'replace': if ($SURNAME_TRADITION == 'polish') { $surname = preg_replace(array('/ski$/', '/cki$/', '/dzki$/'), array('ska', 'cka', 'dzka'), $surname); } $married_names[] = "\n2 _MARNM " . preg_replace('!/.*/!', '/' . $surname . '/', $wife_name); break; } } return preg_replace('/(^1 NAME .*([\\r\\n]+[2-9].*)*)/m', '\\1' . implode('', $married_names), $gedrec, 1); }
/** * get edit menu */ function getEditMenu() { $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD'); if (!$this->record || $this->record->isOld()) { return null; } // edit menu $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-note'); if (WT_USER_CAN_EDIT) { $submenu = new WT_Menu(WT_I18N::translate('Edit note'), '#', 'menu-note-edit'); $submenu->addOnclick('return edit_note(\'' . $this->record->getXref() . '\');'); $menu->addSubmenu($submenu); } // edit raw /* Does not currently work - NOTE records do not contain nice level 1 facts if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) { $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-note-editraw'); $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } */ // delete if (WT_USER_CAN_EDIT) { $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-note-del'); $submenu->addOnclick("return delete_note('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-note-addfav'); $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})"); $menu->addSubmenu($submenu); } //-- get the link for the first submenu and set it as the link for the main menu if (isset($menu->submenus[0])) { $link = $menu->submenus[0]->onclick; $menu->addOnclick($link); } return $menu; }
break; case 'style2': default: echo format_surname_table($surns, WT_SCRIPT_NAME); break; } } else { // Show the list $count = 0; foreach ($surns as $surnames) { foreach ($surnames as $list) { $count += count($list); } } // Don't sublists short lists. if ($count < get_gedcom_setting(WT_GED_ID, 'SUBLIST_TRIGGER_I')) { $falpha = ''; $show_all_firstnames = 'no'; } else { $givn_initials = WT_Query_Name::givenAlpha($surname, $alpha, $show_marnm, true, WT_GED_ID); // Break long lists by initial letter of given name if ($surname || $show_all == 'yes') { // Don't show the list until we have some filter criteria $show = $falpha || $show_all_firstnames == 'yes' ? 'indi' : 'none'; $list = array(); foreach ($givn_initials as $givn_initial => $count) { switch ($givn_initial) { case '@': $html = $UNKNOWN_PN; break; default:
$path = $INDEX_DIRECTORY; // snag our path $entryList = array(); while (false !== ($entry = $dir->read())) { $entryList[] = $entry; } sort($entryList); foreach ($entryList as $entry) { //echo $entry, "\n"; if ($entry[0] != '.') { if ($ged_id = get_id_from_gedcom($entry)) { print "<li class=\"facts_value\" name=\"{$entry}\" style=\"margin-bottom:2px;\" id=\"lock_{$entry}\" >"; print "<img src=\"./images/RESN_confidential.gif\" alt=\"\" /> "; print "<span class=\"name2\">" . $entry . "</span>"; print " {$pgv_lang["associated_files"]}<i> " . str_replace($path, "", get_gedcom_setting($ged_id, 'privacy')); print " " . str_replace($path, "", get_gedcom_setting($ged_id, 'config')) . "</i>"; } else { if (in_array($entry, $locked_by_context)) { print "<li class=\"facts_value\" name=\"{$entry}\" style=\"margin-bottom:2px;\" id=\"lock_{$entry}\" >"; print "<img src=\"./images/RESN_confidential.gif\" alt=\"\" /> "; print "<span class=\"name2\">" . $entry . "</span>"; } else { if (in_array($entry, $locked_with_warning)) { print "<li class=\"facts_value\" name=\"{$entry}\" warn=\"true\" style=\"cursor:move;margin-bottom:2px;\" id=\"li_{$entry}\" >"; print "<input type=\"checkbox\" name=\"to_delete[]\" warn=\"true\" value=\"" . $entry . "\" onclick=\"warnuser(this);\" />\n"; print "<img src=\"./images/RESN_locked.gif\" alt=\"\" /> "; print $entry; $element[] = "li_" . $entry; } else { print "<li class=\"facts_value\" name=\"{$entry}\" style=\"cursor:move;margin-bottom:2px;\" id=\"li_{$entry}\" >"; print "<input type=\"checkbox\" name=\"to_delete[]\" value=\"" . $entry . "\" />\n";
function format_indi_table($datalist, $option = '') { global $GEDCOM, $SHOW_LAST_CHANGE, $SEARCH_SPIDER, $MAX_ALIVE_AGE, $controller; $table_id = 'table-indi-' . Uuid::uuid4(); // lists requires a unique ID in case there are multiple lists per page $SHOW_EST_LIST_DATES = get_gedcom_setting(WT_GED_ID, 'SHOW_EST_LIST_DATES'); $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript(' jQuery.fn.dataTableExt.oSort["unicode-asc" ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))}; jQuery.fn.dataTableExt.oSort["unicode-desc" ]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))}; jQuery.fn.dataTableExt.oSort["num-html-asc" ]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a<b) ? -1 : (a>b ? 1 : 0);}; jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);}; jQuery("#' . $table_id . '").dataTable( { dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\', ' . WT_I18N::datatablesI18N() . ', jQueryUI: true, autoWidth: false, processing: true, retrieve: true, columns: [ /* 0 givn */ { dataSort: 2 }, /* 1 surn */ { dataSort: 3 }, /* 2 GIVN,SURN */ { type: "unicode", visible: false }, /* 3 SURN,GIVN */ { type: "unicode", visible: false }, /* 4 sosa */ { dataSort: 5, class: "center", visible: ' . ($option == 'sosa' ? 'true' : 'false') . ' }, /* 5 SOSA */ { type: "num", visible: false }, /* 6 birt date */ { dataSort: 7 }, /* 7 BIRT:DATE */ { visible: false }, /* 8 anniv */ { dataSort: 7, class: "center" }, /* 9 birt plac */ { type: "unicode" }, /* 10 children */ { dataSort: 11, class: "center" }, /* 11 children */ { type: "num", visible: false }, /* 12 deat date */ { dataSort: 13 }, /* 13 DEAT:DATE */ { visible: false }, /* 14 anniv */ { dataSort: 13, class: "center" }, /* 15 age */ { dataSort: 16, class: "center" }, /* 16 AGE */ { type: "num", visible: false }, /* 17 deat plac */ { type: "unicode" }, /* 18 CHAN */ { dataSort: 19, visible: ' . ($SHOW_LAST_CHANGE ? 'true' : 'false') . ' }, /* 19 CHAN_sort */ { visible: false }, /* 20 SEX */ { visible: false }, /* 21 BIRT */ { visible: false }, /* 22 DEAT */ { visible: false }, /* 23 TREE */ { visible: false } ], sorting: [[' . ($option == 'sosa' ? '4, "asc"' : '1, "asc"') . ']], displayLength: 20, pagingType: "full_numbers" }); jQuery("#' . $table_id . '") /* Hide/show parents */ .on("click", ".btn-toggle-parents", function() { jQuery(this).toggleClass("ui-state-active"); jQuery(".parents", jQuery(this).closest("table").DataTable().rows().nodes()).slideToggle(); }) /* Hide/show statistics */ .on("click", ".btn-toggle-statistics", function() { jQuery(this).toggleClass("ui-state-active"); jQuery("#indi_list_table-charts_' . $table_id . '").slideToggle(); }) /* Filter buttons in table header */ .on("click", "button[data-filter-column]", function() { var btn = jQuery(this); // De-activate the other buttons in this button group btn.siblings().removeClass("ui-state-active"); // Apply (or clear) this filter var col = jQuery("#' . $table_id . '").DataTable().column(btn.data("filter-column")); if (btn.hasClass("ui-state-active")) { btn.removeClass("ui-state-active"); col.search("").draw(); } else { btn.addClass("ui-state-active"); col.search(btn.data("filter-value")).draw(); } }); jQuery(".indi-list").css("visibility", "visible"); jQuery(".loading-image").css("display", "none"); '); $stats = new WT_Stats($GEDCOM); // Bad data can cause "longest life" to be huge, blowing memory limits $max_age = min($MAX_ALIVE_AGE, $stats->LongestLifeAge()) + 1; // Inititialise chart data for ($age = 0; $age <= $max_age; $age++) { $deat_by_age[$age] = ''; } for ($year = 1550; $year < 2030; $year += 10) { $birt_by_decade[$year] = ''; $deat_by_decade[$year] = ''; } $html = ' <div class="loading-image"> </div> <div class="indi-list"> <table id="' . $table_id . '"> <thead> <tr> <th colspan="24"> <div class="btn-toolbar"> <div class="btn-group"> <button class="ui-state-default" data-filter-column="20" data-filter-value="M" title="' . WT_I18N::translate('Show only males.') . '" type="button" > ' . WT_Individual::sexImage('M', 'large') . ' </button> <button class="ui-state-default" data-filter-column="20" data-filter-value="F" title="' . WT_I18N::translate('Show only females.') . '" type="button" > ' . WT_Individual::sexImage('F', 'large') . ' </button> <button class="ui-state-default" data-filter-column="20" data-filter-value="U" title="' . WT_I18N::translate('Show only individuals for whom the gender is not known.') . '" type="button" > ' . WT_Individual::sexImage('U', 'large') . ' </button> </div> <div class="btn-group"> <button class="ui-state-default" data-filter-column="22" data-filter-value="N" title="' . WT_I18N::translate('Show individuals who are alive or couples where both partners are alive.') . '" type="button" > ' . WT_I18N::translate('Alive') . ' </button> <button class="ui-state-default" data-filter-column="22" data-filter-value="Y" title="' . WT_I18N::translate('Show individuals who are dead or couples where both partners are deceased.') . '" type="button" > ' . WT_I18N::translate('Dead') . ' </button> <button class="ui-state-default" data-filter-column="22" data-filter-value="YES" title="' . WT_I18N::translate('Show individuals who died more than 100 years ago.') . '" type="button" > ' . WT_Gedcom_Tag::getLabel('DEAT') . '>100 </button> <button class="ui-state-default" data-filter-column="22" data-filter-value="Y100" title="' . WT_I18N::translate('Show individuals who died within the last 100 years.') . '" type="button" > ' . WT_Gedcom_Tag::getLabel('DEAT') . '<=100 </button> </div> <div class="btn-group"> <button class="ui-state-default" data-filter-column="21" data-filter-value="YES" title="' . WT_I18N::translate('Show individuals born more than 100 years ago.') . '" type="button" > ' . WT_Gedcom_Tag::getLabel('BIRT') . '>100 </button> <button class="ui-state-default" data-filter-column="21" data-filter-value="Y100" title="' . WT_I18N::translate('Show individuals born within the last 100 years.') . '" type="button" > ' . WT_Gedcom_Tag::getLabel('BIRT') . '<=100 </button> </div> <div class="btn-group"> <button class="ui-state-default" data-filter-column="23" data-filter-value="R" title="' . WT_I18N::translate('Show “roots” couples or individuals. These individuals may also be called “patriarchs”. They are individuals who have no parents recorded in the database.') . '" type="button" > ' . WT_I18N::translate('Roots') . ' </button> <button class="ui-state-default" data-filter-column="23" data-filter-value="L" title="' . WT_I18N::translate('Show “leaves” couples or individuals. These are individuals who are alive but have no children recorded in the database.') . '" type="button" > ' . WT_I18N::translate('Leaves') . ' </button> </div> </div> </th> </tr> <tr> <th>' . WT_Gedcom_Tag::getLabel('GIVN') . '</th> <th>' . WT_Gedcom_Tag::getLabel('SURN') . '</th> <th>GIVN</th> <th>SURN</th> <th>' . WT_I18N::translate('Sosa') . '</th> <th>SOSA</th> <th>' . WT_Gedcom_Tag::getLabel('BIRT') . '</th> <th>SORT_BIRT</th> <th><i class="icon-reminder" title="' . WT_I18N::translate('Anniversary') . '"></i></th> <th>' . WT_Gedcom_Tag::getLabel('PLAC') . '</th> <th><i class="icon-children" title="' . WT_I18N::translate('Children') . '"></i></th> <th>NCHI</th> <th>' . WT_Gedcom_Tag::getLabel('DEAT') . '</th> <th>SORT_DEAT</th> <th><i class="icon-reminder" title="' . WT_I18N::translate('Anniversary') . '"></i></th> <th>' . WT_Gedcom_Tag::getLabel('AGE') . '</th> <th>AGE</th> <th>' . WT_Gedcom_Tag::getLabel('PLAC') . '</th> <th>' . WT_Gedcom_Tag::getLabel('CHAN') . '</th> <th>CHAN</th> <th>SEX</th> <th>BIRT</th> <th>DEAT</th> <th>TREE</th> </tr> </thead> <tfoot> <tr> <th colspan="24"> <div class="btn-toolbar"> <div class="btn-group"> <button type="button" class="ui-state-default btn-toggle-parents"> ' . WT_I18N::translate('Show parents') . ' </button> <button type="button" class="ui-state-default btn-toggle-statistics"> ' . WT_I18N::translate('Show statistics charts') . ' </button> </div> </div> </th> </tr> </tfoot> <tbody>'; $d100y = new WT_Date(date('Y') - 100); // 100 years ago $unique_indis = array(); // Don't double-count indis with multiple names. foreach ($datalist as $key => $value) { if (is_object($value)) { // Array of objects $person = $value; } elseif (!is_array($value)) { // Array of IDs $person = WT_Individual::getInstance($value); } else { // Array of search results $gid = $key; if (isset($value['gid'])) { $gid = $value['gid']; } // from indilist if (isset($value[4])) { $gid = $value[4]; } // from indilist ALL $person = WT_Individual::getInstance($gid); } if (!$person || !$person->canShowName()) { continue; } if ($person->isNew()) { $class = ' class="new"'; } elseif ($person->isOld()) { $class = ' class="old"'; } else { $class = ''; } $html .= '<tr' . $class . '>'; //-- Indi name(s) $html .= '<td colspan="2">'; foreach ($person->getAllNames() as $num => $name) { if ($name['type'] == 'NAME') { $title = ''; } else { $title = 'title="' . strip_tags(WT_Gedcom_Tag::getLabel($name['type'], $person)) . '"'; } if ($num == $person->getPrimaryName()) { $class = ' class="name2"'; $sex_image = $person->getSexImage(); list($surn, $givn) = explode(',', $name['sort']); } else { $class = ''; $sex_image = ''; } $html .= '<a ' . $title . ' href="' . $person->getHtmlUrl() . '"' . $class . '>' . highlight_search_hits($name['full']) . '</a>' . $sex_image . '<br>'; } // Indi parents $html .= $person->getPrimaryParentsNames('parents details1', 'none'); $html .= '</td>'; // Dummy column to match colspan in header $html .= '<td style="display:none;"></td>'; //-- GIVN/SURN // Use "AAAA" as a separator (instead of ",") as Javascript.localeCompare() ignores // punctuation and "ANN,ROACH" would sort after "ANNE,ROACH", instead of before it. // Similarly, @N.N. would sort as NN. $html .= '<td>' . WT_Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . WT_Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . '</td>'; $html .= '<td>' . WT_Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . WT_Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . '</td>'; //-- SOSA if ($option == 'sosa') { $html .= '<td><a href="relationship.php?pid1=' . $datalist[1] . '&pid2=' . $person->getXref() . '" title="' . WT_I18N::translate('Relationships') . '">' . WT_I18N::number($key) . '</a></td><td>' . $key . '</td>'; } else { $html .= '<td> </td><td>0</td>'; } //-- Birth date $html .= '<td>'; if ($birth_dates = $person->getAllBirthDates()) { foreach ($birth_dates as $num => $birth_date) { if ($num) { $html .= '<br>'; } $html .= $birth_date->Display(!$SEARCH_SPIDER); } if ($birth_dates[0]->gregorianYear() >= 1550 && $birth_dates[0]->gregorianYear() < 2030 && !isset($unique_indis[$person->getXref()])) { $birt_by_decade[(int) ($birth_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex(); } } else { $birth_date = $person->getEstimatedBirthDate(); if ($SHOW_EST_LIST_DATES) { $html .= $birth_date->Display(!$SEARCH_SPIDER); } else { $html .= ' '; } $birth_dates[0] = new WT_Date(''); } $html .= '</td>'; //-- Event date (sortable)hidden by datatables code $html .= '<td>' . $birth_date->JD() . '</td>'; //-- Birth anniversary $html .= '<td>' . WT_Date::getAge($birth_dates[0], null, 2) . '</td>'; //-- Birth place $html .= '<td>'; foreach ($person->getAllBirthPlaces() as $n => $birth_place) { $tmp = new WT_Place($birth_place, WT_GED_ID); if ($n) { $html .= '<br>'; } if ($SEARCH_SPIDER) { $html .= $tmp->getShortName(); } else { $html .= '<a href="' . $tmp->getURL() . '" title="' . strip_tags($tmp->getFullName()) . '">'; $html .= highlight_search_hits($tmp->getShortName()) . '</a>'; } } $html .= '</td>'; //-- Number of children $nchi = $person->getNumberOfChildren(); $html .= '<td>' . WT_I18N::number($nchi) . '</td><td>' . $nchi . '</td>'; //-- Death date $html .= '<td>'; if ($death_dates = $person->getAllDeathDates()) { foreach ($death_dates as $num => $death_date) { if ($num) { $html .= '<br>'; } $html .= $death_date->Display(!$SEARCH_SPIDER); } if ($death_dates[0]->gregorianYear() >= 1550 && $death_dates[0]->gregorianYear() < 2030 && !isset($unique_indis[$person->getXref()])) { $deat_by_decade[(int) ($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex(); } } else { $death_date = $person->getEstimatedDeathDate(); if ($SHOW_EST_LIST_DATES) { $html .= $death_date->Display(!$SEARCH_SPIDER); } else { if ($person->isDead()) { $html .= WT_I18N::translate('yes'); } else { $html .= ' '; } } $death_dates[0] = new WT_Date(''); } $html .= '</td>'; //-- Event date (sortable)hidden by datatables code $html .= '<td>' . $death_date->JD() . '</td>'; //-- Death anniversary $html .= '<td>' . WT_Date::getAge($death_dates[0], null, 2) . '</td>'; //-- Age at death $age = WT_Date::getAge($birth_dates[0], $death_dates[0], 0); if (!isset($unique_indis[$person->getXref()]) && $age >= 0 && $age <= $max_age) { $deat_by_age[$age] .= $person->getSex(); } // Need both display and sortable age $html .= '<td>' . WT_Date::getAge($birth_dates[0], $death_dates[0], 2) . '</td><td>' . WT_Date::getAge($birth_dates[0], $death_dates[0], 1) . '</td>'; //-- Death place $html .= '<td>'; foreach ($person->getAllDeathPlaces() as $n => $death_place) { $tmp = new WT_Place($death_place, WT_GED_ID); if ($n) { $html .= '<br>'; } if ($SEARCH_SPIDER) { $html .= $tmp->getShortName(); } else { $html .= '<a href="' . $tmp->getURL() . '" title="' . strip_tags($tmp->getFullName()) . '">'; $html .= highlight_search_hits($tmp->getShortName()) . '</a>'; } } $html .= '</td>'; //-- Last change if ($SHOW_LAST_CHANGE) { $html .= '<td>' . $person->lastChangeTimestamp() . '</td>'; } else { $html .= '<td> </td>'; } //-- Last change hidden sort column if ($SHOW_LAST_CHANGE) { $html .= '<td>' . $person->lastChangeTimestamp(true) . '</td>'; } else { $html .= '<td> </td>'; } //-- Sorting by gender $html .= '<td>'; $html .= $person->getSex(); $html .= '</td>'; //-- Filtering by birth date $html .= '<td>'; if (!$person->canShow() || WT_Date::Compare($birth_date, $d100y) > 0) { $html .= 'Y100'; } else { $html .= 'YES'; } $html .= '</td>'; //-- Filtering by death date $html .= '<td>'; // Died in last 100 years? Died? Not dead? if (WT_Date::Compare($death_date, $d100y) > 0) { $html .= 'Y100'; } elseif ($death_date->minJD() || $person->isDead()) { $html .= 'YES'; } else { $html .= 'N'; } $html .= '</td>'; //-- Roots or Leaves ? $html .= '<td>'; if (!$person->getChildFamilies()) { $html .= 'R'; } elseif (!$person->isDead() && $person->getNumberOfChildren() < 1) { $html .= 'L'; } else { $html .= ' '; } $html .= '</td>'; $html .= '</tr>'; $unique_indis[$person->getXref()] = true; } $html .= ' </tbody> </table> <div id="indi_list_table-charts_' . $table_id . '" style="display:none"> <table class="list-charts"> <tr> <td> ' . print_chart_by_decade($birt_by_decade, WT_I18N::translate('Decade of birth')) . ' </td> <td> ' . print_chart_by_decade($deat_by_decade, WT_I18N::translate('Decade of death')) . ' </td> </tr> <tr> <td colspan="2"> ' . print_chart_by_age($deat_by_age, WT_I18N::translate('Age related to death year')) . ' </td> </tr> </table> </div> </div>'; return $html; }
function load_gedcom_settings($ged_id = WT_GED_ID) { // Load the configuration settings into global scope // TODO: some of these are used infrequently - just load them when we need them global $ADVANCED_NAME_FACTS; $ADVANCED_NAME_FACTS = get_gedcom_setting($ged_id, 'ADVANCED_NAME_FACTS'); global $ADVANCED_PLAC_FACTS; $ADVANCED_PLAC_FACTS = get_gedcom_setting($ged_id, 'ADVANCED_PLAC_FACTS'); global $CALENDAR_FORMAT; $CALENDAR_FORMAT = get_gedcom_setting($ged_id, 'CALENDAR_FORMAT'); global $CHART_BOX_TAGS; $CHART_BOX_TAGS = get_gedcom_setting($ged_id, 'CHART_BOX_TAGS'); global $CONTACT_USER_ID; $CONTACT_USER_ID = get_gedcom_setting($ged_id, 'CONTACT_USER_ID'); global $DEFAULT_PEDIGREE_GENERATIONS; $DEFAULT_PEDIGREE_GENERATIONS = get_gedcom_setting($ged_id, 'DEFAULT_PEDIGREE_GENERATIONS'); global $EXPAND_NOTES; $EXPAND_NOTES = get_gedcom_setting($ged_id, 'EXPAND_NOTES'); global $EXPAND_RELATIVES_EVENTS; $EXPAND_RELATIVES_EVENTS = get_gedcom_setting($ged_id, 'EXPAND_RELATIVES_EVENTS'); global $EXPAND_SOURCES; $EXPAND_SOURCES = get_gedcom_setting($ged_id, 'EXPAND_SOURCES'); global $FAM_ID_PREFIX; $FAM_ID_PREFIX = get_gedcom_setting($ged_id, 'FAM_ID_PREFIX'); global $FULL_SOURCES; $FULL_SOURCES = get_gedcom_setting($ged_id, 'FULL_SOURCES'); global $GEDCOM_ID_PREFIX; $GEDCOM_ID_PREFIX = get_gedcom_setting($ged_id, 'GEDCOM_ID_PREFIX'); global $GEDCOM_MEDIA_PATH; $GEDCOM_MEDIA_PATH = get_gedcom_setting($ged_id, 'GEDCOM_MEDIA_PATH'); global $GENERATE_UIDS; $GENERATE_UIDS = get_gedcom_setting($ged_id, 'GENERATE_UIDS'); global $HIDE_GEDCOM_ERRORS; $HIDE_GEDCOM_ERRORS = get_gedcom_setting($ged_id, 'HIDE_GEDCOM_ERRORS'); global $HIDE_LIVE_PEOPLE; $HIDE_LIVE_PEOPLE = get_gedcom_setting($ged_id, 'HIDE_LIVE_PEOPLE'); global $KEEP_ALIVE_YEARS_BIRTH; $KEEP_ALIVE_YEARS_BIRTH = get_gedcom_setting($ged_id, 'KEEP_ALIVE_YEARS_BIRTH'); global $KEEP_ALIVE_YEARS_DEATH; $KEEP_ALIVE_YEARS_DEATH = get_gedcom_setting($ged_id, 'KEEP_ALIVE_YEARS_DEATH'); global $LANGUAGE; $LANGUAGE = get_gedcom_setting($ged_id, 'LANGUAGE'); global $MAX_ALIVE_AGE; $MAX_ALIVE_AGE = get_gedcom_setting($ged_id, 'MAX_ALIVE_AGE'); global $MAX_DESCENDANCY_GENERATIONS; $MAX_DESCENDANCY_GENERATIONS = get_gedcom_setting($ged_id, 'MAX_DESCENDANCY_GENERATIONS'); global $MAX_PEDIGREE_GENERATIONS; $MAX_PEDIGREE_GENERATIONS = get_gedcom_setting($ged_id, 'MAX_PEDIGREE_GENERATIONS'); global $MEDIA_DIRECTORY; $MEDIA_DIRECTORY = get_gedcom_setting($ged_id, 'MEDIA_DIRECTORY'); global $MEDIA_ID_PREFIX; $MEDIA_ID_PREFIX = get_gedcom_setting($ged_id, 'MEDIA_ID_PREFIX'); global $NOTE_ID_PREFIX; $NOTE_ID_PREFIX = get_gedcom_setting($ged_id, 'NOTE_ID_PREFIX'); global $NO_UPDATE_CHAN; $NO_UPDATE_CHAN = get_gedcom_setting($ged_id, 'NO_UPDATE_CHAN'); global $PEDIGREE_FULL_DETAILS; $PEDIGREE_FULL_DETAILS = get_gedcom_setting($ged_id, 'PEDIGREE_FULL_DETAILS'); global $PEDIGREE_LAYOUT; $PEDIGREE_LAYOUT = get_gedcom_setting($ged_id, 'PEDIGREE_LAYOUT'); global $PEDIGREE_SHOW_GENDER; $PEDIGREE_SHOW_GENDER = get_gedcom_setting($ged_id, 'PEDIGREE_SHOW_GENDER'); global $PREFER_LEVEL2_SOURCES; $PREFER_LEVEL2_SOURCES = get_gedcom_setting($ged_id, 'PREFER_LEVEL2_SOURCES'); global $QUICK_REQUIRED_FACTS; $QUICK_REQUIRED_FACTS = get_gedcom_setting($ged_id, 'QUICK_REQUIRED_FACTS'); global $QUICK_REQUIRED_FAMFACTS; $QUICK_REQUIRED_FAMFACTS = get_gedcom_setting($ged_id, 'QUICK_REQUIRED_FAMFACTS'); global $REPO_ID_PREFIX; $REPO_ID_PREFIX = get_gedcom_setting($ged_id, 'REPO_ID_PREFIX'); global $REQUIRE_AUTHENTICATION; $REQUIRE_AUTHENTICATION = get_gedcom_setting($ged_id, 'REQUIRE_AUTHENTICATION'); global $SAVE_WATERMARK_IMAGE; $SAVE_WATERMARK_IMAGE = get_gedcom_setting($ged_id, 'SAVE_WATERMARK_IMAGE'); global $SAVE_WATERMARK_THUMB; $SAVE_WATERMARK_THUMB = get_gedcom_setting($ged_id, 'SAVE_WATERMARK_THUMB'); global $SHOW_AGE_DIFF; $SHOW_AGE_DIFF = get_gedcom_setting($ged_id, 'SHOW_AGE_DIFF'); global $SHOW_COUNTER; $SHOW_COUNTER = get_gedcom_setting($ged_id, 'SHOW_COUNTER'); global $SHOW_DEAD_PEOPLE; $SHOW_DEAD_PEOPLE = get_gedcom_setting($ged_id, 'SHOW_DEAD_PEOPLE'); global $SHOW_FACT_ICONS; $SHOW_FACT_ICONS = get_gedcom_setting($ged_id, 'SHOW_FACT_ICONS'); global $SHOW_GEDCOM_RECORD; $SHOW_GEDCOM_RECORD = get_gedcom_setting($ged_id, 'SHOW_GEDCOM_RECORD'); global $SHOW_HIGHLIGHT_IMAGES; $SHOW_HIGHLIGHT_IMAGES = get_gedcom_setting($ged_id, 'SHOW_HIGHLIGHT_IMAGES'); global $SHOW_LAST_CHANGE; $SHOW_LAST_CHANGE = get_gedcom_setting($ged_id, 'SHOW_LAST_CHANGE'); global $SHOW_LDS_AT_GLANCE; $SHOW_LDS_AT_GLANCE = get_gedcom_setting($ged_id, 'SHOW_LDS_AT_GLANCE'); global $SHOW_LEVEL2_NOTES; $SHOW_LEVEL2_NOTES = get_gedcom_setting($ged_id, 'SHOW_LEVEL2_NOTES'); global $SHOW_LIVING_NAMES; $SHOW_LIVING_NAMES = get_gedcom_setting($ged_id, 'SHOW_LIVING_NAMES'); global $SHOW_MEDIA_DOWNLOAD; $SHOW_MEDIA_DOWNLOAD = get_gedcom_setting($ged_id, 'SHOW_MEDIA_DOWNLOAD'); global $SHOW_NO_WATERMARK; $SHOW_NO_WATERMARK = get_gedcom_setting($ged_id, 'SHOW_NO_WATERMARK'); global $SHOW_PARENTS_AGE; $SHOW_PARENTS_AGE = get_gedcom_setting($ged_id, 'SHOW_PARENTS_AGE'); global $SHOW_PEDIGREE_PLACES; $SHOW_PEDIGREE_PLACES = get_gedcom_setting($ged_id, 'SHOW_PEDIGREE_PLACES'); global $SHOW_PEDIGREE_PLACES_SUFFIX; $SHOW_PEDIGREE_PLACES_SUFFIX = get_gedcom_setting($ged_id, 'SHOW_PEDIGREE_PLACES_SUFFIX'); global $SHOW_PRIVATE_RELATIONSHIPS; $SHOW_PRIVATE_RELATIONSHIPS = get_gedcom_setting($ged_id, 'SHOW_PRIVATE_RELATIONSHIPS'); global $SHOW_RELATIVES_EVENTS; $SHOW_RELATIVES_EVENTS = get_gedcom_setting($ged_id, 'SHOW_RELATIVES_EVENTS'); global $SOURCE_ID_PREFIX; $SOURCE_ID_PREFIX = get_gedcom_setting($ged_id, 'SOURCE_ID_PREFIX'); global $SURNAME_LIST_STYLE; $SURNAME_LIST_STYLE = get_gedcom_setting($ged_id, 'SURNAME_LIST_STYLE'); global $THUMBNAIL_WIDTH; $THUMBNAIL_WIDTH = get_gedcom_setting($ged_id, 'THUMBNAIL_WIDTH'); global $USE_RIN; $USE_RIN = get_gedcom_setting($ged_id, 'USE_RIN'); global $USE_SILHOUETTE; $USE_SILHOUETTE = get_gedcom_setting($ged_id, 'USE_SILHOUETTE'); global $WATERMARK_THUMB; $WATERMARK_THUMB = get_gedcom_setting($ged_id, 'WATERMARK_THUMB'); global $WEBMASTER_USER_ID; $WEBMASTER_USER_ID = get_gedcom_setting($ged_id, 'WEBMASTER_USER_ID'); global $WEBTREES_EMAIL; $WEBTREES_EMAIL = get_gedcom_setting($ged_id, 'WEBTREES_EMAIL'); global $WORD_WRAPPED_NOTES; $WORD_WRAPPED_NOTES = get_gedcom_setting($ged_id, 'WORD_WRAPPED_NOTES'); global $person_privacy; $person_privacy = array(); global $person_facts; $person_facts = array(); global $global_facts; $global_facts = array(); $rows = WT_DB::prepare("SELECT SQL_CACHE xref, tag_type, CASE resn WHEN 'none' THEN ? WHEN 'privacy' THEN ? WHEN 'confidential' THEN ? WHEN 'hidden' THEN ? END AS resn FROM `##default_resn` WHERE gedcom_id=?")->execute(array(WT_PRIV_PUBLIC, WT_PRIV_USER, WT_PRIV_NONE, WT_PRIV_HIDE, $ged_id))->fetchAll(); foreach ($rows as $row) { if ($row->xref !== null) { if ($row->tag_type !== null) { $person_facts[$row->xref][$row->tag_type] = (int) $row->resn; } else { $person_privacy[$row->xref] = (int) $row->resn; } } else { $global_facts[$row->tag_type] = (int) $row->resn; } } }
print "function helpPopup03(which) {"; print "location.href = 'editlang_edit_settings.php?' + which + '&new_shortcut=' + document.new_lang_form.new_shortcut.value;"; print "return false;"; print "}"; print PGV_JS_END; // Create array with configured languages in gedcoms and users $configuredlanguages = array(); // Read GEDCOMS configuration and collect language data foreach (get_all_gedcoms() as $ged_id => $ged_name) { require get_gedcom_setting($ged_id, 'config'); if (!isset($configuredlanguages["gedcom"][$LANGUAGE][$ged_name])) { $configuredlanguages["gedcom"][$LANGUAGE][$ged_name] = true; } } // Restore the current settings require get_gedcom_setting(PGV_GED_ID, 'config'); // Read user configuration and collect language data foreach (get_all_users() as $user_id => $user_name) { if (!isset($configuredlanguages["users"][get_user_setting($user_id, 'language')][$user_id])) { $configuredlanguages["users"][get_user_setting($user_id, 'language')][$user_id] = true; } } // Sort the Language table into localized language name order foreach ($pgv_language as $key => $value) { $d_LangName = "lang_name_" . $key; $Sorted_Langs[$key] = $pgv_lang[$d_LangName]; } asort($Sorted_Langs); // Split defined languages into active and inactive $split_langs_active = array(); $split_langs_inactive = array();
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); exit; } echo '</div>'; // <div id="content"> if ($view != 'simple') { echo '<div id="footer" class="', $TEXT_DIRECTION, '">'; echo '<br>'; echo contact_links(); echo '<br>'; echo '<p class="logo">'; echo '<a href="', WT_WEBTREES_URL, '" target="_blank" class="icon-webtrees" title="', WT_WEBTREES, ' ', WT_VERSION, '"></a>'; echo '</p>'; if (WT_DEBUG || get_gedcom_setting(WT_GED_ID, 'SHOW_STATS')) { echo execution_stats(); } if (exists_pending_change()) { echo '<a href="#" onclick="window.open(\'edit_changes.php\', \'_blank\', chan_window_specs); return false;">'; echo '<p class="error center">', WT_I18N::translate('There are pending changes for you to moderate.'), '</p>'; echo '</a>'; } echo '</div>'; // <div id="footer"> }
public static function getThemeMenu() { global $SEARCH_SPIDER; if (WT_GED_ID && !$SEARCH_SPIDER && WT_Site::preference('ALLOW_USER_THEMES') && get_gedcom_setting(WT_GED_ID, 'ALLOW_THEME_DROPDOWN')) { $menu = new WT_Menu(WT_I18N::translate('Theme'), '#', 'menu-theme'); foreach (get_theme_names() as $themename => $themedir) { $submenu = new WT_Menu($themename, get_query_url(array('theme' => $themedir), '&'), 'menu-theme-' . $themedir); if (WT_THEME_DIR == 'themes/' . $themedir . '/') { $submenu->addClass('', '', 'theme-active'); } $menu->addSubMenu($submenu); } return $menu; } else { return null; } }
public function getSignificantIndividual() { static $individual; // Only query the DB once. if (!$individual && WT_USER_ROOT_ID) { $individual = WT_Individual::getInstance(WT_USER_ROOT_ID); } if (!$individual && WT_USER_GEDCOM_ID) { $individual = WT_Individual::getInstance(WT_USER_GEDCOM_ID); } if (!$individual) { $individual = WT_Individual::getInstance(get_gedcom_setting(WT_GED_ID, 'PEDIGREE_ROOT_ID')); } if (!$individual) { $individual = WT_Individual::getInstance(WT_DB::prepare("SELECT MIN(i_id) FROM `##individuals` WHERE i_file=?")->execute(array(WT_GED_ID))->fetchOne()); } if (!$individual) { // always return a record $individual = new WT_Individual('I', '0 @I@ INDI', null, WT_GED_ID); } return $individual; }
} // Last theme used? if (!$THEME_DIR && in_array($WT_SESSION->theme_dir, get_theme_names())) { $THEME_DIR = $WT_SESSION->theme_dir; } } else { $THEME_DIR = ''; } if (!$THEME_DIR) { // User cannot choose (or has not chosen) a theme. // 1) gedcom setting // 2) site setting // 3) webtrees // 4) first one found if (WT_GED_ID) { $THEME_DIR = get_gedcom_setting(WT_GED_ID, 'THEME_DIR'); } if (!in_array($THEME_DIR, get_theme_names())) { $THEME_DIR = WT_Site::preference('THEME_DIR'); } if (!in_array($THEME_DIR, get_theme_names())) { $THEME_DIR = 'webtrees'; } if (!in_array($THEME_DIR, get_theme_names())) { list($THEME_DIR) = get_theme_names(); } } define('WT_THEME_DIR', WT_THEMES_DIR . $THEME_DIR . '/'); // Remember this setting if (WT_THEME_DIR != WT_THEMES_DIR . '_administration/') { $WT_SESSION->theme_dir = $THEME_DIR;
public function configureBlock($block_id) { global $ctype, $controller; $PEDIGREE_ROOT_ID = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_ROOT_ID'); if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'details', WT_Filter::postBool('details')); set_block_setting($block_id, 'type', WT_Filter::post('type', 'pedigree|descendants|hourglass|treenav', 'pedigree')); set_block_setting($block_id, 'pid', WT_Filter::post('pid', WT_REGEX_XREF)); exit; } $details = get_block_setting($block_id, 'details', false); $type = get_block_setting($block_id, 'type', 'pedigree'); $pid = get_block_setting($block_id, 'pid', WT_USER_ID ? WT_USER_GEDCOM_ID ? WT_USER_GEDCOM_ID : $PEDIGREE_ROOT_ID : $PEDIGREE_ROOT_ID); $controller->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();'); ?> <tr><td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Chart type'); ?> </td> <td class="optionbox"> <select name="type"> <option value="pedigree"<?php if ($type == "pedigree") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Pedigree'); ?> </option> <option value="descendants"<?php if ($type == "descendants") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Descendants'); ?> </option> <option value="hourglass"<?php if ($type == "hourglass") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Hourglass chart'); ?> </option> <option value="treenav"<?php if ($type == "treenav") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Interactive tree'); ?> </option> </select> </td></tr> <tr> <td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Show details'); ?> </td> <td class="optionbox"> <select name="details"> <option value="no" <?php if (!$details) { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('no'); ?> </option> <option value="yes" <?php if ($details) { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('yes'); ?> </option> </select> </td> </tr> <tr> <td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Individual'); ?> </td> <td class="optionbox"> <input data-autocomplete-type="INDI" type="text" name="pid" id="pid" value="<?php echo $pid; ?> " size="5"> <?php echo print_findindi_link('pid'); $root = WT_Individual::getInstance($pid); if ($root) { echo ' <span class="list_item">', $root->getFullName(), $root->format_first_major_fact(WT_EVENTS_BIRT, 1), '</span>'; } ?> </td> </tr> <?php require_once WT_ROOT . 'includes/functions/functions_edit.php'; $block = get_block_setting($block_id, 'block', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
function load_privacy_file($ged_id = PGV_GED_ID) { global $PRIV_HIDE, $PRIV_PUBLIC, $PRIV_USER, $PRIV_NONE; // Load the privacy settings into global scope global $SHOW_DEAD_PEOPLE, $SHOW_LIVING_NAMES, $SHOW_SOURCES, $MAX_ALIVE_AGE; global $SHOW_RESEARCH_ASSISTANT, $ENABLE_CLIPPINGS_CART, $SHOW_MULTISITE_SEARCH; global $USE_RELATIONSHIP_PRIVACY, $MAX_RELATION_PATH_LENGTH, $CHECK_MARRIAGE_RELATIONS; global $PRIVACY_BY_YEAR, $PRIVACY_BY_RESN, $SHOW_PRIVATE_RELATIONSHIPS; global $person_privacy, $user_privacy, $global_facts, $person_facts; // Load default settings require '../../privacy.php'; // Load settings for the specified gedcom $privacy_file = get_gedcom_setting($ged_id, 'privacy'); if ($privacy_file && file_exists($privacy_file) && version_compare(get_privacy_file_version($privacy_file), PGV_REQUIRED_PRIVACY_VERSION) >= 0) { require $privacy_file; } }
public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $SURNAME_LIST_STYLE; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $COMMON_NAMES_REMOVE = get_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_REMOVE'); $COMMON_NAMES_THRESHOLD = get_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_THRESHOLD'); $num = get_block_setting($block_id, 'num', 10); $infoStyle = get_block_setting($block_id, 'infoStyle', 'table'); $block = get_block_setting($block_id, 'block', false); if ($cfg) { foreach (array('num', 'infoStyle', 'block') as $name) { if (array_key_exists($name, $cfg)) { ${$name} = $cfg[$name]; } } } // This next function is a bit out of date, and doesn't cope well with surname variants $top_surnames = get_top_surnames(WT_GED_ID, $COMMON_NAMES_THRESHOLD, $num); // Remove names found in the "Remove Names" list if ($COMMON_NAMES_REMOVE) { foreach (preg_split("/[,; ]+/", $COMMON_NAMES_REMOVE) as $delname) { unset($top_surnames[$delname]); unset($top_surnames[WT_I18N::strtoupper($delname)]); } } $all_surnames = array(); $i = 0; foreach (array_keys($top_surnames) as $top_surname) { $all_surnames = array_merge($all_surnames, WT_Query_Name::surnames($top_surname, '', false, false, WT_GED_ID)); if (++$i == $num) { break; } } if ($i < $num) { $num = $i; } $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) { $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { $title = ''; } if ($num == 1) { // I18N: i.e. most popular surname. $title .= WT_I18N::translate('Top surname'); } else { // I18N: Title for a list of the most common surnames, %s is a number. Note that a separate translation exists when %s is 1 $title .= WT_I18N::plural('Top %s surname', 'Top %s surnames', $num, WT_I18N::number($num)); } switch ($infoStyle) { case 'tagcloud': uksort($all_surnames, array('WT_I18N', 'strcasecmp')); $content = format_surname_tagcloud($all_surnames, 'indilist.php', true); break; case 'list': uasort($all_surnames, array('top10_surnames_WT_Module', 'top_surname_sort')); $content = format_surname_list($all_surnames, '1', true, 'indilist.php'); break; case 'array': uasort($all_surnames, array('top10_surnames_WT_Module', 'top_surname_sort')); $content = format_surname_list($all_surnames, '2', true, 'indilist.php'); break; case 'table': default: uasort($all_surnames, array('top10_surnames_WT_Module', 'top_surname_sort')); $content = format_surname_table($all_surnames, 'indilist.php'); break; } if ($template) { if ($block) { require WT_THEME_DIR . 'templates/block_small_temp.php'; } else { require WT_THEME_DIR . 'templates/block_main_temp.php'; } } else { return $content; } }
// Fetch the facts $facts = $controller->record->getFacts(); // Sort the facts usort($facts, function (WT_Fact $x, WT_Fact $y) { static $order = array('NAME' => 0, 'ADDR' => 1, 'NOTE' => 2, 'WWW' => 3, 'REFN' => 4, 'RIN' => 5, '_UID' => 6, 'CHAN' => 7); return (array_key_exists($x->getTag(), $order) ? $order[$x->getTag()] : PHP_INT_MAX) - (array_key_exists($y->getTag(), $order) ? $order[$y->getTag()] : PHP_INT_MAX); }); // Print the facts foreach ($facts as $fact) { print_fact($fact, $controller->record); } // new fact link if ($controller->record->canEdit()) { print_add_new_fact($controller->record->getXref(), $facts, 'REPO'); // new media if (get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) { echo '<tr><td class="descriptionbox">'; echo WT_Gedcom_Tag::getLabel('OBJE'); echo '</td><td class="optionbox">'; echo '<a href="#" onclick="window.open(\'addmedia.php?action=showmediaform&linktoid=', $controller->record->getXref(), '\', \'_blank\', edit_window_specs); return false;">', WT_I18N::translate('Add a new media object'), '</a>'; echo help_link('OBJE'); echo '<br>'; echo '<a href="#" onclick="window.open(\'inverselink.php?linktoid=', $controller->record->getXref(), '&linkto=repository\', \'_blank\', find_window_specs); return false;">', WT_I18N::translate('Link to an existing media object'), '</a>'; echo '</td></tr>'; } } echo '</table> </div>'; // Sources linked to this repository if ($linked_sour) { echo '<div id="source-repo">';
} } else { $stat = newConnection(); if ($stat !== false) { addDebugLog($action . " SUCCESS\n" . $stat); print "SUCCESS\n" . $stat; } AddToLog('Read-Only Anonymous Client connection.'); $_SESSION['connected'] = 'Anonymous'; $_SESSION['readonly'] = 1; } exit; case 'listgedcoms': $out_msg = "SUCCESS\n"; foreach (get_all_gedcoms() as $ged_id => $gedcom) { $out_msg .= "{$gedcom}\t" . get_gedcom_setting($ged_id, 'title') . "\n"; } addDebugLog($action . " " . $out_msg); print $out_msg; exit; default: // All other actions require an authenticated connection if (empty($_SESSION['connected'])) { addDebugLog($action . " ERROR 12: use 'connect' action to initiate a session."); print "ERROR 12: use 'connect' action to initiate a session.\n"; exit; } break; } // The following actions can only be performed when connected switch ($action) {
/** * Get array of common surnames * * This function returns a simple array of the most common surnames * found in the individuals list. * * @param int $min the number of times a surname must occur before it is added to the array * * @return array */ function get_common_surnames($min) { $COMMON_NAMES_ADD = get_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_ADD'); $COMMON_NAMES_REMOVE = get_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_REMOVE'); $topsurns = get_top_surnames(WT_GED_ID, $min, 0); foreach (explode(',', $COMMON_NAMES_ADD) as $surname) { if ($surname && !array_key_exists($surname, $topsurns)) { $topsurns[$surname] = $min; } } foreach (explode(',', $COMMON_NAMES_REMOVE) as $surname) { unset($topsurns[WT_I18N::strtoupper($surname)]); } //-- check if we found some, else recurse if (empty($topsurns) && $min > 2) { return get_common_surnames($min / 2); } else { uksort($topsurns, array('WT_I18N', 'strcasecmp')); foreach ($topsurns as $key => $value) { $topsurns[$key] = array('name' => $key, 'match' => $value); } return $topsurns; } }
<label for="user_hashcode">', WT_I18N::translate('Verification code:'), '</label> <input type="text" id="user_hashcode" name="user_hashcode" value="', $user_hashcode, '"> </div> <div> <input type="submit" value="', WT_I18N::translate('Send'), '"> </div> </form> </div>'; break; case 'verify_hash': if (!WT_Site::preference('USE_REGISTRATION_MODULE')) { header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH); exit; } // switch language to webmaster settings $webmaster = User::find(get_gedcom_setting(WT_GED_ID, 'WEBMASTER_USER_ID')); WT_I18N::init($webmaster->getSetting('language')); $user = User::findByIdentifier($user_name); $mail1_body = WT_I18N::translate('Hello administrator…') . WT_Mail::EOL . WT_Mail::EOL . WT_I18N::translate('A new user (%1$s) has requested an account (%2$s) and verified an email address (%3$s).', $user->getRealName(), $user->getUserName(), $user->getEmail()) . WT_Mail::EOL . WT_Mail::EOL; if ($REQUIRE_ADMIN_AUTH_REGISTRATION && !$user->getSetting('verified_by_admin')) { $mail1_body .= WT_I18N::translate('You now need to review the account details, and set the “approved” status to “yes”.'); } else { $mail1_body .= WT_I18N::translate('You do not have to take any action; the user can now login.'); } $mail1_body .= WT_Mail::EOL . '<a href="' . WT_SERVER_NAME . WT_SCRIPT_PATH . "admin_users.php?filter=" . rawurlencode($user->getUserName()) . '">' . WT_SERVER_NAME . WT_SCRIPT_PATH . "admin_users.php?filter=" . rawurlencode($user->getUserName()) . '</a>' . WT_Mail::auditFooter(); $mail1_subject = WT_I18N::translate('New user at %s', WT_SERVER_NAME . WT_SCRIPT_PATH . ' ' . $WT_TREE->tree_title); // Change to the new user’s language WT_I18N::init($user->getSetting('language')); $controller->setPageTitle(WT_I18N::translate('User verification')); $controller->pageHeader(); echo '<div id="login-register-page">';
pastefield.value=value; } //--> </script> <form enctype="multipart/form-data" method="post" id="configform" name="configform" action="editconfig_gedcom.php"> <table class="facts_table <?php echo $TEXT_DIRECTION; ?> "> <tr> <td colspan="2" class="facts_label"><?php echo "<h2>", $pgv_lang["gedconf_head"], " - "; if (PGV_GED_ID) { echo PrintReady(get_gedcom_setting(PGV_GED_ID, 'title')); } elseif ($source == "add_form") { echo $pgv_lang["add_gedcom"]; } elseif ($source == "upload_form") { echo $pgv_lang["upload_gedcom"]; } elseif ($source == "add_new_form") { echo $pgv_lang["add_new_gedcom"]; } elseif ($source == "replace_form") { echo $pgv_lang['upload_replacement']; } echo "</h2>"; echo "<a href=\"editgedcoms.php\"><b>"; echo $pgv_lang["lang_back_manage_gedcoms"]; echo "</b></a><br /><br />"; ?>
echo '<p>', htmlspecialchars(filename_decode($export)), ' => ', $filename, '</p>'; flush(); $gedout = fopen($filename . '.tmp', 'w'); if ($gedout) { $start = microtime(true); $exportOptions = array(); $exportOptions['privatize'] = 'none'; $exportOptions['toANSI'] = 'no'; $exportOptions['noCustomTags'] = 'no'; $exportOptions['path'] = $MEDIA_DIRECTORY; $exportOptions['slashes'] = 'forward'; export_gedcom($export, $gedout, $exportOptions); $end = microtime(true); fclose($gedout); unlink($filename); rename($filename . '.tmp', $filename); $stat = stat($filename); echo sprintf('<p>%d bytes, %0.3f seconds</p>', $stat['size'], $end - $start); } else { echo '<p>Error: could not open file for writing</p>'; } } else { echo '<h1>Export data from database to gedcom file</h1>'; echo '<ul>'; foreach ($gedcoms as $ged_id => $gedcom) { echo '<li><a href="?export=', urlencode($gedcom), '">', $gedcom, ' => ', htmlspecialchars(filename_decode(realpath(get_gedcom_setting($ged_id, 'path')))), '</a></li>'; } echo '</ul>'; } echo '<p><a href="javascript: ', $pgv_lang['close_window'], '" onclick="window.close();">', $pgv_lang['close_window'], '</a></p>'; print_simple_footer();
public function getTabContent() { global $controller; ob_start(); echo '<table class="facts_table">'; foreach ($this->get_facts() as $fact) { if ($fact->getTag() == 'OBJE') { print_main_media($fact, 1); } else { for ($i = 2; $i < 4; ++$i) { print_main_media($fact, $i); } } } if (!$this->get_facts()) { echo '<tr><td id="no_tab4" colspan="2" class="facts_value">', WT_I18N::translate('There are no media objects for this individual.'), '</td></tr>'; } // New media link if ($controller->record->canEdit() && get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) { ?> <tr> <td class="facts_label"> <?php echo WT_Gedcom_Tag::getLabel('OBJE'); ?> </td> <td class="facts_value"> <a href="#" onclick="window.open('addmedia.php?action=showmediaform&linktoid=<?php echo $controller->record->getXref(); ?> &ged=<?php echo WT_GEDURL; ?> ', '_blank', edit_window_specs); return false;"> <?php echo WT_I18N::translate('Add a new media object'); ?> </a> <?php echo help_link('OBJE'); ?> <br> <a href="#" onclick="window.open('inverselink.php?linktoid=<?php echo $controller->record->getXref(); ?> &ged=<?php echo WT_GEDURL; ?> &linkto=person', '_blank', find_window_specs); return false;"> <?php echo WT_I18N::translate('Link to an existing media object'); ?> </a> </td> </tr> <?php } ?> </table> <?php return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; }
// @version $Id: gedcheck.php 6879 2010-01-30 11:35:46Z fisharebest $ // define('PGV_SCRIPT_NAME', 'gedcheck.php'); require './config.php'; // Must be an admin user to use this module if (!PGV_USER_GEDCOM_ADMIN) { header('Location: login.php?url=gedcheck.php'); exit; } print_header($pgv_lang['gedcheck'] . ' - ' . $GEDCOM); //////////////////////////////////////////////////////////////////////////////// // Scan all the gedcom directories for gedcom files //////////////////////////////////////////////////////////////////////////////// $all_dirs = array($INDEX_DIRECTORY => ''); foreach (get_all_gedcoms() as $ged_id => $ged_name) { $all_dirs[dirname(get_gedcom_setting($ged_id, 'path')) . '/'] = ''; } $all_geds = array(); foreach ($all_dirs as $key => $value) { $dir = opendir($key); while ($file = readdir($dir)) { if (!is_dir($key . $file) && is_readable($key . $file)) { $h = fopen($key . $file, 'r'); if (preg_match('/0.*HEAD/i', fgets($h, 255))) { $all_geds[$file] = $key . $file; } fclose($h); } } closedir($dir); }
/** * get edit menu */ function getEditMenu() { $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD'); if (!$this->record || $this->record->isOld()) { return null; } // edit menu $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-indi'); $menu->addLabel($menu->label, 'down'); // What behaviour shall we give the main menu? If we leave it blank, the framework // will copy the first submenu - which may be edit-raw or delete. // As a temporary solution, make it edit the name $menu->addOnclick("return false;"); if (WT_USER_CAN_EDIT) { foreach ($this->record->getFacts() as $fact) { if ($fact->getTag() == 'NAME' && $fact->canEdit()) { $menu->addOnclick("return edit_name('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');"); } break; } $submenu = new WT_Menu(WT_I18N::translate('Add a new name'), '#', 'menu-indi-addname'); $submenu->addOnclick("return add_name('" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); $has_sex_record = false; $submenu = new WT_Menu(WT_I18N::translate('Edit gender'), '#', 'menu-indi-editsex'); foreach ($this->record->getFacts() as $fact) { if ($fact->getTag() == 'SEX' && $fact->canEdit()) { $submenu->addOnclick("return edit_record('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');"); $has_sex_record = true; break; } } if (!$has_sex_record) { $submenu->addOnclick("return add_new_record('" . $this->record->getXref() . "', 'SEX');"); } $menu->addSubmenu($submenu); if (count($this->record->getSpouseFamilies()) > 1) { $submenu = new WT_Menu(WT_I18N::translate('Re-order families'), '#', 'menu-indi-orderfam'); $submenu->addOnclick("return reorder_families('" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } } // delete if (WT_USER_CAN_EDIT) { $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-indi-del'); $submenu->addOnclick("return delete_individual('" . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs(strip_tags($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // edit raw if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) { $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-indi-editraw'); $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');"); $menu->addSubmenu($submenu); } // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-indi-addfav'); $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})"); $menu->addSubmenu($submenu); } return $menu; }
/** * Print a new fact box on details pages * * @param string $id the id of the person, family, source etc the fact will be added to * @param array $usedfacts an array of facts already used in this record * @param string $type the type of record INDI, FAM, SOUR etc */ function print_add_new_fact($id, $usedfacts, $type) { global $WT_SESSION; // -- Add from clipboard if ($WT_SESSION->clipboard) { $newRow = true; foreach (array_reverse($WT_SESSION->clipboard, true) as $fact_id => $fact) { if ($fact["type"] == $type || $fact["type"] == 'all') { if ($newRow) { $newRow = false; echo '<tr><td class="descriptionbox">'; echo WT_I18N::translate('Add from clipboard'), '</td>'; echo '<td class="optionbox wrap"><form method="get" name="newFromClipboard" action="?" onsubmit="return false;">'; echo '<select id="newClipboardFact">'; } echo '<option value="', WT_Filter::escapeHtml($fact_id), '">', WT_Gedcom_Tag::getLabel($fact['fact']); // TODO use the event class to store/parse the clipboard events if (preg_match('/^2 DATE (.+)/m', $fact['factrec'], $match)) { $tmp = new WT_Date($match[1]); echo '; ', $tmp->minDate()->format('%Y'); } if (preg_match('/^2 PLAC ([^,\\n]+)/m', $fact['factrec'], $match)) { echo '; ', $match[1]; } echo '</option>'; } } if (!$newRow) { echo '</select>'; echo ' <input type="button" value="', WT_I18N::translate('Add'), "\" onclick=\"return paste_fact('{$id}', '#newClipboardFact');\"> "; echo '</form></td></tr>', "\n"; } } // -- Add from pick list switch ($type) { case "INDI": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "FAM": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "SOUR": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "NOTE": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "REPO": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; default: return; } $addfacts = array_merge(CheckFactUnique($uniquefacts, $usedfacts, $type), $addfacts); $quickfacts = array_intersect($quickfacts, $addfacts); $translated_addfacts = array(); foreach ($addfacts as $addfact) { $translated_addfacts[$addfact] = WT_Gedcom_Tag::getLabel($addfact); } uasort($translated_addfacts, function ($x, $y) { return WT_I18N::strcasecmp(WT_I18N::translate($x), WT_I18N::translate($y)); }); echo '<tr><td class="descriptionbox">'; echo WT_I18N::translate('Fact or event'); echo help_link('add_facts'), '</td>'; echo '<td class="optionbox wrap">'; echo '<form method="get" name="newfactform" action="?" onsubmit="return false;">'; echo '<select id="newfact" name="newfact">'; echo '<option value="" disabled selected>' . WT_I18N::translate('<select>') . '</option>'; foreach ($translated_addfacts as $fact => $fact_name) { echo '<option value="', $fact, '">', $fact_name, '</option>'; } if ($type == 'INDI' || $type == 'FAM') { echo '<option value="FACT">', WT_I18N::translate('Custom fact'), '</option>'; echo '<option value="EVEN">', WT_I18N::translate('Custom event'), '</option>'; } echo '</select>'; echo '<input type="button" value="', WT_I18N::translate('Add'), '" onclick="add_record(\'' . $id . '\', \'newfact\');">'; echo '<span class="quickfacts">'; foreach ($quickfacts as $fact) { echo '<a href="#" onclick="add_new_record(\'' . $id . '\', \'' . $fact . '\');return false;">', WT_Gedcom_Tag::getLabel($fact), '</a>'; } echo '</span></form>'; echo '</td></tr>'; }