diff --git a/modules/tagsmap/controllers/admin_tagsmap.php b/modules/tagsmap/controllers/admin_tagsmap.php
index f4ffeb6b..561bcee9 100644
--- a/modules/tagsmap/controllers/admin_tagsmap.php
+++ b/modules/tagsmap/controllers/admin_tagsmap.php
@@ -44,6 +44,19 @@ class Admin_TagsMap_Controller extends Admin_Controller {
print $view;
}
+ public function delete_gps($tag_id) {
+ // Delete the GSP data associated with a tag.
+
+ // Delete the record.
+ ORM::factory("tags_gps")
+ ->where("tag_id", $tag_id)
+ ->delete_all();
+
+ // Redirect back to the main screen and display a "success" message.
+ message::success(t("Your Settings Have Been Saved."));
+ url::redirect("admin/tagsmap");
+ }
+
private function _get_tagsgpsedit_form($tag_id) {
// Make a new Form.
$form = new Forge("admin/tagsmap/savegps", "", "post",
diff --git a/modules/tagsmap/views/admin_tagsmap.html.php b/modules/tagsmap/views/admin_tagsmap.html.php
index 305e5ba3..7412d6ee 100644
--- a/modules/tagsmap/views/admin_tagsmap.html.php
+++ b/modules/tagsmap/views/admin_tagsmap.html.php
@@ -46,6 +46,18 @@
(= $tag->count ?>)
id") ?>">= t("Edit GPS") ?>
+
+ // Check and see if this ID already has GPS data.
+ $existingGPS = ORM::factory("tags_gps")
+ ->where("tag_id", $tag->id)
+ ->find_all();
+ if (count($existingGPS) > 0) {
+?>
+ | id") ?>">= t("Delete GPS") ?>
+
+
+ }
+?>