Added a delete button to the admin page.
This commit is contained in:
parent
d711c84876
commit
9511f75ac3
|
@ -44,6 +44,19 @@ class Admin_TagsMap_Controller extends Admin_Controller {
|
||||||
print $view;
|
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) {
|
private function _get_tagsgpsedit_form($tag_id) {
|
||||||
// Make a new Form.
|
// Make a new Form.
|
||||||
$form = new Forge("admin/tagsmap/savegps", "", "post",
|
$form = new Forge("admin/tagsmap/savegps", "", "post",
|
||||||
|
|
|
@ -46,6 +46,18 @@
|
||||||
<span class="understate">(<?= $tag->count ?>)</span>
|
<span class="understate">(<?= $tag->count ?>)</span>
|
||||||
|
|
||||||
<a href="<?= url::site("admin/tagsmap/edit_gps/$tag->id") ?>"><?= t("Edit GPS") ?></a>
|
<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>
|
</li>
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user