From 9511f75ac34774b3330c580a7b98d6539d45d1c9 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Fri, 24 Jul 2009 15:27:15 -0400 Subject: [PATCH] Added a delete button to the admin page. --- modules/tagsmap/controllers/admin_tagsmap.php | 13 +++++++++++++ modules/tagsmap/views/admin_tagsmap.html.php | 12 ++++++++++++ 2 files changed, 25 insertions(+) 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 @@ (count ?>) id") ?>"> +where("tag_id", $tag->id) + ->find_all(); + if (count($existingGPS) > 0) { +?> + | id") ?>"> + +