diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-01-24 21:32:03 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-01-24 21:44:43 -0500 |
commit | 5a3390fbb42a787f7c2ba4f13b6a6843d9a90c7b (patch) | |
tree | 476d707a3ecd3b2dc0ca43b3692a0257234ff66a /engine/lib/views.php | |
parent | 38679b40b4234a4739e14ba418d1cd82110bd02c (diff) | |
download | elgg-5a3390fbb42a787f7c2ba4f13b6a6843d9a90c7b.tar.gz elgg-5a3390fbb42a787f7c2ba4f13b6a6843d9a90c7b.tar.bz2 |
Fixes #4272 where an array of entity types can be used, use array in config object
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r-- | engine/lib/views.php | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php index 0a7969ae3..4883ee739 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1330,21 +1330,18 @@ function elgg_view_form($action, $form_vars = array(), $body_vars = array()) { * @access private */ function elgg_view_list_item($item, array $vars = array()) { + global $CONFIG; - switch ($item->getType()) { - case 'user': - case 'object': - case 'group': - case 'site': - return elgg_view_entity($item, $vars); - case 'annotation': - return elgg_view_annotation($item, $vars); - case 'river': - return elgg_view_river_item($item, $vars); - default: - return false; - break; + $type = $item->getType(); + if (in_array($type, $CONFIG->entity_types)) { + return elgg_view_entity($item, $vars); + } else if ($type == 'annotation') { + return elgg_view_annotation($item, $vars); + } else if ($type == 'river') { + return elgg_view_river_item($item, $vars); } + + return false; } /** |