aboutsummaryrefslogtreecommitdiff
path: root/views/default/export/entity.php
blob: 1ddde4b78769bcf895c0520f7b74dc47fe2d113f (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
	/**
	 * Elgg Entity export.
	 * Displays an entity using the current view.
	 * 
	 * @package Elgg
	 * @subpackage Core
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Marcus Povey
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.org/
	 */

	$entity = $vars['entity'];
	if (!$entity) throw new InvalidParameterException("No entity found, it either doesn't exist or you don't have access to it.");
	
	$metadata = get_metadata_for_entity($entity->guid);
	$annotations = get_annotations($entity->guid);
	$relationships = get_entity_relationships($entity->guid);
	
?>
<div>
	<?php
		foreach ($entity as $k => $v)
		{
?>
		<div>
			<table>
				<tr>
				<td><b><?php echo $k; ?></b></td>
				<td><?php echo $v; ?></td> 
				</tr>
			</table>
		</div>
<?php
		}
	?>
</div>
<div id="metadata">
<h2>Metadata</h2>	
	<?php
		foreach ($metadata as $m)
		{
?>
		<div>
			<table>
				<tr>
				<td><b><?php echo $m->name; ?></b></td>
				<td><?php echo $m->value; ?></td> 
				</tr>
			</table>
		</div>
<?php
		}
	?>
	
</div>

<div id="annotations">
<h2>Annotations</h2>	
	<?php
		foreach ($annotations as $a)
		{
?>
		<div>
			<table>
				<tr>
				<td><b><?php echo $a->name; ?></b></td>
				<td><?php echo $a->value; ?></td> 
				</tr>
			</table>
		</div>
<?php
		}
	?>
</div>

<div id="relationship">
<h2>Relationships</h2>	
	<?php
		foreach ($relationships as $r)
		{
?>
		<div>
			<table>
				<tr>
				<td><b><?php echo $r->relationship; ?></b></td>
				<td><?php echo $r->guid_two; ?></td> 
				</tr>
			</table>
		</div>
<?php
		}
	?>
</div>