aboutsummaryrefslogtreecommitdiff
path: root/views/default/river
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/river')
-rw-r--r--views/default/river/item/list.php44
1 files changed, 24 insertions, 20 deletions
diff --git a/views/default/river/item/list.php b/views/default/river/item/list.php
index 08f8d455d..f529aac3f 100644
--- a/views/default/river/item/list.php
+++ b/views/default/river/item/list.php
@@ -16,31 +16,35 @@
}
- $baseurl = $_SERVER['REQUEST_URI'];
- $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
+ if ($vars['pagination'] !== false) {
- $nav = '';
-
- if (sizeof($vars['items']) > $vars['limit']) {
- $newoffset = $vars['offset'] + $vars['limit'];
- $urladdition = 'offset='.$newoffset;
- if (substr_count($baseurl,'?')) $nexturl=$baseurl . '&' . $urladdition; else $nexturl=$baseurl . '?' . $urladdition;
+ $baseurl = $_SERVER['REQUEST_URI'];
+ $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
- $nav .= '<a class="back" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
- }
+ $nav = '';
- if ($vars['offset'] > 0) {
- $newoffset = $vars['offset'] - $vars['limit'];
- if ($newoffset < 0) $newoffset = 0;
- $urladdition = 'offset='.$newoffset;
- if (substr_count($baseurl,'?')) $prevurl=$baseurl . '&' . $urladdition; else $prevurl=$baseurl . '?' . $urladdition;
+ if (sizeof($vars['items']) > $vars['limit']) {
+ $newoffset = $vars['offset'] + $vars['limit'];
+ $urladdition = 'offset='.$newoffset;
+ if (substr_count($baseurl,'?')) $nexturl=$baseurl . '&' . $urladdition; else $nexturl=$baseurl . '?' . $urladdition;
+
+ $nav .= '<a class="back" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
+ }
+
+ if ($vars['offset'] > 0) {
+ $newoffset = $vars['offset'] - $vars['limit'];
+ if ($newoffset < 0) $newoffset = 0;
+ $urladdition = 'offset='.$newoffset;
+ if (substr_count($baseurl,'?')) $prevurl=$baseurl . '&' . $urladdition; else $prevurl=$baseurl . '?' . $urladdition;
+
+ $nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
+ }
+
- $nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
- }
-
+ if (!empty($nav)) {
+ echo '<div class="river_pagination"><p>'.$nav.'</p><div class="clearfloat"></div></div>';
+ }
- if (!empty($nav)) {
- echo '<div class="river_pagination"><p>'.$nav.'</p><div class="clearfloat"></div></div>';
}
?>