diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-07 17:28:53 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-07 17:28:53 +0000 |
commit | 9fffcb13f23ca91b1efa2da7dbc0627c525ae94c (patch) | |
tree | 4f819014ba8766543a2e2cdc74222c69d8b33b91 /mod/groups/actions/forums/deletepost.php | |
parent | 89fa2c232ea2a806a70f96d0f28fd6318163227c (diff) | |
download | elgg-9fffcb13f23ca91b1efa2da7dbc0627c525ae94c.tar.gz elgg-9fffcb13f23ca91b1efa2da7dbc0627c525ae94c.tar.bz2 |
more group tweaks
git-svn-id: https://code.elgg.org/elgg/trunk@1778 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/actions/forums/deletepost.php')
-rw-r--r-- | mod/groups/actions/forums/deletepost.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/groups/actions/forums/deletepost.php b/mod/groups/actions/forums/deletepost.php new file mode 100644 index 000000000..d84525b13 --- /dev/null +++ b/mod/groups/actions/forums/deletepost.php @@ -0,0 +1,44 @@ +<?php
+
+ /**
+ * Elgg Groups: delete topic comment action
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ // Ensure we're logged in
+ if (!isloggedin()) forward();
+
+
+ // Make sure we can get the comment in question
+ $post_id = (int) get_input('post');
+ $group_guid = (int) get_input('group');
+ $topic_guid = (int) get_input('topic');
+
+ if ($post = get_annotation($post_id)) {
+
+ //check that the user can edit
+ if ($post->canEdit()) {
+
+ //delete
+ $post->delete();
+ //display confirmation message
+ system_message(elgg_echo("grouppost:deleted"));
+
+ }
+
+ } else {
+ $url = "";
+ system_message(elgg_echo("grouppost:notdeleted"));
+ }
+
+ // Forward to the group forum page
+ global $CONFIG;
+ $url = $CONFIG->wwwroot . "mod/groups/topicposts.php?topic={$topic_guid}&group_guid={$group_guid}";
+ forward($url);
+
+?>
\ No newline at end of file |