diff options
Diffstat (limited to 'mod/groups')
31 files changed, 193 insertions, 142 deletions
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php index 3a0376497..c4cf6667e 100644 --- a/mod/groups/actions/groups/edit.php +++ b/mod/groups/actions/groups/edit.php @@ -91,7 +91,7 @@ $group->save(); // group creator needs to be member of new group and river entry created if ($new_group_flag) { - set_page_owner($group->guid); + elgg_set_page_owner_guid($group->guid); $group->join($user); add_to_river('river/group/create', 'create', $user->guid, $group->guid); } @@ -111,7 +111,10 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') { // Now see if we have a file icon if ((isset($_FILES['icon'])) && (substr_count($_FILES['icon']['type'],'image/'))) { - $prefix = "groups/".$group->guid; + + $icon_sizes = elgg_get_config('icon_sizes'); + + $prefix = "groups/" . $group->guid; $filehandler = new ElggFile(); $filehandler->owner_guid = $group->owner_guid; @@ -120,10 +123,10 @@ if ((isset($_FILES['icon'])) && (substr_count($_FILES['icon']['type'],'image/')) $filehandler->write(get_uploaded_file('icon')); $filehandler->close(); - $thumbtiny = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(),25,25, true); - $thumbsmall = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(),40,40, true); - $thumbmedium = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(),100,100, true); - $thumblarge = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(),200,200, false); + $thumbtiny = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(), $icon_sizes['tiny']['w'], $icon_sizes['tiny']['h'], $icon_sizes['tiny']['square']); + $thumbsmall = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(), $icon_sizes['small']['w'], $icon_sizes['small']['h'], $icon_sizes['small']['square']); + $thumbmedium = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(), $icon_sizes['medium']['w'], $icon_sizes['medium']['h'], $icon_sizes['medium']['square']); + $thumblarge = get_resized_image_from_existing_file($filehandler->getFilenameOnFilestore(), $icon_sizes['large']['w'], $icon_sizes['large']['h'], $icon_sizes['large']['square']); if ($thumbtiny) { $thumb = new ElggFile(); diff --git a/mod/groups/actions/groups/membership/leave.php b/mod/groups/actions/groups/membership/leave.php index 390870df1..4f34c7dde 100644 --- a/mod/groups/actions/groups/membership/leave.php +++ b/mod/groups/actions/groups/membership/leave.php @@ -17,7 +17,7 @@ if (!$user_guid) { $group = get_entity($group_guid); -set_page_owner($group->guid); +elgg_set_page_owner_guid($group->guid); if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) { if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 9f8bed9a4..09feaf8d1 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -69,9 +69,9 @@ $english = array( 'groups:notfound' => "Group not found", 'groups:notfound:details' => "The requested group either does not exist or you do not have access to it", - 'groups:requests:none' => 'There are no outstanding membership requests at this time.', + 'groups:requests:none' => 'There are no current membership requests.', - 'groups:invitations:none' => 'There are no outstanding invitations at this time.', + 'groups:invitations:none' => 'There are no current invitations.', 'item:object:groupforumtopic' => "Discussion topics", @@ -113,6 +113,8 @@ $english = array( 'discussion:add' => 'Add discussion topic', '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/lib/discussion.php b/mod/groups/lib/discussion.php index e129e0f9d..2bda4678e 100644 --- a/mod/groups/lib/discussion.php +++ b/mod/groups/lib/discussion.php @@ -60,6 +60,9 @@ function discussion_handle_list_page($guid) { 'full_view' => false, ); $content = elgg_list_entities($options); + if (!$content) { + $content = elgg_echo('discussion:none'); + } $params = array( @@ -189,7 +192,7 @@ function discussion_handle_view_page($guid) { ); $body = elgg_view_layout('content', $params); - echo elgg_view_page($title, $body); + echo elgg_view_page($topic->title, $body); } /** diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index 86e6f018e..7798e5dc3 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -24,6 +24,9 @@ function groups_handle_all_page() { 'inverse_relationship' => false, 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } break; case 'discussion': $content = elgg_list_entities(array( @@ -33,6 +36,9 @@ function groups_handle_all_page() { 'limit' => 40, 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('discussion:none'); + } break; case 'newest': default: @@ -40,6 +46,9 @@ function groups_handle_all_page() { 'type' => 'group', 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } break; } @@ -107,6 +116,9 @@ function groups_handle_owned_page() { 'owner_guid' => elgg_get_page_owner_guid(), 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } $params = array( 'content' => $content, @@ -137,6 +149,9 @@ function groups_handle_mine_page() { 'inverse_relationship' => false, 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } $params = array( 'content' => $content, @@ -388,9 +403,11 @@ function groups_handle_requests_page($guid) { elgg_push_breadcrumb($title); $requests = elgg_get_entities_from_relationship(array( + 'type' => 'user', 'relationship' => 'membership_request', 'relationship_guid' => $guid, 'inverse_relationship' => true, + 'limit' => 0, )); $content = elgg_view('groups/membershiprequests', array( 'requests' => $requests, @@ -430,12 +447,14 @@ function groups_register_profile_buttons($group) { } // group members - if ($group->isMember($user)) { - // leave - $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}"; - $url = elgg_add_action_tokens_to_url($url); - $actions[$url] = 'groups:leave'; - } else { + if ($group->isMember(elgg_get_logged_in_user_entity())) { + if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { + // leave + $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}"; + $url = elgg_add_action_tokens_to_url($url); + $actions[$url] = 'groups:leave'; + } + } elseif (elgg_is_logged_in()) { // join - admins can always join. $url = elgg_get_site_url() . "action/groups/join?group_guid={$group->getGUID()}"; $url = elgg_add_action_tokens_to_url($url); diff --git a/mod/groups/manifest.xml b/mod/groups/manifest.xml index 4188aa861..fd28360d0 100644 --- a/mod/groups/manifest.xml +++ b/mod/groups/manifest.xml @@ -9,11 +9,10 @@ <description>Provides group support for elgg</description> <website>http://www.elgg.org/</website> <copyright>See COPYRIGHT.txt</copyright> - <license>GNU Public License version 2</license> + <license>GNU General Public License version 2</license> <requires> - <type>elgg_version</type> - <version>2010030101</version> + <type>elgg_release</type> + <version>1.8</version> </requires> <activate_on_install>true</activate_on_install> - <admin_interface>simple</admin_interface> </plugin_manifest> diff --git a/mod/groups/start.php b/mod/groups/start.php index 9e4694457..7dcf6b7c4 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -192,6 +192,7 @@ function groups_setup_sidebar_menus() { * Group members: groups/members/<guid> * * @param array $page Array of url segments for routing + * @return bool */ function groups_page_handler($page) { @@ -238,13 +239,17 @@ function groups_page_handler($page) { case 'requests': groups_handle_requests_page($page[1]); break; + default: + return false; } + return true; } /** * Handle group icons. * - * @param unknown_type $page + * @param array $page + * @return void */ function groups_icon_handler($page) { @@ -258,6 +263,7 @@ function groups_icon_handler($page) { // Include the standard profile index $plugin_dir = elgg_get_plugins_path(); include("$plugin_dir/groups/icon.php"); + return true; } /** @@ -435,7 +441,7 @@ function groups_annotation_menu_setup($hook, $type, $return, $params) { 'href' => $url, 'text' => "<span class=\"elgg-icon elgg-icon-delete\"></span>", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false + 'encode_text' => false ); $return[] = ElggMenuItem::factory($options); @@ -447,7 +453,7 @@ function groups_annotation_menu_setup($hook, $type, $return, $params) { 'name' => 'edit', 'href' => "#edit-annotation-$annotation->id", 'text' => elgg_echo('edit'), - 'text_encode' => false, + 'encode_text' => false, 'rel' => 'toggle', ); $return[] = ElggMenuItem::factory($options); @@ -562,8 +568,10 @@ function groups_user_join_event_listener($event, $object_type, $object) { * Make sure users are added to the access collection */ function groups_access_collection_override($hook, $entity_type, $returnvalue, $params) { - if (elgg_instanceof(get_entity($params['collection']->owner_guid), 'group')) { - return true; + if (isset($params['collection'])) { + if (elgg_instanceof(get_entity($params['collection']->owner_guid), 'group')) { + return true; + } } } @@ -748,6 +756,7 @@ function discussion_init() { * Edit discussion topic: discussion/edit/<guid> * * @param array $page Array of url segments for routing + * @return bool */ function discussion_page_handler($page) { @@ -771,7 +780,10 @@ function discussion_page_handler($page) { case 'view': discussion_handle_view_page($page[1]); break; + default: + return false; } + return true; } /** diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php index 3a46e336e..e0bcd55d6 100644 --- a/mod/groups/views/default/discussion/group_module.php +++ b/mod/groups/views/default/discussion/group_module.php @@ -15,6 +15,7 @@ $group = $vars['entity']; $all_link = elgg_view('output/url', array( 'href' => "discussion/owner/$group->guid", 'text' => elgg_echo('link:view:all'), + 'is_trusted' => true, )); elgg_push_context('widgets'); @@ -30,12 +31,13 @@ $content = elgg_list_entities($options); elgg_pop_context(); if (!$content) { - $content = '<p>' . elgg_echo('grouptopic:notcreated') . '</p>'; + $content = '<p>' . elgg_echo('discussion:none') . '</p>'; } $new_link = elgg_view('output/url', array( 'href' => "discussion/add/" . $group->getGUID(), 'text' => elgg_echo('groups:addtopic'), + 'is_trusted' => true, )); echo elgg_view('groups/profile/module', array( diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php index fc91f90d0..6eae467c6 100644 --- a/mod/groups/views/default/group/default.php +++ b/mod/groups/views/default/group/default.php @@ -34,5 +34,5 @@ if ($vars['full_view']) { $params = $params + $vars; $list_body = elgg_view('group/elements/summary', $params); - echo elgg_view_image_block($icon, $list_body); + echo elgg_view_image_block($icon, $list_body, $vars); } diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php index 788788324..94dbdf1f2 100644 --- a/mod/groups/views/default/groups/invitationrequests.php +++ b/mod/groups/views/default/groups/invitationrequests.php @@ -10,11 +10,12 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) { echo '<ul class="elgg-list">'; foreach ($vars['invitations'] as $group) { if ($group instanceof ElggGroup) { - $icon = elgg_view_entity_icon($group, 'tiny', array('override' => 'true')); + $icon = elgg_view_entity_icon($group, 'tiny', array('use_hover' => 'true')); $group_title = elgg_view('output/url', array( 'href' => $group->getURL(), 'text' => $group->name, + 'is_trusted' => true, )); $url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/groups/join?user_guid={$user->guid}&group_guid={$group->guid}"); @@ -22,6 +23,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) { 'href' => $url, 'text' => elgg_echo('accept'), 'class' => 'elgg-button elgg-button-submit', + 'is_trusted' => true, )); $url = "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}"; diff --git a/mod/groups/views/default/groups/membershiprequests.php b/mod/groups/views/default/groups/membershiprequests.php index 4d1c78c8c..9cd28262f 100644 --- a/mod/groups/views/default/groups/membershiprequests.php +++ b/mod/groups/views/default/groups/membershiprequests.php @@ -10,37 +10,37 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) { $user = elgg_get_logged_in_user_entity(); echo '<ul class="elgg-list">'; foreach ($vars['requests'] as $user) { - if ($user instanceof ElggUser) { - $icon = elgg_view_entity_icon($user, 'tiny', array('override' => 'true')); + $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => 'true')); - $user_title = elgg_view('output/url', array( - 'href' => $user->getURL(), - 'text' => $user->name, - )); + $user_title = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => $user->name, + 'is_trusted' => true, + )); - $url = "action/groups/addtogroup?user_guid={$user->guid}&group_guid={$vars['entity']->guid}"; - $url = elgg_add_action_tokens_to_url($url); - $accept_button = elgg_view('output/url', array( - 'href' => $url, - 'text' => elgg_echo('accept'), - 'class' => 'elgg-button elgg-button-submit', - )); + $url = "action/groups/addtogroup?user_guid={$user->guid}&group_guid={$vars['entity']->guid}"; + $url = elgg_add_action_tokens_to_url($url); + $accept_button = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('accept'), + 'class' => 'elgg-button elgg-button-submit', + 'is_trusted' => true, + )); - $url = 'action/groups/killrequest?user_guid=' . $user->guid . '&group_guid=' . $vars['entity']->guid; - $delete_button = elgg_view('output/confirmlink', array( - 'href' => $url, - 'confirm' => elgg_echo('groups:joinrequest:remove:check'), - 'text' => elgg_echo('delete'), - 'class' => 'elgg-button elgg-button-delete mlm', - )); + $url = 'action/groups/killrequest?user_guid=' . $user->guid . '&group_guid=' . $vars['entity']->guid; + $delete_button = elgg_view('output/confirmlink', array( + 'href' => $url, + 'confirm' => elgg_echo('groups:joinrequest:remove:check'), + 'text' => elgg_echo('delete'), + 'class' => 'elgg-button elgg-button-delete mlm', + )); - $body = "<h4>$user_title</h4>"; - $alt = $accept_button . $delete_button; + $body = "<h4>$user_title</h4>"; + $alt = $accept_button . $delete_button; - echo '<li class="pvs">'; - echo elgg_view_image_block($icon, $body, array('image_alt' => $alt)); - echo '</li>'; - } + echo '<li class="pvs">'; + echo elgg_view_image_block($icon, $body, array('image_alt' => $alt)); + echo '</li>'; } echo '</ul>'; } else { diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php index 5e557b443..832ff4a4b 100644 --- a/mod/groups/views/default/groups/profile/activity_module.php +++ b/mod/groups/views/default/groups/profile/activity_module.php @@ -19,6 +19,7 @@ if (!$group) { $all_link = elgg_view('output/url', array( 'href' => "groups/activity/$group->guid", 'text' => elgg_echo('link:view:all'), + 'is_trusted' => true, )); diff --git a/mod/groups/views/default/groups/profile/summary.php b/mod/groups/views/default/groups/profile/summary.php index b7ae51070..54abcb1e5 100644 --- a/mod/groups/views/default/groups/profile/summary.php +++ b/mod/groups/views/default/groups/profile/summary.php @@ -28,6 +28,7 @@ $owner = $group->getOwnerEntity(); echo elgg_view('output/url', array( 'text' => $owner->name, 'value' => $owner->getURL(), + 'is_trusted' => true, )); ?> </p> diff --git a/mod/groups/views/default/groups/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php index caf019a3a..7635cad4f 100644 --- a/mod/groups/views/default/groups/profile/widgets.php +++ b/mod/groups/views/default/groups/profile/widgets.php @@ -6,8 +6,8 @@ */ // tools widget area -echo '<div id="groups-tools" class="elgg-gallery elgg-gallery-fluid mtl clearfix">'; - +echo '<ul id="groups-tools" class="elgg-gallery elgg-gallery-fluid mtl clearfix">'; + // enable tools to extend this area echo elgg_view("groups/tool_latest", $vars); @@ -20,5 +20,5 @@ if ($right || $left) { echo $right; } -echo "</div>"; +echo "</ul>"; diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php index 7249ffbf4..49f14697c 100644 --- a/mod/groups/views/default/groups/sidebar/members.php +++ b/mod/groups/views/default/groups/sidebar/members.php @@ -13,6 +13,7 @@ $limit = elgg_extract('limit', $vars, 10); $all_link = elgg_view('output/url', array( 'href' => 'groups/members/' . $vars['entity']->guid, 'text' => elgg_echo('groups:members:more'), + 'is_trusted' => true, )); $body = elgg_list_entities_from_relationship(array( diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index 22589b84d..34e0ee3cc 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -20,6 +20,7 @@ $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)); @@ -27,7 +28,7 @@ $tags = elgg_view('output/tags', array('tags' => $topic->tags)); $date = elgg_view_friendly_time($topic->time_created); $replies_link = ''; -$replies_text = ''; +$reply_text = ''; $num_replies = elgg_get_annotations(array( 'annotation_name' => 'group_topic_post', 'guid' => $topic->getGUID(), @@ -42,6 +43,7 @@ if ($num_replies != 0) { $replies_link = elgg_view('output/url', array( 'href' => $topic->getURL() . '#group-replies', 'text' => elgg_echo('group:replies') . " ($num_replies)", + 'is_trusted' => true, )); } @@ -62,7 +64,6 @@ if ($full) { $params = array( 'entity' => $topic, - 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, @@ -75,7 +76,6 @@ if ($full) { $body = elgg_view('output/longtext', array('value' => $topic->description)); echo <<<HTML -$header $info $body HTML; diff --git a/mod/groups/views/default/settings/groups/edit.php b/mod/groups/views/default/plugins/groups/settings.php index 7197dcb37..7197dcb37 100644 --- a/mod/groups/views/default/settings/groups/edit.php +++ b/mod/groups/views/default/plugins/groups/settings.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 cc94fbd43..afc823bde 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 @@ -6,7 +6,7 @@ $object = $vars['item']->getObjectEntity(); $reply = $vars['item']->getAnnotation(); $excerpt = elgg_get_excerpt($reply->value); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', 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 cacb5ad3f..ea42b5b00 100644 --- a/mod/groups/views/default/river/group/create.php +++ b/mod/groups/views/default/river/group/create.php @@ -7,7 +7,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = strip_tags($object->description); $excerpt = elgg_get_excerpt($excerpt); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', 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 80e7b09aa..e7d92bc08 100644 --- a/mod/groups/views/default/river/object/groupforumtopic/create.php +++ b/mod/groups/views/default/river/object/groupforumtopic/create.php @@ -15,7 +15,7 @@ if (elgg_is_logged_in() && $object->canAnnotate(0, 'group_topic_post')) { $responses = elgg_view_form('discussion/reply/save', $form_vars, $body_vars); } -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, 'responses' => $responses, diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php index d1c4c3ed3..0afd87e4b 100644 --- a/mod/groups/views/default/river/relationship/member/create.php +++ b/mod/groups/views/default/river/relationship/member/create.php @@ -3,6 +3,6 @@ * Group join river view. */ -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], )); diff --git a/mod/groups/views/default/widgets/a_users_groups/content.php b/mod/groups/views/default/widgets/a_users_groups/content.php index 114fd7565..fe1a46e39 100644 --- a/mod/groups/views/default/widgets/a_users_groups/content.php +++ b/mod/groups/views/default/widgets/a_users_groups/content.php @@ -25,6 +25,7 @@ if ($content) { $more_link = elgg_view('output/url', array( 'href' => $url, 'text' => elgg_echo('groups:more'), + 'is_trusted' => true, )); echo "<span class=\"elgg-widget-more\">$more_link</span>"; } else { 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; |