aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-06-24 07:32:27 -0400
committerCash Costello <cash.costello@gmail.com>2011-06-24 07:32:27 -0400
commit9edc8c6004d1236a21e03fb1c820a6e749f1ee3b (patch)
tree3defb2dc56e726c314b4d92d43744faf4d52bd48 /mod/groups
parent344e47862b1f39eca19e39a000f97f799cc87a12 (diff)
parent5e02fd697fd15ae857aa0c2969fd9ea92043a55a (diff)
downloadelgg-9edc8c6004d1236a21e03fb1c820a6e749f1ee3b.tar.gz
elgg-9edc8c6004d1236a21e03fb1c820a6e749f1ee3b.tar.bz2
Merge pull request #35 - Fixes #3404, #3490
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/languages/en.php8
-rw-r--r--mod/groups/start.php3
-rw-r--r--mod/groups/views/default/river/annotation/group_topic_post/reply.php25
-rw-r--r--mod/groups/views/default/river/group/create.php20
-rw-r--r--mod/groups/views/default/river/object/groupforumtopic/create.php37
-rw-r--r--mod/groups/views/default/river/relationship/member/create.php14
6 files changed, 22 insertions, 85 deletions
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index f2895db88..9f8bed9a4 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -213,10 +213,10 @@ or click below to view the group's join requests:
Forum river items
*/
- 'groups:river:create' => 'created the group',
- 'groups:river:join' => 'joined the group',
- 'forumtopic:river:create' => 'added a new discussion topic',
- 'groups:river:reply' => 'replied on the discussion topic',
+ 'river:create:group:default' => '%s created the group %s',
+ 'river:join:group:default' => '%s joined the group %s',
+ 'river:create:object:groupforumtopic' => '%s added a new discussion topic %s',
+ 'river:reply:object:groupforumtopic' => '%s replied on the discussion topic %s',
'groups:nowidgets' => 'No widgets have been defined for this group.',
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 9a375e89d..066b309a5 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -663,7 +663,8 @@ function discussion_init() {
// commenting not allowed on discussion topics (use a different annotation)
elgg_register_plugin_hook_handler('permissions_check:comment', 'object', 'discussion_comment_override');
-
+ elgg_extend_view('river/elements/responses', 'discussion/river');
+
$action_base = elgg_get_plugins_path() . 'groups/actions/discussion';
elgg_register_action('discussion/save', "$action_base/save.php");
elgg_register_action('discussion/delete', "$action_base/delete.php");
diff --git a/mod/groups/views/default/river/annotation/group_topic_post/reply.php b/mod/groups/views/default/river/annotation/group_topic_post/reply.php
index 1999c8dd9..cc94fbd43 100644
--- a/mod/groups/views/default/river/annotation/group_topic_post/reply.php
+++ b/mod/groups/views/default/river/annotation/group_topic_post/reply.php
@@ -4,24 +4,9 @@
*/
$object = $vars['item']->getObjectEntity();
$reply = $vars['item']->getAnnotation();
+$excerpt = elgg_get_excerpt($reply->value);
-$url = $object->getURL();
-$title = $object->title;
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $title,
-);
-$object_link = elgg_view('output/url', $params);
-
-$type = $object->getType();
-$subtype = $object->getSubtype();
-
-echo elgg_echo('groups:river:reply') . ' ';
-echo $object_link;
-
-if ($reply) {
- $excerpt = elgg_get_excerpt($reply->value);
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/river/group/create.php b/mod/groups/views/default/river/group/create.php
index a70f8b51d..cacb5ad3f 100644
--- a/mod/groups/views/default/river/group/create.php
+++ b/mod/groups/views/default/river/group/create.php
@@ -7,19 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$link = elgg_view('output/url', $params);
-
-
-echo elgg_echo('groups:river:create');
-
-echo " $link";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/river/object/groupforumtopic/create.php b/mod/groups/views/default/river/object/groupforumtopic/create.php
index 466196921..f92e54a5c 100644
--- a/mod/groups/views/default/river/object/groupforumtopic/create.php
+++ b/mod/groups/views/default/river/object/groupforumtopic/create.php
@@ -7,36 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-echo elgg_echo('forumtopic:river:create');
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
-
-if (elgg_is_logged_in() && $container->canWriteToContainer()) {
- // inline comment form
- $form_vars = array('id' => "groups-reply-{$object->getGUID()}", 'class' => 'hidden');
- $body_vars = array('entity' => $object, 'inline' => true);
- echo elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+));
diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php
index 060826649..d1c4c3ed3 100644
--- a/mod/groups/views/default/river/relationship/member/create.php
+++ b/mod/groups/views/default/river/relationship/member/create.php
@@ -3,14 +3,6 @@
* Group join river view.
*/
-$object = $vars['item']->getObjectEntity();
-
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$link = elgg_view('output/url', $params);
-
-echo elgg_echo('groups:river:join');
-
-echo " $link";
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+));