aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/access.php
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-03 01:05:34 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-03 01:05:34 +0000
commit08b8b7d630b1958e7b363c3794f8b67f667a9128 (patch)
tree81b7e3b1d5f931dae7d517500c2762ccdcc4b736 /engine/lib/access.php
parentb8688c6c4f82c5eb3ec3f9744a0ba2e348cb45ba (diff)
downloadelgg-08b8b7d630b1958e7b363c3794f8b67f667a9128.tar.gz
elgg-08b8b7d630b1958e7b363c3794f8b67f667a9128.tar.bz2
Fixes #2606: Abstracted elgg_list_entities. Takes an optional second argument for the 'getter', defaulting to 'elgg_get_entities'. Converted current elgg_list_entities* functions to use it
git-svn-id: http://code.elgg.org/elgg/trunk@7212 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/access.php')
-rw-r--r--engine/lib/access.php45
1 files changed, 26 insertions, 19 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 5b67afbd1..78f933b27 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -843,29 +843,36 @@ function elgg_get_entities_from_access_id(array $options = array()) {
/**
* Lists entities from an access collection
*
- * @param int $collection_id ID of collection
- * @param string $entity_type Type of entities
- * @param string $entity_subtype Subtype of entities
- * @param int $owner_guid Guid of owner
- * @param int $limit Limit of number of entities to return
- * @param bool $fullview Show a full view
- * @param bool $viewtypetoggle Allow to toggle between views
- * @param bool $pagination Show pagination
- *
+ * @param array $options See elgg_list_entities() and elgg_get_entities_from_access_id()
+ *
+ * @see elgg_list_entities()
+ * @see elgg_get_entities_from_access_id()
+ *
+ * @return str
+ */
+function elgg_list_entities_from_access_id(array $options = array()) {
+ return elgg_list_entities($options, 'elgg_get_entities_from_access_id');
+}
+
+/**
* @return str
- * @todo deprecate with elgg_list_entities_from_access_id() function
+ * @deprecated 1.8 Use elgg_list_entities_from_access_id()
*/
function list_entities_from_access_id($collection_id, $entity_type = "", $entity_subtype = "",
$owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
- $offset = (int) get_input('offset');
- $limit = (int) $limit;
- $count = get_entities_from_access_id($collection_id, $entity_type, $entity_subtype,
- $owner_guid, $limit, $offset, "", 0, true);
- $entities = get_entities_from_access_id($collection_id, $entity_type, $entity_subtype,
- $owner_guid, $limit, $offset, "", 0, false);
-
- return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+
+ elgg_deprecated_notice("All list_entities* functions were deprecated in 1.8. Use elgg_list_entities* instead.", 1.8);
+
+ echo elgg_list_entities_from_access_id(array(
+ 'collection_id' => $collection_id,
+ 'types' => $entity_type,
+ 'subtypes' => $entity_subtype,
+ 'owner_guids' => $owner_guid,
+ 'limit' => $limit,
+ 'full_view' => $fullview,
+ 'view_type_toggle' => $viewtypetoggle,
+ 'pagination' => $pagination,
+ ));
}
/**