]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #1411: Deprecated list_entities_from_relationship() in favor of elgg_list_entiti...
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 3 Nov 2010 01:22:46 +0000 (01:22 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 3 Nov 2010 01:22:46 +0000 (01:22 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7213 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/annotations.php
engine/lib/relationships.php

index 78ad7a1b1da7a30146d9abe9179186b4dbc2751e..9ed9cf5f6c741b816c27b55748f45ea52b3ac895 100644 (file)
@@ -324,7 +324,6 @@ $timeupper = 0, $entity_owner_guid = 0) {
        return get_data($query, "row_to_elggannotation");
 }
 
-
 /**
  * Returns entities based upon annotations.  Accepts the same values as
  * elgg_get_entities_from_metadata() but uses the annotations table.
@@ -489,6 +488,7 @@ $count = false, $timelower = 0, $timeupper = 0) {
  * @param boolean $fullview       Whether to display the entities in full
  * @param boolean $viewtypetoggle Can 'gallery' view can be displayed (default: no)
  *
+ * @deprecated 1.7 Use elgg_list_entities_from_annotations()
  * @return string Formatted entity list
  */
 function list_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "",
@@ -546,17 +546,10 @@ $viewtypetoggle = false) {
 /**
  * Returns a viewable list of entities from annotations.
  *
- * @param array $options Any elgg_get_entity_from_annotation() options plus:
- *
- *     offset => INT Start this many from the first result
- *
- *     limit => INT Limit results to this
- *
- *     full_view => BOOL Display full view entities
- *
- *     view_type_toggle => BOOL Display gallery / list switch
- *
- *     pagination => BOOL Display pagination links
+ * @param array $options
+ * 
+ * @see elgg_get_entities_from_annotations()
+ * @see elgg_list_entities()
  *
  * @return str
  */
index 987ba95b08ff0930ad86d286b3ea9a7aabd06305..186e5a595e29ec67f583ec4cab76ab3c295c0a62 100644 (file)
@@ -401,29 +401,27 @@ $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0) {
 /**
  * Returns a viewable list of entities by relationship
  *
- * @see elgg_view_entity_list
- *
- * @param string $relationship         The relationship eg "friends_of"
- * @param int    $relationship_guid    The guid of the entity to use query
- * @param bool   $inverse_relationship Invert relationship owner
- * @param string $type                 The type of entity (eg 'object')
- * @param string $subtype              The entity subtype
- * @param int    $owner_guid           The owner (default: all)
- * @param int    $limit                The number of entities to display on a page
- * @param bool   $fullview             Whether or not to display the full view (default: true)
- * @param bool   $viewtypetoggle       Whether or not to allow gallery view
- * @param bool   $pagination           Whether to display pagination (default: true)
+ * @param array $options
+ * 
+ * @see elgg_list_entities()
+ * @see elgg_get_entities_from_relationship()
  *
  * @return string The viewable list of entities
  */
+function elgg_list_entities_from_relationship(array $options = array()) {
+       return elgg_list_entities($options, 'elgg_get_entities_from_relationship');
+}
+
+/**
+ * @deprecated 1.8 Use elgg_list_entities_from_relationship()
+ */
 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');
-       $options = array(
+       elgg_deprecated_notice("list_entities_from_relationship was deprecated by elgg_list_entities_from_relationship()!", 1.8);
+       return elgg_list_entities_from_relationship(array(
                'relationship' => $relationship,
                'relationship_guid' => $relationship_guid,
                'inverse_relationship' => $inverse_relationship,
@@ -432,15 +430,8 @@ $fullview = true, $viewtypetoggle = false, $pagination = true) {
                '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);
+       ));
 }
 
 /**