aboutsummaryrefslogtreecommitdiff
path: root/views/default/export
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-25 14:53:46 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-25 14:53:46 +0000
commite4f113ba40d597b602cc6cf5d8d88caee8ed727a (patch)
treeb685d79f78f8c42e57b5f8a5fb177d35c1165747 /views/default/export
parent0239951ce60d4f4bef878ea6ad9826152e4a4bf5 (diff)
downloadelgg-e4f113ba40d597b602cc6cf5d8d88caee8ed727a.tar.gz
elgg-e4f113ba40d597b602cc6cf5d8d88caee8ed727a.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Updated ODD handler, now uses views * Normal and ODD view for all data items... cute eh? :) git-svn-id: https://code.elgg.org/elgg/trunk@530 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/export')
-rw-r--r--views/default/export/entity.php95
-rw-r--r--views/default/export/metadata.php23
-rw-r--r--views/default/export/relationship.php25
3 files changed, 143 insertions, 0 deletions
diff --git a/views/default/export/entity.php b/views/default/export/entity.php
new file mode 100644
index 000000000..1ddde4b78
--- /dev/null
+++ b/views/default/export/entity.php
@@ -0,0 +1,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> \ No newline at end of file
diff --git a/views/default/export/metadata.php b/views/default/export/metadata.php
new file mode 100644
index 000000000..303c42e54
--- /dev/null
+++ b/views/default/export/metadata.php
@@ -0,0 +1,23 @@
+<?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/
+ */
+
+ $m = $vars['metadata'];
+?>
+<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
diff --git a/views/default/export/relationship.php b/views/default/export/relationship.php
new file mode 100644
index 000000000..8819a356a
--- /dev/null
+++ b/views/default/export/relationship.php
@@ -0,0 +1,25 @@
+<?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/
+ */
+
+ $r = $vars['relationship'];
+
+?>
+<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