aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent/actions/reportedcontent/archive.php
blob: dd5c6aef1b063780c3b5f9480f069fcd3528886d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
}