aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/actions/blog/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog/actions/blog/delete.php')
-rw-r--r--mod/blog/actions/blog/delete.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/blog/actions/blog/delete.php b/mod/blog/actions/blog/delete.php
new file mode 100644
index 000000000..8fa1ff889
--- /dev/null
+++ b/mod/blog/actions/blog/delete.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Delete blog entity
+ *
+ * @package Blog
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+$blog_guid = get_input('guid');
+$blog = get_entity($blog_guid);
+
+if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
+ if ($blog->delete()) {
+ system_message(elgg_echo('blog:message:deleted_post'));
+ } else {
+ register_error(elgg_echo('blog:error:cannot_delete_post'));
+ }
+} else {
+ register_error(elgg_echo('blog:error:post_not_found'));
+}
+
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file