diff options
Diffstat (limited to 'mod/reportedcontent/actions')
-rw-r--r-- | mod/reportedcontent/actions/add.php | 22 | ||||
-rw-r--r-- | mod/reportedcontent/actions/archive.php | 8 | ||||
-rw-r--r-- | mod/reportedcontent/actions/delete.php | 8 |
3 files changed, 19 insertions, 19 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 { diff --git a/mod/reportedcontent/actions/archive.php b/mod/reportedcontent/actions/archive.php index a550abc2a..ca4ad2c41 100644 --- a/mod/reportedcontent/actions/archive.php +++ b/mod/reportedcontent/actions/archive.php @@ -17,15 +17,15 @@ $guid = (int) get_input('item'); // Make sure we actually have permission to edit - $reported = get_entity($guid); - if ($reported->getSubtype() == "reported_content" && $reported->canEdit()) { + $report = get_entity($guid); + if ($report->getSubtype() == "reported_content" && $report->canEdit()) { // change the state - if (!trigger_plugin_hook('reportedcontent:archive', $reported->type, array('entity'=>$reported), true)) { + if (!trigger_plugin_hook('reportedcontent:archive', 'system', array('report'=>$report), true)) { system_message(elgg_echo("reportedcontent:notarchived")); forward("pg/reportedcontent/"); } - $reported->state = "archived"; + $report->state = "archived"; // Success message system_message(elgg_echo("reportedcontent:archived")); diff --git a/mod/reportedcontent/actions/delete.php b/mod/reportedcontent/actions/delete.php index cff42b025..b2e9c7acd 100644 --- a/mod/reportedcontent/actions/delete.php +++ b/mod/reportedcontent/actions/delete.php @@ -17,15 +17,15 @@ $guid = (int) get_input('item'); // Make sure we actually have permission to edit - $reported = get_entity($guid); - if ($reported->getSubtype() == "reported_content" && $reported->canEdit()) { + $report = get_entity($guid); + if ($report->getSubtype() == "reported_content" && $report->canEdit()) { // Delete it! - if (!trigger_plugin_hook('reportedcontent:delete', $reported->type, array('entity'=>$reported), true)) { + if (!trigger_plugin_hook('reportedcontent:delete', '$system', array('report'=>$report), true)) { register_error(elgg_echo("reportedcontent:notdeleted")); forward("pg/reportedcontent/"); } - $rowsaffected = $reported->delete(); + $rowsaffected = $report->delete(); if ($rowsaffected > 0) { // Success message system_message(elgg_echo("reportedcontent:deleted")); |