aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-19 16:31:35 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-19 16:31:35 +0000
commit856dc92ef07c9fe06339349224533a12898b31d7 (patch)
tree4e1a665848a8339a0c37cab948edab259f338d5f /mod/groups/views
parent47e359de2e11aac5c89039fbac11c1c871d3baed (diff)
downloadelgg-856dc92ef07c9fe06339349224533a12898b31d7.tar.gz
elgg-856dc92ef07c9fe06339349224533a12898b31d7.tar.bz2
There was no point in group discussions having their own comment annotations, better to use the generic comments so this has been changed and a full group activity stream added. For v1.8, there will need to be an upgrade script which will change 'group_topic_post' -> 'generic_comment' and on all existing topics, take the first annotation of type 'group_topic_post' and populate the topic's description.
git-svn-id: http://code.elgg.org/elgg/trunk@6526 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views')
-rw-r--r--mod/groups/views/default/forms/forums/addpost.php34
-rw-r--r--mod/groups/views/default/forms/forums/edittopic.php11
-rw-r--r--mod/groups/views/default/forum/maintopic.php (renamed from mod/groups/views/default/forum/topicposts.php)135
-rw-r--r--mod/groups/views/default/forum/topics.php22
-rw-r--r--mod/groups/views/default/forum/viewposts.php85
-rw-r--r--mod/groups/views/default/groups/css.php3
-rw-r--r--mod/groups/views/default/groups/forum_latest.php17
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php118
-rw-r--r--mod/groups/views/default/river/forum/topic/create.php17
9 files changed, 179 insertions, 263 deletions
diff --git a/mod/groups/views/default/forms/forums/addpost.php b/mod/groups/views/default/forms/forums/addpost.php
deleted file mode 100644
index c5236c532..000000000
--- a/mod/groups/views/default/forms/forums/addpost.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
- /**
- * Elgg group forum post edit/add page
- *
- * @package ElggGroups
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- *
- * @uses $vars['entity'] Optionally, the post to edit
- */
-
-?>
-<form action="<?php echo $vars['url']; ?>action/groups/addpost" method="post" class="margin_top">
- <label><?php echo elgg_echo("groups:reply"); ?></label>
- <?php
-
- echo elgg_view("input/longtext",array(
- "internalname" => "topic_post",
- "value" => $body,
- ));
- ?>
-
-
- <!-- pass across the topic guid -->
- <input type="hidden" name="topic_guid" value="<?php echo $vars['entity']->guid; ?>" />
- <input type="hidden" name="group_guid" value="<?php echo $vars['entity']->container_guid; ?>" />
-
- <?php echo elgg_view('input/securitytoken'); ?>
- <!-- display the post button -->
- <input type="submit" class="submit_button" value="<?php echo elgg_echo('post'); ?>" />
-</form>
diff --git a/mod/groups/views/default/forms/forums/edittopic.php b/mod/groups/views/default/forms/forums/edittopic.php
index 89c8c441b..cfaae5dd9 100644
--- a/mod/groups/views/default/forms/forums/edittopic.php
+++ b/mod/groups/views/default/forms/forums/edittopic.php
@@ -17,12 +17,7 @@
$status = $vars['entity']->status;
$tags = $vars['entity']->tags;
$title = $vars['entity']->title;
- $message = $vars['entity']->getAnnotations('group_topic_post', 1, 0, "asc");
-
- foreach($message as $mes){
- $messsage_content = $mes->value;
- $message_id = $mes->id;
- }
+ $message = $vars['entity']->description;
// get the group GUID
$group_guid = get_input("group");
@@ -72,7 +67,7 @@
echo elgg_view("input/longtext",array(
"internalname" => "topicmessage",
- "value" => $messsage_content,
+ "value" => html_entity_decode($message, ENT_COMPAT, 'UTF-8')
));
?>
</p>
@@ -82,8 +77,6 @@
<label><?php echo elgg_echo("groups:topicstatus"); ?><br />
<select name="status">
<option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option>
- <option value="sticky" <?php if($status == "sticky") echo "SELECTED";?>><?php echo elgg_echo('groups:topicsticky'); ?></option>
- <option value="resolved" <?php if($status == "resolved") echo "SELECTED";?>><?php echo elgg_echo('groups:topicresolved'); ?></option>
<option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option>
</select>
</label>
diff --git a/mod/groups/views/default/forum/topicposts.php b/mod/groups/views/default/forum/maintopic.php
index 7fb32e427..7a4a86da7 100644
--- a/mod/groups/views/default/forum/topicposts.php
+++ b/mod/groups/views/default/forum/maintopic.php
@@ -1,81 +1,56 @@
-<?php
-
- /**
- * Elgg Topic individual post view. This is all the follow up posts on a particular topic
- *
- * @package ElggGroups
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- *
- * @uses $vars['entity'] The posted comment to view
- */
-
-
-?>
-
-<div class="entity_listing topic clearfloat">
-<a class="anchor_link" name="<?php echo $vars['entity']->id; ?>"></a>
- <?php
- // get infomation about the owner of the comment
- if ($post_owner = get_user($vars['entity']->owner_guid)) {
- // display the user icon
- echo "<div class='entity_listing_icon'>" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'tiny')) . "</div>";
- // display the user name
- echo "<div class='entity_listing_info'>";
- // if comment owner, group owner, or site admin - display edit and delete options
- if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
- echo "<div class='entity_metadata'>";
- echo "<span class='delete_button'>".elgg_view("output/confirmlink",array(
- 'href' => $vars['url'] . "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'),
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm')
- ))."</span>";
- echo "<span class='entity_edit'><a class='link' onclick=\"elgg_slide_toggle(this,'.topic','.edit_comment');\">".elgg_echo('edit')."</a></span>";
- echo "</div>";
-
- }
-
- echo "<p class='entity_title'>" . $post_owner->name . "</p>";
- } else {
- echo "<div class='entity_listing_icon'><img src=\"" . elgg_view('icon/user/default/tiny') . "\" /></div>";
- echo "<div class='entity_listing_info'><p class='entity_title'>" . elgg_echo('profile:deleteduser') . "</p>";
- }
-
- //display the date of the comment
- echo "<p class='entity_subtext'>" . friendly_time($vars['entity']->time_created) . "</p>";
-
- //display the actual message posted
- echo parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->value)));
-
- // if comment owner, group owner, or site admin - display edit-form
- if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
- //get the edit form and details
- $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
- $text_textarea = elgg_view('input/longtext', array('internalname' => 'postComment'.$vars['entity']->id, 'value' => $vars['entity']->value));
- $post = elgg_view('input/hidden', array('internalname' => 'post', 'value' => $vars['entity']->id));
- $field = elgg_view('input/hidden', array('internalname' => 'field_num', 'value' => $vars['entity']->id));
- $topic = elgg_view('input/hidden', array('internalname' => 'topic', 'value' => get_input('topic')));
- $group = elgg_view('input/hidden', array('internalname' => 'group', 'value' => get_input('group_guid')));
- $edittopic_title = elgg_echo('groups:edittopic');
-
- $form_body = <<<EOT
-
- <p class='longtext_inputarea'>
- <label>$edittopic_title</label>
- $text_textarea</p>
- $post
- $topic
- $group
- $field
- $submit_input
-EOT;
- echo "<div class='edit_comment margin_top hidden'>";
- echo elgg_view('input/form', array('action' => "{$vars['url']}action/groups/editpost", 'body' => $form_body, 'internalid' => 'editforumpostForm'));
- echo "</div>";
- }
- echo "</div>"; // close entity_listing_info
-?>
-
+<?php
+
+ /**
+ * Elgg Topic individual post view.
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] The post
+ */
+
+ $topic = get_input('topic');
+ $group_guid = get_input('group_guid');
+
+?>
+
+<div class="entity_listing topic clearfloat">
+<a class="anchor_link" name="<?php echo $vars['entity']->id; ?>"></a>
+ <?php
+ // get infomation about the owner of the comment
+ if ($post_owner = get_user($vars['entity']->owner_guid)) {
+ // display the user icon
+ echo "<div class='entity_listing_icon'>" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'tiny')) . "</div>";
+ // display the user name
+ echo "<div class='entity_listing_info'>";
+ // if comment owner, group owner, or site admin - display edit and delete options
+ if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
+ echo "<div class='entity_metadata'>";
+ echo "<span class='delete_button'>".elgg_view("output/confirmlink",array(
+ 'href' => $vars['url'] . "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'),
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm')
+ ))."</span>";
+ echo "<span class='entity_edit'><a class='link' href=\"{$vars['url']}pg/groups/edittopic/{$group_guid}/{$topic}/\">".elgg_echo('edit')."</a></span>";
+ echo "</div>";
+
+ }
+
+ echo "<p class='entity_title'>" . $post_owner->name . "</p>";
+ } else {
+ echo "<div class='entity_listing_icon'><img src=\"" . elgg_view('icon/user/default/tiny') . "\" /></div>";
+ echo "<div class='entity_listing_info'><p class='entity_title'>" . elgg_echo('profile:deleteduser') . "</p>";
+ }
+
+ //display the date of the comment
+ echo "<p class='entity_subtext'>" . friendly_time($vars['entity']->time_created) . "</p>";
+
+ //display the actual message posted
+ echo parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->description)));
+ echo "</div>"; // close entity_listing_info
+?>
+
</div> \ No newline at end of file
diff --git a/mod/groups/views/default/forum/topics.php b/mod/groups/views/default/forum/topics.php
index c0f5ff2d1..91834aa08 100644
--- a/mod/groups/views/default/forum/topics.php
+++ b/mod/groups/views/default/forum/topics.php
@@ -1,13 +1,7 @@
<?php
- /**
- * Elgg groups plugin
- *
- * @package ElggGroups
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
+/**
+ * Elgg groups plugin
+ */
?>
<div id="content_header" class="clearfloat">
@@ -25,9 +19,7 @@
?>
</div>
<?php
- if($vars['topics'])
- echo $vars['topics'];
- else
- echo "<p class='margin_top'>". elgg_echo("grouptopic:notcreated") . "</p>";
-
-?> \ No newline at end of file
+if($vars['topics'])
+ echo $vars['topics'];
+else
+ echo "<p class='margin_top'>". elgg_echo("grouptopic:notcreated") . "</p>"; \ No newline at end of file
diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php
index 0ff70a38a..aa8b334f2 100644
--- a/mod/groups/views/default/forum/viewposts.php
+++ b/mod/groups/views/default/forum/viewposts.php
@@ -1,61 +1,48 @@
<?php
-
- /**
- * Elgg groups plugin display topic posts
- *
- * @package ElggGroups
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- // set up breadcrumbs
- $group_guid = get_input('group_guid');
- $group = get_entity($group_guid);
- elgg_push_breadcrumb(elgg_echo('groups'), $CONFIG->wwwroot."pg/groups/world/");
- elgg_push_breadcrumb($group->name, $group->getURL());
- elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), $CONFIG->wwwroot."pg/groups/forum/{$vars['entity']->container_guid}");
- elgg_push_breadcrumb($vars['entity']->title);
-
- echo elgg_view('navigation/breadcrumbs');
-
- //display follow up comments
- $count = $vars['entity']->countAnnotations('group_topic_post');
- $offset = (int) get_input('offset',0);
-
- $baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}";
- echo elgg_view('navigation/pagination',array(
- 'limit' => 50,
- 'offset' => $offset,
- 'baseurl' => $baseurl,
- 'count' => $count,
- ));
+/**
+ * Elgg groups plugin display topic posts
+ */
+
+// set up breadcrumbs
+$group_guid = get_input('group_guid');
+$group = get_entity($group_guid);
+elgg_push_breadcrumb(elgg_echo('groups'), $CONFIG->wwwroot."pg/groups/world/");
+elgg_push_breadcrumb($group->name, $group->getURL());
+elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), $CONFIG->wwwroot."pg/groups/forum/{$vars['entity']->container_guid}");
+elgg_push_breadcrumb($vars['entity']->title);
+
+echo elgg_view('navigation/breadcrumbs');
+
+//display follow up comments
+$count = $vars['entity']->countAnnotations('group_topic_post');
+$offset = (int) get_input('offset',0);
+
+$baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}";
+echo elgg_view('navigation/pagination',array(
+ 'limit' => 50,
+ 'offset' => $offset,
+ 'baseurl' => $baseurl,
+ 'count' => $count,
+ ));
?>
<!-- grab the topic title -->
<h2><?php echo $vars['entity']->title; ?></h2>
<?php
-
- foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
-
- echo elgg_view("forum/topicposts",array('entity' => $post));
-
- }
+ //display the topic
+ echo elgg_view("forum/maintopic",array('entity' => $vars['entity']));
// check to find out the status of the topic and act
- if($vars['entity']->status != "closed" && page_owner_entity()->isMember($vars['user'])){
-
- //display the add comment form, this will appear after all the existing comments
- echo elgg_view("forms/forums/addpost", array('entity' => $vars['entity']));
-
- } elseif($vars['entity']->status == "closed") {
-
+ if($vars['entity']->status == "closed") {
+ echo elgg_view_comments($vars['entity'], false);
//this topic has been closed by the owner
- echo "<h2>" . elgg_echo("groups:topicisclosed") . "</h2>";
+ echo "<h3>" . elgg_echo("groups:topicisclosed") . "</h3>";
echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>";
- } else {
+ }elseif(page_owner_entity()->isMember($vars['user'])){
+ //comments are on and the user viewing is a member
+ echo elgg_view_comments($vars['entity']);
+ }else{
+ //the user is not a member so cannot post a comment
+ echo elgg_view_comments($vars['entity'], false);
}
-
-?>
diff --git a/mod/groups/views/default/groups/css.php b/mod/groups/views/default/groups/css.php
index fc160453a..d435b1f7c 100644
--- a/mod/groups/views/default/groups/css.php
+++ b/mod/groups/views/default/groups/css.php
@@ -150,5 +150,4 @@
- force tinyMCE to correct width */
.edit_comment .defaultSkin table.mceLayout {
width: 694px !important;
-}
-
+} \ No newline at end of file
diff --git a/mod/groups/views/default/groups/forum_latest.php b/mod/groups/views/default/groups/forum_latest.php
index 3c6ce6ccf..865b04ca2 100644
--- a/mod/groups/views/default/groups/forum_latest.php
+++ b/mod/groups/views/default/groups/forum_latest.php
@@ -8,23 +8,26 @@ if($vars['entity']->forum_enable != 'no'){
<h3><?php echo elgg_echo('groups:latestdiscussion'); ?></h3>
<?php
- $forum = elgg_get_entities_from_annotations(array('types' => 'object', 'subtypes' => 'groupforumtopic', 'annotation_names' => 'group_topic_post', 'container_guid' => $vars['entity']->guid, 'limit' => 6, 'order_by' => 'maxtime desc'));
+ $forum = elgg_get_entities(array('types' => 'object', 'subtypes' => 'groupforumtopic', 'container_guid' => $vars['entity']->guid, 'limit' => 6));
if($forum){
foreach($forum as $f){
- $count_annotations = $f->countAnnotations("group_topic_post");
+ $count_annotations = $f->countAnnotations("generic_comment");
echo "<div class='entity_listing clearfloat'>";
echo "<div class='entity_listing_icon'>" . elgg_view('profile/icon',array('entity' => $f->getOwnerEntity(), 'size' => 'tiny')) . "</div>";
echo "<div class='entity_listing_info'><p class='entity_title'><a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$f->guid}&group_guid={$vars['entity']->guid}\">" . $f->title . "</a></p>";
- echo "<p class='entity_subtext'>".elgg_echo('groups:posts').": " . $count_annotations . "</p></div>";
+ echo "<p class='entity_subtext'>".elgg_echo('comments').": " . $count_annotations . "</p></div>";
echo "</div>";
}
} else {
- $create_discussion = $vars['url'] . "mod/groups/addtopic.php?group_guid=" . page_owner();
- echo "<p class='margin_top'><a href=\"{$create_discussion}\">".elgg_echo("groups:addtopic")."</a></p>";
+ if(page_owner_entity()->isMember($vars['user'])){
+ $create_discussion = $vars['url'] . "mod/groups/addtopic.php?group_guid=" . page_owner();
+ echo "<p class='margin_top'><a href=\"{$create_discussion}\">".elgg_echo("groups:addtopic")."</a></p>";
+ }else{
+ echo "<p class='margin_top'>". elgg_echo("grouptopic:notcreated") . "</p>";
+ }
}
-}//end of forum active check
-?> \ No newline at end of file
+}//end of forum active check \ No newline at end of file
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index 8d5d655c0..e32f83cd4 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -1,71 +1,71 @@
<?php
-
- /**
- * Elgg Groups latest discussion listing
- *
- * @package ElggGroups
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
+/**
+ * Elgg Groups latest discussion listing
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+*/
- //get the required variables
- $title = htmlentities($vars['entity']->title, ENT_QUOTES, 'UTF-8');
- //$description = get_entity($vars['entity']->description);
- $topic_owner = get_user($vars['entity']->owner_guid);
- $group = get_entity($vars['entity']->container_guid);
- $forum_created = friendly_time($vars['entity']->time_created);
- $counter = $vars['entity']->countAnnotations("group_topic_post");
- $last_post = $vars['entity']->getAnnotations("group_topic_post", 1, 0, "desc");
-
- //get the time and user
- if ($last_post) {
- foreach($last_post as $last) {
- $last_time = $last->time_created;
- $last_user = $last->owner_guid;
- }
+//get the required variables
+$title = htmlentities($vars['entity']->title, ENT_QUOTES, 'UTF-8');
+//$description = get_entity($vars['entity']->description);
+$topic_owner = get_user($vars['entity']->owner_guid);
+$group = get_entity($vars['entity']->container_guid);
+$forum_created = friendly_time($vars['entity']->time_created);
+$counter = $vars['entity']->countAnnotations("generic_comment");
+$last_post = $vars['entity']->getAnnotations("generic_comment", 1, 0, "desc");
+//get the time and user
+if ($last_post) {
+ foreach($last_post as $last) {
+ $last_time = $last->time_created;
+ $last_user = $last->owner_guid;
}
+}
- $u = get_user($last_user);
+$u = get_user($last_user);
- //select the correct output depending on where you are
- if(get_context() == "search"){
-
- $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('group:created'), $forum_created, $counter) . "<br />";
- if (($last_time) && ($u)) $info.= sprintf(elgg_echo('groups:lastupdated'), friendly_time($last_time), " <a href=\"" . $u->getURL() . "\">" . $u->name . "</a>");
- $info .= '</p>';
- //get the group avatar
- $icon = elgg_view("profile/icon",array('entity' => $u, 'size' => 'tiny'));
- //get the group and topic title
- $info .= "<p class='entity_subtext'><b>" . elgg_echo('Topic') . ":</b> <a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
- if ($group instanceof ElggGroup) {
- $info .= "<p class='entity_title'><b>" . elgg_echo('group') . ":</b> <a href=\"{$group->getURL()}\">".htmlentities($group->name, ENT_QUOTES, 'UTF-8') ."</a></p>";
- }
-
+//select the correct output depending on where you are
+if(get_context() == "search"){
+ var_export($counter);
+ if($counter == 1){
+ $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created:single'), $forum_created, $counter) . "<br />";
}else{
+ $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created'), $forum_created, $counter) . "<br />";
+ }
+ if (($last_time) && ($u)) $info.= sprintf(elgg_echo('groups:lastupdated'), friendly_time($last_time), " <a href=\"" . $u->getURL() . "\">" . $u->name . "</a>");
+ $info .= '</p>';
+ //get the group avatar
+ $icon = elgg_view("profile/icon",array('entity' => $u, 'size' => 'tiny'));
+ //get the group and topic title
+ $info .= "<p class='entity_subtext'><b>" . elgg_echo('Topic') . ":</b> <a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
+ if ($group instanceof ElggGroup) {
+ $info .= "<p class='entity_title'><b>" . elgg_echo('group') . ":</b> <a href=\"{$group->getURL()}\">".htmlentities($group->name, ENT_QUOTES, 'UTF-8') ."</a></p>";
+ }
- $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('group:created'), $forum_created, $counter) . "</p>";
- $info .= "<p class='entity_title'>" . elgg_echo('groups:started') . " " . $topic_owner->name . ": <a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
+}else{
+ if($counter == 1){
+ $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created:single'), $forum_created, $counter) . "</p>";
+ }else{
+ $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created'), $forum_created, $counter) . "</p>";
+ }
+ $info .= "<p class='entity_title'>" . elgg_echo('groups:started') . " " . $topic_owner->name . ": <a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
- if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
- // display the delete link to those allowed to delete
- $info .= "<div class='delete_button'>" . elgg_view("output/confirmlink", array(
- 'href' => $vars['url'] . "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
- 'text' => " ",
- 'confirm' => elgg_echo('deleteconfirm'),
- )) . "</div>";
+ if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
+ // display the delete link to those allowed to delete
+ $info .= "<div class='delete_button'>" . elgg_view("output/confirmlink", array(
+ 'href' => $vars['url'] . "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
+ 'text' => " ",
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )) . "</div>";
- }
+ }
- if (($last_time) && ($u)) {
- $info.= "<p class='entity_subtext'>" . elgg_echo('groups:updated') . " " . friendly_time($last_time) . " by <a href=\"" . $u->getURL() . "\">" . $u->name . "</a></p>";
- }
- //get the user avatar
- $icon = elgg_view("profile/icon",array('entity' => $topic_owner, 'size' => 'tiny'));
+ if (($last_time) && ($u)) {
+ $info.= "<p class='entity_subtext'>" . elgg_echo('groups:updated') . " " . friendly_time($last_time) . " by <a href=\"" . $u->getURL() . "\">" . $u->name . "</a></p>";
}
+ //get the user avatar
+ $icon = elgg_view("profile/icon",array('entity' => $topic_owner, 'size' => 'tiny'));
+}
- //display
- echo elgg_view_listing($icon, $info);
-
-?> \ No newline at end of file
+//display
+echo elgg_view_listing($icon, $info); \ No newline at end of file
diff --git a/mod/groups/views/default/river/forum/topic/create.php b/mod/groups/views/default/river/forum/topic/create.php
index 0b65f79b6..fb2a3556d 100644
--- a/mod/groups/views/default/river/forum/topic/create.php
+++ b/mod/groups/views/default/river/forum/topic/create.php
@@ -7,19 +7,20 @@
$group_guid = $object->container_guid;
$group = get_entity($group_guid);
$url = $vars['url'] . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid;
- $comment = $object->getAnnotations("group_topic_post", 1, 0, "asc");
- foreach($comment as $c){
- $contents = $c->value;
- }
+ //$comment = $object->getAnnotations("group_topic_post", 1, 0, "asc");
+ //foreach($comment as $c){
+ $contents = $object->description;
+ //}
$contents = strip_tags($contents);//this is so we don't get large images etc in the activity river
$url_user = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$string = sprintf(elgg_echo("groupforum:river:postedtopic"),$url_user) . ": ";
$string .= "<a href=\"" . $url . "\">" . $object->title . "</a>";
- if(get_context() != 'groups'){
- $string .= " " . elgg_echo('groups:ingroup') . " <a href=\"{$group->getURL()}\">" . $group->name . "</a>";
+ $string .= " " . elgg_echo('groups:ingroup') . " <a href=\"{$group->getURL()}\">" . $group->name . "</a>";
+ $string .= " <span class='entity_subtext'>". friendly_time($object->time_created) ."</span>";
+ if (isloggedin() && $object->status != "closed") {
+ $string .= '<a class="river_comment_form_button link">' . elgg_echo('generic_comments:text') . '</a>';
+ $string .= elgg_view('likes/forms/link', array('entity' => $object));
}
- $string .= " <span class='entity_subtext'>". friendly_time($object->time_created) ."</span> <a class='river_comment_form_button link' href=\"{$object_url}\">Visit discussion</a>";
- $string .= elgg_view('likes/forms/link', array('entity' => $object));
$string .= "<div class=\"river_content_display\">";
$string .= elgg_make_excerpt($contents, 200);
$string .= "</div>";