aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-18 13:34:58 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-18 13:34:58 +0000
commit269386b9cfa0e1558edde89442c6f571ef32c645 (patch)
tree8714e84ec6bcfca99bf3ee560024090d36cc6543 /engine/lib/users.php
parentc3a4bafc3f3f0984e8751e00e024ab8c09e0ff1b (diff)
downloadelgg-269386b9cfa0e1558edde89442c6f571ef32c645.tar.gz
elgg-269386b9cfa0e1558edde89442c6f571ef32c645.tar.bz2
Added generic listing and pagination functions
git-svn-id: https://code.elgg.org/elgg/trunk@964 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 5065a633a..16e7a2c5f 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -526,6 +526,27 @@
$total = get_entities('object', $subtype, $user_guid, "time_created desc", null, null, true);
return $total;
}
+
+ /**
+ * Displays a list of user objects of a particular subtype, with navigation.
+ *
+ * @see elgg_view_entity_list
+ *
+ * @param int $user_guid The GUID of the user
+ * @param string $subtype The object subtype
+ * @param int $limit The number of entities to display on a page
+ * @return string The list in a form suitable to display
+ */
+ function list_user_objects($user_guid, $subtype = "", $limit = 10) {
+
+ $offset = (int) get_input('offset');
+ $limit = (int) $limit;
+ $count = (int) count_user_objects($user_guid, $subtype);
+ $entities = get_user_objects($user_guid, $subtype, $limit, $offset);
+
+ return elgg_view_entity_list($entities, $count, $offset, $limit);
+
+ }
/**
* Obtains a list of objects owned by a user's friends
@@ -566,6 +587,27 @@
}
/**
+ * Displays a list of a user's friends' objects of a particular subtype, with navigation.
+ *
+ * @see elgg_view_entity_list
+ *
+ * @param int $user_guid The GUID of the user
+ * @param string $subtype The object subtype
+ * @param int $limit The number of entities to display on a page
+ * @return string The list in a form suitable to display
+ */
+ function list_user_friends_objects($user_guid, $subtype = "", $limit = 10) {
+
+ $offset = (int) get_input('offset');
+ $limit = (int) $limit;
+ $count = (int) count_user_friends_objects($user_guid, $subtype);
+ $entities = get_user_friends_objects($user_guid, $subtype, $limit, $offset);
+
+ return elgg_view_entity_list($entities, $count, $offset, $limit);
+
+ }
+
+ /**
* Get user objects by an array of metadata
*
* @param int $user_guid The GUID of the owning user