diff options
Diffstat (limited to 'mod/reportedcontent/actions/reportedcontent/archive.php')
-rw-r--r-- | mod/reportedcontent/actions/reportedcontent/archive.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mod/reportedcontent/actions/reportedcontent/archive.php b/mod/reportedcontent/actions/reportedcontent/archive.php new file mode 100644 index 000000000..dd5c6aef1 --- /dev/null +++ b/mod/reportedcontent/actions/reportedcontent/archive.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg reported content: archive action + * + * @package ElggReportedContent + */ + +$guid = (int) get_input('guid'); + +$report = get_entity($guid); + +// Make sure we actually have permission to edit +if ($report->getSubtype() == "reported_content" && $report->canEdit()) { + + // allow another plugin to override + if (!elgg_trigger_plugin_hook('reportedcontent:archive', 'system', array('report' => $report), TRUE)) { + system_message(elgg_echo("reportedcontent:notarchived")); + forward(REFERER); + } + + // change the state + $report->state = "archived"; + + system_message(elgg_echo("reportedcontent:archived")); + + forward(REFERER); +} |