aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/views.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/views.php
parentd3ae577f3a7c08c1e3add6eaff1b09661127d4f6 (diff)
downloadelgg-32f2a17bec4dc7e19cfdc5f2e5dd55b37732e910.tar.gz
elgg-32f2a17bec4dc7e19cfdc5f2e5dd55b37732e910.tar.bz2
detect pagination needs
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r--engine/lib/views.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 65ba20204..7f179f572 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -218,7 +218,7 @@ function elgg_register_ajax_view($view) {
/**
* Unregister a view for ajax calls
- *
+ *
* @param string $view The view name
* @return void
* @since 1.8.3
@@ -992,6 +992,11 @@ function elgg_view_annotation(ElggAnnotation $annotation, array $vars = array(),
function elgg_view_entity_list($entities, $vars = array(), $offset = 0, $limit = 10, $full_view = true,
$list_type_toggle = true, $pagination = true) {
+ if (!$vars["limit"] && !$vars["offset"]) {
+ // no need for pagination if listing is unlimited
+ $vars["pagination"] = false;
+ }
+
if (!is_int($offset)) {
$offset = (int)get_input('offset', 0);
}
@@ -1064,8 +1069,13 @@ function elgg_view_annotation_list($annotations, array $vars = array()) {
'full_view' => true,
'offset_key' => 'annoff',
);
-
+
$vars = array_merge($defaults, $vars);
+
+ if (!$vars["limit"] && !$vars["offset"]) {
+ // no need for pagination if listing is unlimited
+ $vars["pagination"] = false;
+ }
return elgg_view('page/components/list', $vars);
}
@@ -1334,12 +1344,12 @@ function elgg_view_list_item($item, array $vars = array()) {
/**
* View one of the elgg sprite icons
- *
+ *
* Shorthand for <span class="elgg-icon elgg-icon-$name"></span>
- *
+ *
* @param string $name The specific icon to display
* @param string $class Additional class: float, float-alt, or custom class
- *
+ *
* @return string The html for displaying an icon
*/
function elgg_view_icon($name, $class = '') {