diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-06-17 10:36:24 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-06-17 10:36:24 +0000 |
commit | 2444225aaf495cd8df9029ae2d3a03ef0a2fd6f5 (patch) | |
tree | 7b7926876e25494102a162aa168db4754a7b0369 /engine/lib | |
parent | 56d9f24a7dc866ea1070f52ab6ceb1c7268005d2 (diff) | |
download | elgg-2444225aaf495cd8df9029ae2d3a03ef0a2fd6f5.tar.gz elgg-2444225aaf495cd8df9029ae2d3a03ef0a2fd6f5.tar.bz2 |
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
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 36 |
1 files changed, 26 insertions, 10 deletions
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; }
@@ -785,6 +777,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 * in the views as $vars['area1'] .. $vars['areaN']. |