From 4766f36a4d74924f21ff329c4318ce4e069ffa04 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 3 Mar 2010 17:53:05 +0000 Subject: Pulled in the interface changes. git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/actions/forums/editpost.php | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 mod/groups/actions/forums/editpost.php (limited to 'mod/groups/actions/forums/editpost.php') diff --git a/mod/groups/actions/forums/editpost.php b/mod/groups/actions/forums/editpost.php new file mode 100644 index 000000000..d30fad31f --- /dev/null +++ b/mod/groups/actions/forums/editpost.php @@ -0,0 +1,53 @@ +isMember($vars['user'])) forward(); + + //get the required variables + $post = get_input("post"); + $field_num = get_input("field_num"); + $post_comment = get_input("postComment{$field_num}"); + $annotation = get_annotation($post); + $commentOwner = $annotation->owner_guid; + $access_id = $annotation->access_id; + $topic = get_input("topic"); + + if($annotation){ + + //can edit? Either the comment owner or admin can + if(groups_can_edit_discussion($annotation, page_owner_entity()->owner_guid)){ + + update_annotation($post, "group_topic_post", $post_comment, "",$commentOwner, $access_id); + system_message(elgg_echo("groups:forumpost:edited")); + + }else{ + system_message(elgg_echo("groups:forumpost:error")); + } + + }else{ + + system_message(elgg_echo("groups:forumpost:error")); + } + + // Forward to the group forum page + global $CONFIG; + $url = $CONFIG->wwwroot . "mod/groups/topicposts.php?topic={$topic}&group_guid={$group_guid}/"; + forward($url); + + +?> \ No newline at end of file -- cgit v1.2.3