aboutsummaryrefslogtreecommitdiff
path: root/views/json/pageshells/pageshell.php
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/pageshells/pageshell.php
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/pageshells/pageshell.php')
-rw-r--r--views/json/pageshells/pageshell.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/views/json/pageshells/pageshell.php b/views/json/pageshells/pageshell.php
index d9cb52b9b..ae51b49e5 100644
--- a/views/json/pageshells/pageshell.php
+++ b/views/json/pageshells/pageshell.php
@@ -10,7 +10,14 @@
* @link http://elgg.org/
*
*/
-
- header("Content-Type: application/json");
- echo $vars['body'];
+
+ if(stristr($_SERVER["HTTP_ACCEPT"],"application/json")) {
+ header("Content-Type: application/json");
+ } else {
+ header("Content-Type: application/javascript");
+ }
+ // echo $vars['body'];
+
+ global $jsonexport;
+ echo json_encode($jsonexport);
?> \ No newline at end of file