aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/groups/icon.php (renamed from mod/groups/graphics/icon.php)0
-rw-r--r--mod/groups/languages/en.php3
-rw-r--r--mod/groups/lib/discussion.php16
-rw-r--r--mod/groups/start.php414
-rw-r--r--mod/groups/views/default/discussion/group_module.php (renamed from mod/groups/views/default/groups/profile/forum_widget.php)2
-rw-r--r--mod/groups/views/default/forum/maintopic.php55
-rw-r--r--mod/groups/views/default/forum/topics.php25
-rw-r--r--mod/groups/views/default/forum/viewposts.php47
-rw-r--r--mod/groups/views/default/groups/profile/widgets.php5
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php22
10 files changed, 263 insertions, 326 deletions
diff --git a/mod/groups/graphics/icon.php b/mod/groups/icon.php
index a6ceaf3b5..a6ceaf3b5 100644
--- a/mod/groups/graphics/icon.php
+++ b/mod/groups/icon.php
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index af4592f99..e5db5d0c5 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -101,6 +101,7 @@ $english = array(
'discussion' => 'Discussion',
'discussion:add' => 'New discussion topic',
'discussion:latest' => 'Latest discussion',
+ 'discussion:group' => 'Group discussion',
'discussion:topic:created' => 'The discussion topic was created.',
'discussion:topic:updated' => 'The discussion topic was updated.',
@@ -139,7 +140,7 @@ $english = array(
'groupstopic:deleted' => 'The topic has been deleted.',
'groups:topicsticky' => 'Sticky',
'groups:topicisclosed' => 'This discussion is closed.',
- 'groups:topiccloseddesc' => 'This discussion has now been closed and is not accepting new comments.',
+ 'groups:topiccloseddesc' => 'This discussion is closed and is not accepting new comments.',
'grouptopic:error' => 'Your group topic could not be created. Please try again or contact a system administrator.',
'groups:forumpost:edited' => "You have successfully edited the forum post.",
'groups:forumpost:error' => "There was a problem editing the forum post.",
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index 92ee94013..4a3cd989a 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -165,7 +165,15 @@ function discussion_handle_view_page($guid) {
elgg_push_breadcrumb($group->name, "pg/discussion/owner/$group->guid");
elgg_push_breadcrumb($topic->title);
- $content = elgg_view('forum/viewposts', array('entity' => $topic));
+ $content = elgg_view_entity($topic, true);
+ if ($topic->status == 'closed') {
+ $content .= elgg_view_comments($topic, false);
+ $content .= elgg_view('discussion/closed');
+ } elseif ($group->isMember() || isadminloggedin()) {
+ $content .= elgg_view_comments($topic);
+ } else {
+ $content .= elgg_view_comments($topic, false);
+ }
$params = array(
'content' => $content,
@@ -178,6 +186,12 @@ function discussion_handle_view_page($guid) {
echo elgg_view_page($title, $body);
}
+/**
+ * Prepare discussion topic form variables
+ *
+ * @param ElggObject $topic Topic object if editing
+ * @return array
+ */
function discussion_prepare_form_vars($topic = NULL) {
// input names => defaults
$values = array(
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 199e3b27d..d782c745f 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -5,16 +5,16 @@
* @package ElggGroups
*/
+elgg_register_event_handler('init', 'system', 'groups_init');
+
/**
- * Initialise the groups plugin.
- * Register actions, set up menus
+ * Initialize the groups plugin.
*/
function groups_init() {
global $CONFIG;
elgg_register_library('elgg:groups', elgg_get_plugin_path() . 'groups/lib/groups.php');
- elgg_register_library('elgg:discussion', elgg_get_plugin_path() . 'groups/lib/discussion.php');
// Set up the menu
$item = new ElggMenuItem('groups', elgg_echo('groups'), 'pg/groups/all');
@@ -22,11 +22,9 @@ function groups_init() {
// Register a page handler, so we can have nice URLs
register_page_handler('groups', 'groups_page_handler');
- register_page_handler('discussion', 'discussion_page_handler');
- // Register a URL handler for groups and forum topics
+ // Register a URL handler for groups
register_entity_url_handler('groups_url', 'group', 'all');
- register_entity_url_handler('groups_groupforumtopic_url', 'object', 'groupforumtopic');
// Register an icon handler for groups
register_page_handler('groupicon', 'groups_icon_handler');
@@ -45,6 +43,7 @@ function groups_init() {
// Add a page owner handler
//elgg_register_plugin_hook_handler('page_owner', 'system', 'groups_page_owner_handler');
+
// Add some widgets
elgg_register_widget_type('a_users_groups', elgg_echo('groups:widget:membership'), elgg_echo('groups:widgets:description'));
@@ -56,16 +55,6 @@ function groups_init() {
// Access permissions
elgg_register_plugin_hook_handler('access:collections:write', 'all', 'groups_write_acl_plugin_hook');
//elgg_register_plugin_hook_handler('access:collections:read', 'all', 'groups_read_acl_plugin_hook');
- // Notification hooks
- if (is_callable('register_notification_object'))
- register_notification_object('object', 'groupforumtopic', elgg_echo('groupforumtopic:new'));
- elgg_register_plugin_hook_handler('object:notifications', 'object', 'group_object_notifications_intercept');
-
- // Listen to notification events and supply a more useful message
- elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'groupforumtopic_notify_message');
-
- // add the forum tool option
- add_group_tool_option('forum', elgg_echo('groups:enableforum'), true);
// Now override icons
elgg_register_plugin_hook_handler('entity:icon:url', 'group', 'groups_groupicon_hook');
@@ -77,86 +66,22 @@ function groups_init() {
// allow ecml in discussion and profiles
elgg_register_plugin_hook_handler('get_views', 'ecml', 'groups_ecml_views_hook');
elgg_register_plugin_hook_handler('get_views', 'ecml', 'groupprofile_ecml_views_hook');
-}
-
-/**
- * Event handler for group forum posts
- *
- */
-function group_object_notifications($event, $object_type, $object) {
-
- static $flag;
- if (!isset($flag))
- $flag = 0;
-
- if (is_callable('object_notifications'))
- if ($object instanceof ElggObject) {
- if ($object->getSubtype() == 'groupforumtopic') {
- //if ($object->countAnnotations('group_topic_post') > 0) {
- if ($flag == 0) {
- $flag = 1;
- object_notifications($event, $object_type, $object);
- }
- //}
- }
- }
-}
-
-/**
- * Intercepts the notification on group topic creation and prevents a notification from going out
- * (because one will be sent on the annotation)
- *
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $returnvalue
- * @param unknown_type $params
- * @return unknown
- */
-function group_object_notifications_intercept($hook, $entity_type, $returnvalue, $params) {
- if (isset($params)) {
- if ($params['event'] == 'create' && $params['object'] instanceof ElggObject) {
- if ($params['object']->getSubtype() == 'groupforumtopic') {
- return true;
- }
- }
- }
- return null;
-}
-/**
- * Returns a more meaningful message
- *
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $returnvalue
- * @param unknown_type $params
- */
-function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $params) {
- $entity = $params['entity'];
- $to_entity = $params['to_entity'];
- $method = $params['method'];
- if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'groupforumtopic')) {
+ // Register a handler for create groups
+ elgg_register_event_handler('create', 'group', 'groups_create_event_listener');
- $descr = $entity->description;
- $title = $entity->title;
- global $CONFIG;
- $url = $entity->getURL();
+ // Register a handler for delete groups
+ elgg_register_event_handler('delete', 'group', 'groups_delete_event_listener');
- $msg = get_input('topicmessage');
- if (empty($msg))
- $msg = get_input('topic_post');
- if (!empty($msg))
- $msg = $msg . "\n\n"; else
- $msg = '';
+ // Make sure the groups initialisation function is called on initialisation
- $owner = get_entity($entity->container_guid);
- if ($method == 'sms') {
- return elgg_echo("groupforumtopic:new") . ': ' . $url . " ({$owner->name}: {$title})";
- } else {
- return get_loggedin_user()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL();
- }
- }
- return null;
+ // Ensure this runs after other plugins
+ elgg_register_event_handler('init', 'system', 'groups_fields_setup', 10000);
+
+ elgg_register_event_handler('join', 'group', 'groups_user_join_event_listener');
+ elgg_register_event_handler('leave', 'group', 'groups_user_leave_event_listener');
+ elgg_register_event_handler('pagesetup', 'system', 'groups_submenus');
+ elgg_register_event_handler('annotate', 'all', 'group_object_notifications');
}
/**
@@ -294,43 +219,6 @@ function groups_page_handler($page) {
}
/**
- * Discussion page handler
- *
- * URLs take the form of
- * All topics in site: pg/discussion/all
- * List topics in forum: pg/discussion/owner/<guid>
- * View discussion topic: pg/discussion/view/<guid>
- * Add discussion topic: pg/discussion/add/<guid>
- * Edit discussion topic: pg/discussion/edit/<guid>
- *
- * @param array $page Array of url segments for routing
- */
-function discussion_page_handler($page) {
-
- elgg_load_library('elgg:discussion');
-
- elgg_push_breadcrumb(elgg_echo('discussion'), 'pg/discussion/all');
-
- switch ($page[0]) {
- case 'all':
- discussion_handle_all_page();
- break;
- case 'owner':
- discussion_handle_list_page($page[1]);
- break;
- case 'add':
- discussion_handle_edit_page('add', $page[1]);
- break;
- case 'edit':
- discussion_handle_edit_page('edit', $page[1]);
- break;
- case 'view':
- discussion_handle_view_page($page[1]);
- break;
- }
-}
-
-/**
* Handle group icons.
*
* @param unknown_type $page
@@ -347,7 +235,7 @@ function groups_icon_handler($page) {
set_input('size', $page[1]);
}
// Include the standard profile index
- include($CONFIG->pluginspath . "groups/graphics/icon.php");
+ include($CONFIG->pluginspath . "groups/icon.php");
}
/**
@@ -362,9 +250,6 @@ function groups_url($entity) {
return "pg/groups/profile/{$entity->guid}/$title";
}
-function groups_groupforumtopic_url($entity) {
- return 'pg/discussion/view/' . $entity->guid;
-}
/**
* Groups created so create an access list for it
@@ -518,34 +403,6 @@ function groups_groupicon_hook($hook, $entity_type, $returnvalue, $params) {
}
/**
- * A simple function to see who can edit a group discussion post
- * @param the comment $entity
- * @param user who owns the group $group_owner
- * @return boolean
- */
-function groups_can_edit_discussion($entity, $group_owner) {
-
- //logged in user
- $user = get_loggedin_userid();
-
- if (($entity->owner_guid == $user) || $group_owner == $user || isadminloggedin()) {
- return true;
- } else {
- return false;
- }
-}
-
-/**
- * Overrides topic post getURL() value.
- *
- */
-function group_topicpost_url($annotation) {
- if ($parent = get_entity($annotation->entity_guid)) {
- return 'pg/discussion/view/' . $parent->guid . '#' . $annotation->id;
- }
-}
-
-/**
* Grabs groups by invitations
* Have to override all access until there's a way override access to getter functions.
*
@@ -605,11 +462,6 @@ function activity_profile_menu($hook, $entity_type, $return_value, $params) {
/**
* Parse ECML on group discussion views
- *
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $return_value
- * @param unknown_type $params
*/
function groups_ecml_views_hook($hook, $entity_type, $return_value, $params) {
$return_value['forum/viewposts'] = elgg_echo('groups:ecml:discussion');
@@ -619,11 +471,6 @@ function groups_ecml_views_hook($hook, $entity_type, $return_value, $params) {
/**
* Parse ECML on group profiles
- *
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $return_value
- * @param unknown_type $params
*/
function groupprofile_ecml_views_hook($hook, $entity_type, $return_value, $params) {
$return_value['groups/groupprofile'] = elgg_echo('groups:ecml:groupprofile');
@@ -631,23 +478,214 @@ function groupprofile_ecml_views_hook($hook, $entity_type, $return_value, $param
return $return_value;
}
-register_extender_url_handler('group_topicpost_url', 'annotation', 'group_topic_post');
-// Register a handler for create groups
-elgg_register_event_handler('create', 'group', 'groups_create_event_listener');
-// Register a handler for delete groups
-elgg_register_event_handler('delete', 'group', 'groups_delete_event_listener');
+/**
+ * Discussion
+ *
+ */
-// Make sure the groups initialisation function is called on initialisation
-elgg_register_event_handler('init', 'system', 'groups_init');
-elgg_register_event_handler('init', 'system', 'groups_fields_setup', 10000); // Ensure this runs after other plugins
-elgg_register_event_handler('join', 'group', 'groups_user_join_event_listener');
-elgg_register_event_handler('leave', 'group', 'groups_user_leave_event_listener');
-elgg_register_event_handler('pagesetup', 'system', 'groups_submenus');
-elgg_register_event_handler('annotate', 'all', 'group_object_notifications');
-
-// Register actions
-global $CONFIG;
-elgg_register_action('discussion/save', $CONFIG->pluginspath . "groups/actions/discussion/save.php");
-elgg_register_action('discussion/delete', $CONFIG->pluginspath . "groups/actions/discussion/delete.php");
+elgg_register_event_handler('init', 'system', 'discussion_init');
+
+/**
+ * Initialize the discussion component
+ */
+function discussion_init() {
+
+ elgg_register_library('elgg:discussion', elgg_get_plugin_path() . 'groups/lib/discussion.php');
+
+ register_page_handler('discussion', 'discussion_page_handler');
+
+ register_entity_url_handler('discussion_override_topic_url', 'object', 'groupforumtopic');
+ //register_extender_url_handler('group_topicpost_url', 'annotation', 'group_topic_post');
+
+ $action_base = elgg_get_plugin_path() . 'groups/actions/discussion';
+ elgg_register_action('discussion/save', "$action_base/save.php");
+ elgg_register_action('discussion/delete', "$action_base/delete.php");
+
+ // add link to owner block
+ elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'discussion_owner_block_menu');
+
+ // add the forum tool option
+ add_group_tool_option('forum', elgg_echo('groups:enableforum'), true);
+ elgg_extend_view('groups/tool_latest', 'discussion/group_module');
+
+ // notifications
+ register_notification_object('object', 'groupforumtopic', elgg_echo('groupforumtopic:new'));
+ elgg_register_plugin_hook_handler('object:notifications', 'object', 'group_object_notifications_intercept');
+ elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'groupforumtopic_notify_message');
+
+}
+
+/**
+ * Discussion page handler
+ *
+ * URLs take the form of
+ * All topics in site: pg/discussion/all
+ * List topics in forum: pg/discussion/owner/<guid>
+ * View discussion topic: pg/discussion/view/<guid>
+ * Add discussion topic: pg/discussion/add/<guid>
+ * Edit discussion topic: pg/discussion/edit/<guid>
+ *
+ * @param array $page Array of url segments for routing
+ */
+function discussion_page_handler($page) {
+
+ elgg_load_library('elgg:discussion');
+
+ elgg_push_breadcrumb(elgg_echo('discussion'), 'pg/discussion/all');
+
+ switch ($page[0]) {
+ case 'all':
+ discussion_handle_all_page();
+ break;
+ case 'owner':
+ discussion_handle_list_page($page[1]);
+ break;
+ case 'add':
+ discussion_handle_edit_page('add', $page[1]);
+ break;
+ case 'edit':
+ discussion_handle_edit_page('edit', $page[1]);
+ break;
+ case 'view':
+ discussion_handle_view_page($page[1]);
+ break;
+ }
+}
+
+/**
+ * Override the discussion topic url
+ *
+ * @param ElggObject $entity Discussion topic
+ * @return string
+ */
+function discussion_override_topic_url($entity) {
+ return 'pg/discussion/view/' . $entity->guid;
+}
+
+/**
+ * Override the annotation url
+ *
+ * @param ElggAnnotation $annotation
+ * @return string
+ */
+function discussion_override_comment_url($annotation) {
+ $parent = get_entity($annotation->entity_guid);
+ if ($parent) {
+ return 'pg/discussion/view/' . $parent->guid . '#' . $annotation->id;
+ }
+}
+
+/**
+ * Add owner block link
+ */
+function discussion_owner_block_menu($hook, $type, $return, $params) {
+ if (elgg_instanceof($params['entity'], 'group')) {
+ if ($params['entity']->forum_enable != "no") {
+ $url = "pg/discussion/owner/{$params['entity']->guid}";
+ $item = new ElggMenuItem('discussion', elgg_echo('discussion:group'), $url);
+ $return[] = $item;
+ }
+ }
+
+ return $return;
+}
+
+/**
+ * Event handler for group forum posts
+ *
+ */
+function group_object_notifications($event, $object_type, $object) {
+
+ static $flag;
+ if (!isset($flag))
+ $flag = 0;
+
+ if (is_callable('object_notifications'))
+ if ($object instanceof ElggObject) {
+ if ($object->getSubtype() == 'groupforumtopic') {
+ //if ($object->countAnnotations('group_topic_post') > 0) {
+ if ($flag == 0) {
+ $flag = 1;
+ object_notifications($event, $object_type, $object);
+ }
+ //}
+ }
+ }
+}
+
+/**
+ * Intercepts the notification on group topic creation and prevents a notification from going out
+ * (because one will be sent on the annotation)
+ *
+ * @param unknown_type $hook
+ * @param unknown_type $entity_type
+ * @param unknown_type $returnvalue
+ * @param unknown_type $params
+ * @return unknown
+ */
+function group_object_notifications_intercept($hook, $entity_type, $returnvalue, $params) {
+ if (isset($params)) {
+ if ($params['event'] == 'create' && $params['object'] instanceof ElggObject) {
+ if ($params['object']->getSubtype() == 'groupforumtopic') {
+ return true;
+ }
+ }
+ }
+ return null;
+}
+
+/**
+ * Returns a more meaningful message
+ *
+ * @param unknown_type $hook
+ * @param unknown_type $entity_type
+ * @param unknown_type $returnvalue
+ * @param unknown_type $params
+ */
+function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $params) {
+ $entity = $params['entity'];
+ $to_entity = $params['to_entity'];
+ $method = $params['method'];
+ if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'groupforumtopic')) {
+
+ $descr = $entity->description;
+ $title = $entity->title;
+ global $CONFIG;
+ $url = $entity->getURL();
+
+ $msg = get_input('topicmessage');
+ if (empty($msg))
+ $msg = get_input('topic_post');
+ if (!empty($msg))
+ $msg = $msg . "\n\n"; else
+ $msg = '';
+
+ $owner = get_entity($entity->container_guid);
+ if ($method == 'sms') {
+ return elgg_echo("groupforumtopic:new") . ': ' . $url . " ({$owner->name}: {$title})";
+ } else {
+ return get_loggedin_user()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL();
+ }
+ }
+ return null;
+}
+
+/**
+ * A simple function to see who can edit a group discussion post
+ * @param the comment $entity
+ * @param user who owns the group $group_owner
+ * @return boolean
+ */
+function groups_can_edit_discussion($entity, $group_owner) {
+
+ //logged in user
+ $user = get_loggedin_userid();
+
+ if (($entity->owner_guid == $user) || $group_owner == $user || isadminloggedin()) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/mod/groups/views/default/groups/profile/forum_widget.php b/mod/groups/views/default/discussion/group_module.php
index 969eb0559..b42084655 100644
--- a/mod/groups/views/default/groups/profile/forum_widget.php
+++ b/mod/groups/views/default/discussion/group_module.php
@@ -18,7 +18,7 @@ $all_link = elgg_view('output/url', array(
));
$header = "<span class=\"group-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('groups:latestdiscussion') . '</h3>';
+$header .= '<h3>' . elgg_echo('discussion:group') . '</h3>';
elgg_push_context('widgets');
diff --git a/mod/groups/views/default/forum/maintopic.php b/mod/groups/views/default/forum/maintopic.php
deleted file mode 100644
index 7031c7418..000000000
--- a/mod/groups/views/default/forum/maintopic.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
- /**
- * Elgg Topic individual post view.
- *
- * @package ElggGroups
- *
- * @uses $vars['entity'] The post
- */
-
- $topic = get_input('topic');
- $group_guid = get_input('group_guid');
-
-?>
-
-<div class="entity-listing topic clearfix">
-<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'], elgg_get_page_owner()->owner_guid)) {
- echo "<div class='entity-metadata'>";
- echo "<span class='delete-button'>".elgg_view("output/confirmlink",array(
- 'href' => "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=\"".elgg_get_site_url()."pg/discussion/edit/{$vars['entity']->guid}\">".elgg_echo('edit')."</a></span>";
- echo "</div>";
-
- }
-
- echo "<p class='entity-title'><a href='".$post_owner->getURL()."'>" . $post_owner->name . "</a></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'>" . elgg_view_friendly_time($vars['entity']->time_created) . "</p>";
- echo "</div>"; // close entity-listing-info
- echo "</div>"; // close entity-listing.topic
-
- //display the actual message posted
- echo "<div class='topic_post maintopic'>";
- echo parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->description)));
- echo "</div>";
-?>
-
-<!-- </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
deleted file mode 100644
index e67294c72..000000000
--- a/mod/groups/views/default/forum/topics.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Elgg groups plugin
- */
-?>
-
-<div id="content-header" class="clearfix">
- <div class="content-header-title">
- <h2><?php echo elgg_echo("groups:forum"); ?></h2>
- </div>
- <?php // only show the add topic button if the user is a member
- if(elgg_get_page_owner()->isMember(get_loggedin_user())) {
- ?>
- <div class="content-header-options">
- <a class="elgg-action-button" href="<?php echo elgg_get_site_url(); ?>mod/groups/addtopic.php?group_guid=<?php echo $vars['group_guid']; ?>"><?php echo elgg_echo("groups:addtopic"); ?></a>
- </div>
- <?php
- }
- ?>
-</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
diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php
deleted file mode 100644
index 3c9da1258..000000000
--- a/mod/groups/views/default/forum/viewposts.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * 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'), elgg_get_site_url()."pg/groups/world/");
-elgg_push_breadcrumb($group->name, $group->getURL());
-elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), elgg_get_site_url()."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 = elgg_get_site_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,
- ));
-
-?>
-<?php
- //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") {
- echo elgg_view_comments($vars['entity'], false);
- //this topic has been closed by the owner
- echo "<h3>" . elgg_echo("groups:topicisclosed") . "</h3>";
- echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>";
-
- }elseif(elgg_get_page_owner()->isMember(get_loggedin_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/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php
index af558c90d..3e28c0091 100644
--- a/mod/groups/views/default/groups/profile/widgets.php
+++ b/mod/groups/views/default/groups/profile/widgets.php
@@ -12,11 +12,6 @@ echo "<div id='group_tools_latest' class='clearfix'>";
echo "<div class='group_tool_widget activity clearfix'>";
echo elgg_view("groups/profile/activity_widget", array('entity' => $vars['entity']));
echo "</div>";
-
- // forum latest
- //echo "<div class='group_tool_widget forum clearfix'>";
- echo elgg_view("groups/profile/forum_widget", array('entity' => $vars['entity']));
- //echo "</div>";
// enable tools to extend this area
echo elgg_view("groups/tool_latest", array('entity' => $vars['entity']));
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index a89419931..c6f9da4b4 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -5,7 +5,7 @@
* @package ElggGroups
*/
-//$full = elgg_get_array_value('full', $vars, FALSE);
+$full = elgg_get_array_value('full', $vars, FALSE);
$topic = elgg_get_array_value('entity', $vars, FALSE);
if (!$topic) {
@@ -46,17 +46,33 @@ $metadata = elgg_view('layout/objects/list/metadata', array(
'handler' => 'discussion',
));
-$subtitle = "$poster_text $date $comments_link <span class=\"groups-latest-comment\">$comments_text</span>";
-
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
$metadata = '';
}
if ($full) {
+ $subtitle = "$poster_text $date $comments_link";
+
+ $params = array(
+ 'entity' => $topic,
+ 'title' => false,
+ 'metadata' => $metadata,
+ 'subtitle' => $subtitle,
+ 'tags' => $tags,
+ );
+ $list_body = elgg_view('layout/objects/list/body', $params);
+
+ $info = elgg_view_image_block($poster_icon, $list_body);
+ echo <<<HTML
+$header
+$info
+$body
+HTML;
} else {
// brief view
+ $subtitle = "$poster_text $date $comments_link <span class=\"groups-latest-comment\">$comments_text</span>";
$params = array(
'entity' => $topic,