Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
entity.php
Go to the documentation of this file.
1 <?php
11 $entity = $vars['entity'];
12 if (!$entity) {
13  throw new InvalidParameterException("No entity found, it either doesn't exist or you don't have access to it.");
14 }
15 $options = array(
16  'guid' => $entity->guid,
17  'limit' => 0
18 );
22 
23 $exportable_values = $entity->getExportableValues();
24 ?>
25 <div>
26 <?php // do not change localization string since this is deprecated view ?>
27 <h2><?php echo elgg_echo('Entity'); ?></h2>
28  <?php
29  foreach ($entity as $k => $v) {
30  if ((in_array($k, $exportable_values)) || (elgg_is_admin_logged_in())) {
31 ?>
32  <p class="margin-none"><b><?php echo $k; ?>: </b><?php echo strip_tags($v); ?></p>
33 <?php
34  }
35  }
36  ?>
37 </div>
38 
39 <?php if ($metadata) { ?>
40 <div id="metadata" class="mtm">
41 <h2><?php echo elgg_echo('metadata'); ?></h2>
42  <?php
43  foreach ($metadata as $m) {
44 ?>
45  <p class="margin-none"><b><?php echo $m->name; ?>: </b><?php echo $m->value; ?></p>
46 <?php
47  }
48  ?>
49 
50 </div>
51 <?php } ?>
52 
53 <?php if ($annotations) { ?>
54 <div id="annotations" class="mtm">
55 <h2><?php echo elgg_echo('annotations'); ?></h2>
56  <?php
57  foreach ($annotations as $a) {
58 ?>
59  <table>
60  <p class="margin-none"><b><?php echo $a->name; ?>: </b><?php echo $a->value; ?></p>
61  </table>
62 <?php
63  }
64  ?>
65 </div>
66 <?php } ?>
67 
68 <?php if ($relationships) { ?>
69 <div id="relationship" class="mtm">
70 <h2><?php echo elgg_echo('relationships'); ?></h2>
71  <?php
72  foreach ($relationships as $r) {
73 ?>
74  <table>
75  <p class="margin-none"><b><?php echo $r->relationship; ?>: </b><?php echo $r->guid_two; ?></p>
76  </table>
77 <?php
78  }
79  ?>
80 </div>
81 <?php }
$r
$entity
Definition: entity.php:11
$relationships
Definition: entity.php:21
$m
Definition: metadata.php:11
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:60
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$exportable_values
Definition: entity.php:23
$metadata
Definition: entity.php:19
if(!$entity) $options
Definition: entity.php:15
$vars['entity']
get_entity_relationships($guid, $inverse_relationship=false)
Get all the relationships for a given GUID.
$annotations
Definition: entity.php:20
table
Definition: admin.css.php:59
elgg_get_metadata(array $options=array())
Returns metadata.
Definition: metadata.php:143
b
Definition: admin.css.php:56
elgg_get_annotations(array $options=array())
Returns annotations.