aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent/actions/add.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-29 00:56:55 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-29 00:56:55 +0000
commit855b008013aad0426ab0332b040bddb033bb6af9 (patch)
tree70c137e5c9a9c916bb9f8172daf3bd0483895bf6 /mod/reportedcontent/actions/add.php
parent71dc8cbf9eecb4de149bc96bb5758b866116b1c8 (diff)
downloadelgg-855b008013aad0426ab0332b040bddb033bb6af9.tar.gz
elgg-855b008013aad0426ab0332b040bddb033bb6af9.tar.bz2
cleaned up the reported content plugin
git-svn-id: http://code.elgg.org/elgg/trunk@7466 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent/actions/add.php')
-rw-r--r--mod/reportedcontent/actions/add.php74
1 files changed, 34 insertions, 40 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php
index 138e66cb9..7c60cdf22 100644
--- a/mod/reportedcontent/actions/add.php
+++ b/mod/reportedcontent/actions/add.php
@@ -1,45 +1,39 @@
<?php
+/**
+ * Elgg report action
+ *
+ * @package ElggReportContent
+ */
+$title = get_input('title');
+$description = get_input('description');
+$address = get_input('address');
+$access = ACCESS_PRIVATE; //this is private and only admins can see it
- /**
- * Elgg report action
- *
- * @package ElggReportContent
- */
+if ($title && $address) {
- $title = get_input('title');
- $description = get_input('description');
- $address = get_input('address');
- $access = ACCESS_PRIVATE; //this is private and only admins can see it
-
- if ($title && $address) {
-
- $report = new ElggObject;
- $report->subtype = "reported_content";
- $report->owner_guid = get_loggedin_userid();
- $report->title = $title;
- $report->address = $address;
- $report->description = $description;
- $report->access_id = $access;
-
- if ($report->save()) {
- if (!elgg_trigger_plugin_hook('reportedcontent:add', 'system', array('report'=>$report), true)) {
- $report->delete();
- register_error(elgg_echo('reportedcontent:failed'));
- } else {
- system_message(elgg_echo('reportedcontent:success'));
- $report->state = "active";
- }
- forward($address);
- } else {
- register_error(elgg_echo('reportedcontent:failed'));
- forward($address);
- }
-
+ $report = new ElggObject;
+ $report->subtype = "reported_content";
+ $report->owner_guid = get_loggedin_userid();
+ $report->title = $title;
+ $report->address = $address;
+ $report->description = $description;
+ $report->access_id = $access;
+
+ if ($report->save()) {
+ if (!elgg_trigger_plugin_hook('reportedcontent:add', 'system', array('report' => $report), true)) {
+ $report->delete();
+ register_error(elgg_echo('reportedcontent:failed'));
} else {
-
- register_error(elgg_echo('reportedcontent:failed'));
- forward($address);
-
- }
+ system_message(elgg_echo('reportedcontent:success'));
+ $report->state = "active";
+ }
+ forward($address);
+ } else {
+ register_error(elgg_echo('reportedcontent:failed'));
+ forward($address);
+ }
+} else {
-?> \ No newline at end of file
+ register_error(elgg_echo('reportedcontent:failed'));
+ forward($address);
+}