From 8680a8aad4ead5605463c1b0642486da842e9180 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 30 Nov 2009 23:00:20 +0000 Subject: Added pagination to comments view. git-svn-id: http://code.elgg.org/elgg/trunk@3712 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/search/views/default/search/listing.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mod/search/views/default') 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']}"); -- cgit v1.2.3