header('Content-length: ' . filesize($temp_dir . $zip_file));
            readfile($temp_dir . $zip_file);
            File::delete($temp_dir);
        }
    } else {
        header('Content-Type: text/plain; charset=UTF-8');
        header('Content-Disposition: attachment; filename="' . $download_filename . '"');
        // Stream the GEDCOM file straight to the browser.
        // We could open "php://compress.zlib" to create a .gz file or "php://compress.bzip2" to create a .bz2 file
        $stream = fopen('php://output', 'w');
        FunctionsExport::exportGedcom($WT_TREE, $stream, $exportOptions);
        fclose($stream);
    }
    return;
}
$controller->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>
示例#2
0
        return;
    case 'edit':
        $user_id = Filter::getInteger('user_id');
        if ($user_id === 0) {
            $controller->setPageTitle(I18N::translate('Add a user'));
            $tmp = new \stdClass();
            $tmp->user_id = '';
            $tmp->user_name = '';
            $tmp->real_name = '';
            $tmp->email = '';
            $user = new User($tmp);
        } else {
            $controller->setPageTitle(I18N::translate('Edit the user'));
            $user = User::find($user_id);
        }
        $controller->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();')->addInlineJavascript('
			jQuery(".relpath").change(function() {
				var fieldIDx = jQuery(this).attr("id");
				var idNum = fieldIDx.replace("RELATIONSHIP_PATH_LENGTH","");
				var newIDx = "gedcomid"+idNum;
				if (jQuery("#"+newIDx).val() === "" && jQuery("#".fieldIDx).val() !== "0") {
					alert("' . I18N::translate('You must specify an individual record before you can restrict the user to their immediate family.') . '");
					jQuery(this).val("0");
				}
			});
			function regex_quote(str) {
				return str.replace(/[\\\\.?+*()[\\](){}|]/g, "\\\\$&");
			}
		');
        ?>
	<ol class="breadcrumb small">
示例#3
0
    private function edit()
    {
        global $WT_TREE;
        if (webtrees\Filter::postBool('save') && webtrees\Filter::checkCsrf()) {
            $block_id = webtrees\Filter::post('block_id');
            if ($block_id) {
                webtrees\Database::prepare("UPDATE `##block` SET gedcom_id=NULLIF(?, ''), block_order=? WHERE block_id=?")->execute(array(webtrees\Filter::post('gedcom_id'), (int) webtrees\Filter::post('block_order'), $block_id));
            } else {
                webtrees\Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(?, ''), ?, ?)")->execute(array(webtrees\Filter::post('gedcom_id'), $this->getName(), (int) webtrees\Filter::post('block_order')));
                $block_id = webtrees\Database::getInstance()->lastInsertId();
            }
            $this->setBlockSetting($block_id, 'menu_title', webtrees\Filter::post('menu_title'));
            $this->setBlockSetting($block_id, 'menu_address', webtrees\Filter::post('menu_address'));
            $this->setBlockSetting($block_id, 'menu_access', webtrees\Filter::post('menu_access'));
            $languages = array();
            foreach (webtrees\I18N::installedLocales() as $locale) {
                if (webtrees\Filter::postBool('lang_' . $locale->languageTag())) {
                    $languages[] = $locale->languageTag();
                }
            }
            $this->setBlockSetting($block_id, 'languages', implode(',', $languages));
            $this->config();
        } else {
            $block_id = webtrees\Filter::get('block_id');
            $controller = new webtrees\Controller\PageController();
            $controller->restrictAccess(webtrees\Auth::isEditor($WT_TREE));
            if ($block_id) {
                $controller->setPageTitle(webtrees\I18N::translate('Edit menu'));
                $menu_title = $this->getBlockSetting($block_id, 'menu_title');
                $menu_address = $this->getBlockSetting($block_id, 'menu_address');
                $menu_access = $this->getBlockSetting($block_id, 'menu_access');
                $block_order = webtrees\Database::prepare("SELECT block_order FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
                $gedcom_id = webtrees\Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
            } else {
                $controller->setPageTitle(webtrees\I18N::translate('Add menu'));
                $menu_access = 1;
                $menu_title = '';
                $menu_address = '';
                $block_order = webtrees\Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name=?")->execute(array($this->getName()))->fetchOne();
                $gedcom_id = $WT_TREE->getTreeId();
            }
            $controller->pageHeader();
            ?>
			
			<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><a href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&mod_action=admin_config"><?php 
            echo webtrees\I18N::translate($this->getTitle());
            ?>
</a></li>
				<li class="active"><?php 
            echo $controller->getPageTitle();
            ?>
</li>
			</ol>
			
			<form class="form-horizontal" method="POST" action="#" name="menu" id="menuForm">
				<?php 
            echo webtrees\Filter::getCsrf();
            ?>
				<input type="hidden" name="save" value="1">
				<input type="hidden" name="block_id" value="<?php 
            echo $block_id;
            ?>
">
				<h3><?php 
            echo webtrees\I18N::translate('General');
            ?>
</h3>
				
				<div class="form-group">
					<label class="control-label col-sm-3" for="menu_title">
						<?php 
            echo webtrees\I18N::translate('Title');
            ?>
					</label>
					<div class="col-sm-9">
						<input
							class="form-control"
							id="menu_title"
							size="90"
							name="menu_title"
							required
							type="text"
							value="<?php 
            echo webtrees\Filter::escapeHtml($menu_title);
            ?>
"
							>
					</div>
					<span class="help-block col-sm-9 col-sm-offset-3 small text-muted">
						<?php 
            echo webtrees\I18N::translate('Add your menu title here');
            ?>
					</span>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-3" for="menu_address">
						<?php 
            echo webtrees\I18N::translate('Menu address');
            ?>
					</label>
					<div class="col-sm-9">
						<input
							class="form-control"
							id="menu_address"
							size="90"
							name="menu_address"
							required
							type="text"
							value="<?php 
            echo webtrees\Filter::escapeHtml($menu_address);
            ?>
"
							>
					</div>
					<span class="help-block col-sm-9 col-sm-offset-3 small text-muted">
						<?php 
            echo webtrees\I18N::translate('Add your menu address here');
            ?>
					</span>
				</div>
				
				<h3><?php 
            echo webtrees\I18N::translate('Languages');
            ?>
</h3>
				
				<div class="form-group">
					<label class="control-label col-sm-3" for="lang_*">
						<?php 
            echo webtrees\I18N::translate('Show this menu for which languages?');
            ?>
					</label>
					<div class="col-sm-9">
						<?php 
            $accepted_languages = explode(',', $this->getBlockSetting($block_id, 'languages'));
            foreach (webtrees\I18N::installedLocales() as $locale) {
                ?>
								<div class="checkbox">
									<label title="<?php 
                echo $locale->languageTag();
                ?>
">
										<input type="checkbox" name="lang_<?php 
                echo $locale->languageTag();
                ?>
" <?php 
                echo in_array($locale->languageTag(), $accepted_languages) ? 'checked' : '';
                ?>
 ><?php 
                echo $locale->endonym();
                ?>
									</label>
								</div>
						<?php 
            }
            ?>
					</div>
				</div>
				
				<h3><?php 
            echo webtrees\I18N::translate('Visibility and Access');
            ?>
</h3>
				
				<div class="form-group">
					<label class="control-label col-sm-3" for="block_order">
						<?php 
            echo webtrees\I18N::translate('Menu position');
            ?>
					</label>
					<div class="col-sm-9">
						<input
							class="form-control"
							id="position"
							name="block_order"
							size="3"
							required
							type="number"
							value="<?php 
            echo webtrees\Filter::escapeHtml($block_order);
            ?>
"
						>
					</div>
					<span class="help-block col-sm-9 col-sm-offset-3 small text-muted">
						<?php 
            echo webtrees\I18N::translate('This field controls the order in which the menu items are displayed.'), '<br><br>', webtrees\I18N::translate('You do not have to enter the numbers sequentially. If you leave holes in the numbering scheme, you can insert other menu items later. For example, if you use the numbers 1, 6, 11, 16, you can later insert menu items with the missing sequence numbers. Negative numbers and zero are allowed, and can be used to insert menu items in front of the first one.'), '<br><br>', webtrees\I18N::translate('When more than one menu item has the same position number, only one of these menu items will be visible.');
            ?>
					</span>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-3" for="block_order">
						<?php 
            echo webtrees\I18N::translate('Menu visibility');
            ?>
					</label>
					<div class="col-sm-9">
						<?php 
            echo webtrees\Functions\FunctionsEdit::selectEditControl('gedcom_id', webtrees\Tree::getIdList(), webtrees\I18N::translate('All'), $WT_TREE->getTreeId(), 'class="form-control"');
            ?>
					</div>
					<span class="help-block col-sm-9 col-sm-offset-3 small text-muted">
						<?php 
            echo webtrees\I18N::translate('You can determine whether this menu item will be visible regardless of family tree, or whether it will be visible only to the current family tree.');
            ?>
					</span>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-3" for="menu_access">
						<?php 
            echo webtrees\I18N::translate('Access level');
            ?>
					</label>
					<div class="col-sm-9">
						<?php 
            echo webtrees\Functions\FunctionsEdit::editFieldAccessLevel('menu_access', $menu_access, 'class="form-control"');
            ?>
					</div>
				</div>
				
				<div class="row col-sm-9 col-sm-offset-3">
					<button class="btn btn-primary" type="submit">
						<i class="fa fa-check"></i>
						<?php 
            echo webtrees\I18N::translate('save');
            ?>
					</button>
					<button class="btn" type="button" onclick="window.location='<?php 
            echo $this->getConfigLink();
            ?>
';">
						<i class="fa fa-close"></i>
						<?php 
            echo webtrees\I18N::translate('cancel');
            ?>
					</button>
				</div>
			</form>
<?php 
        }
    }
示例#4
0
            $datum[2] = I18N::translate($datum[2]);
            $datum[3] = '<a href="gedrecord.php?pid=' . $datum[3] . '&ged=' . $datum[7] . '">' . $datum[3] . '</a>';
            $datum[4] = '<div class="gedcom-data" dir="ltr">' . Filter::escapeHtml($datum[4]) . '</div>';
            $datum[5] = '<div class="gedcom-data" dir="ltr">' . Filter::escapeHtml($datum[5]) . '</div>';
            $datum[6] = Filter::escapeHtml($datum[6]);
            $datum[7] = Filter::escapeHtml($datum[7]);
        }
        // Total filtered/unfiltered rows
        $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
        $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne();
        header('Content-type: application/json');
        // See http://www.datatables.net/usage/server-side
        echo json_encode(array('draw' => Filter::getInteger('draw'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data));
        return;
}
$controller->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addExternalJavascript(WT_MOMENT_JS_URL)->addExternalJavascript(WT_BOOTSTRAP_DATETIMEPICKER_JS_URL)->addInlineJavascript('
		jQuery(".table-site-changes").dataTable( {
			processing: true,
			serverSide: true,
			ajax: "' . WT_BASE_URL . WT_SCRIPT_NAME . '?action=load_json&from=' . $from . '&to=' . $to . '&type=' . $type . '&oldged=' . rawurlencode($oldged) . '&newged=' . rawurlencode($newged) . '&xref=' . rawurlencode($xref) . '&user='******'&gedc=' . rawurlencode($gedc) . '",
			' . I18N::datatablesI18N(array(10, 20, 50, 100, 500, 1000, -1)) . ',
			sorting: [[ 0, "desc" ]],
			pageLength: ' . Auth::user()->getPreference('admin_site_change_page_size', 10) . ',
			columns: [
			/* change_id   */ { visible: false },
			/* Timestamp   */ { sort: 0 },
			/* Status      */ { },
			/* Record      */ { },
			/* Old data    */ { sortable: false },
			/* New data    */ { sortable: false },
			/* User        */ { },
示例#5
0
    /**
     * A form to edit the module configuration.
     */
    private function config()
    {
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Google Maps™'));
        if (Filter::post('action') === 'update') {
            $this->setSetting('GM_MAP_TYPE', Filter::post('GM_MAP_TYPE'));
            $this->setSetting('GM_USE_STREETVIEW', Filter::post('GM_USE_STREETVIEW'));
            $this->setSetting('GM_MIN_ZOOM', Filter::post('GM_MIN_ZOOM'));
            $this->setSetting('GM_MAX_ZOOM', Filter::post('GM_MAX_ZOOM'));
            $this->setSetting('GM_XSIZE', Filter::post('GM_XSIZE'));
            $this->setSetting('GM_YSIZE', Filter::post('GM_YSIZE'));
            $this->setSetting('GM_PRECISION_0', Filter::post('GM_PRECISION_0'));
            $this->setSetting('GM_PRECISION_1', Filter::post('GM_PRECISION_1'));
            $this->setSetting('GM_PRECISION_2', Filter::post('GM_PRECISION_2'));
            $this->setSetting('GM_PRECISION_3', Filter::post('GM_PRECISION_3'));
            $this->setSetting('GM_PRECISION_4', Filter::post('GM_PRECISION_4'));
            $this->setSetting('GM_PRECISION_5', Filter::post('GM_PRECISION_5'));
            $this->setSetting('GM_COORD', Filter::post('GM_COORD'));
            $this->setSetting('GM_PLACE_HIERARCHY', Filter::post('GM_PLACE_HIERARCHY'));
            $this->setSetting('GM_PH_XSIZE', Filter::post('GM_PH_XSIZE'));
            $this->setSetting('GM_PH_YSIZE', Filter::post('GM_PH_YSIZE'));
            $this->setSetting('GM_PH_MARKER', Filter::post('GM_PH_MARKER'));
            $this->setSetting('GM_PREFIX_1', Filter::post('GM_PREFIX_1'));
            $this->setSetting('GM_PREFIX_2', Filter::post('GM_PREFIX_2'));
            $this->setSetting('GM_PREFIX_3', Filter::post('GM_PREFIX_3'));
            $this->setSetting('GM_PREFIX_4', Filter::post('GM_PREFIX_4'));
            $this->setSetting('GM_PREFIX_5', Filter::post('GM_PREFIX_5'));
            $this->setSetting('GM_PREFIX_6', Filter::post('GM_PREFIX_6'));
            $this->setSetting('GM_PREFIX_7', Filter::post('GM_PREFIX_7'));
            $this->setSetting('GM_PREFIX_8', Filter::post('GM_PREFIX_8'));
            $this->setSetting('GM_PREFIX_9', Filter::post('GM_PREFIX_9'));
            $this->setSetting('GM_POSTFIX_1', Filter::post('GM_POSTFIX_1'));
            $this->setSetting('GM_POSTFIX_2', Filter::post('GM_POSTFIX_2'));
            $this->setSetting('GM_POSTFIX_3', Filter::post('GM_POSTFIX_3'));
            $this->setSetting('GM_POSTFIX_4', Filter::post('GM_POSTFIX_4'));
            $this->setSetting('GM_POSTFIX_5', Filter::post('GM_POSTFIX_5'));
            $this->setSetting('GM_POSTFIX_6', Filter::post('GM_POSTFIX_6'));
            $this->setSetting('GM_POSTFIX_7', Filter::post('GM_POSTFIX_7'));
            $this->setSetting('GM_POSTFIX_8', Filter::post('GM_POSTFIX_8'));
            $this->setSetting('GM_POSTFIX_9', Filter::post('GM_POSTFIX_9'));
            FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->getName()), 'success');
            header('Location: ' . WT_BASE_URL . 'module.php?mod=googlemap&mod_action=admin_config');
            return;
        }
        $controller->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" class="active">
				<a href="#" role="tab">
					<?php 
        echo I18N::translate('Google Maps™ preferences');
        ?>
				</a>
			</li>
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_places">
					<?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('Google Maps™ preferences');
        ?>
</h2>

		<form class="form-horizontal" method="post" name="configform" action="module.php?mod=googlemap&mod_action=admin_config">
			<input type="hidden" name="action" value="update">
			<h3><?php 
        echo I18N::translate('Basic');
        ?>
</h3>

			<!-- GM_MAP_TYPE -->
			<div class="form-group">
				<label class="control-label col-sm-3" for="GM_MAP_TYPE">
					<?php 
        echo I18N::translate('Default map type');
        ?>
				</label>
				<div class="col-sm-9">
					<?php 
        $options = array('ROADMAP' => I18N::translate('Map'), 'SATELLITE' => I18N::translate('Satellite'), 'HYBRID' => I18N::translate('Hybrid'), 'TERRAIN' => I18N::translate('Terrain'));
        echo FunctionsEdit::selectEditControl('GM_MAP_TYPE', $options, null, $this->getSetting('GM_MAP_TYPE'), 'class="form-control"');
        ?>
				</div>
			</div>

			<!-- GM_USE_STREETVIEW -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Google Street View™');
        ?>
				</legend>
				<div class="col-sm-9">
					<?php 
        echo FunctionsEdit::radioButtons('GM_USE_STREETVIEW', array(false => I18N::translate('hide'), true => I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW'), 'class="radio-inline"');
        ?>
				</div>
			</fieldset>

			<!-- GM_XSIZE / GM_YSIZE -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Size of map (in pixels)');
        ?>
				</legend>
				<div class="col-sm-9">
					<div class="row">
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon" for="GM_XSIZE"><?php 
        echo I18N::translate('Width');
        ?>
</label>
								<input id="GM_XSIZE" class="form-control" type="text" name="GM_XSIZE" value="<?php 
        echo $this->getSetting('GM_XSIZE');
        ?>
">
							</div>
						</div>
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon" for="GM_YSIZE"><?php 
        echo I18N::translate('Height');
        ?>
</label>
								<input id="GM_YSIZE" class="form-control" type="text" name="GM_YSIZE" value="<?php 
        echo $this->getSetting('GM_YSIZE');
        ?>
">
							</div>
						</div>
					</div>
				</div>
			</fieldset>

			<!-- GM_MIN_ZOOM / GM_MAX_ZOOM -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Zoom level of map');
        ?>
				</legend>
				<div class="col-sm-9">
					<div class="row">
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon" for="GM_MIN_ZOOM"><?php 
        echo I18N::translate('minimum');
        ?>
</label>
								<?php 
        echo FunctionsEdit::selectEditControl('GM_MIN_ZOOM', array_combine(range(1, 14), range(1, 14)), null, $this->getSetting('GM_MIN_ZOOM'), 'class="form-control"');
        ?>
							</div>
						</div>
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon" for="GM_MAX_ZOOM"><?php 
        echo I18N::translate('maximum');
        ?>
</label>
								<?php 
        echo FunctionsEdit::selectEditControl('GM_MAX_ZOOM', array_combine(range(1, 20), range(1, 20)), null, $this->getSetting('GM_MAX_ZOOM'), 'class="form-control"');
        ?>
							</div>
						</div>
					</div>
					<p class="small text-muted"><?php 
        echo I18N::translate('Minimum and maximum zoom level for the Google map.  1 is the full map, 15 is single house.  Note that 15 is only available in certain areas.');
        ?>
</p>
				</div>
			</fieldset>

			<h3><?php 
        echo I18N::translate('Advanced');
        ?>
</h3>

			<!-- GM_PRECISION -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Precision of the latitude and longitude');
        ?>
				</legend>
				<div class="col-sm-9">
					<div class="row">
						<?php 
        foreach (array(I18N::translate('Country'), I18N::translate('State'), I18N::translate('City'), I18N::translate('Neighborhood'), I18N::translate('House'), I18N::translate('Max')) as $level => $label) {
            ?>
						<div class="col-sm-4">
							<div class="input-group">
								<label class="input-group-addon" for="GM_PRECISION_<?php 
            echo $level;
            ?>
"><?php 
            echo $label;
            ?>
</label>
								<?php 
            echo FunctionsEdit::selectEditControl('GM_PRECISION_' . $level, range(0, 9), null, $this->getSetting('GM_PRECISION_' . $level), 'class="form-control"');
            ?>
							</div>
						</div>
						<?php 
        }
        ?>
					</div>
					<p class="small text-muted"><?php 
        echo I18N::translate('This specifies the precision of the different levels when entering new geographic locations.  For example a country will be specified with precision 0 (=0 digits after the decimal point), while a town needs 3 or 4 digits.');
        ?>
</p>
				</div>
			</fieldset>

			<!-- GM_PREFIX / GM_POSTFIX -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Optional prefixes and suffixes');
        ?>
				</legend>
				<div class="col-sm-9">
					<div class="row">
						<div class ="col-sm-6">
							<p class="form-control-static"><strong><?php 
        echo I18N::translate('Prefixes');
        ?>
</strong></p>
							<?php 
        for ($level = 1; $level < 10; $level++) {
            ?>
							<?php 
            if ($level == 1) {
                $label = I18N::translate('Country');
            } else {
                $label = I18N::translate('Level') . ' ' . $level;
            }
            ?>
							<div class="input-group">
								<label class="input-group-addon" for="GM_PREFIX_<?php 
            echo $level;
            ?>
"><?php 
            echo $label;
            ?>
</label>
								<input class="form-control" type="text" name="GM_PREFIX_<?php 
            echo $level;
            ?>
" value="<?php 
            echo $this->getSetting('GM_PREFIX_' . $level);
            ?>
">
							</div>
							<?php 
        }
        ?>
						</div>
						<div class="col-sm-6">
							<p class="form-control-static"><strong><?php 
        echo I18N::translate('Suffixes');
        ?>
</strong></p>
							<?php 
        for ($level = 1; $level < 10; $level++) {
            ?>
							<?php 
            if ($level == 1) {
                $label = I18N::translate('Country');
            } else {
                $label = I18N::translate('Level') . ' ' . $level;
            }
            ?>
							<div class="input-group">
								<label class="input-group-addon" for="GM_POSTFIX_<?php 
            echo $level;
            ?>
"><?php 
            echo $label;
            ?>
</label>
								<input class="form-control" type="text" name="GM_POSTFIX_<?php 
            echo $level;
            ?>
" value="<?php 
            echo $this->getSetting('GM_POSTFIX_' . $level);
            ?>
">
							</div>
							<?php 
        }
        ?>
						</div>
					</div>
					<p class="small text-muted"><?php 
        echo I18N::translate('Some place names may be written with optional prefixes and suffixes.  For example “Orange” versus “Orange County”.  If the family tree contains the full place names, but the geographic database contains the short place names, then you should specify a list of the prefixes and suffixes to be disregarded.  Multiple options should be separated with semicolons.  For example “County;County of” or “Township;Twp;Twp.”.');
        ?>
</p>
				</div>
			</fieldset>

			<h3><?php 
        echo I18N::translate('Place hierarchy');
        ?>
</h3>

			<!-- GM_PLACE_HIERARCHY -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Use Google Maps™ for the place hierarchy');
        ?>
				</legend>
				<div class="col-sm-9">
					<?php 
        echo FunctionsEdit::editFieldYesNo('GM_PLACE_HIERARCHY', $this->getSetting('GM_PLACE_HIERARCHY'), 'class="radio-inline"');
        ?>
				</div>
			</fieldset>

			<!-- GM_PH_XSIZE / GM_PH_YSIZE -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Size of map (in pixels)');
        ?>
				</legend>
				<div class="col-sm-9">
					<div class="row">
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon" for="GM_PH_XSIZE"><?php 
        echo I18N::translate('Width');
        ?>
</label>
								<input id="GM_XSIZE" class="form-control" type="text" name="GM_PH_XSIZE" value="<?php 
        echo $this->getSetting('GM_PH_XSIZE');
        ?>
">
							</div>
						</div>
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon" for="GM_PH_YSIZE"><?php 
        echo I18N::translate('Height');
        ?>
</label>
								<input id="GM_YSIZE" class="form-control" type="text" name="GM_PH_YSIZE" value="<?php 
        echo $this->getSetting('GM_PH_YSIZE');
        ?>
">
							</div>
						</div>
					</div>
				</div>
			</fieldset>

			<!-- GM_PH_MARKER -->
			<div class="form-group">
				<label class="control-label col-sm-3" for="GM_PH_MARKER">
					<?php 
        echo I18N::translate('Type of place markers in Place Hierarchy');
        ?>
				</label>
				<div class="col-sm-9">
					<?php 
        $ph_options = array('G_DEFAULT_ICON' => I18N::translate('Standard'), 'G_FLAG' => I18N::translate('Flag'));
        echo FunctionsEdit::selectEditControl('GM_PH_MARKER', $ph_options, null, $this->getSetting('GM_PH_MARKER'), 'class="form-control"');
        ?>
				</div>
			</div>

			<!-- GM_COORD -->
			<fieldset class="form-group">
				<legend class="control-label col-sm-3">
					<?php 
        echo I18N::translate('Display map coordinates');
        ?>
				</legend>
				<div class="col-sm-9">
					<?php 
        echo FunctionsEdit::editFieldYesNo('GM_COORD', $this->getSetting('GM_COORD'), 'class="radio-inline"');
        ?>
					<p class="small text-muted">
						<?php 
        echo I18N::translate('This options sets whether latitude and longitude are displayed on the pop-up window attached to map markers.');
        ?>
					</p>
				</div>
			</fieldset>

			<!-- SAVE BUTTON -->
			<div class="form-group">
				<div class="col-sm-offset-3 col-sm-9">
					<button type="submit" class="btn btn-primary">
						<i class="fa fa-check"></i>
						<?php 
        echo I18N::translate('save');
        ?>
					</button>
				</div>
			</div>
		</form>
		<?php 
    }
    /**
     * Action from the configuration page
     */
    private function edit()
    {
        global $WT_TREE;
        if (Filter::postBool('save') && Filter::checkCsrf()) {
            $block_id = Filter::postInteger('block_id');
            if ($block_id) {
                Database::prepare("UPDATE `##block` SET gedcom_id = NULLIF(:tree_id, '0'), block_order = :block_order WHERE block_id = :block_id")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'block_order' => Filter::postInteger('block_order'), 'block_id' => $block_id));
            } else {
                Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(:tree_id, '0'), :module_name, :block_order)")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'module_name' => $this->getName(), 'block_order' => Filter::postInteger('block_order')));
                $block_id = Database::getInstance()->lastInsertId();
            }
            $this->setBlockSetting($block_id, 'header', Filter::post('header'));
            $this->setBlockSetting($block_id, 'faqbody', Filter::post('faqbody'));
            $languages = Filter::postArray('lang');
            $this->setBlockSetting($block_id, 'languages', implode(',', $languages));
            $this->config();
        } else {
            $block_id = Filter::getInteger('block_id');
            $controller = new PageController();
            if ($block_id) {
                $controller->setPageTitle(I18N::translate('Edit FAQ item'));
                $header = $this->getBlockSetting($block_id, 'header');
                $faqbody = $this->getBlockSetting($block_id, 'faqbody');
                $block_order = Database::prepare("SELECT block_order FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne();
                $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne();
            } else {
                $controller->setPageTitle(I18N::translate('Add an FAQ item'));
                $header = '';
                $faqbody = '';
                $block_order = Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name = :module_name")->execute(array('module_name' => $this->getName()))->fetchOne();
                $gedcom_id = $WT_TREE->getTreeId();
            }
            $controller->pageHeader();
            if (Module::getModuleByName('ckeditor')) {
                CkeditorModule::enableEditor($controller);
            }
            ?>
			<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><a
						href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&mod_action=admin_config"><?php 
            echo I18N::translate('Frequently asked questions');
            ?>
</a>
				</li>
				<li class="active"><?php 
            echo $controller->getPageTitle();
            ?>
</li>
			</ol>
			<h1><?php 
            echo $controller->getPageTitle();
            ?>
</h1>

			<form name="faq" class="form-horizontal" method="post" action="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_edit">
			<?php 
            echo Filter::getCsrf();
            ?>
			<input type="hidden" name="save" value="1">
			<input type="hidden" name="block_id" value="<?php 
            echo $block_id;
            ?>
">

			<div class="form-group">
				<label for="header" class="col-sm-3 control-label">
					<?php 
            echo I18N::translate('Question');
            ?>
				</label>

				<div class="col-sm-9">
					<input type="text" class="form-control" name="header" id="header"
					       value="<?php 
            echo Filter::escapeHtml($header);
            ?>
">
				</div>
			</div>

			<div class="form-group">
				<label for="faqbody" class="col-sm-3 control-label">
					<?php 
            echo I18N::translate('Answer');
            ?>
				</label>

				<div class="col-sm-9">
					<textarea name="faqbody" id="faqbody" class="form-control html-edit"
					          rows="10"><?php 
            echo Filter::escapeHtml($faqbody);
            ?>
</textarea>
				</div>
			</div>

			<div class="form-group">
				<label for="xref" class="col-sm-3 control-label">
					<?php 
            echo I18N::translate('Show this block for which languages?');
            ?>
				</label>

				<div class="col-sm-9">
					<?php 
            echo FunctionsEdit::editLanguageCheckboxes('lang', explode(',', $this->getBlockSetting($block_id, 'languages')));
            ?>
				</div>
			</div>

			<div class="form-group">
				<label for="block_order" class="col-sm-3 control-label">
					<?php 
            echo I18N::translate('FAQ position');
            ?>
				</label>

				<div class="col-sm-9">
					<input type="text" name="block_order" id="block_order" class="form-control" value="<?php 
            echo $block_order;
            ?>
">
				</div>
			</div>

			<div class="form-group">
				<label for="gedcom_id" class="col-sm-3 control-label">
					<?php 
            echo I18N::translate('FAQ visibility');
            ?>
				</label>

				<div class="col-sm-9">
					<?php 
            echo FunctionsEdit::selectEditControl('gedcom_id', Tree::getIdList(), I18N::translate('All'), $gedcom_id, 'class="form-control"');
            ?>
					<p class="small text-muted">
						<?php 
            echo I18N::translate('A FAQ item can be displayed on just one of the family trees, or on all the family trees.');
            ?>
					</p>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-3 col-sm-9">
					<button type="submit" class="btn btn-primary">
						<i class="fa fa-check"></i>
						<?php 
            echo I18N::translate('save');
            ?>
					</button>
				</div>
			</div>

		</form>
		<?php 
        }
    }
示例#7
0
     return;
 }
 $controller->setPageTitle(I18N::translate('Request new user account'));
 // The form parameters are mandatory, and the validation errors are shown in the client.
 if (Session::get('good_to_send') && $user_name && $user_password01 && $user_password01 == $user_password02 && $user_realname && $user_email && $user_comments) {
     // These validation errors cannot be shown in the client.
     if (User::findByUserName($user_name)) {
         FlashMessages::addMessage(I18N::translate('Duplicate user name. A user with that user name already exists. Please choose another user name.'));
     } elseif (User::findByEmail($user_email)) {
         FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.'));
     } elseif (preg_match('/(?!' . preg_quote(WT_BASE_URL, '/') . ')(((?:ftp|http|https):\\/\\/)[a-zA-Z0-9.-]+)/', $user_comments, $match)) {
         FlashMessages::addMessage(I18N::translate('You are not allowed to send messages that contain external links.') . ' ' . I18N::translate('You should delete the “%1$s” from “%2$s” and try again.', $match[2], $match[1]));
         Log::addAuthenticationLog('Possible spam registration from "' . $user_name . '"/"' . $user_email . '" comments="' . $user_comments . '"');
     } else {
         // Everything looks good - create the user
         $controller->pageHeader();
         Log::addAuthenticationLog('User registration requested for: ' . $user_name);
         $user = User::create($user_name, $user_realname, $user_email, $user_password01);
         $user->setPreference('language', WT_LOCALE)->setPreference('verified', '0')->setPreference('verified_by_admin', 0)->setPreference('reg_timestamp', date('U'))->setPreference('reg_hashcode', md5(Uuid::uuid4()))->setPreference('contactmethod', 'messaging2')->setPreference('comment', $user_comments)->setPreference('visibleonline', '1')->setPreference('auto_accept', '0')->setPreference('canadmin', '0')->setPreference('sessiontime', '0');
         // Generate an email in the admin’s language
         $webmaster = User::find($WT_TREE->getPreference('WEBMASTER_USER_ID'));
         I18N::init($webmaster->getPreference('language'));
         $mail1_body = I18N::translate('Hello administrator…') . Mail::EOL . Mail::EOL . I18N::translate('A prospective user has registered with webtrees at %s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml()) . Mail::EOL . Mail::EOL . I18N::translate('Username') . ' ' . Filter::escapeHtml($user->getUserName()) . Mail::EOL . I18N::translate('Real name') . ' ' . $user->getRealNameHtml() . Mail::EOL . I18N::translate('Email address') . ' ' . Filter::escapeHtml($user->getEmail()) . Mail::EOL . I18N::translate('Comments') . ' ' . Filter::escapeHtml($user_comments) . Mail::EOL . Mail::EOL . I18N::translate('The user has been sent an e-mail with the information necessary to confirm the access request.') . Mail::EOL . Mail::EOL . I18N::translate('You will be informed by e-mail when this prospective user has confirmed the request. You can then complete the process by activating the user name. The new user will not be able to login until you activate the account.');
         $mail1_subject = I18N::translate('New registration at %s', WT_BASE_URL . ' ' . $WT_TREE->getTitle());
         I18N::init(WT_LOCALE);
         echo '<div id="login-register-page">';
         // Generate an email in the user’s language
         $mail2_body = I18N::translate('Hello %s…', $user->getRealNameHtml()) . Mail::EOL . Mail::EOL . I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml(), $user->getEmail()) . ' ' . I18N::translate('Information about the request is shown under the link below.') . Mail::EOL . I18N::translate('Please click on the following link and fill in the requested data to confirm your request and email address.') . Mail::EOL . Mail::EOL . '<a href="' . WT_LOGIN_URL . '?user_name=' . Filter::escapeUrl($user->getUserName()) . '&amp;user_hashcode=' . $user->getPreference('reg_hashcode') . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameUrl() . '">' . WT_LOGIN_URL . "?user_name=" . Filter::escapeHtml($user->getUserName()) . "&amp;user_hashcode=" . urlencode($user->getPreference('reg_hashcode')) . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameHtml() . '</a>' . Mail::EOL . Mail::EOL . I18N::translate('Username') . " - " . Filter::escapeHtml($user->getUserName()) . Mail::EOL . I18N::translate('Verification code') . " - " . $user->getPreference('reg_hashcode') . Mail::EOL . I18N::translate('Comments') . " - " . $user->getPreference('comment') . Mail::EOL . I18N::translate('If you didn’t request an account, you can just delete this message.') . Mail::EOL;
         $mail2_subject = I18N::translate('Your registration at %s', WT_BASE_URL);
         $mail2_to = $user->getEmail();
         $mail2_from = $WT_TREE->getPreference('WEBTREES_EMAIL');
示例#8
0
        // deleted blocks
        foreach ($blocks[$location] as $block_id => $block_name) {
            if (!in_array($block_id, $main) && !in_array($block_id, $right)) {
                Database::prepare("DELETE FROM `##block_setting` WHERE block_id=?")->execute(array($block_id));
                Database::prepare("DELETE FROM `##block`         WHERE block_id=?")->execute(array($block_id));
            }
        }
    }
    if ($user_id) {
        header('Location: ' . WT_BASE_URL . 'index.php?ctype=user&ged=' . $WT_TREE->getNameUrl());
    } else {
        header('Location: ' . WT_BASE_URL . 'index.php?ctype=gedcom&ged=' . $WT_TREE->getNameUrl());
    }
    return;
}
$controller->pageHeader()->addInlineJavascript('
	/**
	 * Move Up Block Javascript function
	 *
	 * This function moves the selected option up in the given select list
	 *
	 * @param String section_name the name of the select to move the options
	 */
	function move_up_block(section_name) {
		section_select = document.getElementById(section_name);
		if (section_select) {
			if (section_select.selectedIndex <= 0) return false;
			index = section_select.selectedIndex;
			temp = new Option(section_select.options[index-1].text, section_select.options[index-1].value);
			section_select.options[index-1] = new Option(section_select.options[index].text, section_select.options[index].value);
			section_select.options[index] = temp;
示例#9
0
    /**
     * Show and process a form to edit a story.
     */
    private function edit()
    {
        global $WT_TREE;
        if (Auth::isEditor($WT_TREE)) {
            if (Filter::postBool('save') && Filter::checkCsrf()) {
                $block_id = Filter::postInteger('block_id');
                if ($block_id) {
                    Database::prepare("UPDATE `##block` SET gedcom_id=?, xref=? WHERE block_id=?")->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $block_id));
                } else {
                    Database::prepare("INSERT INTO `##block` (gedcom_id, xref, module_name, block_order) VALUES (?, ?, ?, ?)")->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $this->getName(), 0));
                    $block_id = Database::getInstance()->lastInsertId();
                }
                $this->setBlockSetting($block_id, 'title', Filter::post('title'));
                $this->setBlockSetting($block_id, 'story_body', Filter::post('story_body'));
                $languages = Filter::postArray('lang');
                $this->setBlockSetting($block_id, 'languages', implode(',', $languages));
                $this->config();
            } else {
                $block_id = Filter::getInteger('block_id');
                $controller = new PageController();
                if ($block_id) {
                    $controller->setPageTitle(I18N::translate('Edit story'));
                    $title = $this->getBlockSetting($block_id, 'title');
                    $story_body = $this->getBlockSetting($block_id, 'story_body');
                    $xref = Database::prepare("SELECT xref FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
                } else {
                    $controller->setPageTitle(I18N::translate('Add a story'));
                    $title = '';
                    $story_body = '';
                    $xref = Filter::get('xref', WT_REGEX_XREF);
                }
                $controller->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
                if (Module::getModuleByName('ckeditor')) {
                    CkeditorModule::enableEditor($controller);
                }
                $individual = Individual::getInstance($xref, $WT_TREE);
                ?>
				<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><a href="module.php?mod=<?php 
                echo $this->getName();
                ?>
&mod_action=admin_config"><?php 
                echo $this->getTitle();
                ?>
</a></li>
					<li class="active"><?php 
                echo $controller->getPageTitle();
                ?>
</li>
				</ol>

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

				<form class="form-horizontal" method="post" action="module.php?mod=<?php 
                echo $this->getName();
                ?>
&amp;mod_action=admin_edit">
					<?php 
                echo Filter::getCsrf();
                ?>
					<input type="hidden" name="save" value="1">
					<input type="hidden" name="block_id" value="<?php 
                echo $block_id;
                ?>
">
					<input type="hidden" name="gedcom_id" value="<?php 
                echo $WT_TREE->getTreeId();
                ?>
">

					<div class="form-group">
						<label for="title" class="col-sm-3 control-label">
							<?php 
                echo I18N::translate('Story title');
                ?>
						</label>
						<div class="col-sm-9">
							<input type="text" class="form-control" name="title" id="title" value="<?php 
                echo Filter::escapeHtml($title);
                ?>
">
						</div>
					</div>

					<div class="form-group">
						<label for="story_body" class="col-sm-3 control-label">
							<?php 
                echo I18N::translate('Story');
                ?>
						</label>
						<div class="col-sm-9">
							<textarea name="story_body" id="story_body" class="html-edit form-control" rows="10"><?php 
                echo Filter::escapeHtml($story_body);
                ?>
</textarea>
						</div>
					</div>

					<div class="form-group">
						<label for="xref" class="col-sm-3 control-label">
							<?php 
                echo I18N::translate('Individual');
                ?>
						</label>
						<div class="col-sm-9">
							<input data-autocomplete-type="INDI" type="text" name="xref" id="xref" size="4" value="<?php 
                echo $xref;
                ?>
">
							<?php 
                echo FunctionsPrint::printFindIndividualLink('xref');
                ?>
							<?php 
                if ($individual) {
                    ?>
								<?php 
                    echo $individual->formatList('span');
                    ?>
							<?php 
                }
                ?>
						</div>
					</div>

					<div class="form-group">
						<label for="xref" class="col-sm-3 control-label">
							<?php 
                echo I18N::translate('Show this block for which languages?');
                ?>
						</label>
						<div class="col-sm-9">
							<?php 
                echo FunctionsEdit::editLanguageCheckboxes('lang', explode(',', $this->getBlockSetting($block_id, 'languages')));
                ?>
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-offset-3 col-sm-9">
							<button type="submit" class="btn btn-primary">
								<i class="fa fa-check"></i>
								<?php 
                echo I18N::translate('save');
                ?>
							</button>
						</div>
					</div>

				</form>
				<?php 
            }
        } else {
            header('Location: ' . WT_BASE_URL);
        }
    }
示例#10
0
    /**
     * A form to edit the module configuration.
     */
    private function config()
    {
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Google Maps™'));
        if (Filter::post('action') === 'update') {
            $this->setSetting('GM_MAP_TYPE', Filter::post('GM_MAP_TYPE'));
            $this->setSetting('GM_USE_STREETVIEW', Filter::post('GM_USE_STREETVIEW'));
            $this->setSetting('GM_MIN_ZOOM', Filter::post('GM_MIN_ZOOM'));
            $this->setSetting('GM_MAX_ZOOM', Filter::post('GM_MAX_ZOOM'));
            $this->setSetting('GM_XSIZE', Filter::post('GM_XSIZE'));
            $this->setSetting('GM_YSIZE', Filter::post('GM_YSIZE'));
            $this->setSetting('GM_PRECISION_0', Filter::post('GM_PRECISION_0'));
            $this->setSetting('GM_PRECISION_1', Filter::post('GM_PRECISION_1'));
            $this->setSetting('GM_PRECISION_2', Filter::post('GM_PRECISION_2'));
            $this->setSetting('GM_PRECISION_3', Filter::post('GM_PRECISION_3'));
            $this->setSetting('GM_PRECISION_4', Filter::post('GM_PRECISION_4'));
            $this->setSetting('GM_PRECISION_5', Filter::post('GM_PRECISION_5'));
            $this->setSetting('GM_COORD', Filter::post('GM_COORD'));
            $this->setSetting('GM_PLACE_HIERARCHY', Filter::post('GM_PLACE_HIERARCHY'));
            $this->setSetting('GM_PH_XSIZE', Filter::post('GM_PH_XSIZE'));
            $this->setSetting('GM_PH_YSIZE', Filter::post('GM_PH_YSIZE'));
            $this->setSetting('GM_PH_MARKER', Filter::post('GM_PH_MARKER'));
            $this->setSetting('GM_DISP_SHORT_PLACE', Filter::post('GM_DISP_SHORT_PLACE'));
            $this->setSetting('GM_PREFIX_1', Filter::post('GM_PREFIX_1'));
            $this->setSetting('GM_PREFIX_2', Filter::post('GM_PREFIX_2'));
            $this->setSetting('GM_PREFIX_3', Filter::post('GM_PREFIX_3'));
            $this->setSetting('GM_PREFIX_4', Filter::post('GM_PREFIX_4'));
            $this->setSetting('GM_PREFIX_5', Filter::post('GM_PREFIX_5'));
            $this->setSetting('GM_PREFIX_6', Filter::post('GM_PREFIX_6'));
            $this->setSetting('GM_PREFIX_7', Filter::post('GM_PREFIX_7'));
            $this->setSetting('GM_PREFIX_8', Filter::post('GM_PREFIX_8'));
            $this->setSetting('GM_PREFIX_9', Filter::post('GM_PREFIX_9'));
            $this->setSetting('GM_POSTFIX_1', Filter::post('GM_POSTFIX_1'));
            $this->setSetting('GM_POSTFIX_2', Filter::post('GM_POSTFIX_2'));
            $this->setSetting('GM_POSTFIX_3', Filter::post('GM_POSTFIX_3'));
            $this->setSetting('GM_POSTFIX_4', Filter::post('GM_POSTFIX_4'));
            $this->setSetting('GM_POSTFIX_5', Filter::post('GM_POSTFIX_5'));
            $this->setSetting('GM_POSTFIX_6', Filter::post('GM_POSTFIX_6'));
            $this->setSetting('GM_POSTFIX_7', Filter::post('GM_POSTFIX_7'));
            $this->setSetting('GM_POSTFIX_8', Filter::post('GM_POSTFIX_8'));
            $this->setSetting('GM_POSTFIX_9', Filter::post('GM_POSTFIX_9'));
            FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->getName()), 'success');
            header('Location: ' . WT_BASE_URL . 'module.php?mod=googlemap&mod_action=admin_config');
            return;
        }
        $controller->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" class="active">
				<a href="#" role="tab">
					<?php 
        echo I18N::translate('Google Maps™ preferences');
        ?>
				</a>
			</li>
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_places">
					<?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>

		<form method="post" name="configform" action="module.php?mod=googlemap&mod_action=admin_config">
			<input type="hidden" name="action" value="update">
			<h2><?php 
        echo I18N::translate('Basic');
        ?>
</h2>
			<div id="tabs">
				<div id="gm_basic">
					<table class="gm_edit_config">
						<tr>
							<th><?php 
        echo I18N::translate('Default map type');
        ?>
</th>
							<td>
								<select name="GM_MAP_TYPE">
									<option value="ROADMAP" <?php 
        if ($this->getSetting('GM_MAP_TYPE') === 'ROADMAP') {
            echo "selected";
        }
        ?>
><?php 
        echo I18N::translate('Map');
        ?>
</option>
									<option value="SATELLITE" <?php 
        if ($this->getSetting('GM_MAP_TYPE') === 'SATELLITE') {
            echo "selected";
        }
        ?>
><?php 
        echo I18N::translate('Satellite');
        ?>
</option>
									<option value="HYBRID" <?php 
        if ($this->getSetting('GM_MAP_TYPE') === 'HYBRID') {
            echo "selected";
        }
        ?>
><?php 
        echo I18N::translate('Hybrid');
        ?>
</option>
									<option value="TERRAIN" <?php 
        if ($this->getSetting('GM_MAP_TYPE') === 'TERRAIN') {
            echo "selected";
        }
        ?>
><?php 
        echo I18N::translate('Terrain');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr>
							<th><?php 
        echo I18N::translate('Google Street View™');
        ?>
</th>
							<td><?php 
        echo FunctionsEdit::radioButtons('GM_USE_STREETVIEW', array(false => I18N::translate('hide'), true => I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW'), 'class="radio-inline"');
        ?>
</td>
						</tr>
						<tr>
							<th><?php 
        echo I18N::translate('Size of map (in pixels)');
        ?>
</th>
							<td>
								<?php 
        echo I18N::translate('Width');
        ?>
								<input type="text" name="GM_XSIZE" value="<?php 
        echo $this->getSetting('GM_XSIZE');
        ?>
" size="10">
								<?php 
        echo I18N::translate('Height');
        ?>
								<input type="text" name="GM_YSIZE" value="<?php 
        echo $this->getSetting('GM_YSIZE');
        ?>
" size="10">
							</td>
						</tr>
						<tr>
							<th><?php 
        echo I18N::translate('Zoom level of map');
        ?>
</th>
							<td>
								<?php 
        echo I18N::translate('minimum');
        ?>
: <select name="GM_MIN_ZOOM">
								<?php 
        for ($j = 1; $j < 15; $j++) {
            ?>
								<option value="<?php 
            echo $j, "\" ";
            if ($this->getSetting('GM_MIN_ZOOM') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
								<?php 
        }
        ?>
								</select>
								<?php 
        echo I18N::translate('maximum');
        ?>
: <select name="GM_MAX_ZOOM">
								<?php 
        for ($j = 1; $j < 21; $j++) {
            ?>
								<option value="<?php 
            echo $j, "\" ";
            if ($this->getSetting('GM_MAX_ZOOM') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
								<?php 
        }
        ?>
								</select>
								<p>
									<?php 
        echo I18N::translate('Minimum and maximum zoom level for the Google map.  1 is the full map, 15 is single house.  Note that 15 is only available in certain areas.');
        ?>
								</p>
							</td>
						</tr>
					</table>
				</div>

				<h2><?php 
        echo I18N::translate('Advanced');
        ?>
</h2>

				<div id="gm_advanced">
					<table class="gm_edit_config">
						<tr>
							<th colspan="2">
								<?php 
        echo I18N::translate('Precision of the latitude and longitude');
        ?>
							</th>
							<td>
								<table>
									<tr>
										<td><?php 
        echo I18N::translate('Country');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="GM_PRECISION_0">
											<?php 
        for ($j = 0; $j < 10; $j++) {
            ?>
											<option value="<?php 
            echo $j;
            ?>
" <?php 
            if ($this->getSetting('GM_PRECISION_0') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr>
										<td><?php 
        echo I18N::translate('State');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="GM_PRECISION_1">
											<?php 
        for ($j = 0; $j < 10; $j++) {
            ?>
											<option value="<?php 
            echo $j;
            ?>
" <?php 
            if ($this->getSetting('GM_PRECISION_1') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr>
										<td><?php 
        echo I18N::translate('City');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="GM_PRECISION_2">
											<?php 
        for ($j = 0; $j < 10; $j++) {
            ?>
											<option value="<?php 
            echo $j;
            ?>
" <?php 
            if ($this->getSetting('GM_PRECISION_2') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr><td><?php 
        echo I18N::translate('Neighborhood');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="GM_PRECISION_3">
											<?php 
        for ($j = 0; $j < 10; $j++) {
            ?>
											<option value="<?php 
            echo $j;
            ?>
" <?php 
            if ($this->getSetting('GM_PRECISION_3') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr><td><?php 
        echo I18N::translate('House');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="GM_PRECISION_4">
											<?php 
        for ($j = 0; $j < 10; $j++) {
            ?>
											<option value="<?php 
            echo $j;
            ?>
" <?php 
            if ($this->getSetting('GM_PRECISION_4') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr><td><?php 
        echo I18N::translate('Max');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="GM_PRECISION_5">
											<?php 
        for ($j = 0; $j < 10; $j++) {
            ?>
											<option value="<?php 
            echo $j;
            ?>
" <?php 
            if ($this->getSetting('GM_PRECISION_5') == $j) {
                echo "selected";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo I18N::translate('digits');
        ?>
										</td>
									</tr>
								</table>
								<p class="small text-muted">
									<?php 
        echo I18N::translate('This specifies the precision of the different levels when entering new geographic locations.  For example a country will be specified with precision 0 (=0 digits after the decimal point), while a town needs 3 or 4 digits.');
        ?>
								</p>
							</td>
							<td></td>
						</tr>
							<th class="gm_prefix">
								<?php 
        echo I18N::translate('Optional prefixes and suffixes');
        ?>
							</th>
							<td colspan="2">
								<p class="small text-muted">
									<?php 
        echo I18N::translate('Some place names may be written with optional prefixes and suffixes.  For example “Orange” versus “Orange County”.  If the family tree contains the full place names, but the geographic database contains the short place names, then you should specify a list of the prefixes and suffixes to be disregarded.  Multiple options should be separated with semicolons.  For example “County;County of” or “Township;Twp;Twp.”.');
        ?>
								</p>
							</td>
						</tr>
						<tr id="gm_level_titles">
							<th></th>
							<th><?php 
        echo I18N::translate('Prefixes');
        ?>
</th>
							<th><?php 
        echo I18N::translate('Suffixes');
        ?>
</th>
						<?php 
        for ($level = 1; $level < 10; $level++) {
            ?>
						<tr  class="gm_levels">
							<th>
								<?php 
            if ($level == 1) {
                echo I18N::translate('Country');
            } else {
                echo I18N::translate('Level'), " ", $level;
            }
            ?>
							</th>
							<td>
								<input type="text" size="30" name="GM_PREFIX_<?php 
            echo $level;
            ?>
" value="<?php 
            echo $this->getSetting('GM_PREFIX_' . $level);
            ?>
">
							</td>
							<td>
								<input type="text" size="30" name="GM_POSTFIX_<?php 
            echo $level;
            ?>
" value="<?php 
            echo $this->getSetting('GM_POSTFIX_' . $level);
            ?>
">
							</td>
						</tr>
						<?php 
        }
        ?>
					</table>
				</div>

				<h2><?php 
        echo I18N::translate('Place hierarchy');
        ?>
</h2>

				<div id="gm_ph">
					<table class="gm_edit_config">
						<tr>
							<th><?php 
        echo I18N::translate('Use Google Maps™ for the place hierarchy');
        ?>
</th>
							<td><?php 
        echo FunctionsEdit::editFieldYesNo('GM_PLACE_HIERARCHY', $this->getSetting('GM_PLACE_HIERARCHY'), 'class="radio-inline"');
        ?>
</td>
						</tr>
						<tr>
							<th><?php 
        echo I18N::translate('Size of map (in pixels)');
        ?>
</th>
							<td>
								<?php 
        echo I18N::translate('Width');
        ?>
								<input type="text" name="GM_PH_XSIZE" value="<?php 
        echo $this->getSetting('GM_PH_XSIZE');
        ?>
" size="10">
								<?php 
        echo I18N::translate('Height');
        ?>
								<input type="text" name="GM_PH_YSIZE" value="<?php 
        echo $this->getSetting('GM_PH_YSIZE');
        ?>
" size="10">
							</td>
						</tr>
						<tr>
							<th><?php 
        echo I18N::translate('Type of place markers in Place Hierarchy');
        ?>
</th>
							<td>
								<select name="GM_PH_MARKER">
									<option value="G_DEFAULT_ICON" <?php 
        if ($this->getSetting('GM_PH_MARKER') == "G_DEFAULT_ICON") {
            echo "selected";
        }
        ?>
><?php 
        echo I18N::translate('Standard');
        ?>
</option>
									<option value="G_FLAG" <?php 
        if ($this->getSetting('GM_PH_MARKER') == "G_FLAG") {
            echo "selected";
        }
        ?>
><?php 
        echo I18N::translate('Flag');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr>
							<th>
								<?php 
        echo I18N::translate('Display short placenames');
        ?>
							</th>
							<td>
								<?php 
        echo FunctionsEdit::editFieldYesNo('GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE'), 'class="radio-inline"');
        ?>
								<p class="small text-muted">
									<?php 
        echo I18N::translate('Hide the flags that are configured in the googlemap module.  Usually these are for countries and states.  This serves as a visual cue that the markers around the flag are from the general area, and not the specific spot.');
        ?>
								</p>
							</td>
						</tr>
						<tr>
							<th>
								<?php 
        echo I18N::translate('Display map coordinates');
        ?>
							</th>
							<td>
								<?php 
        echo FunctionsEdit::editFieldYesNo('GM_COORD', $this->getSetting('GM_COORD'), 'class="radio-inline"');
        ?>
								<p class="small text-muted">
									<?php 
        echo I18N::translate('This options sets whether latitude and longitude are displayed on the pop-up window attached to map markers.');
        ?>
								</p>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<p>
				<input type="submit" value="<?php 
        echo I18N::translate('save');
        ?>
">
			</p>
		</form>
		<?php 
    }