aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-22 23:11:29 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-22 23:11:29 +0000
commitda4c15449dd48b3135ac14924e04c88bed8da427 (patch)
treec8afab45e5105afc0631445572c0aa9b1a934196 /engine/lib
parent63722e11e656df0328f0051f68ad993e04b8947f (diff)
downloadelgg-da4c15449dd48b3135ac14924e04c88bed8da427.tar.gz
elgg-da4c15449dd48b3135ac14924e04c88bed8da427.tar.bz2
updated the deprecated list_site_members() to use new ElggSite::listMembers() method and updated ElggSite::getMembers() to accept all the arguments from elgg_get_entities()
git-svn-id: http://code.elgg.org/elgg/trunk@7422 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/sites.php38
1 files changed, 14 insertions, 24 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index ac048c26b..f8590a4e0 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -136,17 +136,12 @@ function get_site_members($site_guid, $limit = 10, $offset = 0) {
elgg_deprecated_notice("get_site_members() deprecated.
Use ElggSite::getMembers()", 1.8);
- $site_guid = (int)$site_guid;
- $limit = (int)$limit;
- $offset = (int)$offset;
+ $site = get_entity($site_guid);
+ if ($site) {
+ return $site->getMembers($limit, $offset);
+ }
- return elgg_get_entities_from_relationship(array(
- 'relationship' => 'member_of_site',
- 'relationship_guid' => $site_guid,
- 'inverse_relationship' => TRUE,
- 'types' => 'user',
- 'limit' => $limit, 'offset' => $offset
- ));
+ return false;
}
/**
@@ -157,28 +152,23 @@ function get_site_members($site_guid, $limit = 10, $offset = 0) {
* @param bool $fullview Whether or not to display the full view (default: true)
*
* @return string A displayable list of members
- * @deprecated 1.8 Use elgg_list_entities_from_relationships() with relationship
- * 'member_of_site'
+ * @deprecated 1.8 Use ElggSite::listMembers()
*/
function list_site_members($site_guid, $limit = 10, $fullview = true) {
elgg_deprecated_notice("list_site_members() deprecated.
- Use elgg_list_entities_from_relationships()", 1.8);
+ Use ElggSite::listMembers()", 1.8);
- $offset = (int) get_input('offset');
- $limit = (int) $limit;
$options = array(
- 'relationship' => 'member_of_site',
- 'relationship_guid' => $site_guid,
- 'inverse_relationship' => TRUE,
- 'types' => 'user',
'limit' => $limit,
- 'offset' => $offset,
- 'count' => TRUE
+ 'full_view' => $full_view,
);
- $count = (int) elgg_get_entities_from_relationship($options);
- $entities = get_site_members($site_guid, $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
+ $site = get_entity($site_guid);
+ if ($site) {
+ return $site->listMembers($options);
+ }
+
+ return '';
}
/**