From ba94a48ff66a001dd20c5ac2da34681880583945 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 17 Feb 2010 23:14:33 +0000 Subject: Fixes #1488: Removed use of deprecated functions in core. git-svn-id: http://code.elgg.org/elgg/trunk@3947 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/relationships.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'engine/lib/relationships.php') diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index 789dd4575..c67596837 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -662,11 +662,24 @@ $count = false, $site_guid = 0) { * @param true|false $pagination Whether to display pagination (default: true) * @return string The viewable list of entities */ -function list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) { +function list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = ELGG_ENTITIES_ANY_VALUE, $subtype = ELGG_ENTITIES_ANY_VALUE, $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) { $limit = (int) $limit; $offset = (int) get_input('offset'); - $count = get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship, $type, $subtype, $owner_guid, "", $limit, $offset, true); - $entities = get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship, $type, $subtype, $owner_guid, "", $limit, $offset); + $options = array( + 'relationship' => $relationship, + 'relationship_guid' => $relationship_guid, + 'inverse_relationship' => $inverse_relationship, + 'types' => $type, + 'subtypes' => $subtype, + 'owner_guid' => $owner_guid, + 'order_by' => '', + 'limit' => $limit, + 'offset' => $offset, + 'count' => TRUE + ); + $count = elgg_get_entities_from_relationship($options); + $options['count'] = FALSE; + $entities = elgg_get_entities_from_relationship($options); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination); } @@ -947,7 +960,7 @@ function already_attached($guid_one, $guid_two){ **/ function get_attachments($guid, $type=""){ - $attached = get_entities_from_relationship("attached", $guid, $inverse_relationship = false, $type, $subtype = "", $owner_guid = 0, $order_by = "time_created desc", $limit = 10, $offset = 0, $count = false, $site_guid = 0); + $attached = elgg_get_entities_from_relationship(array('relationship' => 'attached', 'relationship_guid' => $guid, 'inverse_relationship' => $inverse_relationship = false, 'types' => $type, 'subtypes' => '', 'owner_guid' => 0, 'order_by' => 'time_created desc', 'limit' => 10, 'offset' => 0, 'count' => false, 'site_guid' => 0)); return $attached; } -- cgit v1.2.3