diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-19 20:03:55 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-19 20:03:55 +0000 |
commit | 541ca24c3903f691130f5dd33e879272b31fcd96 (patch) | |
tree | 987a27132cfdd803f05de5eac5802155dc2603b9 /views | |
parent | 849148f0079b5f723c89f332a0eb6b6b3b2e0137 (diff) | |
download | elgg-541ca24c3903f691130f5dd33e879272b31fcd96.tar.gz elgg-541ca24c3903f691130f5dd33e879272b31fcd96.tar.bz2 |
Pagination is now optional on river lists; is removed on the river widget
git-svn-id: https://code.elgg.org/elgg/trunk@2834 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/river/item/list.php | 44 |
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.'">« ' . 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.'">« ' . 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') . ' »</a> ';
+ }
+
- $nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' »</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>';
}
?>
|