aboutsummaryrefslogtreecommitdiff
path: root/views/json/export
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-04 18:44:54 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-04 18:44:54 +0000
commit93e99d5a0080f6ef89192b7d406e013a3b9fe48f (patch)
tree131373d5de5108aa6b62e4b5c2913f2ed932393d /views/json/export
parentd8d330a7c40975fce62e0fc6b5473ff6844f6384 (diff)
downloadelgg-93e99d5a0080f6ef89192b7d406e013a3b9fe48f.tar.gz
elgg-93e99d5a0080f6ef89192b7d406e013a3b9fe48f.tar.bz2
JSON feeds now work. Fixes #716
git-svn-id: https://code.elgg.org/elgg/trunk@2650 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/json/export')
-rw-r--r--views/json/export/entity.php11
-rw-r--r--views/json/export/metadata.php6
-rw-r--r--views/json/export/relationship.php4
3 files changed, 14 insertions, 7 deletions
diff --git a/views/json/export/entity.php b/views/json/export/entity.php
index 3b0ce8367..c5369eea1 100644
--- a/views/json/export/entity.php
+++ b/views/json/export/entity.php
@@ -11,13 +11,16 @@
* @link http://elgg.org/
*/
- $entity = $vars['entity'];
+ $entity = $vars['entity'];
$export = new stdClass;
$exportable_values = $entity->getExportableValues();
foreach ($exportable_values as $v)
- $export->$v = $entity->$v;
-
- echo json_encode($export);
+ $export->$v = $entity->$v;
+
+ $export->url = $entity->getURL();
+
+ global $jsonexport;
+ $jsonexport[$entity->getType()][$entity->getSubtype()][] = $export;
?> \ No newline at end of file
diff --git a/views/json/export/metadata.php b/views/json/export/metadata.php
index 273051d22..d1a5a44d8 100644
--- a/views/json/export/metadata.php
+++ b/views/json/export/metadata.php
@@ -18,6 +18,8 @@
foreach ($exportable_values as $v)
$export->$v = $m->$v;
-
- echo json_encode($export);
+
+ global $jsonexport;
+ $jsonexport['metadata'][] = $entity;
+ // echo json_encode($export);
?> \ No newline at end of file
diff --git a/views/json/export/relationship.php b/views/json/export/relationship.php
index 1c255ad4d..4b5006d73 100644
--- a/views/json/export/relationship.php
+++ b/views/json/export/relationship.php
@@ -20,5 +20,7 @@
foreach ($exportable_values as $v)
$export->$v = $r->$v;
- echo json_encode($export);
+ global $jsonexport;
+ $jsonexport['relationships'][] = $export;
+
?> \ No newline at end of file