aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent/actions
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-12 21:25:57 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-12 21:25:57 +0000
commitf1230a2c6b8bf0586447e4f9bad2089b7cc3b8bf (patch)
tree96e13233a5635166126b0fccf06a110edda79ca7 /mod/reportedcontent/actions
parent70d21050c08ddf8ee5253b6e6cd6c16fa125ef74 (diff)
downloadelgg-f1230a2c6b8bf0586447e4f9bad2089b7cc3b8bf.tar.gz
elgg-f1230a2c6b8bf0586447e4f9bad2089b7cc3b8bf.tar.bz2
report content added as a core plugin. Still needs a couple of bits wired up.
git-svn-id: https://code.elgg.org/elgg/trunk@1867 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent/actions')
-rw-r--r--mod/reportedcontent/actions/add.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php
new file mode 100644
index 000000000..bfb5fcfb3
--- /dev/null
+++ b/mod/reportedcontent/actions/add.php
@@ -0,0 +1,43 @@
+<?php
+
+ /**
+ * Elgg report action
+ *
+ * @package ElggReportContent
+ * @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/
+ */
+
+ $title = get_input('title');
+ $description = get_input('description');
+ $address = get_input('address');
+ $access = 0; //this is private and only admins can see it
+
+ if ($title && $address) {
+
+ $entity = new ElggObject;
+ $entity->subtype = "reported_content";
+ $entity->owner_guid = $_SESSION['user']->getGUID();
+ $entity->title = $title;
+ $entity->address = $address;
+ $entity->description = $description;
+ $entity->access_id = $access;
+
+ if ($entity->save()) {
+ system_message(elgg_echo('reportedcontent:success'));
+ forward($address);
+ } else {
+ register_error(elgg_echo('reportedcontent:failed'));
+ forward($address);
+ }
+
+ } else {
+
+ register_error(elgg_echo('reportedcontent:failed'));
+ forward($address);
+
+ }
+
+?> \ No newline at end of file