From 4e8504f3c9f82ad48ada71ead81d0bfea4913c52 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 9 Jul 2008 15:11:58 +0000 Subject: 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 --- engine/lib/elgglib.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'engine/lib') 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; + } } -- cgit v1.2.3