aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/languages/en.php1
-rw-r--r--mod/groups/views/rss/annotation/group_topic_post.php32
-rw-r--r--mod/groups/views/rss/discussion/replies.php12
-rw-r--r--mod/groups/views/rss/forum/topicposts.php3
-rw-r--r--mod/groups/views/rss/forum/topics.php10
-rw-r--r--mod/groups/views/rss/forum/viewposts.php22
-rw-r--r--mod/groups/views/rss/groups/contentwrapper.php5
-rw-r--r--mod/groups/views/rss/groups/profile/layout.php13
-rw-r--r--mod/groups/views/rss/groups/profileitems.php15
-rw-r--r--mod/groups/views/rss/object/groupforumtopic.php49
10 files changed, 84 insertions, 78 deletions
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 0818e5602..09feaf8d1 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -114,6 +114,7 @@ $english = array(
'discussion:latest' => 'Latest discussion',
'discussion:group' => 'Group discussion',
'discussion:none' => 'No discussion',
+ 'discussion:reply:title' => 'Reply by %s',
'discussion:topic:created' => 'The discussion topic was created.',
'discussion:topic:updated' => 'The discussion topic was updated.',
diff --git a/mod/groups/views/rss/annotation/group_topic_post.php b/mod/groups/views/rss/annotation/group_topic_post.php
new file mode 100644
index 000000000..0d3a40117
--- /dev/null
+++ b/mod/groups/views/rss/annotation/group_topic_post.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * RSS view for a discussion reply
+ *
+ * @uses $vars['annotation']
+ */
+
+$annotation = $vars['annotation'];
+
+$poster = $annotation->getOwnerEntity();
+$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $annotation->getTimeCreated());
+$permalink = $annotation->getURL();
+
+$title = elgg_echo('discussion:reply:title', array($poster_name));
+
+$creator = elgg_view('page/components/creator', array('entity' => $annotation));
+$extensions = elgg_view('extensions/item', $vars);
+
+$item = <<<__HTML
+<item>
+ <guid isPermaLink='true'>$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[{$vars['annotation']->value}]]></description>
+ $creator$extensions
+</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/groups/views/rss/discussion/replies.php b/mod/groups/views/rss/discussion/replies.php
new file mode 100644
index 000000000..419003b21
--- /dev/null
+++ b/mod/groups/views/rss/discussion/replies.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * List replies RSS view
+ *
+ * @uses $vars['entity'] ElggEntity
+ */
+
+$options = array(
+ 'guid' => $vars['entity']->getGUID(),
+ 'annotation_name' => 'group_topic_post',
+);
+echo elgg_list_annotations($options);
diff --git a/mod/groups/views/rss/forum/topicposts.php b/mod/groups/views/rss/forum/topicposts.php
deleted file mode 100644
index 15c5adc7f..000000000
--- a/mod/groups/views/rss/forum/topicposts.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/forum/topics.php b/mod/groups/views/rss/forum/topics.php
deleted file mode 100644
index 1cb22aaea..000000000
--- a/mod/groups/views/rss/forum/topics.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
- /**
- * Elgg groups plugin
- *
- * @package ElggGroups
- */
-
- // If there are any topics to view, view them
- echo $vars['topics'];
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/forum/viewposts.php b/mod/groups/views/rss/forum/viewposts.php
deleted file mode 100644
index ad52365e6..000000000
--- a/mod/groups/views/rss/forum/viewposts.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
- /**
- * Elgg groups plugin display topic posts
- *
- * @package ElggGroups
- */
-
- //display follow up comments
- $count = $vars['entity']->countAnnotations('group_topic_post');
- $offset = (int) get_input('offset',0);
-
- foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
-
- $post->title = '';
- $post->description = $post->value;
- echo elgg_view('object/default', array('entity' => $post));
- // echo elgg_view("forum/topicposts",array('entity' => $post));
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/groups/contentwrapper.php b/mod/groups/views/rss/groups/contentwrapper.php
deleted file mode 100644
index 15397d552..000000000
--- a/mod/groups/views/rss/groups/contentwrapper.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
- echo $vars['body'];
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/groups/profile/layout.php b/mod/groups/views/rss/groups/profile/layout.php
new file mode 100644
index 000000000..3eeb9eaf2
--- /dev/null
+++ b/mod/groups/views/rss/groups/profile/layout.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Group profile RSS view
+ *
+ * Displays a list of the latest content in the group
+ *
+ * @uses $vars['entity'] ElggGroup object
+ */
+
+echo elgg_list_entities(array(
+ 'type' => 'object',
+ 'container_guid' => $vars['entity']->getGUID(),
+));
diff --git a/mod/groups/views/rss/groups/profileitems.php b/mod/groups/views/rss/groups/profileitems.php
deleted file mode 100644
index 5e595a379..000000000
--- a/mod/groups/views/rss/groups/profileitems.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
- /**
- * Elgg groups items view.
- * This is the messageboard, members, pages and latest forums posts. Each plugin will extend the views
- *
- * @package ElggGroups
- */
-
- //right column
- if ($forae = elgg_get_entities(array('types' => 'object', 'container_guid' => $vars['entity']->guid))) {
- foreach($forae as $forum)
- echo elgg_view_entity($forum);
- }
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/object/groupforumtopic.php b/mod/groups/views/rss/object/groupforumtopic.php
index 19297b350..d730ef796 100644
--- a/mod/groups/views/rss/object/groupforumtopic.php
+++ b/mod/groups/views/rss/object/groupforumtopic.php
@@ -1,32 +1,35 @@
<?php
/**
- * Elgg groupforumtopic view
+ * Elgg groupforumtopic RSS view
*
- * @package Elgg
- * @subpackage Core
+ * @package ElggGroups
*/
$title = $vars['entity']->title;
-
-$body = '';
-$annotation = $vars['entity']->getAnnotations('group_topic_post', 1, 0, "asc");
-if (count($annotation == 1)) {
- $body = $annotation[0]->value;
+if (empty($title)) {
+ $title = strip_tags($vars['entity']->description);
+ $title = elgg_get_excerpt($title, 32);
}
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+
+$description = autop($vars['entity']->description);
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item', $vars);
+
+$item = <<<__HTML
<item>
-<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid>
-<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
-<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
-<title><![CDATA[<?php echo $title; ?>]]></title>
-<description><![CDATA[<?php echo (autop($body)); ?>]]></description>
-<?php
- $owner = $vars['entity']->getOwnerEntity();
- if ($owner) {
-?>
-<dc:creator><?php echo $owner->name; ?></dc:creator>
-<?php
- }
-?>
-</item> \ No newline at end of file
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
+</item>
+
+__HTML;
+
+echo $item;