aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-03 01:58:03 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-03 01:58:03 +0000
commitbe0be6667aa5adce027c9e0496ce70fda260ae3f (patch)
treef75ed350acc67a9ccc2ea5c0444be3d1ace85248
parent608647dcf59c60e55d86a69e39e2626e6f1eb6bc (diff)
downloadelgg-be0be6667aa5adce027c9e0496ce70fda260ae3f.tar.gz
elgg-be0be6667aa5adce027c9e0496ce70fda260ae3f.tar.bz2
Refs #2679 preventing people from commenting on a discussion topic in the river
git-svn-id: http://code.elgg.org/elgg/trunk@8571 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/groups/start.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 26452ebca..fe3600dec 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -478,7 +478,9 @@ function discussion_init() {
elgg_register_page_handler('discussion', 'discussion_page_handler');
elgg_register_entity_url_handler('object', 'groupforumtopic', 'discussion_override_topic_url');
- //register_extender_url_handler('group_topicpost_url', 'annotation', 'group_topic_post');
+
+ // commenting not allowed on discussion topics (use a different annotation)
+ elgg_register_plugin_hook_handler('permissions_check:comment', 'object', 'discussion_comment_override');
$action_base = elgg_get_plugins_path() . 'groups/actions/discussion';
elgg_register_action('discussion/save', "$action_base/save.php");
@@ -548,15 +550,11 @@ function discussion_override_topic_url($entity) {
}
/**
- * Override the annotation url
- *
- * @param ElggAnnotation $annotation
- * @return string
+ * We don't want people commenting on topics in the river
*/
-function discussion_override_comment_url($annotation) {
- $parent = get_entity($annotation->entity_guid);
- if ($parent) {
- return 'pg/discussion/view/' . $parent->guid . '#' . $annotation->id;
+function discussion_comment_override($hook, $type, $return, $params) {
+ if (elgg_instanceof($params['entity'], 'object', 'groupforumtopic')) {
+ return false;
}
}