From 41543b02582d1f923d5523c57ac66fa9ce61437d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 8 Oct 2011 15:24:12 -0400 Subject: Fixes #3937 updated the documentation for the access lib and a few minor code clean-ups --- engine/lib/views.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'engine/lib/views.php') diff --git a/engine/lib/views.php b/engine/lib/views.php index a18118f32..43725d3da 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1327,6 +1327,25 @@ function elgg_view_icon($name, $class = '') { return ""; } +/** + * Displays a user's access collections, using the core/friends/collections view + * + * @param int $owner_guid The GUID of the owning user + * + * @return string A formatted rendition of the collections + * @todo Move to the friends/collection.php page. + */ +function elgg_view_access_collections($owner_guid) { + if ($collections = get_user_access_collections($owner_guid)) { + foreach ($collections as $key => $collection) { + $collections[$key]->members = get_members_of_access_collection($collection->id, true); + $collections[$key]->entities = get_user_friends($owner_guid, "", 9999); + } + } + + return elgg_view('core/friends/collections', array('collections' => $collections)); +} + /** * Registers a function to handle templates. * -- cgit v1.2.3