diff options
Diffstat (limited to 'mod/groups/views/rss')
-rw-r--r-- | mod/groups/views/rss/annotation/group_topic_post.php | 32 | ||||
-rw-r--r-- | mod/groups/views/rss/discussion/replies.php | 12 | ||||
-rw-r--r-- | mod/groups/views/rss/groups/profile/layout.php | 18 | ||||
-rw-r--r-- | mod/groups/views/rss/object/groupforumtopic.php | 35 |
4 files changed, 97 insertions, 0 deletions
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/groups/profile/layout.php b/mod/groups/views/rss/groups/profile/layout.php new file mode 100644 index 000000000..0dafe78ad --- /dev/null +++ b/mod/groups/views/rss/groups/profile/layout.php @@ -0,0 +1,18 @@ +<?php +/** + * Group profile RSS view + * + * Displays a list of the latest content in the group + * + * @uses $vars['entity'] ElggGroup object + */ + +$entities = elgg_get_config('registered_entities'); + +if (!empty($entities['object'])) { + echo elgg_list_entities(array( + 'type' => 'object', + 'subtypes' => $entities['object'], + 'container_guid' => $vars['entity']->getGUID(), + )); +} diff --git a/mod/groups/views/rss/object/groupforumtopic.php b/mod/groups/views/rss/object/groupforumtopic.php new file mode 100644 index 000000000..b2d05d488 --- /dev/null +++ b/mod/groups/views/rss/object/groupforumtopic.php @@ -0,0 +1,35 @@ +<?php +/** + * Elgg groupforumtopic RSS view + * + * @package ElggGroups + */ + +$title = $vars['entity']->title; +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 = elgg_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">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $creator$georss$extension +</item> + +__HTML; + +echo $item; |