Exemplo n.º 1
0
 private function pageHeader(PageController $controller)
 {
     $controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Fancy Treeview'))->pageHeader();
     // add javascript and styleseheet
     $this->includeJs($controller, 'admin');
     echo $this->getStylesheet();
 }
Exemplo n.º 2
0
 /**
  * AdminConfig@index
  */
 public function index()
 {
     global $WT_TREE;
     $action = Filter::post('action');
     if ($action == 'update' && Filter::checkCsrf()) {
         $this->update();
     }
     Theme::theme(new AdministrationTheme())->init($WT_TREE);
     $ctrl = new PageController();
     $ctrl->restrictAccess(Auth::isAdmin())->setPageTitle($this->module->getTitle());
     $view_bag = new ViewBag();
     $view_bag->set('title', $ctrl->getPageTitle());
     $view_bag->set('module', $this->module);
     ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
 }
    private function pageHeader(PageController $controller)
    {
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Fancy Research Links'))->pageHeader()->addInlineJavascript('
				jQuery("head").append("<style>[dir=rtl] .checkbox-inline input[type=checkbox]{margin-left:-20px}</style>");
				jQuery("input[name=select-all]").click(function(){
					if (jQuery(this).is(":checked") == true) {
						jQuery(".checkbox-inline").find(":checkbox").prop("checked", true).val(1);
						jQuery("input[id^=NEW_FRL_PLUGINS]").val(1);
					} else {
						jQuery(".checkbox-inline").find(":checkbox").prop("checked", false).val(0);
						jQuery("input[id^=NEW_FRL_PLUGINS]").val(0);
					}
					formChanged = true;
				});
			');
    }
    /**
     * Translation@status
     */
    public function status()
    {
        global $WT_TREE;
        $table_id = \Rhumsaa\Uuid\Uuid::uuid4();
        Theme::theme(new AdministrationTheme())->init($WT_TREE);
        $ctrl = new PageController();
        $ctrl->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Translations status'))->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
                //Datatable initialisation
				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_missing_' . $table_id . '").DataTable({
					' . I18N::datatablesI18N() . ',			
					sorting: [[0, "asc"]],                    
					pageLength: 15,
                    columns: [
						/* 0 Message	 	*/ null,
                        /* 1 Reference      */ null
					],
				});
                
                jQuery("#table_nonused_' . $table_id . '").DataTable({
					' . I18N::datatablesI18N() . ',			
					sorting: [[0, "asc"]],                    
					pageLength: 15,
                    columns: [
						/* 0 Message	 	*/ null,
                        /* 1 Reference      */ null
					],
				});
            ');
        $source_code_paths = array(WT_ROOT . 'vendor/jon48/webtrees-lib/src', WT_ROOT . 'vendor/jon48/webtrees-tools/src/app');
        $analyzer = new TranslationsAnalyzer($source_code_paths);
        $analyzer->load();
        $locale = $analyzer->getLocale();
        $view_bag = new ViewBag();
        $view_bag->set('table_id', $table_id);
        $view_bag->set('module', $this->module);
        $view_bag->set('source_code_paths', $source_code_paths);
        $view_bag->set('title', $ctrl->getPageTitle() . ' - ' . I18N::languageName($locale->languageTag()));
        $view_bag->set('missing_translations', $analyzer->getMissingTranslations());
        $view_bag->set('non_used_translations', $analyzer->getMajNonUsedTranslations());
        $view_bag->set('loading_stats', $analyzer->getLoadingStatistics());
        ViewFactory::make('TranslationStatus', $this, $ctrl, $view_bag)->render();
    }
Exemplo n.º 5
0
    /**
     * Certificate@index
     */
    public function index()
    {
        global $WT_TREE;
        $controller = new PageController();
        $controller->setPageTitle(I18N::translate('Certificate'))->restrictAccess($this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE));
        $cid = Filter::get('cid');
        $certificate = null;
        if (!empty($cid) && strlen($cid) > 22) {
            $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
        }
        $data = new ViewBag();
        $data->set('title', $controller->getPageTitle());
        $data->set('has_certif', false);
        if ($certificate) {
            $controller->restrictAccess($certificate->canShow());
            $data->set('title', $certificate->getTitle());
            $data->set('has_certif', true);
            $data->set('certificate', $certificate);
            $data->set('url_certif_city', 'module.php?mod=' . Constants::MODULE_MAJ_CERTIF_NAME . '&mod_action=Certificate@listAll' . '&ged=' . $WT_TREE->getNameUrl() . '&city=' . Functions::encryptToSafeBase64($certificate->getCity()));
            $controller->addInlineJavascript('
                jQuery("#certificate-tabs").tabs();
			    jQuery("#certificate-tabs").css("visibility", "visible");    
            ');
            $data->set('has_linked_indis', false);
            $data->set('has_linked_fams', false);
            $linked_indis = $certificate->linkedIndividuals();
            $linked_fams = $certificate->linkedFamilies();
            if ($linked_indis && count($linked_indis) > 0) {
                $data->set('has_linked_indis', true);
                $data->set('linked_indis', $linked_indis);
            }
            if (!empty($linked_fams)) {
                $data->set('has_linked_fams', true);
                $data->set('linked_fams', $linked_fams);
            }
        }
        ViewFactory::make('Certificate', $this, $controller, $data)->render();
    }
Exemplo n.º 6
0
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_trees_check.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Check for errors') . ' — ' . $WT_TREE->getTitleHtml())->pageHeader();
// We need to work with raw GEDCOM data, as we are looking for errors
// which may prevent the GedcomRecord objects from working.
$rows = Database::prepare("SELECT i_id AS xref, 'INDI' AS type, i_gedcom AS gedrec FROM `##individuals` WHERE i_file=?" . " UNION " . "SELECT f_id AS xref, 'FAM'  AS type, f_gedcom AS gedrec FROM `##families`    WHERE f_file=?" . " UNION " . "SELECT s_id AS xref, 'SOUR' AS type, s_gedcom AS gedrec FROM `##sources`     WHERE s_file=?" . " UNION " . "SELECT m_id AS xref, 'OBJE' AS type, m_gedcom AS gedrec FROM `##media`       WHERE m_file=?" . " UNION " . "SELECT o_id AS xref, o_type AS type, o_gedcom AS gedrec FROM `##other`       WHERE o_file=? AND o_type NOT IN ('HEAD', 'TRLR')")->execute(array($WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId()))->fetchAll();
$records = array();
foreach ($rows as $row) {
    $records[$row->xref] = $row;
}
// Need to merge pending new/changed/deleted records
$rows = Database::prepare("SELECT xref, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(CASE WHEN old_gedcom='' THEN new_gedcom ELSE old_gedcom END, '\n', 1), ' ', 3), ' ', -1) AS type, new_gedcom AS gedrec" . " FROM (" . "  SELECT MAX(change_id) AS change_id" . "  FROM `##change`" . "  WHERE gedcom_id=? AND status='pending'" . "  GROUP BY xref" . " ) AS t1" . " JOIN `##change` t2 USING (change_id)")->execute(array($WT_TREE->getTreeId()))->fetchAll();
foreach ($rows as $row) {
    if ($row->gedrec) {
        // new/updated record
        $records[$row->xref] = $row;
    } else {
        // deleted record
Exemplo n.º 7
0
        $record = Family::getInstance($row->xref, $WT_TREE, $row->gedcom);
        foreach ($record->getFacts() as $fact) {
            $old_place = $fact->getAttribute('PLAC');
            if (preg_match('/(^|, )' . preg_quote($search, '/') . '$/i', $old_place)) {
                $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place);
                $changes[$old_place] = $new_place;
                if ($confirm == 'update') {
                    $gedcom = preg_replace('/(\\n2 PLAC (?:.*, )*)' . preg_quote($search, '/') . '(\\n|$)/i', '$1' . $replace . '$2', $fact->getGedcom());
                    $record->updateFact($fact->getFactId(), $gedcom, false);
                }
            }
        }
    }
}
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Update all the place names in a family tree') . ' — ' . $WT_TREE->getTitleHtml())->addInlineJavascript('autocomplete();')->pageHeader();
?>

<ol class="breadcrumb small">
	<li><a href="admin.php"><?php 
echo I18N::translate('Control panel');
?>
</a></li>
	<li><a href="admin_trees_manage.php"><?php 
echo I18N::translate('Manage family trees');
?>
</a></li>
	<li class="active"><?php 
echo $controller->getPageTitle();
?>
</li>
Exemplo n.º 8
0
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsDate;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use PDO;
/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
define('WT_SCRIPT_NAME', 'admin_users.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin());
// Valid values for form variables
$ALL_EDIT_OPTIONS = array('none' => I18N::translate('Visitor'), 'access' => I18N::translate('Member'), 'edit' => I18N::translate('Editor'), 'accept' => I18N::translate('Moderator'), 'admin' => I18N::translate('Manager'));
// Form actions
switch (Filter::post('action')) {
    case 'save':
        if (Filter::checkCsrf()) {
            $user_id = Filter::postInteger('user_id');
            $user = User::find($user_id);
            $username = Filter::post('username');
            $real_name = Filter::post('real_name');
            $email = Filter::postEmail('email');
            $pass1 = Filter::post('pass1', WT_REGEX_PASSWORD);
            $pass2 = Filter::post('pass2', WT_REGEX_PASSWORD);
            $theme = Filter::post('theme', implode('|', array_keys(Theme::themeNames())), '');
            $language = Filter::post('language');
Exemplo n.º 9
0
    /**
     * AdminConfig@index
     */
    public function index()
    {
        global $WT_TREE;
        HookProvider::getInstance()->updateHooks();
        $action = Filter::post('action');
        if ($action == 'update' && Filter::checkCsrf()) {
            $this->update();
        }
        Theme::theme(new AdministrationTheme())->init($WT_TREE);
        $ctrl = new PageController();
        $ctrl->restrictAccess(Auth::isAdmin())->setPageTitle($this->module->getTitle());
        $table_id = 'table-installedhooks-' . Uuid::uuid4();
        $view_bag = new ViewBag();
        $view_bag->set('title', $ctrl->getPageTitle());
        $view_bag->set('table_id', $table_id);
        $view_bag->set('hook_list', HookProvider::getInstance()->getRawInstalledHooks());
        $ctrl->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
		  	jQuery(document).ready(function() {
				jQuery("#' . $table_id . '").dataTable( {
					' . I18N::datatablesI18N() . ',		
					sorting: [[ 2, "asc" ], [ 3, "asc" ]],
					displayLength: 10,
					pagingType: "full_numbers",
					columns: [
						/* 0 Enabled 		*/	{ dataSort: 1, class: "center" },
						/* 1 Enabled sort	*/	{ visible: false},
						/* 2 Hook function	*/	null,
						/* 3 Hook context	*/	null,
						/* 4 Module name	*/	null,
						/* 5 Priority		*/	{ dataSort: 6, class: "center" },
						/* 6 Priority sort	*/	{ type: "num", visible: false}
					]
			  });
			});
		');
        ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
    }
Exemplo n.º 10
0
 * 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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Module\ModuleConfigInterface;
define('WT_SCRIPT_NAME', 'admin_module_sidebar.php');
require 'includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Sidebars'));
$action = Filter::post('action');
$modules = Module::getAllModulesByComponent('sidebar');
if ($action === 'update_mods' && Filter::checkCsrf()) {
    foreach ($modules as $module) {
        foreach (Tree::getAll() as $tree) {
            $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getTreeId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
            Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'sidebar', ?)")->execute(array($module->getName(), $tree->getTreeId(), $access_level));
        }
        $order = Filter::post('order-' . $module->getName());
        Database::prepare("UPDATE `##module` SET sidebar_order = ? WHERE module_name = ?")->execute(array($order, $module->getName()));
    }
    header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
    return;
}
$controller->addInlineJavascript('
Exemplo n.º 11
0
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
define('WT_SCRIPT_NAME', 'admin_trees_config.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE));
$calendars = array('none' => I18N::translate('No calendar conversion')) + Date::calendarNames();
$french_calendar_start = new Date('22 SEP 1792');
$french_calendar_end = new Date('31 DEC 1805');
$gregorian_calendar_start = new Date('15 OCT 1582');
$hide_show = array(0 => I18N::translate('hide'), 1 => I18N::translate('show'));
$surname_list_styles = array('style1' => I18N::translate('list'), 'style2' => I18N::translate('table'), 'style3' => I18N::translate('tag cloud'));
$layouts = array(0 => I18N::translate('Portrait'), 1 => I18N::translate('Landscape'));
$one_to_nine = array();
for ($n = 1; $n <= 9; ++$n) {
    $one_to_nine[$n] = I18N::number($n);
}
$formats = array('' => I18N::translate('none'), 'markdown' => I18N::translate('markdown'));
$source_types = array(0 => I18N::translate('none'), 1 => I18N::translate('facts'), 2 => I18N::translate('records'));
$no_yes = array(0 => I18N::translate('no'), 1 => I18N::translate('yes'));
$PRIVACY_CONSTANTS = array('none' => I18N::translate('Show to visitors'), 'privacy' => I18N::translate('Show to members'), 'confidential' => I18N::translate('Show to managers'), 'hidden' => I18N::translate('Hide from everyone'));
Exemplo n.º 12
0
        }
        $html .= '</ul>';
    } else {
        $html .= '<div class="alert alert-danger">' . I18N::translate('This media object is not linked to any other record.') . '</div>';
    }
    return $html;
}
////////////////////////////////////////////////////////////////////////////////
// Start here
////////////////////////////////////////////////////////////////////////////////
// Preserve the pagination/filtering/sorting between requests, so that the
// browser’s back button works. Pagination is dependent on the currently
// selected folder.
$table_id = md5($files . $media_folder . $media_path . $subfolders);
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Manage media'))->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->pageHeader()->addInlineJavascript('
	jQuery("#media-table-' . $table_id . '").dataTable({
		processing: true,
		serverSide: true,
		ajax: "' . WT_BASE_URL . WT_SCRIPT_NAME . '?action=load_json&files=' . $files . '&media_folder=' . $media_folder . '&media_path=' . $media_path . '&subfolders=' . $subfolders . '",
		' . I18N::datatablesI18N(array(5, 10, 20, 50, 100, 500, 1000, -1)) . ',
		autoWidth:false,
		pageLength: 10,
		pagingType: "full_numbers",
		stateSave: true,
		stateDuration: 300,
		columns: [
			{},
			{ sortable: false },
			{ sortable: ' . ($files === 'unused' ? 'false' : 'true') . ' }
		]
Exemplo n.º 13
0
use Fisharebest\Webtrees\Functions\Functions;
define('WT_SCRIPT_NAME', 'admin.php');
require './includes/session.php';
// This is a list of old files and directories, from earlier versions of webtrees, that can be deleted.
// It was generated with the help of a command like this:
// git diff 1.6.0..master --name-status | grep ^D
$old_files = array(WT_ROOT . 'language/en.mo', WT_ROOT . 'themechange.php', WT_ROOT . 'includes/extras', WT_ROOT . 'addremotelink.php', WT_ROOT . 'addsearchlink.php', WT_ROOT . 'client.php', WT_ROOT . 'dir_editor.php', WT_ROOT . 'editconfig_gedcom.php', WT_ROOT . 'editgedcoms.php', WT_ROOT . 'edit_merge.php', WT_ROOT . 'genservice.php', WT_ROOT . 'includes/classes', WT_ROOT . 'includes/controllers', WT_ROOT . 'includes/family_nav.php', WT_ROOT . 'logs.php', WT_ROOT . 'manageservers.php', WT_ROOT . 'media.php', WT_ROOT . 'module_admin.php', WT_ROOT . 'opensearch.php', WT_ROOT . 'PEAR.php', WT_ROOT . 'pgv_to_wt.php', WT_ROOT . 'places', WT_ROOT . 'serviceClientTest.php', WT_ROOT . 'siteconfig.php', WT_ROOT . 'SOAP', WT_ROOT . 'themes/clouds/mozilla.css', WT_ROOT . 'themes/clouds/netscape.css', WT_ROOT . 'themes/colors/mozilla.css', WT_ROOT . 'themes/colors/netscape.css', WT_ROOT . 'themes/fab/mozilla.css', WT_ROOT . 'themes/fab/netscape.css', WT_ROOT . 'themes/minimal/mozilla.css', WT_ROOT . 'themes/minimal/netscape.css', WT_ROOT . 'themes/webtrees/mozilla.css', WT_ROOT . 'themes/webtrees/netscape.css', WT_ROOT . 'themes/webtrees/style_rtl.css', WT_ROOT . 'themes/xenea/mozilla.css', WT_ROOT . 'themes/xenea/netscape.css', WT_ROOT . 'uploadmedia.php', WT_ROOT . 'useradmin.php', WT_ROOT . 'webservice', WT_ROOT . 'wtinfo.php', WT_ROOT . 'treenav.php', WT_ROOT . 'themes/clouds/jquery', WT_ROOT . 'themes/colors/jquery', WT_ROOT . 'themes/fab/jquery', WT_ROOT . 'themes/minimal/jquery', WT_ROOT . 'themes/webtrees/jquery', WT_ROOT . 'themes/xenea/jquery', WT_ROOT . 'themes/clouds/chrome.css', WT_ROOT . 'themes/clouds/opera.css', WT_ROOT . 'themes/clouds/print.css', WT_ROOT . 'themes/clouds/style_rtl.css', WT_ROOT . 'themes/colors/chrome.css', WT_ROOT . 'themes/colors/opera.css', WT_ROOT . 'themes/colors/print.css', WT_ROOT . 'themes/colors/style_rtl.css', WT_ROOT . 'themes/fab/chrome.css', WT_ROOT . 'themes/fab/opera.css', WT_ROOT . 'themes/minimal/chrome.css', WT_ROOT . 'themes/minimal/opera.css', WT_ROOT . 'themes/minimal/print.css', WT_ROOT . 'themes/minimal/style_rtl.css', WT_ROOT . 'themes/xenea/chrome.css', WT_ROOT . 'themes/xenea/opera.css', WT_ROOT . 'themes/xenea/print.css', WT_ROOT . 'themes/xenea/style_rtl.css', WT_ROOT . 'includes/cssparser.inc.php', WT_ROOT . 'modules_v3/gedcom_favorites/help_text.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php', WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL2.css', WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL.css', WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL_ff.css', WT_ROOT . 'modules_v3/lightbox/css/clearbox_music.css', WT_ROOT . 'modules_v3/lightbox/css/clearbox_music_RTL.css', WT_ROOT . 'modules_v3/user_favorites/db_schema', WT_ROOT . 'modules_v3/user_favorites/help_text.php', WT_ROOT . 'search_engine.php', WT_ROOT . 'themes/clouds/modules.css', WT_ROOT . 'themes/colors/modules.css', WT_ROOT . 'themes/fab/modules.css', WT_ROOT . 'themes/minimal/modules.css', WT_ROOT . 'themes/webtrees/modules.css', WT_ROOT . 'themes/xenea/modules.css', WT_ROOT . 'includes/media_reorder_count.php', WT_ROOT . 'includes/media_tab_head.php', WT_ROOT . 'modules_v3/clippings/index.php', WT_ROOT . 'modules_v3/googlemap/css/googlemap_style.css', WT_ROOT . 'modules_v3/googlemap/css/wt_v3_places_edit.css', WT_ROOT . 'modules_v3/googlemap/index.php', WT_ROOT . 'modules_v3/lightbox/index.php', WT_ROOT . 'modules_v3/recent_changes/help_text.php', WT_ROOT . 'modules_v3/todays_events/help_text.php', WT_ROOT . 'sidebar.php', WT_ROOT . 'modules_v3/sitemap/admin_index.php', WT_ROOT . 'modules_v3/sitemap/help_text.php', WT_ROOT . 'modules_v3/tree/css/styles', WT_ROOT . 'modules_v3/tree/css/treebottom.gif', WT_ROOT . 'modules_v3/tree/css/treebottomleft.gif', WT_ROOT . 'modules_v3/tree/css/treebottomright.gif', WT_ROOT . 'modules_v3/tree/css/tree.jpg', WT_ROOT . 'modules_v3/tree/css/treeleft.gif', WT_ROOT . 'modules_v3/tree/css/treeright.gif', WT_ROOT . 'modules_v3/tree/css/treetop.gif', WT_ROOT . 'modules_v3/tree/css/treetopleft.gif', WT_ROOT . 'modules_v3/tree/css/treetopright.gif', WT_ROOT . 'modules_v3/tree/css/treeview_print.css', WT_ROOT . 'modules_v3/tree/help_text.php', WT_ROOT . 'modules_v3/tree/images/print.png', WT_ROOT . 'login_register.php', WT_ROOT . 'modules_v3/top10_givnnames/help_text.php', WT_ROOT . 'modules_v3/top10_surnames/help_text.php', WT_ROOT . 'admin_site_ipaddress.php', WT_ROOT . 'downloadgedcom.php', WT_ROOT . 'export_gedcom.php', WT_ROOT . 'gedcheck.php', WT_ROOT . 'images', WT_ROOT . 'includes/dmsounds_UTF8.php', WT_ROOT . 'includes/grampsxml.rng', WT_ROOT . 'includes/session_spider.php', WT_ROOT . 'modules_v3/googlemap/admin_editconfig.php', WT_ROOT . 'modules_v3/googlemap/admin_placecheck.php', WT_ROOT . 'modules_v3/googlemap/flags.php', WT_ROOT . 'modules_v3/googlemap/images/pedigree_map.gif', WT_ROOT . 'modules_v3/googlemap/pedigree_map.php', WT_ROOT . 'modules_v3/lightbox/admin_config.php', WT_ROOT . 'modules_v3/lightbox/album.php', WT_ROOT . 'modules_v3/tree/css/vline.jpg', WT_ROOT . 'imageflush.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_pedigree_map.js.php', WT_ROOT . 'modules_v3/lightbox/js/tip_balloon_RTL.js', WT_ROOT . 'includes/set_gedcom_defaults.php', WT_ROOT . 'modules_v3/address_report', WT_ROOT . 'modules_v3/lightbox/functions/lb_horiz_sort.php', WT_ROOT . 'modules_v3/random_media/help_text.php', WT_ROOT . 'imageview.php', WT_ROOT . 'media/MediaInfo.txt', WT_ROOT . 'media/thumbs/ThumbsInfo.txt', WT_ROOT . 'modules_v3/GEDFact_assistant/css/media_0_inverselink.css', WT_ROOT . 'modules_v3/lightbox/help_text.php', WT_ROOT . 'modules_v3/lightbox/images/blank.gif', WT_ROOT . 'modules_v3/lightbox/images/close_1.gif', WT_ROOT . 'modules_v3/lightbox/images/image_add.gif', WT_ROOT . 'modules_v3/lightbox/images/image_copy.gif', WT_ROOT . 'modules_v3/lightbox/images/image_delete.gif', WT_ROOT . 'modules_v3/lightbox/images/image_edit.gif', WT_ROOT . 'modules_v3/lightbox/images/image_link.gif', WT_ROOT . 'modules_v3/lightbox/images/images.gif', WT_ROOT . 'modules_v3/lightbox/images/image_view.gif', WT_ROOT . 'modules_v3/lightbox/images/loading.gif', WT_ROOT . 'modules_v3/lightbox/images/next.gif', WT_ROOT . 'modules_v3/lightbox/images/nextlabel.gif', WT_ROOT . 'modules_v3/lightbox/images/norm_2.gif', WT_ROOT . 'modules_v3/lightbox/images/overlay.png', WT_ROOT . 'modules_v3/lightbox/images/prev.gif', WT_ROOT . 'modules_v3/lightbox/images/prevlabel.gif', WT_ROOT . 'modules_v3/lightbox/images/private.gif', WT_ROOT . 'modules_v3/lightbox/images/slideshow.jpg', WT_ROOT . 'modules_v3/lightbox/images/transp80px.gif', WT_ROOT . 'modules_v3/lightbox/images/zoom_1.gif', WT_ROOT . 'modules_v3/lightbox/js', WT_ROOT . 'modules_v3/lightbox/music', WT_ROOT . 'modules_v3/lightbox/pic', WT_ROOT . 'themes/_administration/jquery', WT_ROOT . 'themes/webtrees/chrome.css', WT_ROOT . 'modules_v3/lightbox/images/image_edit.png', WT_ROOT . 'modules_v3/lightbox/images/image_view.png', WT_ROOT . 'modules_v3/lightbox/images/image_view.png', WT_ROOT . 'modules_v3/top10_pageviews/help_text.php', WT_ROOT . 'themes/_administration/jquery-ui-1.10.0', WT_ROOT . 'themes/clouds/jquery-ui-1.10.0', WT_ROOT . 'themes/colors/jquery-ui-1.10.0', WT_ROOT . 'themes/fab/jquery-ui-1.10.0', WT_ROOT . 'themes/minimal/jquery-ui-1.10.0', WT_ROOT . 'themes/webtrees/jquery-ui-1.10.0', WT_ROOT . 'themes/xenea/jquery-ui-1.10.0', WT_ROOT . 'includes/media_reorder.php', WT_ROOT . 'includes/old_messages.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_note_decode.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_asst_date.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_googlemap.js.php', WT_ROOT . 'modules_v3/lightbox/functions/lightbox_print_media.php', WT_ROOT . 'modules_v3/upcoming_events/help_text.php', WT_ROOT . 'modules_v3/stories/help_text.php', WT_ROOT . 'modules_v3/user_messages/help_text.php', WT_ROOT . 'themes/_administration/favicon.png', WT_ROOT . 'themes/_administration/images', WT_ROOT . 'themes/_administration/msie.css', WT_ROOT . 'themes/_administration/style.css', WT_ROOT . 'themes/clouds/favicon.png', WT_ROOT . 'themes/clouds/images', WT_ROOT . 'themes/clouds/msie.css', WT_ROOT . 'themes/clouds/style.css', WT_ROOT . 'themes/colors/css', WT_ROOT . 'themes/colors/favicon.png', WT_ROOT . 'themes/colors/images', WT_ROOT . 'themes/colors/ipad.css', WT_ROOT . 'themes/colors/msie.css', WT_ROOT . 'themes/fab/favicon.png', WT_ROOT . 'themes/fab/images', WT_ROOT . 'themes/fab/msie.css', WT_ROOT . 'themes/fab/style.css', WT_ROOT . 'themes/minimal/favicon.png', WT_ROOT . 'themes/minimal/images', WT_ROOT . 'themes/minimal/msie.css', WT_ROOT . 'themes/minimal/style.css', WT_ROOT . 'themes/webtrees/favicon.png', WT_ROOT . 'themes/webtrees/images', WT_ROOT . 'themes/webtrees/msie.css', WT_ROOT . 'themes/webtrees/style.css', WT_ROOT . 'themes/xenea/favicon.png', WT_ROOT . 'themes/xenea/images', WT_ROOT . 'themes/xenea/msie.css', WT_ROOT . 'themes/xenea/style.css', WT_ROOT . 'themes/_administration/css-1.5.0', WT_ROOT . 'themes/clouds/css-1.5.0', WT_ROOT . 'themes/colors/css-1.5.0', WT_ROOT . 'themes/fab/css-1.5.0', WT_ROOT . 'themes/minimal/css-1.5.0', WT_ROOT . 'themes/webtrees/css-1.5.0', WT_ROOT . 'themes/xenea/css-1.5.0', WT_ROOT . 'themes/_administration/css-1.5.1', WT_ROOT . 'themes/clouds/css-1.5.1', WT_ROOT . 'themes/colors/css-1.5.1', WT_ROOT . 'themes/fab/css-1.5.1', WT_ROOT . 'themes/minimal/css-1.5.1', WT_ROOT . 'themes/webtrees/css-1.5.1', WT_ROOT . 'themes/xenea/css-1.5.1', WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_asst_help.php', WT_ROOT . 'modules_v3/googlemap/admin_places.php', WT_ROOT . 'modules_v3/googlemap/defaultconfig.php', WT_ROOT . 'modules_v3/googlemap/googlemap.php', WT_ROOT . 'modules_v3/googlemap/placehierarchy.php', WT_ROOT . 'modules_v3/googlemap/places_edit.php', WT_ROOT . 'modules_v3/googlemap/util.js', WT_ROOT . 'modules_v3/googlemap/wt_v3_places_edit.js.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_places_edit_overlays.js.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_street_view.php', WT_ROOT . 'readme.html', WT_ROOT . 'themes/_administration/css-1.5.2', WT_ROOT . 'themes/clouds/css-1.5.2', WT_ROOT . 'themes/colors/css-1.5.2', WT_ROOT . 'themes/fab/css-1.5.2', WT_ROOT . 'themes/minimal/css-1.5.2', WT_ROOT . 'themes/webtrees/css-1.5.2', WT_ROOT . 'themes/xenea/css-1.5.2', WT_ROOT . 'downloadbackup.php', WT_ROOT . 'modules_v3/ckeditor/ckeditor-4.3.2-custom', WT_ROOT . 'site-php-version.php', WT_ROOT . 'themes/_administration/css-1.5.3', WT_ROOT . 'themes/clouds/css-1.5.3', WT_ROOT . 'themes/colors/css-1.5.3', WT_ROOT . 'themes/fab/css-1.5.3', WT_ROOT . 'themes/minimal/css-1.5.3', WT_ROOT . 'themes/webtrees/css-1.5.3', WT_ROOT . 'themes/xenea/css-1.5.3', WT_ROOT . 'includes/authentication.php', WT_ROOT . 'themes/_administration/css-1.6.0', WT_ROOT . 'themes/_administration/jquery-ui-1.10.3', WT_ROOT . 'themes/clouds/css-1.6.0', WT_ROOT . 'themes/clouds/jquery-ui-1.10.3', WT_ROOT . 'themes/colors/css-1.6.0', WT_ROOT . 'themes/colors/jquery-ui-1.10.3', WT_ROOT . 'themes/fab/css-1.6.0', WT_ROOT . 'themes/fab/jquery-ui-1.10.3', WT_ROOT . 'themes/minimal/css-1.6.0', WT_ROOT . 'themes/minimal/jquery-ui-1.10.3', WT_ROOT . 'themes/webtrees/css-1.6.0', WT_ROOT . 'themes/webtrees/jquery-ui-1.10.3', WT_ROOT . 'themes/xenea/css-1.6.0', WT_ROOT . 'themes/xenea/jquery-ui-1.10.3', WT_ROOT . 'themes/_administration/css-1.6.0', WT_ROOT . 'themes/_administration/jquery-ui-1.10.3', WT_ROOT . 'admin_site_other.php', WT_ROOT . 'includes/config_data.php', WT_ROOT . 'includes/db_schema', WT_ROOT . 'includes/fonts', WT_ROOT . 'includes/functions', WT_ROOT . 'includes/hitcount.php', WT_ROOT . 'includes/reportheader.php', WT_ROOT . 'includes/specialchars.php', WT_ROOT . 'js', WT_ROOT . 'language/en_GB.mo', WT_ROOT . 'language/en_US.mo', WT_ROOT . 'language/pt_BR.mo', WT_ROOT . 'language/zh_CN.mo', WT_ROOT . 'language/extra', WT_ROOT . 'library', WT_ROOT . 'modules_v3/batch_update/admin_batch_update.php', WT_ROOT . 'modules_v3/batch_update/plugins', WT_ROOT . 'modules_v3/charts/help_text.php', WT_ROOT . 'modules_v3/ckeditor/ckeditor-4.4.1-custom', WT_ROOT . 'modules_v3/clippings/clippings_ctrl.php', WT_ROOT . 'modules_v3/clippings/help_text.php', WT_ROOT . 'modules_v3/faq/help_text.php', WT_ROOT . 'modules_v3/gedcom_favorites/db_schema', WT_ROOT . 'modules_v3/gedcom_news/db_schema', WT_ROOT . 'modules_v3/googlemap/db_schema', WT_ROOT . 'modules_v3/googlemap/help_text.php', WT_ROOT . 'modules_v3/html/help_text.php', WT_ROOT . 'modules_v3/logged_in/help_text.php', WT_ROOT . 'modules_v3/review_changes/help_text.php', WT_ROOT . 'modules_v3/todo/help_text.php', WT_ROOT . 'modules_v3/tree/class_treeview.php', WT_ROOT . 'modules_v3/user_blog/db_schema', WT_ROOT . 'modules_v3/yahrzeit/help_text.php', WT_ROOT . 'save.php', WT_ROOT . 'themes/_administration/css-1.6.2', WT_ROOT . 'themes/_administration/templates', WT_ROOT . 'themes/_administration/header.php', WT_ROOT . 'themes/_administration/footer.php', WT_ROOT . 'themes/clouds/css-1.6.2', WT_ROOT . 'themes/clouds/templates', WT_ROOT . 'themes/clouds/header.php', WT_ROOT . 'themes/clouds/footer.php', WT_ROOT . 'themes/colors/css-1.6.2', WT_ROOT . 'themes/colors/templates', WT_ROOT . 'themes/colors/header.php', WT_ROOT . 'themes/colors/footer.php', WT_ROOT . 'themes/fab/css-1.6.2', WT_ROOT . 'themes/fab/templates', WT_ROOT . 'themes/fab/header.php', WT_ROOT . 'themes/fab/footer.php', WT_ROOT . 'themes/minimal/css-1.6.2', WT_ROOT . 'themes/minimal/templates', WT_ROOT . 'themes/minimal/header.php', WT_ROOT . 'themes/minimal/footer.php', WT_ROOT . 'themes/webtrees/css-1.6.2', WT_ROOT . 'themes/webtrees/templates', WT_ROOT . 'themes/webtrees/header.php', WT_ROOT . 'themes/webtrees/footer.php', WT_ROOT . 'themes/xenea/css-1.6.2', WT_ROOT . 'themes/xenea/templates', WT_ROOT . 'themes/xenea/header.php', WT_ROOT . 'themes/xenea/footer.php', WT_ROOT . 'assets/js-1.7.0', WT_ROOT . 'packages/bootstrap-3.3.4', WT_ROOT . 'packages/bootstrap-datetimepicker-4.0.0', WT_ROOT . 'packages/ckeditor-4.4.7-custom', WT_ROOT . 'packages/font-awesome-4.3.0', WT_ROOT . 'packages/jquery-1.11.2', WT_ROOT . 'packages/jquery-2.1.3', WT_ROOT . 'packages/moment-2.10.3', WT_ROOT . 'includes/php_53_compatibility.php', WT_ROOT . 'modules_v3/GEDFact_assistant/census/date.js', WT_ROOT . 'modules_v3/GEDFact_assistant/census/dynamicoptionlist.js', WT_ROOT . 'packages/jquery-cookie-1.4.1/jquery.cookie.js');
// Delete old files (if we can).
$files_to_delete = array();
foreach ($old_files as $file) {
    if (file_exists($file) && !File::delete($file)) {
        $files_to_delete[] = $file;
    }
}
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Control panel') . ' — ' . I18N::translate('Dashboard'))->pageHeader();
// Check for updates
$latest_version_txt = Functions::fetchLatestVersion();
if (preg_match('/^[0-9.]+\\|[0-9.]+\\|/', $latest_version_txt)) {
    list($latest_version) = explode('|', $latest_version_txt);
} else {
    // Cannot determine the latest version
    $latest_version = '';
}
$update_available = Auth::isAdmin() && $latest_version && version_compare(WT_VERSION, $latest_version) < 0;
// Total number of users
$total_users = User::count();
// Administrators
$administrators = Database::prepare("SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_setting` USING (user_id) WHERE setting_name='canadmin' AND setting_value='1'")->fetchAll();
// Managers
$managers = Database::prepare("SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_gedcom_setting` USING (user_id)" . " WHERE setting_name = 'canedit' AND setting_value='admin'" . " GROUP BY user_id, real_name" . " ORDER BY real_name")->fetchAll();
Exemplo n.º 14
0
    /**
     * The admin view - list, create, edit, delete stories.
     */
    private function config()
    {
        global $WT_TREE;
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle($this->getTitle())->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
				jQuery("#story_table").dataTable({
					' . I18N::datatablesI18N() . ',
					autoWidth: false,
					paging: true,
					pagingType: "full_numbers",
					lengthChange: true,
					filter: true,
					info: true,
					sorting: [[0,"asc"]],
					columns: [
						/* 0-name */ null,
						/* 1-NAME */ null,
						/* 2-NAME */ { sortable:false },
						/* 3-NAME */ { sortable:false }
					]
				});
			');
        $stories = Database::prepare("SELECT block_id, xref" . " FROM `##block` b" . " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref")->execute(array($this->getName(), $WT_TREE->getTreeId()))->fetchAll();
        ?>
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>

		<h1><?php 
        echo $controller->getPageTitle();
        ?>
</h1>

		<form class="form form-inline">
			<label for="ged" class="sr-only">
				<?php 
        echo I18N::translate('Family tree');
        ?>
			</label>
			<input type="hidden" name="mod" value="<?php 
        echo $this->getName();
        ?>
">
			<input type="hidden" name="mod_action" value="admin_config">
			<?php 
        echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
        ?>
			<input type="submit" class="btn btn-primary" value="<?php 
        echo I18N::translate('show');
        ?>
">
		</form>

		<p>
			<a href="module.php?mod=<?php 
        echo $this->getName();
        ?>
&amp;mod_action=admin_edit" class="btn btn-default">
				<i class="fa fa-plus"></i>
				<?php 
        echo I18N::translate('Add a story');
        ?>
			</a>
		</p>

		<table class="table table-bordered table-condensed">
			<thead>
				<tr>
					<th><?php 
        echo I18N::translate('Story title');
        ?>
</th>
					<th><?php 
        echo I18N::translate('Individual');
        ?>
</th>
					<th><?php 
        echo I18N::translate('Edit');
        ?>
</th>
					<th><?php 
        echo I18N::translate('Delete');
        ?>
</th>
				</tr>
			</thead>
			<tbody>
				<?php 
        foreach ($stories as $story) {
            ?>
				<tr>
					<td>
						<?php 
            echo Filter::escapeHtml($this->getBlockSetting($story->block_id, 'title'));
            ?>
					</td>
					<td>
						<?php 
            $individual = Individual::getInstance($story->xref, $WT_TREE);
            ?>
						<?php 
            if ($individual) {
                ?>
						<a href="<?php 
                echo $individual->getHtmlUrl();
                ?>
#stories">
							<?php 
                echo $individual->getFullName();
                ?>
						</a>
						<?php 
            } else {
                ?>
							<?php 
                echo $story->xref;
                ?>
						<?php 
            }
            ?>
						</td>
						<td>
							<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_edit&amp;block_id=<?php 
            echo $story->block_id;
            ?>
">
								<i class="fa fa-pencil"></i> <?php 
            echo I18N::translate('Edit');
            ?>
							</a>
						</td>
						<td>
							<a
								href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_delete&amp;block_id=<?php 
            echo $story->block_id;
            ?>
"
								onclick="return confirm('<?php 
            echo I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeHtml($this->getBlockSetting($story->block_id, 'title')));
            ?>
');"
							>
								<i class="fa fa-trash"></i> <?php 
            echo I18N::translate('Delete');
            ?>
							</a>
					</td>
				</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
		<?php 
    }
Exemplo n.º 15
0
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Module\AbstractModule;
use Fisharebest\Webtrees\Module\ModuleBlockInterface;
use Fisharebest\Webtrees\Module\ModuleChartInterface;
use Fisharebest\Webtrees\Module\ModuleConfigInterface;
use Fisharebest\Webtrees\Module\ModuleMenuInterface;
use Fisharebest\Webtrees\Module\ModuleReportInterface;
use Fisharebest\Webtrees\Module\ModuleSidebarInterface;
use Fisharebest\Webtrees\Module\ModuleTabInterface;
use Fisharebest\Webtrees\Module\ModuleThemeInterface;
define('WT_SCRIPT_NAME', 'admin_modules.php');
require 'includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Module administration'));
$modules = Module::getInstalledModules('disabled');
$module_status = Database::prepare("SELECT module_name, status FROM `##module`")->fetchAssoc();
uasort($modules, function (AbstractModule $x, AbstractModule $y) {
    return I18N::strcasecmp($x->getTitle(), $y->getTitle());
});
if (Filter::post('action') === 'update_mods' && Filter::checkCsrf()) {
    foreach ($modules as $module) {
        $new_status = Filter::post('status-' . $module->getName(), '[01]');
        if ($new_status !== null) {
            $new_status = $new_status ? 'enabled' : 'disabled';
            $old_status = $module_status[$module->getName()];
            if ($new_status !== $old_status) {
                Database::prepare("UPDATE `##module` SET status=? WHERE module_name=?")->execute(array($new_status, $module->getName()));
                if ($new_status === 'disabled') {
                    FlashMessages::addMessage(I18N::translate('The module “%s” has been disabled.', $module->getTitle()), 'success');
Exemplo n.º 16
0
    /**
     * Edit the configuration
     */
    private function admin()
    {
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle($this->getTitle())->pageHeader();
        // Save the updated preferences
        if (Filter::post('action') == 'save') {
            foreach (Tree::getAll() as $tree) {
                $tree->setPreference('include_in_sitemap', Filter::postBool('include' . $tree->getTreeId()));
            }
            // Clear cache and force files to be regenerated
            Database::prepare("DELETE FROM `##module_setting` WHERE setting_name LIKE 'sitemap%'")->execute();
        }
        $include_any = false;
        ?>
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>
		<h1><?php 
        echo $controller->getPageTitle();
        ?>
</h1>
		<?php 
        echo '<p>', I18N::translate('Sitemaps are a way for webmasters to tell search engines about the pages on a website that are available for crawling. All major search engines support sitemaps. For more information, see <a href="http://www.sitemaps.org/">www.sitemaps.org</a>.') . '</p>', '<p>', I18N::translate('Which family trees should be included in the sitemaps'), '</p>', '<form method="post" action="module.php?mod=' . $this->getName() . '&amp;mod_action=admin">', '<input type="hidden" name="action" value="save">';
        foreach (Tree::getAll() as $tree) {
            echo '<div class="checkbox"><label><input type="checkbox" name="include', $tree->getTreeId(), '" ';
            if ($tree->getPreference('include_in_sitemap')) {
                echo 'checked';
                $include_any = true;
            }
            echo '>', $tree->getTitleHtml(), '</label></div>';
        }
        echo '<input type="submit" value="', I18N::translate('save'), '">', '</form>', '<hr>';
        if ($include_any) {
            $site_map_url1 = WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap.xml';
            $site_map_url2 = rawurlencode(WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap.xml');
            echo '<p>', I18N::translate('To tell search engines that sitemaps are available, you should add the following line to your robots.txt file.'), '</p>', '<pre>Sitemap: ', $site_map_url1, '</pre>', '<hr>', '<p>', I18N::translate('To tell search engines that sitemaps are available, you can use the following links.'), '</p>', '<ul>', '<li><a href="http://www.bing.com/webmaster/ping.aspx?siteMap=' . $site_map_url2 . '">Bing</a></li>', '<li><a href="http://www.google.com/webmasters/tools/ping?sitemap=' . $site_map_url2 . '">Google</a></li>', '</ul>';
        }
    }
Exemplo n.º 17
0
    list($latest_version, $earliest_version, $download_url) = explode('|', '||');
}
$latest_version_html = '<span dir="ltr">' . $latest_version . '</span>';
$download_url_html = '<b dir="auto"><a href="' . Filter::escapeHtml($download_url) . '">' . Filter::escapeHtml($download_url) . '</a></b>';
// Show a friendly message while the site is being upgraded
$lock_file = __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'offline.txt';
$lock_file_text = I18N::translate('This website is being upgraded. Try again in a few minutes.') . PHP_EOL . FunctionsDate::formatTimestamp(WT_TIMESTAMP) . I18N::translate('UTC');
// Success/failure indicators
$icon_success = '<i class="icon-yes"></i>';
$icon_failure = '<i class="icon-failure"></i>';
// Need confirmation for various actions
$continue = Filter::post('continue', '1') && Filter::checkCsrf();
$modules_action = Filter::post('modules', 'ignore|disable');
$themes_action = Filter::post('themes', 'ignore|disable');
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Upgrade wizard'))->pageHeader();
echo '<h1>', $controller->getPageTitle(), '</h1>';
if ($latest_version == '') {
    echo '<p>', I18N::translate('No upgrade information is available.'), '</p>';
    return;
}
if (version_compare(WT_VERSION, $latest_version) >= 0) {
    echo '<p>', I18N::translate('This is the latest version of webtrees. No upgrade is available.'), '</p>';
    return;
}
echo '<form method="post" action="admin_site_upgrade.php">';
echo Filter::getCsrf();
if ($continue) {
    echo '<input type="hidden" name="continue" value="1">';
    echo '<p>', I18N::translate('It can take several minutes to download and install the upgrade. Be patient.'), '</p>';
} else {
Exemplo n.º 18
0
    } else {
        return;
    }
    if (array_key_exists($module_name, $active_blocks)) {
        echo $active_blocks[$module_name]->getBlock($block_id);
    }
    return;
}
// Redirect search engines to the full URL
if (Filter::get('ctype') !== $ctype || Filter::get('ged') !== $WT_TREE->getName()) {
    header('Location: ' . WT_BASE_URL . 'index.php?ctype=' . $ctype . '&ged=' . $WT_TREE->getNameUrl());
    return;
}
$controller = new PageController();
if ($ctype === 'user') {
    $controller->restrictAccess(Auth::check());
}
$controller->setPageTitle($ctype === 'user' ? I18N::translate('My page') : $WT_TREE->getTitle())->setMetaRobots('index,follow')->pageHeader()->addInlineJavascript('jQuery.ajaxSetup({cache:true});');
if ($ctype === 'user') {
    echo '<div id="my-page">';
    echo '<h1 class="center">', 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) {
Exemplo n.º 19
0
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsDb;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
define('WT_SCRIPT_NAME', 'admin_site_merge.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Merge records') . ' — ' . $WT_TREE->getTitleHtml())->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
$gid1 = Filter::post('gid1', WT_REGEX_XREF, Filter::get('gid1', WT_REGEX_XREF));
$gid2 = Filter::post('gid2', WT_REGEX_XREF, Filter::get('gid2', WT_REGEX_XREF));
$keep1 = Filter::postArray('keep1');
$keep2 = Filter::postArray('keep2');
$rec1 = GedcomRecord::getInstance($gid1, $WT_TREE);
$rec2 = GedcomRecord::getInstance($gid2, $WT_TREE);
if ($gid1 && !$rec1) {
    FlashMessages::addMessage(I18N::translate('%1$s does not exist.', $gid1), 'danger');
}
if ($gid2 && !$rec2) {
    FlashMessages::addMessage(I18N::translate('%1$s does not exist.', $gid2), 'danger');
}
if ($rec1 && $rec2 && $rec1->getXref() === $rec2->getXref()) {
    FlashMessages::addMessage(I18N::translate('You entered the same IDs. You cannot merge the same records.'), 'danger');
}
Exemplo n.º 20
0
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_trees_renumber.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Renumber family tree') . ' — ' . $WT_TREE->getTitleHtml())->pageHeader();
// Every XREF used by this tree and also used by some other tree
$xrefs = Database::prepare("SELECT xref, type FROM (" . " SELECT i_id AS xref, 'INDI' AS type FROM `##individuals` WHERE i_file = ?" . "  UNION " . " SELECT f_id AS xref, 'FAM' AS type FROM `##families` WHERE f_file = ?" . "  UNION " . " SELECT s_id AS xref, 'SOUR' AS type FROM `##sources` WHERE s_file = ?" . "  UNION " . " SELECT m_id AS xref, 'OBJE' AS type FROM `##media` WHERE m_file = ?" . "  UNION " . " SELECT o_id AS xref, o_type AS type FROM `##other` WHERE o_file = ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS this_tree JOIN (" . " SELECT xref FROM `##change` WHERE gedcom_id <> ?" . "  UNION " . " SELECT i_id AS xref FROM `##individuals` WHERE i_file <> ?" . "  UNION " . " SELECT f_id AS xref FROM `##families` WHERE f_file <> ?" . "  UNION " . " SELECT s_id AS xref FROM `##sources` WHERE s_file <> ?" . "  UNION " . " SELECT m_id AS xref FROM `##media` WHERE m_file <> ?" . "  UNION " . " SELECT o_id AS xref FROM `##other` WHERE o_file <> ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS other_trees USING (xref)")->execute(array($WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId()))->fetchAssoc();
echo '<h1>', $controller->getPageTitle(), '</h1>';
if (Filter::get('action') === 'renumber') {
    foreach ($xrefs as $old_xref => $type) {
        Database::beginTransaction();
        Database::exec("LOCK TABLE `##individuals` WRITE," . " `##families` WRITE," . " `##sources` WRITE," . " `##media` WRITE," . " `##other` WRITE," . " `##name` WRITE," . " `##placelinks` WRITE," . " `##change` WRITE," . " `##next_id` WRITE," . " `##dates` WRITE," . " `##default_resn` WRITE," . " `##hit_counter` WRITE," . " `##link` WRITE," . " `##user_gedcom_setting` WRITE");
        $new_xref = $WT_TREE->getNewXref($type);
        switch ($type) {
            case 'INDI':
                Database::prepare("UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?")->execute(array($new_xref, "0 @{$old_xref}@ INDI\n", "0 @{$new_xref}@ INDI\n", $old_xref, $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " HUSB @{$old_xref}@", " HUSB @{$new_xref}@", $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " WIFE @{$old_xref}@", " WIFE @{$new_xref}@", $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " CHIL @{$old_xref}@", " CHIL @{$new_xref}@", $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " ASSO @{$old_xref}@", " ASSO @{$new_xref}@", $WT_TREE->getTreeId()));
    /**
     * Provide a form to manage the FAQs.
     */
    private function config()
    {
        global $WT_TREE;
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Frequently asked questions'))->pageHeader();
        $faqs = Database::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 = :module_name" . " AND bs1.setting_name = 'header'" . " AND bs2.setting_name = 'faqbody'" . " AND IFNULL(gedcom_id, :tree_id_1) = :tree_id_2" . " ORDER BY block_order")->execute(array('module_name' => $this->getName(), 'tree_id_1' => $WT_TREE->getTreeId(), 'tree_id_2' => $WT_TREE->getTreeId()))->fetchAll();
        $min_block_order = Database::prepare("SELECT MIN(block_order) FROM `##block` WHERE module_name = 'faq' AND (gedcom_id = :tree_id OR gedcom_id IS NULL)")->execute(array('tree_id' => $WT_TREE->getTreeId()))->fetchOne();
        $max_block_order = Database::prepare("SELECT MAX(block_order) FROM `##block` WHERE module_name = 'faq' AND (gedcom_id = :tree_id OR gedcom_id IS NULL)")->execute(array('tree_id' => $WT_TREE->getTreeId()))->fetchOne();
        ?>
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>
		<h2><?php 
        echo $controller->getPageTitle();
        ?>
</h2>
		<p>
			<?php 
        echo I18N::translate('FAQs are lists of questions and answers, which allow you to explain the site’s rules, policies, and procedures to your visitors.  Questions are typically concerned with privacy, copyright, user-accounts, unsuitable content, requirement for source-citations, etc.');
        ?>
			<?php 
        echo I18N::translate('You may use HTML to format the answer and to add links to other websites.');
        ?>
		</p>
		<form class="form form-inline">
			<label for="ged" class="sr-only">
				<?php 
        echo I18N::translate('Family tree');
        ?>
			</label>
			<input type="hidden" name="mod" value="<?php 
        echo $this->getName();
        ?>
">
			<input type="hidden" name="mod_action" value="admin_config">
			<?php 
        echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
        ?>
			<input type="submit" class="btn btn-primary" value="<?php 
        echo I18N::translate('show');
        ?>
">
		</form>

		<p>
			<a href="module.php?mod=<?php 
        echo $this->getName();
        ?>
&amp;mod_action=admin_edit" class="btn btn-default">
				<i class="fa fa-plus"></i>
				<?php 
        echo I18N::translate('Add an FAQ item');
        ?>
			</a>
		</p>

		<?php 
        echo '<table class="table table-bordered">';
        if (empty($faqs)) {
            echo '<tr><td class="error center" colspan="5">', I18N::translate('The FAQ list is empty.'), '</td></tr></table>';
        } else {
            foreach ($faqs as $faq) {
                // NOTE: Print the position of the current item
                echo '<tr class="faq_edit_pos"><td>';
                echo I18N::translate('#%s', $faq->block_order + 1), ' ';
                if ($faq->gedcom_id === null) {
                    echo I18N::translate('All');
                } else {
                    echo $WT_TREE->getTitleHtml();
                }
                echo '</td>';
                // NOTE: Print the edit options of the current item
                echo '<td>';
                if ($faq->block_order == $min_block_order) {
                    echo '&nbsp;';
                } else {
                    echo '<a href="module.php?mod=', $this->getName(), '&amp;mod_action=admin_moveup&amp;block_id=', $faq->block_id, '"><i class="fa fa-arrow-up"></i></i> ', I18N::translate('Move up'), '</a>';
                }
                echo '</td><td>';
                if ($faq->block_order == $max_block_order) {
                    echo '&nbsp;';
                } else {
                    echo '<a href="module.php?mod=', $this->getName(), '&amp;mod_action=admin_movedown&amp;block_id=', $faq->block_id, '"><i class="fa fa-arrow-down"></i></i> ', I18N::translate('Move down'), '</a>';
                }
                echo '</td><td>';
                echo '<a href="module.php?mod=', $this->getName(), '&amp;mod_action=admin_edit&amp;block_id=', $faq->block_id, '"><i class="fa fa-pencil"></i> ', I18N::translate('Edit'), '</a>';
                echo '</td><td>';
                echo '<a href="module.php?mod=', $this->getName(), '&amp;mod_action=admin_delete&amp;block_id=', $faq->block_id, '" onclick="return confirm(\'', I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeHtml($faq->header)), '\');"><i class="fa fa-trash"></i> ', I18N::translate('Delete'), '</a>';
                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>';
        }
    }
Exemplo n.º 22
0
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use PDO;
/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
define('WT_SCRIPT_NAME', 'admin_site_change.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Changes'));
$earliest = Database::prepare("SELECT DATE(MIN(change_time)) FROM `##change`")->execute(array())->fetchOne();
$latest = Database::prepare("SELECT DATE(MAX(change_time)) FROM `##change`")->execute(array())->fetchOne();
// Filtering
$action = Filter::get('action');
$from = Filter::get('from', '\\d\\d\\d\\d-\\d\\d-\\d\\d', $earliest);
$to = Filter::get('to', '\\d\\d\\d\\d-\\d\\d-\\d\\d', $latest);
$type = Filter::get('type', 'accepted|rejected|pending');
$oldged = Filter::get('oldged');
$newged = Filter::get('newged');
$xref = Filter::get('xref', WT_REGEX_XREF);
$user = Filter::get('user');
$search = Filter::get('search');
$search = isset($search['value']) ? $search['value'] : null;
$statuses = array('' => '', 'accepted' => I18N::translate('accepted'), 'rejected' => I18N::translate('rejected'), 'pending' => I18N::translate('pending'));
if (Auth::isAdmin()) {
Exemplo n.º 23
0
 * the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_site_info.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Server information'))->pageHeader();
$variables = Database::prepare("SHOW VARIABLES")->fetchAssoc();
array_walk($variables, function (&$x) {
    $x = str_replace(',', ', ', $x);
});
ob_start();
phpinfo(INFO_ALL & ~INFO_CREDITS & ~INFO_LICENSE);
preg_match('%<body>(.*)</body>%s', ob_get_clean(), $matches);
$html = $matches[1];
?>

<ol class="breadcrumb small">
	<li><a href="admin.php"><?php 
echo I18N::translate('Control panel');
?>
</a></li>
Exemplo n.º 24
0
 private function pageHeader(PageController $controller)
 {
     $controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Fancy Treeview PDF'))->pageHeader();
 }
Exemplo n.º 25
0
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
define('WT_SCRIPT_NAME', 'admin_trees_merge.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Merge family trees'))->pageHeader();
?>
<ol class="breadcrumb small">
	<li><a href="admin.php"><?php 
echo I18N::translate('Control panel');
?>
</a></li>
	<li><a href="admin_trees_manage.php"><?php 
echo I18N::translate('Manage family trees');
?>
</a></li>
	<li class="active"><?php 
echo $controller->getPageTitle();
?>
</li>
</ol>
Exemplo n.º 26
0
use PDOException;
/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
define('WT_SCRIPT_NAME', 'admin_pgv_to_wt.php');
require './includes/session.php';
// We can only import into an empty system, so deny access if we have already created a gedcom or added users.
if ($WT_TREE || count(User::all()) > 1) {
    header('Location: ' . WT_BASE_URL);
    return;
}
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('PhpGedView to webtrees transfer wizard'));
$error = false;
$PGV_PATH = Filter::post('PGV_PATH');
// We read these variables from PhpGedView's config.php, and set them here in case any are missing.
$INDEX_DIRECTORY = '';
$DBHOST = '';
$DBNAME = '';
$TBLPREFIX = '';
$PGV_SCHEMA_VERSION = '';
$USE_REGISTRATION_MODULE = '';
$ALLOW_USER_THEMES = '';
$ALLOW_CHANGE_GEDCOM = '';
$PGV_SESSION_TIME = '';
$PGV_SMTP_ACTIVE = '';
$PGV_SMTP_HOST = '';
$PGV_SMTP_HELO = '';
Exemplo n.º 27
0
    /**
     * Places administration.
     */
    private function adminPlaces()
    {
        global $WT_TREE;
        $action = Filter::get('action');
        $parent = Filter::get('parent');
        $inactive = Filter::getBool('inactive');
        $deleteRecord = Filter::get('deleteRecord');
        if (!isset($parent)) {
            $parent = 0;
        }
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin());
        if ($action == 'ExportFile' && Auth::isAdmin()) {
            $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 '"', I18N::translate('Level'), '";"', I18N::translate('Country'), '";';
            if ($maxLevel > 0) {
                echo '"', I18N::translate('State'), '";';
            }
            if ($maxLevel > 1) {
                echo '"', I18N::translate('County'), '";';
            }
            if ($maxLevel > 2) {
                echo '"', I18N::translate('City'), '";';
            }
            if ($maxLevel > 3) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 4) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 5) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 6) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 7) {
                echo '"', I18N::translate('Place'), '";';
            }
            echo '"', I18N::translate('Longitude'), '";"', I18N::translate('Latitude'), '";';
            echo '"', I18N::translate('Zoom level'), '";"', I18N::translate('Icon'), '";', WT_EOL;
            $this->outputLevel($parent);
            exit;
        }
        $controller->setPageTitle(I18N::translate('Google Maps™'))->pageHeader();
        ?>
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>

		<ul class="nav nav-tabs nav-justified" role="tablist">
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_config" role="tab">
					<?php 
        echo I18N::translate('Google Maps™ preferences');
        ?>
				</a>
			</li>
			<li role="presentation" class="active">
				<a href="#">
					<?php 
        echo I18N::translate('Geographic data');
        ?>
				</a>
			</li>
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_placecheck">
					<?php 
        echo I18N::translate('Place check');
        ?>
				</a>
			</li>
		</ul>

		<h2><?php 
        echo I18N::translate('Geographic data');
        ?>
</h2>
		<?php 
        if ($action == 'ImportGedcom') {
            $placelist = array();
            $j = 0;
            $gedcom_records = Database::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_file=? UNION ALL SELECT f_gedcom FROM `##families` WHERE f_file=?")->execute(array($WT_TREE->getTreeId(), $WT_TREE->getTreeId()))->fetchOneColumn();
            foreach ($gedcom_records as $gedrec) {
                $i = 1;
                $placerec = Functions::getSubRecord(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 = Functions::getSubRecord(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 = Database::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++;
                            Database::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 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++;
                            Database::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 Filter::escapeHtml($escparent), '<br>';
                        } else {
                            if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') {
                                Database::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $row->pl_id));
                                echo Filter::escapeHtml($escparent), '<br>';
                            }
                        }
                    }
                }
            }
            $parent = 0;
        }
        if ($action === 'ImportFile') {
            $placefiles = $this->findFiles(WT_MODULES_DIR . 'googlemap/extra');
            sort($placefiles);
            ?>
		<form class="form-horizontal" method="post" enctype="multipart/form-data" id="importfile" name="importfile" action="module.php?mod=googlemap&amp;mod_action=admin_places&amp;action=ImportFile2">

			<!-- PLACES FILE -->
			<div class="form-group">
				<label class="control-label col-sm-4" for="placesfile">
					<?php 
            echo I18N::translate('File containing places (CSV)');
            ?>
				</label>
				<div class="col-sm-8">
					<div class="btn btn-default">
					<input id="placesfile" type="file" name="placesfile">
					</div>
				</div>
			</div>

			<!-- LOCAL FILE -->
			<?php 
            if (count($placefiles) > 0) {
                ?>
			<div class="form-group">
				<label class="control-label col-sm-4" for="localfile">
					<?php 
                echo I18N::translate('Server file containing places (CSV)');
                ?>
				</label>
				<div class="col-sm-8">
					<div class="input-group">
						<span class="input-group-addon">
							<?php 
                echo WT_MODULES_DIR . 'googlemap/extra/';
                ?>
						</span>
						<?php 
                foreach ($placefiles as $p => $placefile) {
                    unset($placefiles[$p]);
                    $p = Filter::escapeHtml($placefile);
                    if (substr($placefile, 0, 1) == "/") {
                        $placefiles[$p] = substr($placefile, 1);
                    } else {
                        $placefiles[$p] = $placefile;
                    }
                }
                echo FunctionsEdit::selectEditControl('localfile', $placefiles, '', '', 'class="form-control"');
                ?>
					</div>
				</div>
			</div>
			<?php 
            }
            ?>

			<!-- CLEAR DATABASE -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-4">
					<?php 
            echo I18N::translate('Delete all existing geographic data before importing the file.');
            ?>
				</legend>
				<div class="col-sm-8">
					<?php 
            echo FunctionsEdit::editFieldYesNo('cleardatabase', 0, 'class="radio-inline"');
            ?>
				</div>
			</fieldset>

			<!-- UPDATE ONLY -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-4">
					<?php 
            echo I18N::translate('Do not create new locations, just import coordinates for existing locations.');
            ?>
				</legend>
				<div class="col-sm-8">
					<?php 
            echo FunctionsEdit::editFieldYesNo('updateonly', 0, 'class="radio-inline"');
            ?>
				</div>
			</fieldset>

			<!-- OVERWRITE DATA -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-4">
					<?php 
            echo I18N::translate('Overwrite existing coordinates.');
            ?>
				</legend>
				<div class="col-sm-8">
					<?php 
            echo FunctionsEdit::editFieldYesNo('overwritedata', 0, 'class="radio-inline"');
            ?>
				</div>
			</fieldset>

			<!-- SAVE BUTTON -->
			<div class="form-group">
				<div class="col-sm-offset-4 col-sm-8">
					<button type="submit" class="btn btn-primary">
						<i class="fa fa-check"></i>
						<?php 
            echo I18N::translate('Continue adding');
            ?>
					</button>
				</div>
			</div>
		</form>
		<?php 
            exit;
        }
        if ($action === 'ImportFile2') {
            $country_names = array();
            $stats = new Stats($WT_TREE);
            foreach ($stats->iso3166() as $key => $value) {
                $country_names[$key] = I18N::translate($key);
            }
            if (Filter::postBool('cleardatabase')) {
                Database::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 = Database::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 (!Filter::postBool('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)) {
                                Database::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);
                                }
                                Database::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 (Filter::postBool('overwritedata') && $i + 1 == count($parent)) {
                            Database::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 {
                            // Update only if existing data is missing
                            if (!$row->pl_long && !$row->pl_lati) {
                                Database::prepare("UPDATE `##placelocation` SET pl_lati = ?, pl_long = ? WHERE pl_id = ?")->execute(array($place['lati'], $place['long'], $parent_id));
                            }
                            if (!$row->pl_icon && $place['icon']) {
                                Database::prepare("UPDATE `##placelocation` SET pl_icon = ? WHERE pl_id = ?")->execute(array($place['icon'], $parent_id));
                            }
                        }
                    }
                }
            }
            $parent = 0;
        }
        if ($action == 'DeleteRecord') {
            $exists = Database::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($deleteRecord))->fetchOne();
            if (!$exists) {
                Database::prepare("DELETE FROM `##placelocation` WHERE pl_id=?")->execute(array($deleteRecord));
            } else {
                echo '<table class="facts_table"><tr><td>', 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 I18N::translate('Remove this location?');
        ?>
');
			if (answer == true) {
				window.location = '<?php 
        echo Functions::getQueryUrl(array('action' => 'DeleteRecord'));
        ?>
&action=DeleteRecord&deleteRecord=' + placeid;
			}
		}
		</script>
		<p id="gm_breadcrumb">
			<?php 
        $where_am_i = $this->placeIdToHierarchy($parent);
        foreach (array_reverse($where_am_i, true) as $id => $place) {
            if ($id == $parent) {
                if ($place != 'Unknown') {
                    echo Filter::escapeHtml($place);
                } else {
                    echo I18N::translate('unknown');
                }
            } else {
                echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $id, '&inactive=', $inactive, '">';
                if ($place != 'Unknown') {
                    echo Filter::escapeHtml($place), '</a>';
                } else {
                    echo I18N::translate('unknown'), '</a>';
                }
            }
            echo ' - ';
        }
        ?>
			<a href="module.php?mod=googlemap&mod_action=admin_places&parent=0&inactive=', $inactive, '"><?php 
        echo I18N::translate('Top level');
        ?>
</a>
		</p>

		<form class="form-inline" name="active" method="post" action="module.php?mod=googlemap&mod_action=admin_places&parent=', $parent, '&inactive=', $inactive, '">
			<div class="checkbox">
				<label for="inactive">
				   <?php 
        echo FunctionsEdit::checkbox('inactive', $inactive, 'onclick="updateList(this.checked)"');
        ?>
				   <?php 
        echo I18N::translate('Show inactive places');
        ?>
				</label>
			</div>
			<p class="small text-muted">
				<?php 
        echo I18N::translate('By default, the list shows only those places which can be found in your family trees.  You may have details for other places, such as those imported in bulk from an external file.  Selecting this option will show all places, including ones that are not currently used.');
        ?>
				<?php 
        echo I18N::translate('If you have a large number of inactive places, it can be slow to generate the list.');
        ?>
			</p>
		</form>

		<?php 
        $placelist = $this->getPlaceListLocation($parent, $inactive);
        echo '<div class="gm_plac_edit">';
        echo '<table class="table table-bordered table-condensed table-hover"><tr>';
        echo '<th>', GedcomTag::getLabel('PLAC'), '</th>';
        echo '<th>', GedcomTag::getLabel('LATI'), '</th>';
        echo '<th>', GedcomTag::getLabel('LONG'), '</th>';
        echo '<th>', I18N::translate('Zoom level'), '</th>';
        echo '<th>', I18N::translate('Icon'), '</th>';
        echo '<th>';
        echo I18N::translate('Edit'), '</th><th>', I18N::translate('Delete'), '</th></tr>';
        if (count($placelist) == 0) {
            echo '<tr><td colspan="7">', 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 Filter::escapeHtml($place['place']), '</a></td>';
            } else {
                echo 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']) {
                echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/', $place['icon'], '" width="25" height="15">';
            } else {
                if ($place['lati'] || $place['long']) {
                    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/images/mm_20_yellow.png">';
                }
            }
            echo '</td>';
            echo '<td class="narrow"><a href="#" onclick="edit_place_location(', $place['place_id'], ');return false;" class="icon-edit" title="', I18N::translate('Edit'), '"></a></td>';
            $noRows = Database::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 I18N::translate('Remove');
                ?>
"></a></td>
		<?php 
            } else {
                ?>
				<td><i class="icon-delete-grey"></i></td>
		<?php 
            }
            ?>
			</tr>
			<?php 
        }
        ?>
		</table>
		</div>

		<hr>
		<form class="form-horizontal" action="?" onsubmit="add_place_location(this.parent_id.options[this.parent_id.selectedIndex].value); return false;">
			<div class="form-group">
				<label class="form-control-static col-sm-4" for="parent_id">
					<?php 
        echo I18N::translate('Add a new geographic location');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<?php 
        echo FunctionsEdit::selectEditControl('parent_id', $where_am_i, I18N::translate('Top level'), $parent, 'class="form-control"');
        ?>
					</div>
					<button type="submit" class="btn btn-default">
						<i class="fa fa-plus"></i>
						<?php 
        echo I18N::translate('Add');
        ?>
					</button>
				</div>
			</div>
		</form>

		<form class="form-horizontal" 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">
			<div class="form-group">
				<label class="form-control-static col-sm-4" for="ged">
					<?php 
        echo I18N::translate('Import all places from a family tree');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<?php 
        echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
        ?>
					</div>
					<button type="submit" class="btn btn-default">
						<i class="fa fa-upload"></i>
						<?php 
        echo I18N::translate('Import');
        ?>
					</button>
				</div>
			</div>
		</form>

		<form class="form-horizontal" 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">
			<div class="form-group">
				<label class="form-control-static col-sm-4">
					<?php 
        echo I18N::translate('Upload geographic data');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<button type="submit" class="btn btn-default">
							<i class="fa fa-upload"></i>
							<?php 
        echo I18N::translate('Upload');
        ?>
						</button>
					</div>
				</div>
			</div>
		</form>

		<form class="form-horizontal" 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">
			<div class="form-group">
				<label class="form-control-static col-sm-4">
					<?php 
        echo I18N::translate('Download geographic data');
        ?>
				</label>
				<div class="col-sm-8">
					<div class="col-sm-6">
						<?php 
        echo FunctionsEdit::selectEditControl('parent', $where_am_i, I18N::translate('All'), $WT_TREE->getTreeId(), 'class="form-control"');
        ?>
					</div>
					<button type="submit" class="btn btn-default">
						<i class="fa fa-download"></i>
						<?php 
        echo I18N::translate('Download');
        ?>
					</button>
				</div>
			</div>
		</form>
		<?php 
    }
Exemplo n.º 28
0
 * (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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
use Michelf\MarkdownExtra;
define('WT_SCRIPT_NAME', 'admin_site_readme.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('README documentation'))->pageHeader();
// The readme file contains code-quality badges before the first header
$readme = file_get_contents('README.md');
$readme = preg_replace('/.*(?=# webtrees)/s', '', $readme);
?>
<ol class="breadcrumb small">
	<li><a href="admin.php"><?php 
echo I18N::translate('Control panel');
?>
</a></li>
	<li class="active"><?php 
echo $controller->getPageTitle();
?>
</li>
</ol>
Exemplo n.º 29
0
    private function config()
    {
        global $WT_TREE;
        $controller = new webtrees\Controller\PageController();
        $controller->restrictAccess(webtrees\Auth::isManager($WT_TREE))->setPageTitle($this->getTitle())->pageHeader();
        $args = array();
        $args['module_name'] = $this->getName();
        $args['tree_id'] = $WT_TREE->getTreeId();
        $items = webtrees\Database::prepare("SELECT block_id, block_order, gedcom_id, bs1.setting_value AS menu_title, bs2.setting_value AS menu_address" . " FROM `##block` b" . " JOIN `##block_setting` bs1 USING (block_id)" . " JOIN `##block_setting` bs2 USING (block_id)" . " WHERE module_name = :module_name" . " AND bs1.setting_name = 'menu_title'" . " AND bs2.setting_name = 'menu_address'" . " AND IFNULL(gedcom_id, :tree_id) = :tree_id" . " ORDER BY block_order")->execute($args)->fetchAll();
        unset($args['tree_id']);
        $min_block_order = webtrees\Database::prepare("SELECT MIN(block_order) FROM `##block` WHERE module_name = :module_name")->execute($args)->fetchOne();
        $max_block_order = webtrees\Database::prepare("SELECT MAX(block_order) FROM `##block` WHERE module_name = :module_name")->execute($args)->fetchOne();
        ?>
		
		<style>
			.text-left-not-xs, .text-left-not-sm, .text-left-not-md, .text-left-not-lg {
				text-align: left;
			}
			.text-center-not-xs, .text-center-not-sm, .text-center-not-md, .text-center-not-lg {
				text-align: center;
			}
			.text-right-not-xs, .text-right-not-sm, .text-right-not-md, .text-right-not-lg {
				text-align: right;
			}
			.text-justify-not-xs, .text-justify-not-sm, .text-justify-not-md, .text-justify-not-lg {
				text-align: justify;
			}

			@media (max-width: 767px) {
				.text-left-not-xs, .text-center-not-xs, .text-right-not-xs, .text-justify-not-xs {
					text-align: inherit;
				}
				.text-left-xs {
					text-align: left;
				}
				.text-center-xs {
					text-align: center;
				}
				.text-right-xs {
					text-align: right;
				}
				.text-justify-xs {
					text-align: justify;
				}
			}
			@media (min-width: 768px) and (max-width: 991px) {
				.text-left-not-sm, .text-center-not-sm, .text-right-not-sm, .text-justify-not-sm {
					text-align: inherit;
				}
				.text-left-sm {
					text-align: left;
				}
				.text-center-sm {
					text-align: center;
				}
				.text-right-sm {
					text-align: right;
				}
				.text-justify-sm {
					text-align: justify;
				}
			}
			@media (min-width: 992px) and (max-width: 1199px) {
				.text-left-not-md, .text-center-not-md, .text-right-not-md, .text-justify-not-md {
					text-align: inherit;
				}
				.text-left-md {
					text-align: left;
				}
				.text-center-md {
					text-align: center;
				}
				.text-right-md {
					text-align: right;
				}
				.text-justify-md {
					text-align: justify;
				}
			}
			@media (min-width: 1200px) {
				.text-left-not-lg, .text-center-not-lg, .text-right-not-lg, .text-justify-not-lg {
					text-align: inherit;
				}
				.text-left-lg {
					text-align: left;
				}
				.text-center-lg {
					text-align: center;
				}
				.text-right-lg {
					text-align: right;
				}
				.text-justify-lg {
					text-align: justify;
				}
			}
		</style>
		
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo webtrees\I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo webtrees\I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>
		
		<div class="row">
			<div class="col-sm-4 col-xs-12">
				<form class="form">
					<label for="ged" class="sr-only">
						<?php 
        echo webtrees\I18N::translate('Family tree');
        ?>
					</label>
					<input type="hidden" name="mod" value="<?php 
        echo $this->getName();
        ?>
">
					<input type="hidden" name="mod_action" value="admin_config">
					<div class="col-sm-9 col-xs-9" style="padding:0;">
						<?php 
        echo webtrees\Functions\FunctionsEdit::selectEditControl('ged', webtrees\Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
        ?>
					</div>
					<div class="col-sm-3" style="padding:0;">
						<input type="submit" class="btn btn-primary" value="<?php 
        echo webtrees\I18N::translate('show');
        ?>
">
					</div>
				</form>
			</div>
			<span class="visible-xs hidden-sm hidden-md hidden-lg" style="display:block;"></br></br></span>
			<div class="col-sm-4 text-center text-left-xs col-xs-12">
				<p>
					<a href="module.php?mod=<?php 
        echo $this->getName();
        ?>
&amp;mod_action=admin_edit" class="btn btn-primary">
						<i class="fa fa-plus"></i>
						<?php 
        echo webtrees\I18N::translate('Add Menu');
        ?>
					</a>
				</p>
			</div>
			<div class="col-sm-4 text-right text-left-xs col-xs-12">		
				<?php 
        // TODO: Move to internal item/page
        if (file_exists(WT_MODULES_DIR . $this->getName() . '/readme.html')) {
            ?>
					<a href="<?php 
            echo WT_MODULES_DIR . $this->getName();
            ?>
/readme.html" class="btn btn-info">
						<i class="fa fa-newspaper-o"></i>
						<?php 
            echo webtrees\I18N::translate('ReadMe');
            ?>
					</a>
				<?php 
        }
        ?>
			</div>
		</div>
		
		<table class="table table-bordered table-condensed">
			<thead>
				<tr>
					<th class="col-sm-2"><?php 
        echo webtrees\I18N::translate('Position');
        ?>
</th>
					<th class="col-sm-4"><?php 
        echo webtrees\I18N::translate('Menu title');
        ?>
</th>
					<th class="col-sm-4"><?php 
        echo webtrees\I18N::translate('Menu address');
        ?>
</th>
					<th class="col-sm-2" colspan=4><?php 
        echo webtrees\I18N::translate('Controls');
        ?>
</th>
				</tr>
			</thead>
			<tbody>
				<?php 
        foreach ($items as $item) {
            ?>
				<tr>
					<td>
						<?php 
            echo $item->block_order, ', ';
            if ($item->gedcom_id == null) {
                echo webtrees\I18N::translate('All');
            } else {
                echo webtrees\Tree::findById($item->gedcom_id)->getTitleHtml();
            }
            ?>
					</td>
					<td>
						<?php 
            echo webtrees\Filter::escapeHtml(webtrees\I18N::translate($item->menu_title));
            ?>
					</td>
					<td>
						<?php 
            echo webtrees\Filter::escapeHtml(substr(webtrees\I18N::translate($item->menu_address), 0, 1) == '<' ? webtrees\I18N::translate($item->menu_address) : nl2br(webtrees\I18N::translate($item->menu_address)));
            ?>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_edit&amp;block_id=<?php 
            echo $item->block_id;
            ?>
">
							<div class="icon-edit">&nbsp;</div>
						</a>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_moveup&amp;block_id=<?php 
            echo $item->block_id;
            ?>
">
							<?php 
            if ($item->block_order == $min_block_order) {
                echo '&nbsp;';
            } else {
                echo '<div class="icon-uarrow">&nbsp;</div>';
            }
            ?>
						</a>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_movedown&amp;block_id=<?php 
            echo $item->block_id;
            ?>
">
							<?php 
            if ($item->block_order == $max_block_order) {
                echo '&nbsp;';
            } else {
                echo '<div class="icon-darrow">&nbsp;</div>';
            }
            ?>
						</a>
					</td>
					<td class="text-center">
						<a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_delete&amp;block_id=<?php 
            echo $item->block_id;
            ?>
"
							onclick="return confirm('<?php 
            echo webtrees\I18N::translate('Are you sure you want to delete this menu?');
            ?>
');">
							<div class="icon-delete">&nbsp;</div>
						</a>
					</td>
				</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
<?php 
    }
Exemplo n.º 30
0
 * the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_users_bulk.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Send broadcast messages'))->pageHeader();
?>

<ol class="breadcrumb small">
	<li><a href="admin.php"><?php 
echo I18N::translate('Control panel');
?>
</a></li>
	<li><a href="admin_users.php"><?php 
echo I18N::translate('User administration');
?>
</a></li>
	<li class="active"><?php 
echo $controller->getPageTitle();
?>
</li>