From 611b8f44ed949140a6b69190c25954b840e2e783 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 6 Dec 2008 06:10:15 +0000 Subject: Add firing comment_added and comment_updated events --- modules/comment/controllers/comments.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/comment/controllers/comments.php') 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. -- cgit v1.2.3