From 6c366e6a8306f43fefb6a0bccfb010aad61a3c3d Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 16 Nov 2010 02:31:21 +0000 Subject: ported the portion of the [7027] commit that dealt with pagination to trunk git-svn-id: http://code.elgg.org/elgg/trunk@7328 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/admin/users/unvalidated.php | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php index 0a274c1dc..279c7387f 100644 --- a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php +++ b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php @@ -6,22 +6,39 @@ * @subpackage UserValidationByEmail.Administration */ -// @todo pagination would be nice. +$limit = get_input('limit', 10); +$offset = get_input('offset', 0); + // can't use elgg_list_entities() and friends because we don't use the default view for users. $ia = elgg_set_ignore_access(TRUE); $hidden_entities = access_get_show_hidden_status(); access_show_hidden_entities(TRUE); -$users = elgg_get_entities_from_metadata(array( +$options = array( 'type' => 'user', 'metadata_name' => 'validated', 'metadata_value' => 0, - 'limit' => 9999, -)); + 'limit' => $limit, + 'offset' => $offset +); +$users = elgg_get_entities_from_metadata($options); + +$options['count'] = TRUE; +$count = elgg_get_entities_from_metadata($options); access_show_hidden_entities($hidden_entities); elgg_set_ignore_access($ia); +// setup pagination +$pagination = elgg_view('navigation/pagination', array( + 'baseurl' => $vars['url'] . 'pg/admin/users/unvalidated', + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, +)); + +echo $pagination; + if ($users) { foreach ($users as $user) { $form_body .= elgg_view('uservalidationbyemail/unvalidated_user', array('theuser' => $user)); -- cgit v1.2.3