1
0

Added a delete button to the admin page.

This commit is contained in:
rWatcher 2009-07-24 15:27:15 -04:00
parent d711c84876
commit 9511f75ac3
2 changed files with 25 additions and 0 deletions

View File

@ -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",

View File

@ -46,6 +46,18 @@
<span class="understate">(<?= $tag->count ?>)</span>
<a href="<?= url::site("admin/tagsmap/edit_gps/$tag->id") ?>"><?= t("Edit GPS") ?></a>
<?
// 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) {
?>
| <a href="<?= url::site("admin/tagsmap/delete_gps/$tag->id") ?>"><?= t("Delete GPS") ?></a>
<?
}
?>
</li>