]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
ported the portion of the [7027] commit that dealt with pagination to trunk
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 16 Nov 2010 02:31:21 +0000 (02:31 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 16 Nov 2010 02:31:21 +0000 (02:31 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7328 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/uservalidationbyemail/views/default/admin/users/unvalidated.php

index 0a274c1dcc5cfafa1d8946b111f1ca0c6b4f6a3e..279c7387fa2febf8fcaa4cf43249d567528b3e3b 100644 (file)
@@ -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));