aboutsummaryrefslogtreecommitdiff
path: root/views/default/export/entity.php
blob: 0bbc9d0797b82515d7caaba4f8f17381c3baf7e0 (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
<?php
/**
 * Elgg Entity export.
 * Displays an entity using the current view.
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */

$entity = $vars['entity'];
if (!$entity) {
	throw new InvalidParameterException(elgg_echo('InvalidParameterException:NoEntityFound'));
}

$metadata = get_metadata_for_entity($entity->guid);
$annotations = get_annotations($entity->guid);
$relationships = get_entity_relationships($entity->guid);

$exportable_values = $entity->getExportableValues();
?>
<div class="contentWrapper">
<div>
	<?php
		foreach ($entity as $k => $v)
		{
			if ((in_array($k, $exportable_values)) || (isadminloggedin())) {
?>
		<div>
			<p><b><?php echo $k; ?>: </b><?php echo $v; ?></p>
		</div>
<?php
			}
		}
	?>
</div>

<?php if ($metadata) { ?>
<div id="metadata">
<h2><?php echo elgg_echo('metadata'); ?></h2>
	<?php
		foreach ($metadata as $m)
		{
?>
		<div>
			<p><b><?php echo $m->name; ?>: </b><?php echo $m->value; ?></p>
		</div>
<?php
		}
	?>

</div>
<?php } ?>

<?php if ($annotations) { ?>
<div id="annotations">
<h2><?php echo elgg_echo('annotations'); ?></h2>
	<?php
		foreach ($annotations as $a)
		{
?>
		<div>
			<table>
				<p><b><?php echo $a->name; ?>: </b><?php echo $a->value; ?></p>
			</table>
		</div>
<?php
		}
	?>
</div>
<?php } ?>

<?php if ($relationships) { ?>
<div id="relationship">
<h2><?php echo elgg_echo('relationships'); ?></h2>
	<?php
		foreach ($relationships as $r)
		{
?>
		<div>
			<table>
				<p><b><?php echo $r->relationship; ?>: </b><?php echo $r->guid_two; ?></p>
			</table>
		</div>
<?php
		}
	?>
</div>
<?php } ?>
</div>