summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-12-06 06:10:15 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-12-06 06:10:15 +0000
commit611b8f44ed949140a6b69190c25954b840e2e783 (patch)
tree3d80d0e5b631e08e7464b2929a85f4242487fef7
parentbda84d71eb7a52ba29d4d1434a21bac476124877 (diff)
Add firing comment_added and comment_updated events
-rw-r--r--modules/comment/controllers/comments.php5
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.