diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-12 17:03:51 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-12 17:03:51 +0000 |
commit | 73ed4ae8513af1cc6e795b125cc1f319a965bfb4 (patch) | |
tree | 86681c6baee8869faab58940588251be692dd9e4 /mod/reportedcontent/actions/add.php | |
parent | c41553d5e532ca86070d511d50d150d97869bb84 (diff) | |
download | elgg-73ed4ae8513af1cc6e795b125cc1f319a965bfb4.tar.gz elgg-73ed4ae8513af1cc6e795b125cc1f319a965bfb4.tar.bz2 |
Merged Cash's bugfixes from the 1.7 branch (3288:5377).
git-svn-id: http://code.elgg.org/elgg/trunk@5378 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent/actions/add.php')
-rw-r--r-- | mod/reportedcontent/actions/add.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php index 76cefa4c8..80f67eab4 100644 --- a/mod/reportedcontent/actions/add.php +++ b/mod/reportedcontent/actions/add.php @@ -17,21 +17,21 @@ 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; + $report = new ElggObject; + $report->subtype = "reported_content"; + $report->owner_guid = $_SESSION['user']->getGUID(); + $report->title = $title; + $report->address = $address; + $report->description = $description; + $report->access_id = $access; - if ($entity->save()) { - if (!trigger_plugin_hook('reportedcontent:add', $reported->type, array('entity'=>$reported), true)) { - $entity->delete(); + if ($report->save()) { + if (!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')); - $entity->state = "active"; + $report->state = "active"; } forward($address); } else { |