Permalink
Browse files

Code cleanup and comments.

  • Loading branch information...
1 parent 42784d6 commit 9ab7b6b74287b3f137ef95792fa7c2bfc64b83b6 rWatcher committed with talmdal Mar 11, 2010
@@ -33,9 +33,12 @@ public function saveprefs() {
// 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);
@@ -64,7 +67,7 @@ private function _get_admin_form() {
->value(module::get_var("exif_gps", "googlemap_api_key"))
->rules("required");
- // Create a group for sidebar settings
+ // Create a group for sidebar settings
$gps_sidebar = $form->group("Sidebar")
->label(t("Sidebar Settings"));
$gps_sidebar->input("sidebar_default_zoom")
@@ -82,9 +85,9 @@ private function _get_admin_form() {
->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;
}
-}
+}
@@ -74,4 +74,4 @@ private static function _keys() {
}
return self::$exif_keys;
}
-}
+}
@@ -19,4 +19,4 @@ function initialize() {
google.setOnLoadCallback(initialize);
</script>
- <div id="sidebar_map_canvas" style="width:205px; height:214px"></div>
+<div id="sidebar_map_canvas" style="width:205px; height:214px"></div>
@@ -10,7 +10,7 @@ function initialize() {
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(); ?>
@@ -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">
-

0 comments on commit 9ab7b6b

Please sign in to comment.