From d611e9c962ce825eb7f4600f27f74c3dc477000f Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 13 Dec 2010 12:32:43 +0000 Subject: Refs #2226 moving riverdashboard into core - need to clean up riverdashboard plugin and move to plugins repository and update plugins with new river views git-svn-id: http://code.elgg.org/elgg/trunk@7610 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/views.php | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'engine/lib/views.php') diff --git a/engine/lib/views.php b/engine/lib/views.php index 7c542b289..fa65bcae8 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -835,18 +835,17 @@ $list_type_toggle = true, $pagination = true) { * @return string The list of annotations * @access private */ -function elgg_view_annotation_list($annotations, $count, $offset, $limit) { - $params = array( +function elgg_view_annotation_list($annotations, array $vars = array()) { + $defaults = array( 'items' => $annotations, - 'count' => (int) $count, - 'offset' => (int) $offset, - 'limit' => (int) $limit, - 'list-class' => 'elgg-annotation-list', + 'list_class' => 'elgg-annotation-list', 'full_view' => true, 'offset_key' => 'annoff', ); - return elgg_view('layout/objects/list', $params); + $vars = array_merge($defaults, $vars); + + return elgg_view('layout/objects/list', $vars); } /** @@ -1062,11 +1061,19 @@ function elgg_view_form($action, $form_vars = array(), $body_vars = array()) { * @since 1.8.0 * @access private */ -function elgg_view_list_item($item, $full_view, $vars) { - if (elgg_instanceof($item)) { - return elgg_view_entity($item, $full_view); - } else { - return elgg_view_annotation($item, $full_view); +function elgg_view_list_item($item, $full_view, array $vars = array()) { + switch ($item->getType()) { + case 'user': + case 'object': + case 'group': + case 'site': + return elgg_view_entity($item, $full_view); + case 'annotation': + return elgg_view_annotation($item, $full_view); + case 'river': + return elgg_view_river_item($item); + default: + break; } } -- cgit v1.2.3