diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-09 15:11:58 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-09 15:11:58 +0000 |
commit | 4e8504f3c9f82ad48ada71ead81d0bfea4913c52 (patch) | |
tree | a04bb637600752fd1c12b151f361a8d7c2c5e6e2 | |
parent | ed0e804d3cbca06ff1ba5e202bacf8009e26c04b (diff) | |
download | elgg-4e8504f3c9f82ad48ada71ead81d0bfea4913c52.tar.gz elgg-4e8504f3c9f82ad48ada71ead81d0bfea4913c52.tar.bz2 |
Added a comment hook so that other plugins can handle comments instead
git-svn-id: https://code.elgg.org/elgg/trunk@1362 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/elgglib.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index e0970ef91..c2cc9cff8 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -496,12 +496,18 @@ if (!($entity instanceof ElggEntity)) return false;
- $comments = list_annotations($entity->getGUID(),'generic_comment');
-
- //display the comment form
- $comments .= elgg_view('comments/forms/edit',array('entity' => $entity));
-
- return $comments;
+ if ($comments = trigger_plugin_hook('comments',$entity->getType(),array('entity' => $entity),false)) {
+
+ return $comments;
+
+ } else {
+ $comments = list_annotations($entity->getGUID(),'generic_comment');
+
+ //display the comment form
+ $comments .= elgg_view('comments/forms/edit',array('entity' => $entity));
+
+ return $comments;
+ }
}
|