aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-11 21:38:38 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-11 21:38:38 +0000
commitce7f8e4f6763a2f1ce10b90c99c839ea2b46ee1d (patch)
tree80f81a14876312567ca109dfb2c714c754abc40c /engine/lib
parent8dbf58c92c0ccc80f84585f3be7c37f3fa6fff83 (diff)
downloadelgg-ce7f8e4f6763a2f1ce10b90c99c839ea2b46ee1d.tar.gz
elgg-ce7f8e4f6763a2f1ce10b90c99c839ea2b46ee1d.tar.bz2
Added $viewer callback option for elgg_list_entities().
git-svn-id: http://code.elgg.org/elgg/trunk@8117 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index bc097e4ab..fb4cdd2e6 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -764,7 +764,7 @@ function elgg_get_entities(array $options = array()) {
'wheres' => array(),
'joins' => array(),
- 'callback' => 'entity_row_to_elggstar',
+ 'callback' => 'entity_row_to_elggstar',
);
$options = array_merge($defaults, $options);
@@ -1136,12 +1136,16 @@ $time_created_lower = NULL, $time_updated_upper = NULL, $time_updated_lower = NU
*
* @tip Pagination is handled automatically.
*
+ * @internal This also provides the views for elgg_view_annotation().
+ *
* @param array $options Any options from $getter options plus:
* full_view => BOOL Display full view entities
* list_type_toggle => BOOL Display gallery / list switch
* pagination => BOOL Display pagination links
+ * gallery => BOOL display in gallery view
*
- * @param mixed $getter The entity getter function to use to fetch the entities
+ * @param mixed $getter The entity getter function to use to fetch the entities
+ * @param mixed $viewer The function to use to view the entity list.
*
* @return string
* @since 1.7
@@ -1149,7 +1153,9 @@ $time_created_lower = NULL, $time_updated_upper = NULL, $time_updated_lower = NU
* @see elgg_view_entity_list()
* @link http://docs.elgg.org/Entities/Output
*/
-function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entities') {
+function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entities',
+ $viewer = 'elgg_view_entity_list') {
+
$defaults = array(
'offset' => (int) max(get_input('offset', 0), 0),
'limit' => (int) max(get_input('limit', 10), 0),
@@ -1174,7 +1180,7 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
$options['count'] = $count;
- return elgg_view_entity_list($entities, $options);
+ return $viewer($entities, $options);
}
/**