diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-04 15:29:16 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-04 15:29:16 +0000 |
commit | cb29f5f73e530b776002077f7c9afa45e094ff1c (patch) | |
tree | f458143d78c2f1942566b07239a65e47fd142925 /mod/reportedcontent/actions/add.php | |
parent | 053480d718c7613d4b778350b757b9e35f9d8f54 (diff) | |
download | elgg-cb29f5f73e530b776002077f7c9afa45e094ff1c.tar.gz elgg-cb29f5f73e530b776002077f7c9afa45e094ff1c.tar.bz2 |
Added plugin hook triggers to reportedcontent plugin. Fixes #725
git-svn-id: https://code.elgg.org/elgg/trunk@2646 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent/actions/add.php')
-rw-r--r-- | mod/reportedcontent/actions/add.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php index 3f818ca3c..c43e14baa 100644 --- a/mod/reportedcontent/actions/add.php +++ b/mod/reportedcontent/actions/add.php @@ -26,8 +26,13 @@ $entity->access_id = $access;
if ($entity->save()) {
- system_message(elgg_echo('reportedcontent:success'));
- $entity->state = "active";
+ if (!trigger_plugin_hook('reportedcontent:add', $entity->type, array('entity'=>$entity), true)) {
+ $entity->delete();
+ register_error(elgg_echo('reportedcontent:failed'));
+ } else {
+ system_message(elgg_echo('reportedcontent:success'));
+ $entity->state = "active";
+ }
forward($address);
} else {
register_error(elgg_echo('reportedcontent:failed'));
|