aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/views.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-06-24 20:25:34 -0400
committercash <cash.costello@gmail.com>2011-06-24 20:25:34 -0400
commitefff3471e09a864948feadb989d2ac9f5f2e0fc5 (patch)
treeb11bff8918e3659f612ffe6a4267e4eeb3db0efd /engine/lib/views.php
parent43e2672f65d12a36d75ad9257a936dc93a2108f3 (diff)
downloadelgg-efff3471e09a864948feadb989d2ac9f5f2e0fc5.tar.gz
elgg-efff3471e09a864948feadb989d2ac9f5f2e0fc5.tar.bz2
Refs #1253 using 'list_type' string instead of boolean 'gallery' for entity listing
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r--engine/lib/views.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index df69593f9..7358fc0ba 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -950,9 +950,10 @@ function elgg_view_annotation(ElggAnnotation $annotation, array $vars = array(),
* 'offset' The current indexing offset
* 'limit' The number of entities to display per page
* 'full_view' Display the full view of the entities?
- * 'list_class' CSS Class applied to the list
+ * 'list_class' CSS class applied to the list
+ * 'item_class' CSS class applied to the list items
* 'pagination' Display pagination?
- * 'gallery' Display as gallery?
+ * 'list_type' List type: 'list' (default), 'gallery'
* 'list_type_toggle' Display the list type toggle?
*
* @return string The rendered list of entities
@@ -965,6 +966,13 @@ $list_type_toggle = true, $pagination = true) {
$offset = (int)get_input('offset', 0);
}
+ // list type can be passed as request parameter
+ $list_type = get_input('list_type', 'list');
+ if (get_input('listtype')) {
+ elgg_deprecated_notice("'listtype' has been deprecated by 'list_type' for lists", 1.8);
+ $list_type = get_input('listtype');
+ }
+
if (is_array($vars)) {
// new function
$defaults = array(
@@ -972,7 +980,7 @@ $list_type_toggle = true, $pagination = true) {
'list_class' => 'elgg-list-entity',
'full_view' => true,
'pagination' => true,
- 'gallery' => false,
+ 'list_type' => $list_type,
'list_type_toggle' => false,
'offset' => $offset,
);
@@ -990,18 +998,13 @@ $list_type_toggle = true, $pagination = true) {
'limit' => (int) $limit,
'full_view' => $full_view,
'pagination' => $pagination,
- 'gallery' => false,
+ 'list_type' => $list_type,
'list_type_toggle' => $list_type_toggle,
'list_class' => 'elgg-list-entity',
);
}
- $listtype = get_input('listtype', 'list');
- if ($listtype != 'list') {
- $vars['gallery'] = true;
- }
-
- if ($vars['gallery']) {
+ if ($vars['list_type'] != 'list') {
return elgg_view('page/components/gallery', $vars);
} else {
return elgg_view('page/components/list', $vars);