diff options
author | Steve Clay <steve@mrclay.org> | 2013-09-20 11:59:58 -0700 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2013-09-20 11:59:58 -0700 |
commit | 5b361f8b2b00d85282bb827f5bd83cf0e44fe4df (patch) | |
tree | c4d7abbde549209c28b5007770985472e686529b /engine/lib/river.php | |
parent | d3ae577f3a7c08c1e3add6eaff1b09661127d4f6 (diff) | |
parent | 32f2a17bec4dc7e19cfdc5f2e5dd55b37732e910 (diff) | |
download | elgg-5b361f8b2b00d85282bb827f5bd83cf0e44fe4df.tar.gz elgg-5b361f8b2b00d85282bb827f5bd83cf0e44fe4df.tar.bz2 |
Merge pull request #5971 from jdalsem/detect-pagination-needs
Eliminate unneeded pagination when no limit/offset
Diffstat (limited to 'engine/lib/river.php')
-rw-r--r-- | engine/lib/river.php | 10 |
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); } |