diff options
Diffstat (limited to 'views/json/export/entity.php')
| -rw-r--r-- | views/json/export/entity.php | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/views/json/export/entity.php b/views/json/export/entity.php index 83524cbd8..36af5eaef 100644 --- a/views/json/export/entity.php +++ b/views/json/export/entity.php @@ -1,22 +1,25 @@ <?php - /** - * Elgg Entity export. - * Displays an entity as JSON - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008 - * @link http://elgg.org/ - */ +/** + * Elgg Entity export. + * Displays an entity as JSON + * + * @package Elgg + * @subpackage Core + */ - $entity = $vars['entity']; - - $export = new stdClass; - - foreach ($entity as $k => $v) - $export->$k = $v; - - echo json_encode($export); -?>
\ No newline at end of file +$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"; |
