public function modAction($mod_action) { switch ($mod_action) { case 'admin_batch_update': $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Batch update'))->restrictAccess(Auth::isAdmin())->pageHeader(); // TODO: these files should be methods in this class require WT_ROOT . WT_MODULES_DIR . $this->getName() . '/' . $mod_action . '.php'; $mod = new batch_update(); echo $mod->main(); break; default: header('HTTP/1.0 404 Not Found'); } }
private function show_list() { global $controller; $controller = new WT_Controller_Page(); $controller->setPageTitle($this->getTitle())->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript(' jQuery("#story_table").dataTable({ dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\', ' . WT_I18N::datatablesI18N() . ', autoWidth: false, paging: true, pagingType: "full_numbers", lengthChange: true, filter: true, info: true, jQueryUI: true, sorting: [[0,"asc"]], columns: [ /* 0-name */ null, /* 1-NAME */ null ] }); '); $stories = WT_DB::prepare("SELECT block_id, xref" . " FROM `##block` b" . " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref")->execute(array($this->getName(), WT_GED_ID))->fetchAll(); echo '<h2 class="center">', WT_I18N::translate('Stories'), '</h2>'; if (count($stories) > 0) { echo '<table id="story_table" class="width100">'; echo '<thead><tr> <th>', WT_I18N::translate('Story title'), '</th> <th>', WT_I18N::translate('Individual'), '</th> </tr></thead> <tbody>'; foreach ($stories as $story) { $indi = WT_Individual::getInstance($story->xref); $story_title = get_block_setting($story->block_id, 'title'); $languages = get_block_setting($story->block_id, 'languages'); if (!$languages || in_array(WT_LOCALE, explode(',', $languages))) { if ($indi) { if ($indi->canShow()) { echo '<tr><td><a href="' . $indi->getHtmlUrl() . '#stories">' . $story_title . '</a></td><td><a href="' . $indi->getHtmlUrl() . '#stories">' . $indi->getFullName() . '</a></td></tr>'; } } else { echo '<tr><td>', $story_title, '</td><td class="error">', $story->xref, '</td></tr>'; } } } echo '</tbody></table>'; } }
<?php // Parses gedcom file and displays a list of the shared notes in the file. // // webtrees: Web based Family History software // Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2009 PGV Development Team. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'notelist.php'); require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Shared notes')); $controller->pageHeader(); echo '<div id="notelist-page">', '<h2>', WT_I18N::translate('Shared notes'), '</h2>', format_note_table(get_note_list(WT_GED_ID)); echo '</div>';
// 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 define('WT_SCRIPT_NAME', 'placelist.php'); require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Page(); $action = WT_Filter::get('action', 'find|show', 'find'); $display = WT_Filter::get('display', 'hierarchy|list', 'hierarchy'); $parent = WT_Filter::getArray('parent'); $level = count($parent); if ($display == 'hierarchy') { if ($level) { $controller->setPageTitle(WT_I18N::translate('Place hierarchy') . ' - <span dir="auto">' . WT_Filter::escapeHtml(end($parent)) . '</span>'); } else { $controller->setPageTitle(WT_I18N::translate('Place hierarchy')); } } else { $controller->setPageTitle(WT_I18N::translate('Place list')); } $controller->pageHeader(); echo '<div id="place-hierarchy">'; switch ($display) { case 'list': echo '<h2>', $controller->getPageTitle(), '</h2>'; $list_places = WT_Place::allPlaces(WT_GED_ID); $num_places = count($list_places); if ($num_places == 0) { echo '<b>', WT_I18N::translate('No results found.'), '</b><br>';
// This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'statistics.php'); require './includes/session.php'; // check for on demand content loading $tab = WT_Filter::getInteger('tab', 0, 3); $ajax = WT_Filter::getBool('ajax'); if (!$ajax) { $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Statistics'))->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript(' jQuery("#statistics_chart").css("visibility", "visible"); jQuery("#statistics_chart").tabs({ load: function() { jQuery("#loading-indicator").removeClass("loading-image"); }, beforeLoad: function(event, ui) { jQuery("#loading-indicator").addClass("loading-image"); // Only load each tab once if (ui.tab.data("loaded")) { event.preventDefault(); return; } ui.jqXHR.success(function() { ui.tab.data("loaded", true); });
define('WT_THEME_URL', WT_STATIC_URL . WT_THEME_DIR); require WT_ROOT . WT_THEME_DIR . 'theme.php'; // Page hit counter - load after theme, as we need theme formatting if ($WT_TREE && $WT_TREE->preference('SHOW_COUNTER') && !$SEARCH_SPIDER) { require WT_ROOT . 'includes/hitcount.php'; } else { $hitCount = ''; } // define constants to be used when setting permissions after creating files/directories if (substr(PHP_SAPI, 0, 3) == 'cgi') { // cgi-mode, should only be writable by owner define('WT_PERM_EXE', 0755); // to be used on directories, php files, etc. define('WT_PERM_FILE', 0644); // to be used on images, text files, etc. } else { // mod_php mode, should be writable by everyone define('WT_PERM_EXE', 0777); define('WT_PERM_FILE', 0666); } // Lightbox needs custom integration in many places. Only check for the module once. define('WT_USE_LIGHTBOX', !$SEARCH_SPIDER && array_key_exists('lightbox', WT_Module::getActiveModules())); // Search engines are only allowed to see certain pages. if ($SEARCH_SPIDER && !in_array(WT_SCRIPT_NAME, array('index.php', 'indilist.php', 'module.php', 'mediafirewall.php', 'individual.php', 'family.php', 'mediaviewer.php', 'note.php', 'repo.php', 'source.php'))) { header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Search engine')); $controller->pageHeader(); echo '<p class="ui-state-error">', WT_I18N::translate('You do not have permission to view this page.'), '</p>'; exit; }
$reports = array(); foreach (WT_Module::getActiveReports() as $rep) { foreach ($rep->getReportMenus() as $menu) { if (preg_match('/report=(' . preg_quote(WT_MODULES_DIR, '/') . '[a-z0-9_]+\\/[a-z0-9_]+\\.xml)/', $menu->link, $match)) { $reports[$match[1]] = $menu->label; } } } if (!empty($report)) { if (!array_key_exists($report, $reports)) { $action = 'choose'; } } //-- choose a report to run if ($action == 'choose') { $controller->setPageTitle(WT_I18N::translate('Choose a report to run')); $controller->pageHeader(); echo '<div id="reportengine-page"> <form name="choosereport" method="get" action="reportengine.php"> <input type="hidden" name="action" value="setup"> <input type="hidden" name="output" value="', WT_Filter::escapeHtml($output), '"> <table class="facts_table width40"> <tr><td class="topbottombar" colspan="2">', WT_I18N::translate('Choose a report to run'), '</td></tr> <tr><td class="descriptionbox wrap width33 vmiddle">', WT_I18N::translate('Report'), '</td> <td class="optionbox"><select name="report">'; foreach ($reports as $file => $report) { echo '<option value="', WT_Filter::escapeHtml($file), '">', WT_Filter::escapeHtml($report), '</option>'; } echo '</select></td></tr> <tr><td class="topbottombar" colspan="2"><input type="submit" value="', WT_I18N::translate('continue'), '"></td></tr> </table></form></div>';
// Repositories List // // webtrees: Web based Family History software // Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'repolist.php'); require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Repositories')); $controller->pageHeader(); echo '<div id="repolist-page">', '<h2>', WT_I18N::translate('Repositories'), '</h2>'; echo format_repo_table(get_repo_list(WT_GED_ID)); echo '</div>';
private function error_page($message) { global $controller, $WT_SESSION; try { unset($WT_SESSION->facebook_access_token); unset($WT_SESSION->facebook_state); Zend_Session::writeClose(); } catch (Exception $e) { } $controller = new WT_Controller_Page(); $controller->setPageTitle($this->getTitle())->pageHeader(); try { WT_FlashMessages::addMessage($message); } catch (Zend_Session_Exception $zse) { echo '<div class="warning">' . $message . '</div>'; } exit; }
// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'medialist.php'); require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_edit.php'; require_once WT_ROOT . 'includes/functions/functions_print_facts.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Media objects'))->pageHeader(); $search = WT_Filter::get('search'); $sortby = WT_Filter::get('sortby', 'file|title', 'title'); if (!WT_USER_CAN_EDIT && !WT_USER_CAN_ACCEPT) { $sortby = 'title'; } $start = WT_Filter::getInteger('start'); $max = WT_Filter::get('max', '10|20|30|40|50|75|100|125|150|200', '20'); $folder = WT_Filter::get('folder', null, ''); // MySQL needs an empty string, not NULL $reset = WT_Filter::get('reset'); $apply_filter = WT_Filter::get('apply_filter'); $filter = WT_Filter::get('filter', null, ''); // MySQL needs an empty string, not NULL $columns = WT_Filter::getInteger('columns', 1, 2, 2); $subdirs = WT_Filter::get('subdirs', 'on');
private function config() { require_once WT_ROOT . 'includes/functions/functions_edit.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle($this->getTitle())->pageHeader(); $faqs = WT_DB::prepare("SELECT block_id, block_order, gedcom_id, bs1.setting_value AS header, bs2.setting_value AS faqbody" . " FROM `##block` b" . " JOIN `##block_setting` bs1 USING (block_id)" . " JOIN `##block_setting` bs2 USING (block_id)" . " WHERE module_name = ?" . " AND bs1.setting_name = 'header'" . " AND bs2.setting_name = 'faqbody'" . " AND IFNULL(gedcom_id, ?) = ?" . " ORDER BY block_order")->execute(array($this->getName(), WT_GED_ID, WT_GED_ID))->fetchAll(); $min_block_order = WT_DB::prepare("SELECT MIN(block_order) FROM `##block` WHERE module_name=?")->execute(array($this->getName()))->fetchOne(); $max_block_order = WT_DB::prepare("SELECT MAX(block_order) FROM `##block` WHERE module_name=?")->execute(array($this->getName()))->fetchOne(); echo '<p><form method="get" action="', WT_SCRIPT_NAME, '">', WT_I18N::translate('Family tree'), ' ', '<input type="hidden" name="mod", value="', $this->getName(), '">', '<input type="hidden" name="mod_action", value="admin_config">', select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM), '<input type="submit" value="', WT_I18N::translate('show'), '">', '</form></p>'; echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_edit">', WT_I18N::translate('Add an FAQ item'), '</a>'; echo help_link('add_faq_item', $this->getName()); echo '<table id="faq_edit">'; if (empty($faqs)) { echo '<tr><td class="error center" colspan="5">', WT_I18N::translate('The FAQ list is empty.'), '</td></tr></table>'; } else { $trees = WT_Tree::getAll(); foreach ($faqs as $faq) { // NOTE: Print the position of the current item echo '<tr class="faq_edit_pos"><td>'; echo WT_I18N::translate('Position item'), ': ', $faq->block_order + 1, ', '; if ($faq->gedcom_id == null) { echo WT_I18N::translate('All'); } else { echo $trees[$faq->gedcom_id]->tree_title_html; } echo '</td>'; // NOTE: Print the edit options of the current item echo '<td>'; if ($faq->block_order == $min_block_order) { echo ' '; } else { echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_moveup&block_id=', $faq->block_id, '" class="icon-uarrow"></a>'; echo help_link('moveup_faq_item', $this->getName()); } echo '</td><td>'; if ($faq->block_order == $max_block_order) { echo ' '; } else { echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_movedown&block_id=', $faq->block_id, '" class="icon-darrow"></a>'; echo help_link('movedown_faq_item', $this->getName()); } echo '</td><td>'; echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_edit&block_id=', $faq->block_id, '">', WT_I18N::translate('Edit'), '</a>'; echo help_link('edit_faq_item', $this->getName()); echo '</td><td>'; echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_delete&block_id=', $faq->block_id, '" onclick="return confirm(\'', WT_I18N::translate('Are you sure you want to delete this FAQ entry?'), '\');">', WT_I18N::translate('Delete'), '</a>'; echo help_link('delete_faq_item', $this->getName()); echo '</td></tr>'; // NOTE: Print the title text of the current item echo '<tr><td colspan="5">'; echo '<div class="faq_edit_item">'; echo '<div class="faq_edit_title">', $faq->header, '</div>'; // NOTE: Print the body text of the current item echo '<div class="faq_edit_content">', substr($faq->faqbody, 0, 1) == '<' ? $faq->faqbody : nl2br($faq->faqbody, false), '</div></div></td></tr>'; } echo '</table>'; } }
// Parses gedcom file and displays a list of the sources in the file. // // webtrees: Web based Family History software // Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'sourcelist.php'); require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Sources')); $controller->pageHeader(); echo '<div id="sourcelist-page">', '<h2>', WT_I18N::translate('Sources'), '</h2>'; echo format_sour_table(get_source_list(WT_GED_ID)); echo '</div>';
$show = 'indi'; // SURN list makes no sense here } elseif ($alpha) { $show_all = 'no'; $legend = WT_Filter::escapeHtml($alpha) . '…'; $url = WT_SCRIPT_NAME . '?alpha=' . rawurlencode($alpha) . '&ged=' . WT_GEDURL; $show = WT_Filter::get('show', 'surn|indi', 'surn'); } else { $show_all = 'no'; $legend = '…'; $url = WT_SCRIPT_NAME . '?ged=' . WT_GEDURL; $show = 'none'; // Don't show lists until something is chosen } $legend = '<span dir="auto">' . $legend . '</span>'; $controller->setPageTitle(WT_I18N::translate('Individuals') . ' : ' . $legend)->pageHeader(); echo '<h2 class="center">', WT_I18N::translate('Individuals'), '</h2>'; // Print a selection list of initial letters $list = array(); foreach (WT_Query_Name::surnameAlpha($show_marnm, false, WT_GED_ID) as $letter => $count) { switch ($letter) { case '@': $html = $UNKNOWN_NN; break; case ',': $html = WT_I18N::translate('None'); break; default: $html = WT_Filter::escapeHtml($letter); break; }
private function adminPlaces() { require WT_ROOT . 'includes/functions/functions_edit.php'; $action = WT_Filter::get('action'); $parent = WT_Filter::get('parent'); $inactive = WT_Filter::getBool('inactive'); $deleteRecord = WT_Filter::get('deleteRecord'); if (!isset($parent)) { $parent = 0; } $controller = new WT_Controller_Page(); $controller->restrictAccess(Auth::isAdmin()); if ($action == 'ExportFile' && Auth::isAdmin()) { Zend_Session::writeClose(); $tmp = $this->placeIdToHierarchy($parent); $maxLevel = $this->getHighestLevel(); if ($maxLevel > 8) { $maxLevel = 8; } $tmp[0] = 'places'; $outputFileName = preg_replace('/[:;\\/\\\\(\\)\\{\\}\\[\\] $]/', '_', implode('-', $tmp)) . '.csv'; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $outputFileName . '"'); echo '"', WT_I18N::translate('Level'), '";"', WT_I18N::translate('Country'), '";'; if ($maxLevel > 0) { echo '"', WT_I18N::translate('State'), '";'; } if ($maxLevel > 1) { echo '"', WT_I18N::translate('County'), '";'; } if ($maxLevel > 2) { echo '"', WT_I18N::translate('City'), '";'; } if ($maxLevel > 3) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 4) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 5) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 6) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 7) { echo '"', WT_I18N::translate('Place'), '";'; } echo '"', WT_I18N::translate('Longitude'), '";"', WT_I18N::translate('Latitude'), '";'; echo '"', WT_I18N::translate('Zoom level'), '";"', WT_I18N::translate('Icon'), '";', WT_EOL; $this->outputLevel($parent); exit; } $controller->setPageTitle(WT_I18N::translate('Google Maps™'))->pageHeader(); ?> <table id="gm_config"> <tr> <th> <a href="module.php?mod=googlemap&mod_action=admin_config"> <?php echo WT_I18N::translate('Google Maps™ preferences'); ?> </a> </th> <th> <a class="current" href="module.php?mod=googlemap&mod_action=admin_places"> <?php echo WT_I18N::translate('Geographic data'); ?> </a> </th> <th> <a href="module.php?mod=googlemap&mod_action=admin_placecheck"> <?php echo WT_I18N::translate('Place check'); ?> </a> </th> </tr> </table> <?php if ($action == 'ImportGedcom') { $placelist = array(); $j = 0; $gedcom_records = WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_file=? UNION ALL SELECT f_gedcom FROM `##families` WHERE f_file=?")->execute(array(WT_GED_ID, WT_GED_ID))->fetchOneColumn(); foreach ($gedcom_records as $gedrec) { $i = 1; $placerec = get_sub_record(2, '2 PLAC', $gedrec, $i); while (!empty($placerec)) { if (preg_match("/2 PLAC (.+)/", $placerec, $match)) { $placelist[$j] = array(); $placelist[$j]['place'] = trim($match[1]); if (preg_match("/4 LATI (.*)/", $placerec, $match)) { $placelist[$j]['lati'] = trim($match[1]); if ($placelist[$j]['lati'][0] != 'N' && $placelist[$j]['lati'][0] != 'S') { if ($placelist[$j]['lati'] < 0) { $placelist[$j]['lati'][0] = 'S'; } else { $placelist[$j]['lati'] = 'N' . $placelist[$j]['lati']; } } } else { $placelist[$j]['lati'] = NULL; } if (preg_match("/4 LONG (.*)/", $placerec, $match)) { $placelist[$j]['long'] = trim($match[1]); if ($placelist[$j]['long'][0] != 'E' && $placelist[$j]['long'][0] != 'W') { if ($placelist[$j]['long'] < 0) { $placelist[$j]['long'][0] = 'W'; } else { $placelist[$j]['long'] = 'E' . $placelist[$j]['long']; } } } else { $placelist[$j]['long'] = NULL; } $j = $j + 1; } $i = $i + 1; $placerec = get_sub_record(2, '2 PLAC', $gedrec, $i); } } asort($placelist); $prevPlace = ''; $prevLati = ''; $prevLong = ''; $placelistUniq = array(); $j = 0; foreach ($placelist as $k => $place) { if ($place['place'] != $prevPlace) { $placelistUniq[$j] = array(); $placelistUniq[$j]['place'] = $place['place']; $placelistUniq[$j]['lati'] = $place['lati']; $placelistUniq[$j]['long'] = $place['long']; $j = $j + 1; } elseif ($place['place'] == $prevPlace && ($place['lati'] != $prevLati || $place['long'] != $prevLong)) { if ($placelistUniq[$j - 1]['lati'] == 0 || $placelistUniq[$j - 1]['long'] == 0) { $placelistUniq[$j - 1]['lati'] = $place['lati']; $placelistUniq[$j - 1]['long'] = $place['long']; } elseif ($place['lati'] != '0' || $place['long'] != '0') { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>'; } } $prevPlace = $place['place']; $prevLati = $place['lati']; $prevLong = $place['long']; } $highestIndex = $this->getHighestIndex(); $default_zoom_level = array(4, 7, 10, 12); foreach ($placelistUniq as $k => $place) { $parent = preg_split('/ *, */', $place['place']); $parent = array_reverse($parent); $parent_id = 0; for ($i = 0; $i < count($parent); $i++) { if (!isset($default_zoom_level[$i])) { $default_zoom_level[$i] = $default_zoom_level[$i - 1]; } $escparent = $parent[$i]; if ($escparent == '') { $escparent = 'Unknown'; } $row = WT_DB::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ?")->execute(array($i, $parent_id, $escparent))->fetchOneRow(); if ($i < count($parent) - 1) { // Create higher-level places, if necessary if (empty($row)) { $highestIndex++; WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '<br>'; $parent_id = $highestIndex; } else { $parent_id = $row->pl_id; } } else { // Create lowest-level place, if necessary if (empty($row->pl_id)) { $highestIndex++; WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom) VALUES (?, ?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '<br>'; } else { if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $row->pl_id)); echo WT_Filter::escapeHtml($escparent), '<br>'; } } } } } $parent = 0; } if ($action == 'ImportFile') { $placefiles = array(); $this->findFiles(WT_MODULES_DIR . 'googlemap/extra'); sort($placefiles); ?> <form method="post" enctype="multipart/form-data" id="importfile" name="importfile" action="module.php?mod=googlemap&mod_action=admin_places&action=ImportFile2"> <table class="gm_plac_edit"> <tr> <th><?php echo WT_I18N::translate('File containing places (CSV)'); ?> </th> <td><input type="file" name="placesfile" size="50"></td> </tr> <?php if (count($placefiles) > 0) { ?> <tr> <th><?php echo WT_I18N::translate('Server file containing places (CSV)'), help_link('PLIF_LOCALFILE', 'googlemap'); ?> </th> <td> <select name="localfile"> <option></option> <?php foreach ($placefiles as $p => $placefile) { ?> <option value="<?php echo WT_Filter::escapeHtml($placefile); ?> "><?php if (substr($placefile, 0, 1) == "/") { echo substr($placefile, 1); } else { echo $placefile; } ?> </option> <?php } ?> </select> </td> </tr> <?php } ?> <tr> <th><?php echo WT_I18N::translate('Delete all existing geographic data before importing the file.'); ?> </th> <td><input type="checkbox" name="cleardatabase"></td> </tr> <tr> <th><?php echo WT_I18N::translate('Do not create new locations, just import coordinates for existing locations.'); ?> </th> <td><input type="checkbox" name="updateonly"></td> </tr> <tr> <th><?php echo WT_I18N::translate('Overwrite existing coordinates.'); ?> </th> <td><input type="checkbox" name="overwritedata"></td> </tr> </table> <input id="savebutton" type="submit" value="<?php echo WT_I18N::translate('Continue adding'); ?> "><br> </form> <?php exit; } if ($action == 'ImportFile2') { $country_names = array(); foreach (WT_Stats::iso3166() as $key => $value) { $country_names[$key] = WT_I18N::translate($key); } if (isset($_POST['cleardatabase'])) { WT_DB::exec("DELETE FROM `##placelocation` WHERE 1=1"); } if (!empty($_FILES['placesfile']['tmp_name'])) { $lines = file($_FILES['placesfile']['tmp_name']); } elseif (!empty($_REQUEST['localfile'])) { $lines = file(WT_MODULES_DIR . 'googlemap/extra' . $_REQUEST['localfile']); } // Strip BYTE-ORDER-MARK, if present if (!empty($lines[0]) && substr($lines[0], 0, 3) == WT_UTF8_BOM) { $lines[0] = substr($lines[0], 3); } asort($lines); $highestIndex = $this->getHighestIndex(); $placelist = array(); $j = 0; $maxLevel = 0; foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); if ($fieldrec[0] > $maxLevel) { $maxLevel = $fieldrec[0]; } } $fields = count($fieldrec); $set_icon = true; if (!is_dir(WT_MODULES_DIR . 'googlemap/places/flags/')) { $set_icon = false; } foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); if (is_numeric($fieldrec[0]) && $fieldrec[0] <= $maxLevel) { $placelist[$j] = array(); $placelist[$j]['place'] = ''; for ($ii = $fields - 4; $ii > 1; $ii--) { if ($fieldrec[0] > $ii - 2) { $placelist[$j]['place'] .= $fieldrec[$ii] . ','; } } foreach ($country_names as $countrycode => $countryname) { if ($countrycode == strtoupper($fieldrec[1])) { $fieldrec[1] = $countryname; break; } } $placelist[$j]['place'] .= $fieldrec[1]; $placelist[$j]['long'] = $fieldrec[$fields - 4]; $placelist[$j]['lati'] = $fieldrec[$fields - 3]; $placelist[$j]['zoom'] = $fieldrec[$fields - 2]; if ($set_icon) { $placelist[$j]['icon'] = trim($fieldrec[$fields - 1]); } else { $placelist[$j]['icon'] = ''; } $j = $j + 1; } } $prevPlace = ''; $prevLati = ''; $prevLong = ''; $placelistUniq = array(); $j = 0; foreach ($placelist as $k => $place) { if ($place['place'] != $prevPlace) { $placelistUniq[$j] = array(); $placelistUniq[$j]['place'] = $place['place']; $placelistUniq[$j]['lati'] = $place['lati']; $placelistUniq[$j]['long'] = $place['long']; $placelistUniq[$j]['zoom'] = $place['zoom']; $placelistUniq[$j]['icon'] = $place['icon']; $j = $j + 1; } elseif ($place['place'] == $prevPlace && ($place['lati'] != $prevLati || $place['long'] != $prevLong)) { if ($placelistUniq[$j - 1]['lati'] == 0 || $placelistUniq[$j - 1]['long'] == 0) { $placelistUniq[$j - 1]['lati'] = $place['lati']; $placelistUniq[$j - 1]['long'] = $place['long']; $placelistUniq[$j - 1]['zoom'] = $place['zoom']; $placelistUniq[$j - 1]['icon'] = $place['icon']; } elseif ($place['lati'] != '0' || $place['long'] != '0') { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>'; } } $prevPlace = $place['place']; $prevLati = $place['lati']; $prevLong = $place['long']; } $default_zoom_level = array(); $default_zoom_level[0] = 4; $default_zoom_level[1] = 7; $default_zoom_level[2] = 10; $default_zoom_level[3] = 12; foreach ($placelistUniq as $k => $place) { $parent = explode(',', $place['place']); $parent = array_reverse($parent); $parent_id = 0; for ($i = 0; $i < count($parent); $i++) { $escparent = $parent[$i]; if ($escparent == '') { $escparent = 'Unknown'; } $row = WT_DB::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place")->execute(array($i, $parent_id, $escparent))->fetchOneRow(); if (empty($row)) { // this name does not yet exist: create entry if (!isset($_POST['updateonly'])) { $highestIndex = $highestIndex + 1; if ($i + 1 == count($parent)) { $zoomlevel = $place['zoom']; } elseif (isset($default_zoom_level[$i])) { $zoomlevel = $default_zoom_level[$i]; } else { $zoomlevel = $this->getSetting('GM_MAX_ZOOM'); } if ($place['lati'] == '0' || $place['long'] == '0' || $i + 1 < count($parent)) { WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon'])); } else { //delete leading zero $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place['lati']); $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $place['long']); if ($pl_lati >= 0) { $place['lati'] = 'N' . abs($pl_lati); } elseif ($pl_lati < 0) { $place['lati'] = 'S' . abs($pl_lati); } if ($pl_long >= 0) { $place['long'] = 'E' . abs($pl_long); } elseif ($pl_long < 0) { $place['long'] = 'W' . abs($pl_long); } WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon'])); } $parent_id = $highestIndex; } } else { $parent_id = $row->pl_id; if (isset($_POST['overwritedata']) && $i + 1 == count($parent)) { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id)); } else { if (($row->pl_long == '0' || $row->pl_long == null) && ($row->pl_lati == '0' || $row->pl_lati == null)) { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $parent_id)); } if (empty($row->pl_icon) && !empty($place['icon'])) { WT_DB::prepare("UPDATE `##placelocation` SET pl_icon=? WHERE pl_id=?")->execute(array($place['icon'], $parent_id)); } } } } } $parent = 0; } if ($action == 'DeleteRecord') { $exists = WT_DB::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($deleteRecord))->fetchOne(); if (!$exists) { WT_DB::prepare("DELETE FROM `##placelocation` WHERE pl_id=?")->execute(array($deleteRecord)); } else { echo '<table class="facts_table"><tr><td>', WT_I18N::translate('Location not removed: this location contains sub-locations'), '</td></tr></table>'; } } ?> <script> function updateList(inactive) { window.location.href='<?php if (strstr($_SERVER['REQUEST_URI'], '&inactive', true)) { $uri = strstr($_SERVER['REQUEST_URI'], '&inactive', true); } else { $uri = $_SERVER['REQUEST_URI']; } echo $uri, '&inactive='; ?> '+inactive; } function edit_place_location(placeid) { window.open('module.php?mod=googlemap&mod_action=places_edit&action=update&placeid='+placeid, '_blank', gmap_window_specs); return false; } function add_place_location(placeid) { window.open('module.php?mod=googlemap&mod_action=places_edit&action=add&placeid='+placeid, '_blank', gmap_window_specs); return false; } function delete_place(placeid) { var answer=confirm('<?php echo WT_I18N::translate('Remove this location?'); ?> '); if (answer == true) { window.location = '<?php echo $_SERVER['REQUEST_URI']; ?> &action=DeleteRecord&deleteRecord=' + placeid; } } </script> <?php echo '<div id="gm_breadcrumb">'; $where_am_i = $this->placeIdToHierarchy($parent); foreach (array_reverse($where_am_i, true) as $id => $place) { if ($id == $parent) { if ($place != 'Unknown') { echo WT_Filter::escapeHtml($place); } else { echo WT_I18N::translate('unknown'); } } else { echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $id, '&inactive=', $inactive, '">'; if ($place != 'Unknown') { echo WT_Filter::escapeHtml($place), '</a>'; } else { echo WT_I18N::translate('unknown'), '</a>'; } } echo ' - '; } echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=0&inactive=', $inactive, '">', WT_I18N::translate('Top level'), '</a></div>'; echo '<form name="active" method="post" action="module.php?mod=googlemap&mod_action=admin_places&parent=', $parent, '&inactive=', $inactive, '"><div id="gm_active">'; echo '<label for="inactive">', WT_I18N::translate('Show inactive places'), '</label>'; echo '<input type="checkbox" name="inactive" id="inactive"'; if ($inactive) { echo ' checked="checked"'; } echo ' onclick="updateList(this.checked)"'; echo '>', help_link('PLE_ACTIVE', 'googlemap'), '</div></form>'; $placelist = $this->getPlaceListLocation($parent, $inactive); echo '<div class="gm_plac_edit">'; echo '<table class="gm_plac_edit"><tr>'; echo '<th>', WT_Gedcom_Tag::getLabel('PLAC'), '</th>'; echo '<th>', WT_Gedcom_Tag::getLabel('LATI'), '</th>'; echo '<th>', WT_Gedcom_Tag::getLabel('LONG'), '</th>'; echo '<th>', WT_I18N::translate('Zoom level'), '</th>'; echo '<th>', WT_I18N::translate('Icon'), '</th>'; echo '<th>'; echo WT_I18N::translate('Edit'), '</th><th>', WT_I18N::translate('Delete'), '</th></tr>'; if (count($placelist) == 0) { echo '<tr><td colspan="7" class="accepted">', WT_I18N::translate('No places found'), '</td></tr>'; } foreach ($placelist as $place) { echo '<tr><td><a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $place['place_id'], '&inactive=', $inactive, '">'; if ($place['place'] != 'Unknown') { echo WT_Filter::escapeHtml($place['place']), '</a></td>'; } else { echo WT_I18N::translate('unknown'), '</a></td>'; } echo '<td>', $place['lati'], '</td>'; echo '<td>', $place['long'], '</td>'; echo '<td>', $place['zoom'], '</td>'; echo '<td>'; if ($place['icon'] == NULL || $place['icon'] == '') { if ($place['lati'] == NULL || $place['long'] == NULL || $place['lati'] == '0' && $place['long'] == '0') { echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/mm_20_yellow.png">'; } else { echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/mm_20_red.png">'; } } else { echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/', $place['icon'], '" width="25" height="15">'; } echo '</td>'; echo '<td class="narrow"><a href="#" onclick="edit_place_location(', $place['place_id'], ');return false;" class="icon-edit" title="', WT_I18N::translate('Edit'), '"></a></td>'; $noRows = WT_DB::prepare("SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($place['place_id']))->fetchOne(); if ($noRows == 0) { ?> <td><a href="#" onclick="delete_place(<?php echo $place['place_id']; ?> );return false;" class="icon-delete" title="<?php echo WT_I18N::translate('Remove'); ?> "></a></td> <?php } else { ?> <td><i class="icon-delete-grey"></i></td> <?php } ?> </tr> <?php } ?> </table> </div> <table id="gm_manage"> <tr> <td> <?php echo WT_I18N::translate('Add a new geographic location'); ?> </td> <td> <form action="?" onsubmit="add_place_location(this.parent_id.options[this.parent_id.selectedIndex].value); return false;"> <?php echo select_edit_control('parent_id', $where_am_i, WT_I18N::translate('Top level'), $parent); ?> <input type="submit" value="<?php echo WT_I18N::translate('Add'); ?> "> </form> </td> </tr> <tr> <td> <?php echo WT_I18N::translate('Import all places from a family tree'); ?> </td> <td> <form action="module.php" method="get"> <input type="hidden" name="mod" value="googlemap"> <input type="hidden" name="mod_action" value="admin_places"> <input type="hidden" name="action" value="ImportGedcom"> <?php echo select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM); ?> <input type="submit" value="<?php echo WT_I18N::translate('Import'); ?> "> </form> </td> </tr> <tr> <td> <?php echo WT_I18N::translate('Upload geographic data'); ?> </td> <td> <form action="module.php" method="get"> <input type="hidden" name="mod" value="googlemap"> <input type="hidden" name="mod_action" value="admin_places"> <input type="hidden" name="action" value="ImportFile"> <input type="submit" value="<?php echo WT_I18N::translate('Upload'); ?> "> </form> </td> </tr> <tr> <td> <?php echo WT_I18N::translate('Download geographic data'); ?> </td> <td> <form action="module.php" method="get"> <input type="hidden" name="mod" value="googlemap"> <input type="hidden" name="mod_action" value="admin_places"> <input type="hidden" name="action" value="ExportFile"> <?php echo select_edit_control('parent', $where_am_i, WT_I18N::translate('All'), WT_GED_ID); ?> <input type="submit" value="<?php echo WT_I18N::translate('Download'); ?> "> </form> </td> </tr> </table> <?php }
// the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'calendar.php'); require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Anniversary calendar')); $controller->pageHeader(); $cal = WT_Filter::get('cal', '@#D[A-Z ]+@'); $day = WT_Filter::get('day', '\\d\\d?'); $month = WT_Filter::get('month', '[A-Z]{3,5}'); $year = WT_Filter::get('year', '\\d{1,4}(?: B\\.C\\.)?|\\d\\d\\d\\d\\/\\d\\d|\\d+(-\\d+|[?]+)?'); $action = WT_Filter::get('action', 'year|today|calendar', 'today'); $filterev = WT_Filter::get('filterev', 'all|bdm|' . WT_REGEX_TAG, 'bdm'); $filterof = WT_Filter::get('filterof', 'all|living|recent', 'all'); $filtersx = WT_Filter::get('filtersx', '[MF]'); if ($cal . $day . $month . $year == '') { // No date specified? Use the most likely calendar switch (WT_LOCALE) { case 'fa': $cal = '@#DJALALI@'; break;
// Cannot determine the latest version } } // Redirect to the target URL header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . $url); // Explicitly write the session data before we exit, // as it doesn’t always happen when using APC. Zend_Session::writeClose(); exit; } catch (Exception $ex) { $message = $ex->getMessage(); } // No break; // No break; default: $controller->setPageTitle(WT_I18N::translate('Login'))->pageHeader()->addInlineJavascript(' jQuery("#new_passwd_form").hide(); jQuery("#passwd_click").click(function() { jQuery("#new_passwd_form").slideToggle(100, function() { jQuery("#new_passwd_username").focus() }); return false; }); '); echo '<div id="login-page">'; echo '<div id="login-text">'; switch (WT_Site::preference('WELCOME_TEXT_AUTH_MODE')) { case 1: echo WT_I18N::translate('<center><b>Welcome to this genealogy website</b></center><br>Access to this site is permitted to every visitor who has a user account.<br><br>If you have a user account, you can login on this page. If you don’t have a user account, you can apply for one by clicking on the appropriate link below.<br><br>After verifying your application, the site administrator will activate your account. You will receive an email when your application has been approved.'); break; case 2:
Auth::user()->setUserName($form_username); } // Change password if ($form_pass1 && $form_pass1 == $form_pass2) { Auth::user()->setPassword($form_pass1); } // Change other settings Auth::user()->setRealName($form_realname)->setEmail($form_email)->setSetting('theme', $form_theme)->setSetting('language', $form_language)->setSetting('contactmethod', $form_contact_method)->setSetting('visibleonline', $form_visible_online); $WT_TREE->userPreference(WT_USER_ID, 'rootid', $form_rootid); // Reload page to pick up changes such as theme and user_id header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME); exit; } } $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('User administration'))->pageHeader()->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();'); // Form validation ?> <script> function checkform(frm) { if (frm.form_username.value=="") { alert("<?php echo WT_I18N::translate('You must enter a user name.'); ?> "); frm.form_username.focus(); return false; } if (frm.form_realname.value=="") { alert("<?php echo WT_I18N::translate('You must enter a real name.');
// the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 define('WT_SCRIPT_NAME', 'downloadbackup.php'); require './includes/session.php'; $fname = WT_Filter::get('fname'); if (!WT_USER_GEDCOM_ADMIN || !preg_match('/\\.zip$/', $fname)) { $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Error'))->pageHeader(); echo '<p class="ui-state-error">', WT_I18N::translate('You do not have permission to view this page.'), '</p>'; exit; } header('Pragma: public'); // required header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private', false); // required for certain browsers header('Content-Type: application/zip'); header('Content-Disposition: attachment; filename="' . $fname . '"'); header('Content-length: ' . filesize(WT_DATA_DIR . $fname)); header('Content-Transfer-Encoding: binary'); readfile(WT_DATA_DIR . $fname);
// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // 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 use WT\Auth; define('WT_SCRIPT_NAME', 'admin_trees_download.php'); require './includes/session.php'; require WT_ROOT . 'includes/functions/functions_export.php'; $controller = new WT_Controller_Page(); $controller->setPageTitle(WT_I18N::translate('Download GEDCOM'))->restrictAccess(Auth::isManager()); // Validate user parameters $action = WT_Filter::get('action', 'download'); $convert = WT_Filter::get('convert', 'yes|no', 'no'); $zip = WT_Filter::get('zip', 'yes|no', 'no'); $conv_path = WT_Filter::get('conv_path'); $privatize_export = WT_Filter::get('privatize_export', 'none|visitor|user|gedadmin'); if ($action == 'download') { $exportOptions = array(); $exportOptions['privatize'] = $privatize_export; $exportOptions['toANSI'] = $convert; $exportOptions['path'] = $conv_path; } $fileName = WT_GEDCOM; if ($action == "download" && $zip == "yes") { require WT_ROOT . 'library/pclzip.lib.php';
$show = 'indi'; // SURN list makes no sense here } elseif ($alpha) { $show_all = 'no'; $legend = WT_Filter::escapeHtml($alpha) . '…'; $url = WT_SCRIPT_NAME . '?alpha=' . rawurlencode($alpha) . '&ged=' . WT_GEDURL; $show = WT_Filter::get('show', 'surn|indi', 'surn'); } else { $show_all = 'no'; $legend = '…'; $url = WT_SCRIPT_NAME . '?ged=' . WT_GEDURL; $show = 'none'; // Don't show lists until something is chosen } $legend = '<span dir="auto">' . $legend . '</span>'; $controller->setPageTitle(WT_I18N::translate('Families') . ' : ' . $legend)->pageHeader(); echo '<h2 class="center">', WT_I18N::translate('Families'), '</h2>'; // Print a selection list of initial letters $list = array(); foreach (WT_Query_Name::surnameAlpha($show_marnm, true, WT_GED_ID) as $letter => $count) { switch ($letter) { case '@': $html = $UNKNOWN_NN; break; case ',': $html = WT_I18N::translate('None'); break; default: $html = WT_Filter::escapeHtml($letter); break; }
$module = new $class_name(); $module->getBlock($block_id); } if (WT_DEBUG) { echo execution_stats(); } if (WT_DEBUG_SQL) { echo WT_DB::getQueryLog(); } exit; } $controller = new WT_Controller_Page(); if ($ctype == 'user') { $controller->restrictAccess(Auth::isMember()); } $controller->setPageTitle($ctype == 'user' ? WT_I18N::translate('My page') : WT_TREE_TITLE)->setMetaRobots('index,follow')->setCanonicalUrl(WT_SCRIPT_NAME . '?ctype=' . $ctype . '&ged=' . WT_GEDCOM)->pageHeader()->addInlineJavascript('jQuery.ajaxSetup({cache:true});'); if ($ctype == 'user') { echo '<div id="my-page">'; echo '<h1 class="center">', WT_I18N::translate('My page'), '</h1>'; } else { echo '<div id="home-page">'; } if ($blocks['main']) { if ($blocks['side']) { echo '<div id="index_main_blocks">'; } else { echo '<div id="index_full_blocks">'; } foreach ($blocks['main'] as $block_id => $module_name) { $class_name = $module_name . '_WT_Module'; $module = new $class_name();
public function modAction($mod_action) { switch ($mod_action) { case 'ajax': $html = $this->getSidebarAjaxContent(); Zend_Session::writeClose(); header('Content-Type: text/html; charset=UTF-8'); echo $html; break; case 'index': global $MAX_PEDIGREE_GENERATIONS, $controller, $WT_SESSION, $GEDCOM_MEDIA_PATH; require_once WT_ROOT . WT_MODULES_DIR . 'clippings/clippings_ctrl.php'; require_once WT_ROOT . 'includes/functions/functions_export.php'; $clip_ctrl = new WT_Controller_Clippings(); $controller = new WT_Controller_Page(); $controller->setPageTitle($this->getTitle())->PageHeader()->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();'); echo '<script>'; echo 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;}'; echo '</script>'; if (!$WT_SESSION->cart[WT_GED_ID]) { echo '<h2>', WT_I18N::translate('Family tree clippings cart'), '</h2>'; } if ($clip_ctrl->action == 'add') { $person = WT_GedcomRecord::getInstance($clip_ctrl->id); echo '<h3><a href="', $person->getHtmlUrl(), '">' . $person->getFullName(), '</a></h3>'; if ($clip_ctrl->type == 'fam') { ?> <form action="module.php" method="get"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> <tr><td class="topbottombar"><?php echo WT_I18N::translate('Which other links from this family would you like to add?'); ?> <input type="hidden" name="id" value="<?php echo $clip_ctrl->id; ?> "> <input type="hidden" name="type" value="<?php echo $clip_ctrl->type; ?> "> <input type="hidden" name="action" value="add1"></td></tr> <tr><td class="optionbox"><input type="radio" name="others" checked value="none"><?php echo WT_I18N::translate('Add just this family record.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="parents"><?php echo WT_I18N::translate('Add parents’ records together with this family record.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="members"><?php echo WT_I18N::translate('Add parents’ and children’s records together with this family record.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="descendants"><?php echo WT_I18N::translate('Add parents’ and all descendants’ records together with this family record.'); ?> </td></tr> <tr><td class="topbottombar"><input type="submit" value="<?php echo WT_I18N::translate('Continue adding'); ?> "></td></tr> </table> </form> <?php } else { if ($clip_ctrl->type == 'indi') { ?> <form action="module.php" method="get"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> <tr><td class="topbottombar"><?php echo WT_I18N::translate('Which links from this individual would you also like to add?'); ?> <input type="hidden" name="id" value="<?php echo $clip_ctrl->id; ?> "> <input type="hidden" name="type" value="<?php echo $clip_ctrl->type; ?> "> <input type="hidden" name="action" value="add1"></td></tr> <tr><td class="optionbox"><input type="radio" name="others" checked value="none"><?php echo WT_I18N::translate('Add just this individual.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="parents"><?php echo WT_I18N::translate('Add this individual, his parents, and siblings.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="ancestors" id="ancestors"><?php echo WT_I18N::translate('Add this individual and his direct line ancestors.'); ?> <br> <?php echo WT_I18N::translate('Number of generations:'); ?> <input type="text" size="5" name="level1" value="<?php echo $MAX_PEDIGREE_GENERATIONS; ?> " onfocus="radAncestors('ancestors');"></td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="ancestorsfamilies" id="ancestorsfamilies"><?php echo WT_I18N::translate('Add this individual, his direct line ancestors, and their families.'); ?> <br > <?php echo WT_I18N::translate('Number of generations:'); ?> <input type="text" size="5" name="level2" value="<?php echo $MAX_PEDIGREE_GENERATIONS; ?> " onfocus="radAncestors('ancestorsfamilies');"></td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="members"><?php echo WT_I18N::translate('Add this individual, his spouse, and children.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="descendants" id="descendants"><?php echo WT_I18N::translate('Add this individual, his spouse, and all descendants.'); ?> <br > <?php echo WT_I18N::translate('Number of generations:'); ?> <input type="text" size="5" name="level3" value="<?php echo $MAX_PEDIGREE_GENERATIONS; ?> " onfocus="radAncestors('descendants');"></td></tr> <tr><td class="topbottombar"><input type="submit" value="<?php echo WT_I18N::translate('Continue adding'); ?> "> </table> </form> <?php } else { if ($clip_ctrl->type == 'sour') { ?> <form action="module.php" method="get"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> <tr><td class="topbottombar"><?php echo WT_I18N::translate('Which records linked to this source should be added?'); ?> <input type="hidden" name="id" value="<?php echo $clip_ctrl->id; ?> "> <input type="hidden" name="type" value="<?php echo $clip_ctrl->type; ?> "> <input type="hidden" name="action" value="add1"></td></tr> <tr><td class="optionbox"><input type="radio" name="others" checked value="none"><?php echo WT_I18N::translate('Add just this source.'); ?> </td></tr> <tr><td class="optionbox"><input type="radio" name="others" value="linked"><?php echo WT_I18N::translate('Add this source and families/individuals linked to it.'); ?> </td></tr> <tr><td class="topbottombar"><input type="submit" value="<?php echo WT_I18N::translate('Continue adding'); ?> "> </table> </form> <?php } } } } if ($clip_ctrl->privCount > 0) { echo "<span class=\"error\">" . WT_I18N::translate('Some items could not be added due to privacy restrictions') . "</span><br><br>"; } if (!$WT_SESSION->cart[WT_GED_ID]) { if ($clip_ctrl->action != 'add') { echo WT_I18N::translate('The clippings cart allows you to take extracts (“clippings”) from this family tree and bundle them up into a single file for downloading and subsequent importing into your own genealogy program. The downloadable file is recorded in GEDCOM format.<br><ul><li>How to take clippings?<br>This is really simple. Whenever you see a clickable name (individual, family, or source) you can go to the Details page of that name. There you will see the <b>Add to clippings cart</b> option. When you click that link you will be offered several options to download.</li><li>How to download?<br>Once you have items in your cart, you can download them just by clicking the “Download” link. Follow the instructions and links.</li></ul>'); ?> <form method="get" name="addin" action="module.php"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> <tr> <td colspan="2" class="topbottombar" style="text-align:center; "> <?php echo WT_I18N::translate('Enter an individual, family, or source ID'), help_link('add_by_id', $this->getName()); ?> </td> </tr> <tr> <td class="optionbox"> <input type="hidden" name="action" value="add"> <input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="5"> </td> <td class="optionbox"> <?php echo print_findindi_link('cart_item_id'); ?> <?php echo print_findfamily_link('cart_item_id'); ?> <?php echo print_findsource_link('cart_item_id', ''); ?> <input type="submit" value="<?php echo WT_I18N::translate('Add'); ?> "> </td> </tr> </table> </form> <?php } // -- end new lines echo WT_I18N::translate('Your clippings cart is empty.'); } else { // Keep track of the INDI from the parent page, otherwise it will // get lost after ajax updates $pid = WT_Filter::get('pid', WT_REGEX_XREF); if ($clip_ctrl->action != 'download' && $clip_ctrl->action != 'add') { ?> <table><tr><td class="width33" valign="top" rowspan="3"> <form method="get" action="module.php"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <input type="hidden" name="action" value="download"> <input type="hidden" name="pid" value="<?php echo $pid; ?> "> <table> <tr><td colspan="2" class="topbottombar"><h2><?php echo WT_I18N::translate('Download'); ?> </h2></td></tr> <tr><td class="descriptionbox width50 wrap"><?php echo WT_I18N::translate('Zip file(s)'), help_link('zip'); ?> </td> <td class="optionbox"><input type="checkbox" name="Zip" value="yes"></td></tr> <tr><td class="descriptionbox width50 wrap"><?php echo WT_I18N::translate('Include media (automatically zips files)'), help_link('include_media'); ?> </td> <td class="optionbox"><input type="checkbox" name="IncludeMedia" value="yes"></td></tr> <?php if (WT_USER_GEDCOM_ADMIN) { ?> <tr><td class="descriptionbox width50 wrap"><?php echo WT_I18N::translate('Apply privacy settings?'), help_link('apply_privacy'); ?> </td> <td class="optionbox"> <input type="radio" name="privatize_export" value="none" checked="checked"> <?php echo WT_I18N::translate('None'); ?> <br> <input type="radio" name="privatize_export" value="gedadmin"> <?php echo WT_I18N::translate('Manager'); ?> <br> <input type="radio" name="privatize_export" value="user"> <?php echo WT_I18N::translate('Member'); ?> <br> <input type="radio" name="privatize_export" value="visitor"> <?php echo WT_I18N::translate('Visitor'); ?> </td></tr> <?php } elseif (WT_USER_CAN_ACCESS) { ?> <tr><td class="descriptionbox width50 wrap"><?php echo WT_I18N::translate('Apply privacy settings?'), help_link('apply_privacy'); ?> </td> <td class="optionbox"> <input type="radio" name="privatize_export" value="user" checked="checked"> <?php echo WT_I18N::translate('Member'); ?> <br> <input type="radio" name="privatize_export" value="visitor"> <?php echo WT_I18N::translate('Visitor'); ?> </td></tr> <?php } ?> <tr><td class="descriptionbox width50 wrap"><?php echo WT_I18N::translate('Convert from UTF-8 to ANSI (ISO-8859-1)'), help_link('utf8_ansi'); ?> </td> <td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr> <tr><td class="descriptionbox width50 wrap"><?php echo WT_I18N::translate('Add the GEDCOM media path to filenames'), help_link('GEDCOM_MEDIA_PATH'); ?> </td> <td class="optionbox"> <input type="checkbox" name="conv_path" value="<?php echo WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH); ?> "> <span dir="auto"><?php echo WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH); ?> </span> </td></tr> <tr><td class="topbottombar" colspan="2"> <input type="submit" value="<?php echo WT_I18N::translate('Download'); ?> "> </form> </td></tr> </table> </td></tr> </table> <br> <form method="get" name="addin" action="module.php"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> <tr> <td colspan="2" class="topbottombar" style="text-align:center; "> <?php echo WT_I18N::translate('Enter an individual, family, or source ID'), help_link('add_by_id', $this->getName()); ?> </td> </tr> <tr> <td class="optionbox"> <input type="hidden" name="action" value="add"> <input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="8"> </td> <td class="optionbox"> <?php echo print_findindi_link('cart_item_id'); ?> <?php echo print_findfamily_link('cart_item_id'); ?> <?php echo print_findsource_link('cart_item_id'); ?> <input type="submit" value="<?php echo WT_I18N::translate('Add'); ?> "> </td> </tr> </table> </form> <?php } ?> <br><a href="module.php?mod=clippings&mod_action=index&action=empty"><?php echo WT_I18N::translate('Empty the clippings cart'); ?> </a><?php echo help_link('empty_cart', $this->getName()); ?> </td></tr> <tr><td class="topbottombar"><h2><?php echo WT_I18N::translate('Family tree clippings cart'); ?> </h2></td></tr> <tr><td valign="top"> <table id="mycart" class="sortable list_table width100"> <tr> <th class="list_label"><?php echo WT_I18N::translate('Record'); ?> </th> <th class="list_label"><?php echo WT_I18N::translate('Remove'); ?> </th> </tr> <?php foreach (array_keys($WT_SESSION->cart[WT_GED_ID]) as $xref) { $record = WT_GedcomRecord::getInstance($xref); if ($record) { switch ($record::RECORD_TYPE) { case 'INDI': $icon = 'icon-indis'; break; case 'FAM': $icon = 'icon-sfamily'; break; case 'SOUR': $icon = 'icon-source'; break; case 'REPO': $icon = 'icon-repository'; break; case 'NOTE': $icon = 'icon-note'; break; case 'OBJE': $icon = 'icon-media'; break; default: $icon = 'icon-clippings'; break; } ?> <tr><td class="list_value"> <i class="<?php echo $icon; ?> "></i> <?php echo '<a href="', $record->getHtmlUrl(), '">', $record->getFullName(), '</a>'; ?> </td> <td class="list_value center vmiddle"><a href="module.php?mod=clippings&mod_action=index&action=remove&id=<?php echo $xref; ?> " class="icon-remove" title="<?php echo WT_I18N::translate('Remove'); ?> "></a></td> </tr> <?php } } ?> </table> </td></tr></table> <?php } break; default: header('HTTP/1.0 404 Not Found'); break; } }
$Dbwidth = $bwidth; if (!$show_full) { $bwidth = $cbwidth; $bheight = $cbheight; $Dbwidth = $cbwidth; } $Dbheight = $bheight; $Dbxspacing = 0; $Dbyspacing = 0; $Dbasexoffset = 0; $Dbaseyoffset = 0; $person1 = WT_Individual::getInstance($pid1); $person2 = WT_Individual::getInstance($pid2); $controller->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();'); if ($person1 && $person1->canShowName() && $person2 && $person2->canShowName()) { $controller->setPageTitle(WT_I18N::translate('Relationships between %1$s and %2$s', $person1->getFullName(), $person2->getFullName()))->PageHeader(); $node = get_relationship($person1, $person2, $followspouse, 0, $path_to_find); // If no blood relationship exists, look for relationship via marriage if ($path_to_find == 0 && $node == false && $followspouse == false) { $followspouse = true; $node = get_relationship($person1, $person2, $followspouse, 0, $path_to_find); } $disp = true; } else { $controller->setPageTitle(WT_I18N::translate('Relationships'))->PageHeader(); $node = false; $disp = false; } ?> <div id="relationship-page"> <h2><?php