Beispiel #1
0
function edit_field_yes_no($name, $selected = false)
{
    return radio_buttons($name, array(false => WT_I18N::translate('no'), true => WT_I18N::translate('yes')), $selected);
}
Beispiel #2
0
    private function config()
    {
        require WT_ROOT . 'includes/functions/functions_edit.php';
        $action = WT_Filter::post('action');
        $controller = new WT_Controller_Page();
        $controller->restrictAccess(Auth::isAdmin())->setPageTitle(WT_I18N::translate('Google Maps™'))->pageHeader()->addInlineJavascript('jQuery("#tabs").tabs();');
        if ($action == 'update') {
            $this->setSetting('GM_MAP_TYPE', WT_Filter::post('NEW_GM_MAP_TYPE'));
            $this->setSetting('GM_USE_STREETVIEW', WT_Filter::post('NEW_GM_USE_STREETVIEW'));
            $this->setSetting('GM_MIN_ZOOM', WT_Filter::post('NEW_GM_MIN_ZOOM'));
            $this->setSetting('GM_MAX_ZOOM', WT_Filter::post('NEW_GM_MAX_ZOOM'));
            $this->setSetting('GM_XSIZE', WT_Filter::post('NEW_GM_XSIZE'));
            $this->setSetting('GM_YSIZE', WT_Filter::post('NEW_GM_YSIZE'));
            $this->setSetting('GM_PRECISION_0', WT_Filter::post('NEW_GM_PRECISION_0'));
            $this->setSetting('GM_PRECISION_1', WT_Filter::post('NEW_GM_PRECISION_1'));
            $this->setSetting('GM_PRECISION_2', WT_Filter::post('NEW_GM_PRECISION_2'));
            $this->setSetting('GM_PRECISION_3', WT_Filter::post('NEW_GM_PRECISION_3'));
            $this->setSetting('GM_PRECISION_4', WT_Filter::post('NEW_GM_PRECISION_4'));
            $this->setSetting('GM_PRECISION_5', WT_Filter::post('NEW_GM_PRECISION_5'));
            $this->setSetting('GM_COORD', WT_Filter::post('NEW_GM_COORD'));
            $this->setSetting('GM_PLACE_HIERARCHY', WT_Filter::post('NEW_GM_PLACE_HIERARCHY'));
            $this->setSetting('GM_PH_XSIZE', WT_Filter::post('NEW_GM_PH_XSIZE'));
            $this->setSetting('GM_PH_YSIZE', WT_Filter::post('NEW_GM_PH_YSIZE'));
            $this->setSetting('GM_PH_MARKER', WT_Filter::post('NEW_GM_PH_MARKER'));
            $this->setSetting('GM_DISP_SHORT_PLACE', WT_Filter::post('NEW_GM_DISP_SHORT_PLACE'));
            for ($i = 1; $i <= 9; $i++) {
                $this->setSetting('GM_PREFIX_' . $i, WT_Filter::post('NEW_GM_PREFIX_' . $i));
                $this->setSetting('GM_POSTFIX_' . $i, WT_Filter::post('NEW_GM_POSTFIX_' . $i));
            }
            Log::addConfigurationLog('Googlemap config updated');
        }
        ?>
		<table id="gm_config">
			<tr>
				<th>
					<a class="current" href="module.php?mod=googlemap&amp;mod_action=admin_config">
						<?php 
        echo WT_I18N::translate('Google Maps™ preferences');
        ?>
					</a>
				</th>
				<th>
					<a href="module.php?mod=googlemap&amp;mod_action=admin_places">
						<?php 
        echo WT_I18N::translate('Geographic data');
        ?>
					</a>
				</th>
				<th>
					<a href="module.php?mod=googlemap&amp;mod_action=admin_placecheck">
						<?php 
        echo WT_I18N::translate('Place check');
        ?>
					</a>
				</th>
			</tr>
		</table>

		<form method="post" name="configform" action="module.php?mod=googlemap&mod_action=admin_config">
			<input type="hidden" name="action" value="update">
			<div id="tabs">
				<ul>
				<li><a href="#gm_basic"><span><?php 
        echo WT_I18N::translate('Basic');
        ?>
</span></a></li>
					<li><a href="#gm_advanced"><span><?php 
        echo WT_I18N::translate('Advanced');
        ?>
</span></a></li>
					<li><a href="#gm_ph"><span><?php 
        echo WT_I18N::translate('Place hierarchy');
        ?>
</span></a></li>
				</ul>
				<div id="gm_basic">
					<table class="gm_edit_config">
						<tr>
							<th><?php 
        echo WT_I18N::translate('Default map type');
        ?>
</th>
							<td>
								<select name="NEW_GM_MAP_TYPE">
									<option value="ROADMAP" <?php 
        if ($this->getSetting('GM_MAP_TYPE') == 'ROADMAP') {
            echo "selected=\"selected\"";
        }
        ?>
><?php 
        echo WT_I18N::translate('Map');
        ?>
</option>
									<option value="SATELLITE" <?php 
        if ($this->getSetting('GM_MAP_TYPE') == 'SATELLITE') {
            echo "selected=\"selected\"";
        }
        ?>
><?php 
        echo WT_I18N::translate('Satellite');
        ?>
</option>
									<option value="HYBRID" <?php 
        if ($this->getSetting('GM_MAP_TYPE') == 'HYBRID') {
            echo "selected=\"selected\"";
        }
        ?>
><?php 
        echo WT_I18N::translate('Hybrid');
        ?>
</option>
									<option value="TERRAIN" <?php 
        if ($this->getSetting('GM_MAP_TYPE') == 'TERRAIN') {
            echo "selected=\"selected\"";
        }
        ?>
><?php 
        echo WT_I18N::translate('Terrain');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Google Street View™');
        ?>
</th>
							<td><?php 
        echo radio_buttons('NEW_GM_USE_STREETVIEW', array(false => WT_I18N::translate('hide'), true => WT_I18N::translate('show')), $this->getSetting('GM_USE_STREETVIEW'));
        ?>
</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Size of map (in pixels)');
        ?>
</th>
							<td>
								<?php 
        echo WT_I18N::translate('Width');
        ?>
								<input type="text" name="NEW_GM_XSIZE" value="<?php 
        echo $this->getSetting('GM_XSIZE');
        ?>
" size="10">
								<?php 
        echo WT_I18N::translate('Height');
        ?>
								<input type="text" name="NEW_GM_YSIZE" value="<?php 
        echo $this->getSetting('GM_YSIZE');
        ?>
" size="10">
							</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Zoom level of map'), help_link('GM_MAP_ZOOM', 'googlemap');
        ?>
</th>
							<td>
								<?php 
        echo WT_I18N::translate('minimum');
        ?>
: <select name="NEW_GM_MIN_ZOOM">
								<?php 
        for ($j = 1; $j < 15; $j++) {
            ?>
								<option value="<?php 
            echo $j, "\"";
            if ($this->getSetting('GM_MIN_ZOOM') == $j) {
                echo " selected=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
								<?php 
        }
        ?>
								</select>
								<?php 
        echo WT_I18N::translate('maximum');
        ?>
: <select name="NEW_GM_MAX_ZOOM">
								<?php 
        for ($j = 1; $j < 21; $j++) {
            ?>
								<option value="<?php 
            echo $j, "\"";
            if ($this->getSetting('GM_MAX_ZOOM') == $j) {
                echo " selected=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
								<?php 
        }
        ?>
								</select>
							</td>
						</tr>
					</table>
				</div>

				<div id="gm_advanced">
					<table class="gm_edit_config">
						<tr>
							<th colspan="2"><?php 
        echo WT_I18N::translate('Precision of the latitude and longitude'), help_link('GM_PRECISION', 'googlemap');
        ?>
</th>
							<td>
								<table>
									<tr>
										<td><?php 
        echo WT_I18N::translate('Country');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="NEW_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=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo WT_I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr>
										<td><?php 
        echo WT_I18N::translate('State');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="NEW_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=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo WT_I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr>
										<td><?php 
        echo WT_I18N::translate('City');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="NEW_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=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo WT_I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr><td><?php 
        echo WT_I18N::translate('Neighborhood');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="NEW_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=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo WT_I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr><td><?php 
        echo WT_I18N::translate('House');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="NEW_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=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo WT_I18N::translate('digits');
        ?>
										</td>
									</tr>
									<tr><td><?php 
        echo WT_I18N::translate('Max');
        ?>
&nbsp;&nbsp;</td>
										<td><select name="NEW_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=\"selected\"";
            }
            echo ">", $j;
            ?>
</option>
											<?php 
        }
        ?>
											</select>&nbsp;&nbsp;<?php 
        echo WT_I18N::translate('digits');
        ?>
										</td>
									</tr>
								</table>
							</td>
							<td>&nbsp;</td>
						</tr>
							<th class="gm_prefix" colspan="3"><?php 
        echo WT_I18N::translate('Optional prefixes and suffixes'), help_link('GM_NAME_PREFIX_SUFFIX', 'googlemap');
        ?>
</th>
						</tr>
						<tr id="gm_level_titles">
							<th>&nbsp;</th>
							<th><?php 
        echo WT_I18N::translate('Prefixes');
        ?>
</th>
							<th><?php 
        echo WT_I18N::translate('Suffixes');
        ?>
</th>
						<?php 
        for ($level = 1; $level < 10; $level++) {
            ?>
						<tr  class="gm_levels">
							<th>
								<?php 
            if ($level == 1) {
                echo WT_I18N::translate('Country');
            } else {
                echo WT_I18N::translate('Level'), " ", $level;
            }
            ?>
							</th>
							<td><input type="text" size="30" name="NEW_GM_PREFIX_<?php 
            echo $level;
            ?>
" value="<?php 
            echo $this->getSetting('GM_PREFIX_' . $level);
            ?>
"></td>
							<td><input type="text" size="30" name="NEW_GM_POSTFIX_<?php 
            echo $level;
            ?>
" value="<?php 
            echo $this->getSetting('GM_POSTFIX_' . $level);
            ?>
"></td>
						</tr>
						<?php 
        }
        ?>
					</table>
				</div>

				<div id="gm_ph">
					<table class="gm_edit_config">
						<tr>
							<th><?php 
        echo WT_I18N::translate('Use Google Maps™ for the place hierarchy');
        ?>
</th>
							<td><?php 
        echo edit_field_yes_no('NEW_GM_PLACE_HIERARCHY', $this->getSetting('GM_PLACE_HIERARCHY'));
        ?>
</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Size of map (in pixels)');
        ?>
</th>
							<td>
								<?php 
        echo WT_I18N::translate('Width');
        ?>
								<input type="text" name="NEW_GM_PH_XSIZE" value="<?php 
        echo $this->getSetting('GM_PH_XSIZE');
        ?>
" size="10">
								<?php 
        echo WT_I18N::translate('Height');
        ?>
								<input type="text" name="NEW_GM_PH_YSIZE" value="<?php 
        echo $this->getSetting('GM_PH_YSIZE');
        ?>
" size="10">
							</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Type of place markers in Place Hierarchy');
        ?>
</th>
							<td>
								<select name="NEW_GM_PH_MARKER">
									<option value="G_DEFAULT_ICON" <?php 
        if ($this->getSetting('GM_PH_MARKER') == "G_DEFAULT_ICON") {
            echo "selected=\"selected\"";
        }
        ?>
><?php 
        echo WT_I18N::translate('Standard');
        ?>
</option>
									<option value="G_FLAG" <?php 
        if ($this->getSetting('GM_PH_MARKER') == "G_FLAG") {
            echo "selected=\"selected\"";
        }
        ?>
><?php 
        echo WT_I18N::translate('Flag');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Display short placenames'), help_link('GM_DISP_SHORT_PLACE', 'googlemap');
        ?>
</th>
							<td><?php 
        echo edit_field_yes_no('NEW_GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE'));
        ?>
</td>
						</tr>
						<tr>
							<th><?php 
        echo WT_I18N::translate('Display map coordinates'), help_link('GM_COORD', 'googlemap');
        ?>
</th>
							<td><?php 
        echo edit_field_yes_no('NEW_GM_COORD', $this->getSetting('GM_COORD'));
        ?>
</td>
						</tr>
					</table>
				</div>
			</div>
			<p>
				<input type="submit" value="<?php 
        echo WT_I18N::translate('save');
        ?>
">
			</p>
		</form>
		<?php 
    }
					</td>
					<td>
						<?php 
echo radio_buttons('NEW_SHOW_COUNTER', array(false => WT_I18N::translate('hide'), true => WT_I18N::translate('show')), $SHOW_COUNTER);
?>
					</td>
				</tr>
				<tr>
					<td>
						<?php 
echo WT_I18N::translate('Execution statistics'), help_link('SHOW_STATS');
?>
					</td>
					<td>
						<?php 
echo radio_buttons('NEW_SHOW_STATS', array(false => WT_I18N::translate('hide'), true => WT_I18N::translate('show')), get_gedcom_setting(WT_GED_ID, 'SHOW_STATS'));
?>
					</td>
				</tr>
			</table>
		</div>
		<!-- EDIT -->
		<div id="edit-options">
			<table>
			<tr>
				<th colspan="2">
					<?php 
echo WT_I18N::translate('Facts for individual records');
?>
				</th>
			</tr>