Code cleanup and comments.
This commit is contained in:
parent
e497dad6ab
commit
89ba9336f5
@ -33,9 +33,12 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
|
|||||||
// Prevent Cross Site Request Forgery
|
// Prevent Cross Site Request Forgery
|
||||||
access::verify_csrf();
|
access::verify_csrf();
|
||||||
|
|
||||||
|
// Make sure the user filled out the form properly.
|
||||||
$form = $this->_get_admin_form();
|
$form = $this->_get_admin_form();
|
||||||
if ($form->validate()) {
|
if ($form->validate()) {
|
||||||
Kohana_Log::add("error",print_r($form,1));
|
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", "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_zoom", $form->Sidebar->sidebar_default_zoom->value);
|
||||||
module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value);
|
module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value);
|
||||||
@ -64,7 +67,7 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
|
|||||||
->value(module::get_var("exif_gps", "googlemap_api_key"))
|
->value(module::get_var("exif_gps", "googlemap_api_key"))
|
||||||
->rules("required");
|
->rules("required");
|
||||||
|
|
||||||
// Create a group for sidebar settings
|
// Create a group for sidebar settings
|
||||||
$gps_sidebar = $form->group("Sidebar")
|
$gps_sidebar = $form->group("Sidebar")
|
||||||
->label(t("Sidebar Settings"));
|
->label(t("Sidebar Settings"));
|
||||||
$gps_sidebar->input("sidebar_default_zoom")
|
$gps_sidebar->input("sidebar_default_zoom")
|
||||||
@ -82,9 +85,9 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
|
|||||||
->selected(module::get_var("exif_gps", "sidebar_maptype"));
|
->selected(module::get_var("exif_gps", "sidebar_maptype"));
|
||||||
|
|
||||||
// Add a save button to the form.
|
// 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 the newly generated form.
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,4 @@ class exif_gps_Core {
|
|||||||
}
|
}
|
||||||
return self::$exif_keys;
|
return self::$exif_keys;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,4 +19,4 @@
|
|||||||
google.setOnLoadCallback(initialize);
|
google.setOnLoadCallback(initialize);
|
||||||
|
|
||||||
</script>
|
</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 @@
|
|||||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||||
};
|
};
|
||||||
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
|
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; ?>
|
<? $counter = 1; ?>
|
||||||
<? foreach ($items as $item) { ?>
|
<? foreach ($items as $item) { ?>
|
||||||
<? $item_coordinates = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); ?>
|
<? $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.") ?>
|
<?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">
|
<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">
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user