aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/views.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r--engine/lib/views.php23
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;
}
/**