1
0

Enable the options on the new admin screen.

This commit is contained in:
rWatcher 2010-03-10 17:04:44 -05:00
parent c46dee67e5
commit 9d8a667cf7
5 changed files with 39 additions and 5 deletions

View File

@ -72,7 +72,7 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
->value(module::get_var("exif_gps", "sidebar_zoom"))
->rules("required");
$gps_sidebar->dropdown("sidebar_mapformat")
->label(t("Default Map Format"))
->label(t("Map Interface"))
->options(array(t("Static"), t("Interactive")))
->selected(module::get_var("exif_gps", "sidebar_mapformat"));
$gps_sidebar->dropdown("sidebar_maptype")

View File

@ -38,7 +38,19 @@ class exif_gps_block_Core {
$block = new Block();
$block->css_id = "g-exif-gps-sidebar";
$block->title = t("Location");
$block->content = new View("exif_gps_sidebar.html");
if (module::get_var("exif_gps", "sidebar_mapformat") == 1) {
$block->content = new View("exif_gps_dynamic_sidebar.html");
if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "ROADMAP";
if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE";
if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID";
if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN";
} else {
$block->content = new View("exif_gps_static_sidebar.html");
if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "roadmap";
if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "satellite";
if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "hybrid";
if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "terrain";
}
$block->content->latitude = $record->latitude;
$block->content->longitude = $record->longitude;
} elseif (module::is_active("tagsmap") && module::is_active("tag")) {

View File

@ -0,0 +1,22 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript" src="http://www.google.com/jsapi?key=<?= module::get_var("exif_gps", "googlemap_api_key"); ?>"></script>
<script type="text/javascript">
google.load("maps", "3",{"other_params":"sensor=false"});
function initialize() {
var latlng = new google.maps.LatLng(<?=$latitude; ?>,<?=$longitude; ?>);
var myOptions = {
zoom: <?= module::get_var("exif_gps", "sidebar_zoom"); ?>,
center: latlng,
mapTypeId: google.maps.MapTypeId.<?=$sidebar_map_type ?>
};
var map = new google.maps.Map(document.getElementById("sidebar_map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: latlng,
map: map,
});
}
google.setOnLoadCallback(initialize);
</script>
<div id="sidebar_map_canvas" style="width:205px; height:214px"></div>

View File

@ -1,3 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<img src="http://maps.google.com/maps/api/staticmap?center=<?=$latitude; ?>,<?=$longitude; ?>&zoom=14&size=205x214&maptype=roadmap&markers=color:red|color:red|<?=$latitude; ?>,<?=$longitude; ?>&sensor=false">

View File

@ -0,0 +1,3 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<img src="http://maps.google.com/maps/api/staticmap?center=<?=$latitude; ?>,<?=$longitude; ?>&zoom=<?= module::get_var("exif_gps", "sidebar_zoom"); ?>&size=205x214&maptype=<?=$sidebar_map_type ?>&markers=color:red|color:red|<?=$latitude; ?>,<?=$longitude; ?>&sensor=false">