]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #964: Tidied plugin hook into framework function, changed hook to entity:annotate.
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 17 Jun 2009 10:36:24 +0000 (10:36 +0000)
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 17 Jun 2009 10:36:24 +0000 (10:36 +0000)
git-svn-id: https://code.elgg.org/elgg/trunk@3338 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index 3846c98b2061674459f631f191cc71246e36c15c..87f2ec2783ab5e65ad06e1f25cc7410063d6b380 100644 (file)
                        }
                        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;
                        }\r
                        
                }
                
+       /**
+        * 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