aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-22 21:54:25 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-22 21:54:25 +0000
commit9ad20de616eb414a24394772dd548522fd000da2 (patch)
tree9793a9d15e0355883f2874c749679cf5f604b7e4 /engine/lib/annotations.php
parent11512c0b3ef34ebf5b66e98c9c11cbbad074c037 (diff)
downloadelgg-9ad20de616eb414a24394772dd548522fd000da2.tar.gz
elgg-9ad20de616eb414a24394772dd548522fd000da2.tar.bz2
Introducing the annotation listing functions.
git-svn-id: https://code.elgg.org/elgg/trunk@1047 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r--engine/lib/annotations.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 0507cba09..4dcf9b588 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -278,6 +278,30 @@
return get_data($query, "row_to_elggannotation");
}
+
+ /**
+ * Returns a human-readable list of annotations on a particular entity.
+ *
+ * @param int $entity_guid The entity GUID
+ * @param string $name The name of the kind of annotation
+ * @param int $limit The number of annotations to display at once
+ * @param true|false $asc Whether or not the annotations are displayed in ascending order. (Default: true)
+ * @return string HTML (etc) version of the annotation list
+ */
+ function list_annotations($entity_guid, $name = "", $limit = 25, $asc = true) {
+
+ if ($asc) {
+ $asc = "asc";
+ } else {
+ $asc = "desc";
+ }
+ $count = count_annotations($entity_guid, "", "", $name);
+ $offset = (int) get_input("annoff",0);
+ $annotations = get_annotations($entity_guid, "", "", $name, "", "", $limit, $offset, $asc);
+
+ return elgg_view_annotation_list($annotations, $count, $offset, $limit);
+
+ }
/**
* Return the sum of a given integer annotation.