aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default/object/groupforumtopic.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups/views/default/object/groupforumtopic.php')
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php56
1 files changed, 35 insertions, 21 deletions
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index 6ac6d5eda..e6988d16e 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -5,7 +5,7 @@
* @package ElggGroups
*/
-$full = elgg_extract('full', $vars, FALSE);
+$full = elgg_extract('full_view', $vars, FALSE);
$topic = elgg_extract('entity', $vars, FALSE);
if (!$topic) {
@@ -16,34 +16,42 @@ $poster = $topic->getOwnerEntity();
$group = $topic->getContainerEntity();
$excerpt = elgg_get_excerpt($topic->description);
-$poster_icon = elgg_view('profile/icon', array('entity' => $poster, 'size' => 'tiny'));
+$poster_icon = elgg_view_entity_icon($poster, 'tiny');
$poster_link = elgg_view('output/url', array(
'href' => $poster->getURL(),
'text' => $poster->name,
+ 'is_trusted' => true,
));
$poster_text = elgg_echo('groups:started', array($poster->name));
$tags = elgg_view('output/tags', array('tags' => $topic->tags));
$date = elgg_view_friendly_time($topic->time_created);
-$comments_link = '';
-$comments_text = '';
-$num_comments = $topic->countComments();
-if ($num_comments != 0) {
- $last_comment = $topic->getAnnotations("generic_comment", 1, 0, "desc");
- $commenter = $last_comment[0]->getOwnerEntity();
- $comment_time = elgg_view_friendly_time($last_comment[0]->time_created);
- $comments_text = elgg_echo('groups:updated', array($commenter->name, $comment_time));
+$replies_link = '';
+$reply_text = '';
+$num_replies = elgg_get_annotations(array(
+ 'annotation_name' => 'group_topic_post',
+ 'guid' => $topic->getGUID(),
+ 'count' => true,
+));
+if ($num_replies != 0) {
+ $last_reply = $topic->getAnnotations('group_topic_post', 1, 0, 'desc');
+ $poster = $last_reply[0]->getOwnerEntity();
+ $reply_time = elgg_view_friendly_time($last_reply[0]->time_created);
+ $reply_text = elgg_echo('groups:updated', array($poster->name, $reply_time));
- $comments_link = elgg_view('output/url', array(
- 'href' => $topic->getURL() . '#topic-comments',
- 'text' => elgg_echo("comments") . " ($num_comments)",
+ $replies_link = elgg_view('output/url', array(
+ 'href' => $topic->getURL() . '#group-replies',
+ 'text' => elgg_echo('group:replies') . " ($num_replies)",
+ 'is_trusted' => true,
));
}
-$metadata = elgg_view('layout/objects/list/metadata', array(
- 'entity' => $topic,
+$metadata = elgg_view_menu('entity', array(
+ 'entity' => $vars['entity'],
'handler' => 'discussion',
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
));
// do not show the metadata and controls in widget view
@@ -52,27 +60,32 @@ if (elgg_in_context('widgets')) {
}
if ($full) {
- $subtitle = "$poster_text $date $comments_link";
+ $subtitle = "$poster_text $date $replies_link";
$params = array(
'entity' => $topic,
- 'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
'tags' => $tags,
);
- $list_body = elgg_view('layout/objects/list/body', $params);
+ $params = $params + $vars;
+ $list_body = elgg_view('object/elements/summary', $params);
$info = elgg_view_image_block($poster_icon, $list_body);
+
+ $body = elgg_view('output/longtext', array(
+ 'value' => $topic->description,
+ 'class' => 'clearfix',
+ ));
+
echo <<<HTML
-$header
$info
$body
HTML;
} else {
// brief view
- $subtitle = "$poster_text $date $comments_link <span class=\"groups-latest-comment\">$comments_text</span>";
+ $subtitle = "$poster_text $date $replies_link <span class=\"groups-latest-reply\">$reply_text</span>";
$params = array(
'entity' => $topic,
@@ -81,7 +94,8 @@ HTML;
'tags' => $tags,
'content' => $excerpt,
);
- $list_body = elgg_view('layout/objects/list/body', $params);
+ $params = $params + $vars;
+ $list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($poster_icon, $list_body);
}