diff options
author | Beckett Madden-Woods <beckett@beckettmw.com> | 2011-01-09 03:59:25 +0000 |
---|---|---|
committer | Beckett Madden-Woods <beckett@beckettmw.com> | 2011-01-09 03:59:25 +0000 |
commit | b78a1319ae10841ff6be00d041b3d8d6967ca7a3 (patch) | |
tree | 0a240783baea782577b7666e8c0710a0c3840400 /modules/organize/controllers | |
parent | d0df4896b0c96099709b10fa8cbb7d15a4f20461 (diff) |
Add item delete support to the organize module. Fixes #1588.
Diffstat (limited to 'modules/organize/controllers')
-rw-r--r-- | modules/organize/controllers/organize.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 62417525..4e6178b6 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -159,6 +159,21 @@ class Organize_Controller extends Controller { json::reply(null); } + function delete() { + access::verify_csrf(); + + $input = Input::instance(); + + foreach (explode(",", $input->post("item_ids")) as $item_id) { + $item = ORM::factory("item", $item_id); + if (access::can("edit", $item)) { + $item->delete(); + } + } + + json::reply(null); + } + private function _get_tree($item, $selected) { $tree = array(); $children = $item->viewable() |