From 2444225aaf495cd8df9029ae2d3a03ef0a2fd6f5 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 17 Jun 2009 10:36:24 +0000 Subject: Refs #964: Tidied plugin hook into framework function, changed hook to entity:annotate. git-svn-id: https://code.elgg.org/elgg/trunk@3338 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 3846c98b2..87f2ec278 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -636,16 +636,8 @@ } if ($full) // Marcus Povey 20090616 : Speculative and low impact approach for fixing #964 { - $annotations = trigger_plugin_hook('annotations:view', $entity_class, array( - 'entity' => $entity, - 'full' => $full, - - // We already know this, so pass it on. - 'type' => $entity_type, - 'subtype' => $subtype - ) - ); - + $annotations = elgg_view_entity_annotations($entity, $full); + if ($annotations) $contents .= $annotations; } @@ -784,6 +776,30 @@ } + /** + * Display a selective rendered list of annotations for a given entity. + * + * The list is produced as the result of the entity:annotate plugin hook and is designed to provide a + * more generic framework to allow plugins to extend the generic display of entities with their own annotation + * renderings. + * + * This is called automatically by the framework. + * + * @param ElggEntity $entity + * @param bool $full + */ + function elgg_view_entity_annotations(ElggEntity $entity, $full = true) + { + $annotations = trigger_plugin_hook('entity:annotate', $entity_class, + array( + 'entity' => $entity, + 'full' => $full, + ) + ); + + return $annotations; + } + /** * Displays an internal layout for the use of a plugin canvas. * Takes a variable number of parameters, which are made available -- cgit v1.2.3