aboutsummaryrefslogtreecommitdiff
path: root/mod/search
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-30 23:00:20 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-30 23:00:20 +0000
commit8680a8aad4ead5605463c1b0642486da842e9180 (patch)
tree38916760446d7020d653fcd8b9387aa72817b53b /mod/search
parent6a072f3454cd7af60875b080de5246a957b6abbd (diff)
downloadelgg-8680a8aad4ead5605463c1b0642486da842e9180.tar.gz
elgg-8680a8aad4ead5605463c1b0642486da842e9180.tar.bz2
Added pagination to comments view.
git-svn-id: http://code.elgg.org/elgg/trunk@3712 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search')
-rw-r--r--mod/search/views/default/search/listing.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/search/views/default/search/listing.php b/mod/search/views/default/search/listing.php
index d4bdf3a98..b2ce79924 100644
--- a/mod/search/views/default/search/listing.php
+++ b/mod/search/views/default/search/listing.php
@@ -16,6 +16,31 @@ if (!is_array($vars['entities']) || !count($vars['entities'])) {
return FALSE;
}
+$query = htmlspecialchars(http_build_query(
+ array(
+ 'q' => $vars['params']['query'],
+ 'entity_type' => $vars['params']['type'],
+ 'entity_subtype' => $vars['params']['subtype'],
+ 'limit' => get_input('limit', 10),
+ 'offset' => get_input('offset', 0),
+ 'search_type' => 'comments',
+ )
+));
+
+$url = "{$vars['url']}pg/search?$query";
+
+// get pagination
+if (array_key_exists('pagination', $vars) && $vars['pagination']) {
+ $nav .= elgg_view('navigation/pagination',array(
+ 'baseurl' => $url,
+ 'offset' => $vars['params']['offset'],
+ 'count' => $vars['count'],
+ 'limit' => $vars['params']['limit'],
+ ));
+} else {
+ $nav = '';
+}
+
// figure out what we're deal with.
if (array_key_exists('type', $vars['params']) && array_key_exists('subtype', $vars['params'])) {
$type_str = elgg_echo("item:{$vars['params']['type']}:{$vars['params']['subtype']}");