aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-21 13:00:08 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-21 13:00:08 +0000
commit75187715f6d7a04bbda4858d6a17138001da4807 (patch)
tree9a87d9b742c6f82bd6a9ac3a9c51c972ec6cb670
parentc100c017b6c9aeb6faf5b901fe0e128035e9b1e0 (diff)
downloadelgg-75187715f6d7a04bbda4858d6a17138001da4807.tar.gz
elgg-75187715f6d7a04bbda4858d6a17138001da4807.tar.bz2
deprecated two site functions and removed a use of previously deprecated function in the wire plugin
git-svn-id: http://code.elgg.org/elgg/trunk@7396 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggSite.php9
-rw-r--r--engine/lib/sites.php10
-rw-r--r--engine/lib/views.php10
-rw-r--r--mod/thewire/index.php7
4 files changed, 27 insertions, 9 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 6c70d176b..93d442e0a 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -204,7 +204,14 @@ class ElggSite extends ElggEntity {
* @return array of ElggUsers
*/
public function getMembers($limit = 10, $offset = 0) {
- get_site_members($this->getGUID(), $limit, $offset);
+ return elgg_get_entities_from_relationship(array(
+ 'relationship' => 'member_of_site',
+ 'relationship_guid' => $this->getGUID(),
+ 'inverse_relationship' => TRUE,
+ 'types' => 'user',
+ 'limit' => $limit,
+ 'offset' => $offset
+ ));
}
/**
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 79b71d901..cf838e720 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -139,8 +139,12 @@ function remove_site_user($site_guid, $user_guid) {
* @param int $offset Offset
*
* @return mixed
+ * @deprecated 1.8 Use ElggSite::getMembers()
*/
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;
@@ -162,8 +166,13 @@ 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'
*/
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);
+
$offset = (int) get_input('offset');
$limit = (int) $limit;
$options = array(
@@ -179,7 +188,6 @@ function list_site_members($site_guid, $limit = 10, $fullview = true) {
$entities = get_site_members($site_guid, $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
-
}
/**
diff --git a/engine/lib/views.php b/engine/lib/views.php
index f20eabfbf..0c9e83bab 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -786,13 +786,11 @@ function elgg_view_annotation(ElggAnnotation $annotation, $bypass = true, $debug
* Returns a rendered list of entities with pagination. This function should be
* called by wrapper functions.
*
- * @see list_entities()
- * @see list_user_objects()
+ * @see elgg_list_entities()
* @see list_user_friends_objects()
- * @see list_entities_from_metadata()
- * @see list_entities_from_metadata_multi()
- * @see list_entities_from_relationships()
- * @see list_site_members()
+ * @see elgg_list_entities_from_metadata()
+ * @see elgg_list_entities_from_relationships()
+ * @see elgg_list_entities_from_annotations()
*
* @param array $entities List of entities
* @param int $count The total number of entities across all pages
diff --git a/mod/thewire/index.php b/mod/thewire/index.php
index 36dc5ddab..6cd49e472 100644
--- a/mod/thewire/index.php
+++ b/mod/thewire/index.php
@@ -27,7 +27,12 @@
$area2 .= elgg_view("thewire/forms/add");
// Display the user's wire
- $area2 .= list_user_objects($page_owner->getGUID(),'thewire');
+ $options = array(
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'owner_guid' => $page_owner->getGUID()
+ );
+ $area2 .= elgg_list_entities($options);
//select the correct canvas area
$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));