aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.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/elgglib.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/elgglib.php')
-rw-r--r--engine/lib/elgglib.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index f1ddb2472..b39f83417 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -381,6 +381,49 @@
return $html;
}
+
+ /**
+ * Returns a view of a list of annotations, plus navigation. It is intended that this function
+ * be called from other wrapper functions.
+ *
+ * @param array $annotations List of annotations
+ * @param int $count The total number of annotations across all pages
+ * @param int $offset The current indexing offset
+ * @param int $limit The number of annotations to display per page
+ * @return string The list of annotations
+ */
+
+ function elgg_view_annotation_list($annotations, $count, $offset, $limit) {
+
+ $count = (int) $count;
+ $offset = (int) $offset;
+ $limit = (int) $limit;
+
+ $html = "";
+
+ $nav = elgg_view('navigation/pagination',array(
+
+ 'baseurl' => $_SERVER['REQUEST_URI'],
+ 'offset' => $offset,
+ 'count' => $count,
+ 'word' => 'annoff',
+
+ ));
+
+ $html .= $nav;
+
+ if (is_array($annotations) && sizeof($annotations) > 0) {
+ foreach($annotations as $annotation) {
+ $html .= elgg_view_annotation($annotation, "", false);
+ }
+ }
+
+ if ($count)
+ $html .= $nav;
+
+ return $html;
+
+ }
/**
* Displays an internal layout for the use of a plugin canvas.