aboutsummaryrefslogtreecommitdiff
path: root/mod/activity/opendd.php
blob: 86d00ce4ab9fdb53fcc8a4d3f404f23f1528c8d0 (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
28
29
30
31
32
33
34
35
<?php
	/**
	 * Elgg activity plugin opendd export of a given statement.
	 * 
	 * @package ElggActivity
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Curverider Ltd
	 * @copyright Curverider Ltd 2008-2009
	 * @link http://elgg.com/
	 */
	
	$id = (int)get_input('statement_id');
	$type = sanitise_string(get_input('statement_type'));
	$metaname = sanitise_string(get_input('metaname'));
	
	$statement = construct_riverstatement_from_log(
				get_log_entry($id)
			);
	
	global $CONFIG;
			
	switch ($type)
	{
		case 'statement' : $result = activity_export_statement($statement, $id);
						   foreach ($result as $r) $body .=  "$r"; 
		break;
		case 'metadata' :
			
			$md = activity_export_field_from_statement($statement, $id, $metaname);
			$body .= "$md";
		break;
	}
	
	page_draw('',$body);
?>