1
0

Code cleanup and comments.

This commit is contained in:
rWatcher 2010-03-11 12:02:19 +08:00 committed by Tim Almdal
parent 42784d6197
commit 9ab7b6b742
5 changed files with 9 additions and 7 deletions

View File

@ -33,9 +33,12 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
// Prevent Cross Site Request Forgery
access::verify_csrf();
// Make sure the user filled out the form properly.
$form = $this->_get_admin_form();
if ($form->validate()) {
Kohana_Log::add("error",print_r($form,1));
// Save settings to Gallery's database.
module::set_var("exif_gps", "googlemap_api_key", $form->google_api_key->value);
module::set_var("exif_gps", "sidebar_zoom", $form->Sidebar->sidebar_default_zoom->value);
module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value);
@ -82,7 +85,7 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
->selected(module::get_var("exif_gps", "sidebar_maptype"));
// Add a save button to the form.
$form->submit("SaveLinks")->value(t("Save"));
$form->submit("SaveSettings")->value(t("Save"));
// Return the newly generated form.
return $form;

View File

@ -10,7 +10,7 @@
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var glatlngbounds = new google.maps.LatLngBounds( );
var glatlngbounds = new google.maps.LatLngBounds( ); // This is so we can auto center the map.
<? $counter = 1; ?>
<? foreach ($items as $item) { ?>
<? $item_coordinates = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); ?>

View File

@ -1,3 +1,2 @@
<?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">