diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 21:25:25 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 21:25:25 +0000 |
commit | 694781d190fba09437a37983f077d0381a56050b (patch) | |
tree | 788d5eeb369d7dc85bb35adf4fd1abe86f00b504 /views/json | |
parent | d46162271a5ca3c3af690173d0abfcd1ab9f69a1 (diff) | |
download | elgg-694781d190fba09437a37983f077d0381a56050b.tar.gz elgg-694781d190fba09437a37983f077d0381a56050b.tar.bz2 |
Finished standardizing seconday views.
git-svn-id: http://code.elgg.org/elgg/trunk@3559 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/json')
-rw-r--r-- | views/json/api/output.php | 34 | ||||
-rw-r--r-- | views/json/canvas/default.php | 20 | ||||
-rw-r--r-- | views/json/export/entity.php | 44 | ||||
-rw-r--r-- | views/json/export/metadata.php | 42 | ||||
-rw-r--r-- | views/json/export/relationship.php | 41 | ||||
-rw-r--r-- | views/json/group/default.php | 21 | ||||
-rw-r--r-- | views/json/messages/exceptions/exception.php | 30 | ||||
-rw-r--r-- | views/json/object/default.php | 21 | ||||
-rw-r--r-- | views/json/page_elements/contentwrapper.php | 12 | ||||
-rw-r--r-- | views/json/pageshells/pageshell.php | 37 | ||||
-rw-r--r-- | views/json/river/item/list.php | 42 | ||||
-rw-r--r-- | views/json/search/entity_list.php | 30 | ||||
-rw-r--r-- | views/json/site/default.php | 21 | ||||
-rw-r--r-- | views/json/user/default.php | 21 |
14 files changed, 201 insertions, 215 deletions
diff --git a/views/json/api/output.php b/views/json/api/output.php index 94aaaae60..49aeb8438 100644 --- a/views/json/api/output.php +++ b/views/json/api/output.php @@ -1,20 +1,18 @@ <?php - /** - * Elgg JSON output - * This outputs the api as JSON - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - */ +/** + * Elgg JSON output + * This outputs the api as JSON + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + */ - $result = $vars['result']; - $export = $result->export(); - - // echo json_encode($export); - global $jsonexport; - $jsonexport['api'][] = $export; - -?>
\ No newline at end of file +$result = $vars['result']; +$export = $result->export(); + +// echo json_encode($export); +global $jsonexport; +$jsonexport['api'][] = $export;
\ No newline at end of file diff --git a/views/json/canvas/default.php b/views/json/canvas/default.php index 4978b00e7..a7df72778 100644 --- a/views/json/canvas/default.php +++ b/views/json/canvas/default.php @@ -1,15 +1,13 @@ <?php - /** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - global $jsonexport; - -?>
\ No newline at end of file +global $jsonexport;
\ No newline at end of file diff --git a/views/json/export/entity.php b/views/json/export/entity.php index 8c253d9b0..750338964 100644 --- a/views/json/export/entity.php +++ b/views/json/export/entity.php @@ -1,24 +1,24 @@ <?php - /** - * Elgg Entity export. - * Displays an entity as JSON - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * Elgg Entity export. + * Displays an entity as JSON + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - $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; -?>
\ 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;
\ No newline at end of file diff --git a/views/json/export/metadata.php b/views/json/export/metadata.php index 10aceb9df..bde62de57 100644 --- a/views/json/export/metadata.php +++ b/views/json/export/metadata.php @@ -1,23 +1,23 @@ <?php - /** - * Elgg metadata export. - * Displays a metadata item using json - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * Elgg metadata export. + * Displays a metadata item using json + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - $m = $vars['metadata']; - - $export = new stdClass; - $exportable_values = $entity->getExportableValues(); - - foreach ($exportable_values as $v) - $export->$v = $m->$v; - - global $jsonexport; - $jsonexport['metadata'][] = $entity; - // echo json_encode($export); -?>
\ No newline at end of file +$m = $vars['metadata']; + +$export = new stdClass; +$exportable_values = $entity->getExportableValues(); + +foreach ($exportable_values as $v) { + $export->$v = $m->$v; +} + +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 dd1adb4d8..08ed5c008 100644 --- a/views/json/export/relationship.php +++ b/views/json/export/relationship.php @@ -1,24 +1,23 @@ <?php - /** - * Elgg relationship export. - * Displays a relationship using JSON. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * Elgg relationship export. + * Displays a relationship using JSON. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - $r = $vars['relationship']; - - $export = new stdClass; +$r = $vars['relationship']; - $exportable_values = $entity->getExportableValues(); - - foreach ($exportable_values as $v) - $export->$v = $r->$v; - - global $jsonexport; - $jsonexport['relationships'][] = $export; - -?>
\ No newline at end of file +$export = new stdClass; + +$exportable_values = $entity->getExportableValues(); + +foreach ($exportable_values as $v) { + $export->$v = $r->$v; +} + +global $jsonexport; +$jsonexport['relationships'][] = $export;
\ No newline at end of file diff --git a/views/json/group/default.php b/views/json/group/default.php index 8c02f7d5e..5466c83b3 100644 --- a/views/json/group/default.php +++ b/views/json/group/default.php @@ -1,14 +1,11 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - /** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ - - elgg_view('export/entity', $vars); - -?>
\ No newline at end of file +elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/json/messages/exceptions/exception.php b/views/json/messages/exceptions/exception.php index 6255f08a6..306b2bc0e 100644 --- a/views/json/messages/exceptions/exception.php +++ b/views/json/messages/exceptions/exception.php @@ -1,19 +1,17 @@ <?php - /** - * Elgg exception - * Displays a single exception - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @uses $vars['object'] An exception - */ +/** + * Elgg exception + * Displays a single exception + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['object'] An exception + */ - $export = $vars['object']; - - global $jsonexport; - $jsonexport['exceptions'][] = $export; +$export = $vars['object']; -?>
\ No newline at end of file +global $jsonexport; +$jsonexport['exceptions'][] = $export;
\ No newline at end of file diff --git a/views/json/object/default.php b/views/json/object/default.php index 8c02f7d5e..5466c83b3 100644 --- a/views/json/object/default.php +++ b/views/json/object/default.php @@ -1,14 +1,11 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - /** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ - - elgg_view('export/entity', $vars); - -?>
\ No newline at end of file +elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/json/page_elements/contentwrapper.php b/views/json/page_elements/contentwrapper.php index 15397d552..24048528e 100644 --- a/views/json/page_elements/contentwrapper.php +++ b/views/json/page_elements/contentwrapper.php @@ -1,5 +1,11 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - echo $vars['body']; - -?>
\ No newline at end of file +echo $vars['body'];
\ No newline at end of file diff --git a/views/json/pageshells/pageshell.php b/views/json/pageshells/pageshell.php index 2d2526e38..16cfa3cdd 100644 --- a/views/json/pageshells/pageshell.php +++ b/views/json/pageshells/pageshell.php @@ -1,21 +1,20 @@ <?php - /** - * Elgg JSON output pageshell - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - */ +/** + * Elgg JSON output pageshell + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + */ - 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 +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 diff --git a/views/json/river/item/list.php b/views/json/river/item/list.php index 149212135..908ea7a90 100644 --- a/views/json/river/item/list.php +++ b/views/json/river/item/list.php @@ -1,17 +1,22 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ +global $jsonexport; +if (isset($vars['items']) && is_array($vars['items'])) { - global $jsonexport; - if (isset($vars['items']) && is_array($vars['items'])) { - - $i = 0; - if (!empty($vars['items'])) + $i = 0; + if (!empty($vars['items'])) { foreach($vars['items'] as $item) { - + // echo elgg_view_river_item($item); if (elgg_view_exists($item->view,'default')) { - $body = elgg_view($item->view,array( - 'item' => $item - ),false,false,'default'); + $body = elgg_view($item->view,array('item' => $item), false, false, 'default'); $time = date("r",$item->posted); if ($entity = get_entity($item->object_guid)) { $url = htmlspecialchars($entity->getURL()); @@ -25,25 +30,22 @@ $jsonitem->description = autop($body); $jsonitem->title = $title; unset($jsonitem->view); - + if ($subject = get_entity($item->subject_guid)) { elgg_view_entity($subject); } if ($object = get_entity($item->object_guid)) { elgg_view_entity($object); } - + $jsonexport['activity'][] = $jsonitem; - } - + $i++; - if ($i >= $vars['limit']) break; - + if ($i >= $vars['limit']) { + break; + } } - } - echo "!"; - - -?>
\ No newline at end of file +} +echo "!";
\ No newline at end of file diff --git a/views/json/search/entity_list.php b/views/json/search/entity_list.php index 9ca58a8b8..a47bb37fc 100644 --- a/views/json/search/entity_list.php +++ b/views/json/search/entity_list.php @@ -1,18 +1,16 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - /** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ - - $entities = $vars['entities']; - if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); - } - -?>
\ No newline at end of file +$entities = $vars['entities']; +if (is_array($entities) && sizeof($entities) > 0) { + foreach($entities as $entity) { + echo elgg_view_entity($entity); + } +} diff --git a/views/json/site/default.php b/views/json/site/default.php index 8c02f7d5e..5466c83b3 100644 --- a/views/json/site/default.php +++ b/views/json/site/default.php @@ -1,14 +1,11 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - /** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ - - elgg_view('export/entity', $vars); - -?>
\ No newline at end of file +elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/json/user/default.php b/views/json/user/default.php index 8c02f7d5e..5466c83b3 100644 --- a/views/json/user/default.php +++ b/views/json/user/default.php @@ -1,14 +1,11 @@ <?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - /** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ - - elgg_view('export/entity', $vars); - -?>
\ No newline at end of file +elgg_view('export/entity', $vars);
\ No newline at end of file |