aboutsummaryrefslogtreecommitdiff
path: root/views/json/export/entity.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/json/export/entity.php')
-rw-r--r--views/json/export/entity.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/views/json/export/entity.php b/views/json/export/entity.php
new file mode 100644
index 000000000..36af5eaef
--- /dev/null
+++ b/views/json/export/entity.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg Entity export.
+ * Displays an entity as JSON
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$entity = $vars['entity'];
+
+$export = new stdClass;
+$exportable_values = $entity->getExportableValues();
+
+foreach ($exportable_values as $v) {
+ $export->$v = $entity->$v;
+}
+
+$export->url = $entity->getURL();
+
+global $jsonexport;
+$jsonexport[$entity->getType()][$entity->getSubtype()][] = $export;
+
+// @todo hack to fix #4504
+echo "Fix for bug #4504";