aboutsummaryrefslogtreecommitdiff
path: root/views/default/export
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/export')
-rw-r--r--views/default/export/entity.php116
-rw-r--r--views/default/export/metadata.php31
-rw-r--r--views/default/export/relationship.php40
3 files changed, 79 insertions, 108 deletions
diff --git a/views/default/export/entity.php b/views/default/export/entity.php
index 43189d693..3064f1288 100644
--- a/views/default/export/entity.php
+++ b/views/default/export/entity.php
@@ -1,95 +1,79 @@
<?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/
- */
+/**
+ * Elgg Entity export.
+ * Displays an entity using the current view.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
- $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);
-
+$entity = $vars['entity'];
+if (!$entity) {
+ throw new InvalidParameterException(elgg_echo('InvalidParameterException:NoEntityFound'));
+}
+$options = array(
+ 'guid' => $entity->guid,
+ 'limit' => 0
+);
+$metadata = elgg_get_metadata($options);
+$annotations = elgg_get_annotations($options);
+$relationships = get_entity_relationships($entity->guid);
+
+$exportable_values = $entity->getExportableValues();
?>
<div>
+<h2><?php echo elgg_echo('Entity'); ?></h2>
<?php
- foreach ($entity as $k => $v)
- {
+ foreach ($entity as $k => $v) {
+ if ((in_array($k, $exportable_values)) || (elgg_is_admin_logged_in())) {
?>
- <div>
- <table>
- <tr>
- <td><b><?php echo $k; ?></b></td>
- <td><?php echo $v; ?></td>
- </tr>
- </table>
- </div>
+ <p class="margin-none"><b><?php echo $k; ?>: </b><?php echo strip_tags($v); ?></p>
<?php
+ }
}
?>
</div>
-<div id="metadata">
-<h2>Metadata</h2>
+
+<?php if ($metadata) { ?>
+<div id="metadata" class="mtm">
+<h2><?php echo elgg_echo('metadata'); ?></h2>
<?php
- foreach ($metadata as $m)
- {
+ foreach ($metadata as $m) {
?>
- <div>
- <table>
- <tr>
- <td><b><?php echo $m->name; ?></b></td>
- <td><?php echo $m->value; ?></td>
- </tr>
- </table>
- </div>
+ <p class="margin-none"><b><?php echo $m->name; ?>: </b><?php echo $m->value; ?></p>
<?php
}
?>
-
+
</div>
+<?php } ?>
-<div id="annotations">
-<h2>Annotations</h2>
+<?php if ($annotations) { ?>
+<div id="annotations" class="mtm">
+<h2><?php echo elgg_echo('annotations'); ?></h2>
<?php
- foreach ($annotations as $a)
- {
+ foreach ($annotations as $a) {
?>
- <div>
- <table>
- <tr>
- <td><b><?php echo $a->name; ?></b></td>
- <td><?php echo $a->value; ?></td>
- </tr>
- </table>
- </div>
+ <table>
+ <p class="margin-none"><b><?php echo $a->name; ?>: </b><?php echo $a->value; ?></p>
+ </table>
<?php
}
?>
</div>
+<?php } ?>
-<div id="relationship">
-<h2>Relationships</h2>
+<?php if ($relationships) { ?>
+<div id="relationship" class="mtm">
+<h2><?php echo elgg_echo('relationships'); ?></h2>
<?php
- foreach ($relationships as $r)
- {
+ 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>
+ <table>
+ <p class="margin-none"><b><?php echo $r->relationship; ?>: </b><?php echo $r->guid_two; ?></p>
+ </table>
<?php
}
?>
-</div> \ No newline at end of file
+</div>
+<?php } ?>
diff --git a/views/default/export/metadata.php b/views/default/export/metadata.php
index 303c42e54..1dd7f2054 100644
--- a/views/default/export/metadata.php
+++ b/views/default/export/metadata.php
@@ -1,23 +1,14 @@
<?php
- /**
- * Elgg metadata export.
- * Displays a metadata item 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/
- */
+/**
+ * Elgg metadata export.
+ * Displays a metadata item using the current view.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
- $m = $vars['metadata'];
+$m = $vars['metadata'];
+$e = get_entity($m->entity_guid);
?>
-<div>
- <table>
- <tr>
- <td><b><?php echo $m->name; ?></b></td>
- <td><?php echo $m->value; ?></td>
- </tr>
- </table>
-</div> \ No newline at end of file
+<p class="margin-none"><?php if ($e) echo "<a href=\"" . $e->getURL() . "\">GUID:{$m->entity_guid}</a>"; else echo "GUID:".$m->entity_guid;
+?>: <b><?php echo $m->name; ?></b> <?php echo $m->value; ?></p> \ No newline at end of file
diff --git a/views/default/export/relationship.php b/views/default/export/relationship.php
index 8819a356a..d8cb3e4f4 100644
--- a/views/default/export/relationship.php
+++ b/views/default/export/relationship.php
@@ -1,25 +1,21 @@
<?php
- /**
- * Elgg relationship export.
- * Displays a relationship 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/
- */
+/**
+ * Elgg relationship export.
+ * Displays a relationship using the current view.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
- $r = $vars['relationship'];
-
+$r = $vars['relationship'];
+
+$e1 = get_entity($r->guid_one);
+$e2 = get_entity($r->guid_two);
+?>
+<p class="margin-none"><?php
+ if ($e1) echo "<a href=\"" . $e1->getURL() . "\">GUID:" . $r->guid_one . "</a>"; else echo "GUID:".$r->guid_one;
?>
-<div>
- <table>
- <tr>
- <td><?php echo $r->guid_one; ?></td>
- <td><b><?php echo $r->relationship; ?></b></td>
- <td><?php echo $r->guid_two; ?></td>
- </tr>
- </table>
-</div> \ No newline at end of file
+<b><?php echo $r->relationship; ?></b>
+<?php
+ if ($e2) echo "<a href=\"" . $e2->getURL() . "\">GUID:" . $r->guid_two . "</a>"; else echo "GUID:".$r->guid_two;
+?></p>