aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-09 15:11:58 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-09 15:11:58 +0000
commit4e8504f3c9f82ad48ada71ead81d0bfea4913c52 (patch)
treea04bb637600752fd1c12b151f361a8d7c2c5e6e2 /engine/lib/elgglib.php
parented0e804d3cbca06ff1ba5e202bacf8009e26c04b (diff)
downloadelgg-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
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php18
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;
+ }
}