From eb306be905c9fd78600841070d0796bd99ae7f73 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 6 Dec 2010 01:48:53 +0000 Subject: comments use the media view now git-svn-id: http://code.elgg.org/elgg/trunk@7544 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/views.php | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) (limited to 'engine') diff --git a/engine/lib/views.php b/engine/lib/views.php index 3885babf1..d2e63d1a5 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -836,34 +836,14 @@ $list_type_toggle = true, $pagination = true) { * @access private */ function elgg_view_annotation_list($annotations, $count, $offset, $limit) { - $count = (int) $count; - $offset = (int) $offset; - $limit = (int) $limit; - - $html = ""; - - $nav = elgg_view('navigation/pagination', array( - 'baseurl' => $_SERVER['REQUEST_URI'], - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - 'word' => 'annoff', - 'nonefound' => false, - )); - - $html .= $nav; - - if (is_array($annotations) && sizeof($annotations) > 0) { - foreach ($annotations as $annotation) { - $html .= elgg_view_annotation($annotation, true); - } - } - - if ($count) { - $html .= $nav; - } + $params = array( + 'annotations' => $annotations, + 'count' => (int) $count, + 'offset' => (int) $offset, + 'limit' => (int) $limit, + ); - return $html; + return elgg_view('annotation/list', $params); } /** @@ -959,13 +939,19 @@ function elgg_view_comments($entity, $add_comment = true) { if ($comemnts) { return $comments; } else { + $params = array( + 'entity' => $entity, + 'show_add_form' => $add_comment, + ); + $comments = elgg_view('comments/list', $params); + /* $comments = list_annotations($entity->getGUID(), 'generic_comment'); //display the new comment form if required if ($add_comment) { $comments .= elgg_view('comments/forms/edit', array('entity' => $entity)); } - +*/ return $comments; } } -- cgit v1.2.3