aboutsummaryrefslogtreecommitdiff
path: root/views/default/river/item
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-05 03:20:27 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-05 03:20:27 +0000
commit2cd3ef9e9b25a9166b6c816d622f593a41256898 (patch)
treee1b9b947662080d6953513f6714e8a6abfd186f0 /views/default/river/item
parente53bf6cc34137cee9bec69cbe5c35c3851567fe9 (diff)
downloadelgg-2cd3ef9e9b25a9166b6c816d622f593a41256898.tar.gz
elgg-2cd3ef9e9b25a9166b6c816d622f593a41256898.tar.bz2
Fixes #1481: Applie Mike's patch and created function elgg_http_add_url_query_elements() to handle what the pagination view was trying to do.
git-svn-id: http://code.elgg.org/elgg/trunk@3903 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/river/item')
-rw-r--r--views/default/river/item/list.php15
1 files changed, 2 insertions, 13 deletions
diff --git a/views/default/river/item/list.php b/views/default/river/item/list.php
index f9d8dd283..8fcc84bea 100644
--- a/views/default/river/item/list.php
+++ b/views/default/river/item/list.php
@@ -26,18 +26,12 @@
if ($vars['pagination'] !== false) {
$baseurl = $_SERVER['REQUEST_URI'];
- $baseurl = elgg_http_remove_url_query_element($baseurl, 'offset');
$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;
- }
+ $nexturl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset));
$nav .= '<a class="back" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
}
@@ -47,12 +41,7 @@
if ($newoffset < 0) {
$newoffset = 0;
}
- $urladdition = 'offset='.$newoffset;
- if (substr_count($baseurl,'?')) {
- $prevurl=$baseurl . '&' . $urladdition;
- } else {
- $prevurl=$baseurl . '?' . $urladdition;
- }
+ $prevurl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset));
$nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
}