diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-06 06:10:15 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-06 06:10:15 +0000 |
commit | 611b8f44ed949140a6b69190c25954b840e2e783 (patch) | |
tree | 3d80d0e5b631e08e7464b2929a85f4242487fef7 | |
parent | bda84d71eb7a52ba29d4d1434a21bac476124877 (diff) |
Add firing comment_added and comment_updated events
-rw-r--r-- | modules/comment/controllers/comments.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index 8b2e5155..773eb25a 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -49,6 +49,8 @@ class Comments_Controller extends REST_Controller { $comment->item_id = $this->input->post('item_id'); $comment->save(); + module::event("comment_created", $comment); + rest::http_status(rest::CREATED); rest::http_location(url::site("comments/{$comment->id}")); } @@ -97,6 +99,9 @@ class Comments_Controller extends REST_Controller { $comment->email = $this->input->post('email'); $comment->text = $this->input->post('text'); $comment->save(); + + module::event("comment_updated", $comment); + return; } // @todo Return appropriate HTTP status code indicating error. |