aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/river.php
diff options
context:
space:
mode:
authorJeroen Dalsem <jdalsem@coldtrick.com>2013-09-20 10:36:27 +0200
committerJeroen Dalsem <jdalsem@coldtrick.com>2013-09-20 10:36:27 +0200
commit32f2a17bec4dc7e19cfdc5f2e5dd55b37732e910 (patch)
treec4d7abbde549209c28b5007770985472e686529b /engine/lib/river.php
parentd3ae577f3a7c08c1e3add6eaff1b09661127d4f6 (diff)
downloadelgg-32f2a17bec4dc7e19cfdc5f2e5dd55b37732e910.tar.gz
elgg-32f2a17bec4dc7e19cfdc5f2e5dd55b37732e910.tar.bz2
detect pagination needs
Diffstat (limited to 'engine/lib/river.php')
-rw-r--r--engine/lib/river.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 4926a85c4..e92040eb7 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -120,7 +120,7 @@ $posted = 0, $annotation_id = 0) {
* subtypes => STR|ARR Entity subtype string(s)
* type_subtype_pairs => ARR Array of type => subtype pairs where subtype
* can be an array of subtype strings
- *
+ *
* posted_time_lower => INT The lower bound on the time posted
* posted_time_upper => INT The upper bound on the time posted
*
@@ -434,8 +434,13 @@ function elgg_list_river(array $options = array()) {
'pagination' => TRUE,
'list_class' => 'elgg-list-river elgg-river', // @todo remove elgg-river in Elgg 1.9
);
-
+
$options = array_merge($defaults, $options);
+
+ if (!$options["limit"] && !$options["offset"]) {
+ // no need for pagination if listing is unlimited
+ $options["pagination"] = false;
+ }
$options['count'] = TRUE;
$count = elgg_get_river($options);
@@ -445,6 +450,7 @@ function elgg_list_river(array $options = array()) {
$options['count'] = $count;
$options['items'] = $items;
+
return elgg_view('page/components/list', $options);
}