From 694781d190fba09437a37983f077d0381a56050b Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 16 Oct 2009 21:25:25 +0000 Subject: Finished standardizing seconday views. git-svn-id: http://code.elgg.org/elgg/trunk@3559 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/foaf/canvas/default.php | 32 ++++------ views/foaf/page_elements/contentwrapper.php | 11 +++- views/foaf/pageshells/pageshell.php | 78 ++++++++++++------------ views/foaf/search/entity_list.php | 20 ++++--- views/foaf/user/default.php | 39 ++++++------ views/ical/canvas/default.php | 28 ++++----- views/ical/export/entity.php | 44 +++++++------- views/ical/object/default.php | 22 ++++--- views/ical/pageshells/pageshell.php | 23 ++++--- views/ical/search/entity_list.php | 29 ++++----- views/js/object/default.php | 31 ++++------ views/js/pageshells/pageshell.php | 38 +++++------- views/js/user/default.php | 31 ++++------ views/json/api/output.php | 34 +++++------ views/json/canvas/default.php | 20 +++---- views/json/export/entity.php | 44 +++++++------- views/json/export/metadata.php | 42 ++++++------- views/json/export/relationship.php | 41 +++++++------ views/json/group/default.php | 21 +++---- views/json/messages/exceptions/exception.php | 30 +++++----- views/json/object/default.php | 21 +++---- views/json/page_elements/contentwrapper.php | 12 +++- views/json/pageshells/pageshell.php | 37 ++++++------ views/json/river/item/list.php | 42 ++++++------- views/json/search/entity_list.php | 30 +++++----- views/json/site/default.php | 21 +++---- views/json/user/default.php | 21 +++---- views/opendd/canvas/default.php | 28 ++++----- views/opendd/export/entity.php | 29 +++++---- views/opendd/export/metadata.php | 37 ++++++------ views/opendd/export/relationship.php | 35 ++++++----- views/opendd/group/default.php | 25 ++++---- views/opendd/messages/exceptions/exception.php | 39 +++++------- views/opendd/object/default.php | 25 ++++---- views/opendd/pageshells/pageshell.php | 24 ++++---- views/opendd/search/entity_list.php | 18 +++--- views/opendd/site/default.php | 24 ++++---- views/opendd/user/default.php | 25 ++++---- views/php/api/output.php | 29 +++++---- views/php/canvas/default.php | 28 ++++----- views/php/export/entity.php | 38 ++++++------ views/php/export/metadata.php | 38 ++++++------ views/php/export/relationship.php | 38 ++++++------ views/php/group/default.php | 21 +++---- views/php/messages/exceptions/exception.php | 25 ++++---- views/php/object/default.php | 21 +++---- views/php/pageshells/pageshell.php | 21 ++++--- views/php/search/entity_list.php | 28 ++++----- views/php/site/default.php | 28 ++++----- views/php/user/default.php | 21 +++---- views/rss/annotation/default.php | 80 ++++++++++++------------- views/rss/canvas/default.php | 32 ++++------ views/rss/group/default.php | 70 ++++++++++------------ views/rss/object/default.php | 83 +++++++++++++------------- views/rss/page_elements/contentwrapper.php | 10 +++- views/rss/pageshells/pageshell.php | 64 ++++++++++---------- views/rss/river/item/list.php | 50 ++++++++-------- views/rss/search/entity_list.php | 17 ++++-- views/rss/user/default.php | 57 +++++++++--------- views/xml/api/output.php | 29 +++++---- views/xml/messages/exceptions/exception.php | 37 ++++++------ views/xml/pageshells/pageshell.php | 25 ++++---- views/xml/xml-rpc/output.php | 23 ++++--- 63 files changed, 982 insertions(+), 1082 deletions(-) diff --git a/views/foaf/canvas/default.php b/views/foaf/canvas/default.php index a5c30fe52..0cfa8b49a 100644 --- a/views/foaf/canvas/default.php +++ b/views/foaf/canvas/default.php @@ -1,21 +1,15 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/views/foaf/page_elements/contentwrapper.php b/views/foaf/page_elements/contentwrapper.php index 15397d552..faef29e36 100644 --- a/views/foaf/page_elements/contentwrapper.php +++ b/views/foaf/page_elements/contentwrapper.php @@ -1,5 +1,10 @@ \ No newline at end of file +echo $vars['body']; \ No newline at end of file diff --git a/views/foaf/pageshells/pageshell.php b/views/foaf/pageshells/pageshell.php index 4b6701740..9cec8c119 100644 --- a/views/foaf/pageshells/pageshell.php +++ b/views/foaf/pageshells/pageshell.php @@ -1,46 +1,44 @@ \n"; - - if (!$owner = page_owner_entity()) { - if (!isloggedin()) { - exit; - } else { - $owner = $vars['user']; - } +header("Content-Type: text/xml"); +// echo $vars['body']; + +echo "\n"; + +if (!$owner = page_owner_entity()) { + if (!isloggedin()) { + exit; + } else { + $owner = $vars['user']; } - +} + ?> - - username; ?> - name; ?> - - email); ?> - - - + xml:lang="en" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:foaf="http://xmlns.com/foaf/0.1/" + xmlns:ya="http://blogs.yandex.ru/schema/foaf/" + xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + + username; ?> + name; ?> + + email); ?> + + + \ No newline at end of file diff --git a/views/foaf/search/entity_list.php b/views/foaf/search/entity_list.php index 8864b62da..984efe750 100644 --- a/views/foaf/search/entity_list.php +++ b/views/foaf/search/entity_list.php @@ -1,9 +1,15 @@ 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); +/** + * 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 +} \ No newline at end of file diff --git a/views/foaf/user/default.php b/views/foaf/user/default.php index 01b9298e3..86ed8619f 100644 --- a/views/foaf/user/default.php +++ b/views/foaf/user/default.php @@ -1,26 +1,23 @@ - - - username; ?> - name; ?> - email); ?> - username . "/?view=foaf" ?>" /> - - - + + + username; ?> + name; ?> + email); ?> + username . "/?view=foaf" ?>" /> + + + diff --git a/views/ical/canvas/default.php b/views/ical/canvas/default.php index 38977dca9..0a955e92d 100644 --- a/views/ical/canvas/default.php +++ b/views/ical/canvas/default.php @@ -1,18 +1,16 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/views/ical/export/entity.php b/views/ical/export/entity.php index cac1f17ba..6d8a9d655 100644 --- a/views/ical/export/entity.php +++ b/views/ical/export/entity.php @@ -1,33 +1,33 @@ getCalendarStartTime()) && - ($entity->getCalendarEndTime()) - ) - { -?> +$entity = $vars['entity']; + +if ( + ($entity instanceof Notable) && + ($entity->getCalendarStartTime()) && + ($entity->getCalendarEndTime()) +) +{ +?> BEGIN:VEVENT DTSTAMP:getTimeCreated()); ?> DTSTART:getCalendarStartTime()); ?> DTEND:getCalendarEndTime()); ?> SUMMARY:title; ?> LAST-MODIFIED:getTimeUpdated()); ?> -END:VEVENT - if ( - + ) \ No newline at end of file diff --git a/views/ical/object/default.php b/views/ical/object/default.php index 29e4ab219..fcbfcba5b 100644 --- a/views/ical/object/default.php +++ b/views/ical/object/default.php @@ -1,14 +1,12 @@ \ No newline at end of file +elgg_view('export/entity', $vars); \ No newline at end of file diff --git a/views/ical/pageshells/pageshell.php b/views/ical/pageshells/pageshell.php index eee032681..0ea76c9e9 100644 --- a/views/ical/pageshells/pageshell.php +++ b/views/ical/pageshells/pageshell.php @@ -1,18 +1,17 @@ BEGIN:VCALENDAR VERSION:2.0 diff --git a/views/ical/search/entity_list.php b/views/ical/search/entity_list.php index 9e5737bbe..b39bb4229 100644 --- a/views/ical/search/entity_list.php +++ b/views/ical/search/entity_list.php @@ -1,18 +1,15 @@ 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); +} \ No newline at end of file diff --git a/views/js/object/default.php b/views/js/object/default.php index 1e3f65cfd..7c122eba6 100644 --- a/views/js/object/default.php +++ b/views/js/object/default.php @@ -1,20 +1,13 @@ \ No newline at end of file +/** + * Elgg JS default view + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ + +if (isset($vars['entity'])) { + echo elgg_view_entity($vars['entity'],true,false); +} \ No newline at end of file diff --git a/views/js/pageshells/pageshell.php b/views/js/pageshells/pageshell.php index 982bbcb86..a8d3ad2cb 100644 --- a/views/js/pageshells/pageshell.php +++ b/views/js/pageshells/pageshell.php @@ -1,27 +1,19 @@ \ No newline at end of file +foreach($body as $line) { + echo "document.write('" . addslashes($line) . "');\n"; +} \ No newline at end of file diff --git a/views/js/user/default.php b/views/js/user/default.php index 1e3f65cfd..7c122eba6 100644 --- a/views/js/user/default.php +++ b/views/js/user/default.php @@ -1,20 +1,13 @@ \ No newline at end of file +/** + * Elgg JS default view + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ + +if (isset($vars['entity'])) { + echo elgg_view_entity($vars['entity'],true,false); +} \ No newline at end of file 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 @@ 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 @@ \ 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 @@ 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 @@ 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 @@ 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 @@ \ 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 @@ \ 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 @@ \ 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 @@ \ 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 @@ \ 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 @@ 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 @@ 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 @@ \ 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 @@ \ No newline at end of file +elgg_view('export/entity', $vars); \ No newline at end of file diff --git a/views/opendd/canvas/default.php b/views/opendd/canvas/default.php index a5cc56917..0cfa8b49a 100644 --- a/views/opendd/canvas/default.php +++ b/views/opendd/canvas/default.php @@ -1,19 +1,15 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/views/opendd/export/entity.php b/views/opendd/export/entity.php index 60b6628ef..f564ef32a 100644 --- a/views/opendd/export/entity.php +++ b/views/opendd/export/entity.php @@ -1,17 +1,16 @@ guid); - foreach ($serialised as $s) - echo $s; - -?> \ No newline at end of file +$entity = $vars['entity']; +$serialised = exportAsArray($vars['entity']->guid); +foreach ($serialised as $s) { + echo $s; +} \ No newline at end of file diff --git a/views/opendd/export/metadata.php b/views/opendd/export/metadata.php index de29017dd..146f7742e 100644 --- a/views/opendd/export/metadata.php +++ b/views/opendd/export/metadata.php @@ -1,21 +1,20 @@ addElement($m->export()); - - //echo $odd; - - echo $m->export(); -?> \ No newline at end of file +$m = $vars['metadata']; +$uuid = $vars['uuid']; + +//$odd = new ODDDocument(); +//$odd->addElement($m->export()); + +//echo $odd; + +echo $m->export(); \ No newline at end of file diff --git a/views/opendd/export/relationship.php b/views/opendd/export/relationship.php index 39d7a163a..7cac7b0dd 100644 --- a/views/opendd/export/relationship.php +++ b/views/opendd/export/relationship.php @@ -1,20 +1,19 @@ addElement($r->export()); - - //echo $odd; - - echo $r->export(); -?> \ No newline at end of file +$r = $vars['relationship']; + +//$odd = new ODDDocument(); +//$odd->addElement($r->export()); + +//echo $odd; + +echo $r->export(); diff --git a/views/opendd/group/default.php b/views/opendd/group/default.php index 9b9f3169d..b5913689a 100644 --- a/views/opendd/group/default.php +++ b/views/opendd/group/default.php @@ -1,15 +1,14 @@ guid); - foreach ($serialised as $s) - echo $s; -?> \ No newline at end of file +$serialised = exportAsArray($vars['entity']->guid); +foreach ($serialised as $s) { + echo $s; +} \ No newline at end of file diff --git a/views/opendd/messages/exceptions/exception.php b/views/opendd/messages/exceptions/exception.php index eae45f397..c020c0e04 100644 --- a/views/opendd/messages/exceptions/exception.php +++ b/views/opendd/messages/exceptions/exception.php @@ -1,31 +1,24 @@ - \ No newline at end of file diff --git a/views/opendd/object/default.php b/views/opendd/object/default.php index 9b9f3169d..b5913689a 100644 --- a/views/opendd/object/default.php +++ b/views/opendd/object/default.php @@ -1,15 +1,14 @@ guid); - foreach ($serialised as $s) - echo $s; -?> \ No newline at end of file +$serialised = exportAsArray($vars['entity']->guid); +foreach ($serialised as $s) { + echo $s; +} \ No newline at end of file diff --git a/views/opendd/pageshells/pageshell.php b/views/opendd/pageshells/pageshell.php index 4778d0e13..617302dbf 100644 --- a/views/opendd/pageshells/pageshell.php +++ b/views/opendd/pageshells/pageshell.php @@ -1,20 +1,18 @@ - \ No newline at end of file diff --git a/views/opendd/search/entity_list.php b/views/opendd/search/entity_list.php index 8864b62da..3ea06f40f 100644 --- a/views/opendd/search/entity_list.php +++ b/views/opendd/search/entity_list.php @@ -1,9 +1,13 @@ 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); +/** + * @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 +} \ No newline at end of file diff --git a/views/opendd/site/default.php b/views/opendd/site/default.php index 9b9f3169d..0ce66193b 100644 --- a/views/opendd/site/default.php +++ b/views/opendd/site/default.php @@ -1,15 +1,15 @@ guid); - foreach ($serialised as $s) - echo $s; -?> \ No newline at end of file +$serialised = exportAsArray($vars['entity']->guid); +foreach ($serialised as $s) { + echo $s; +} \ No newline at end of file diff --git a/views/opendd/user/default.php b/views/opendd/user/default.php index 9b9f3169d..b5913689a 100644 --- a/views/opendd/user/default.php +++ b/views/opendd/user/default.php @@ -1,15 +1,14 @@ guid); - foreach ($serialised as $s) - echo $s; -?> \ No newline at end of file +$serialised = exportAsArray($vars['entity']->guid); +foreach ($serialised as $s) { + echo $s; +} \ No newline at end of file diff --git a/views/php/api/output.php b/views/php/api/output.php index 1e4133772..2b0b2b754 100644 --- a/views/php/api/output.php +++ b/views/php/api/output.php @@ -1,17 +1,16 @@ export(); - - echo serialize($export); -?> \ No newline at end of file +$result = $vars['result']; +$export = $result->export(); + +echo serialize($export); \ No newline at end of file diff --git a/views/php/canvas/default.php b/views/php/canvas/default.php index a5cc56917..0cfa8b49a 100644 --- a/views/php/canvas/default.php +++ b/views/php/canvas/default.php @@ -1,19 +1,15 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/views/php/export/entity.php b/views/php/export/entity.php index a23f2c1d8..ecceb5fd3 100644 --- a/views/php/export/entity.php +++ b/views/php/export/entity.php @@ -1,21 +1,21 @@ getExportableValues(); - - foreach ($exportable_values as $v) - $export->$v = $entity->$v; - - echo serialize($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; +} + +echo serialize($export); diff --git a/views/php/export/metadata.php b/views/php/export/metadata.php index e0d5cc4a7..d454aec7f 100644 --- a/views/php/export/metadata.php +++ b/views/php/export/metadata.php @@ -1,21 +1,21 @@ getExportableValues(); - - foreach ($exportable_values as $v) - $export->$v = $m->$v; - - echo serialize($export); -?> \ No newline at end of file +$m = $vars['metadata']; + +$export = new stdClass; +$exportable_values = $m->getExportableValues(); + +foreach ($exportable_values as $v) { + $export->$v = $m->$v; +} + +echo serialize($export); \ No newline at end of file diff --git a/views/php/export/relationship.php b/views/php/export/relationship.php index ef6482a64..8cb3c9d73 100644 --- a/views/php/export/relationship.php +++ b/views/php/export/relationship.php @@ -1,21 +1,21 @@ getExportableValues(); - - foreach ($exportable_values as $v) - $export->$v = $r->$v; - - echo serialize($export); -?> \ No newline at end of file +$r = $vars['relationship']; + +$export = new stdClass; +$exportable_values = $r->getExportableValues(); + +foreach ($exportable_values as $v) { + $export->$v = $r->$v; +} + +echo serialize($export); \ No newline at end of file diff --git a/views/php/group/default.php b/views/php/group/default.php index d976764d9..1c8440d4a 100644 --- a/views/php/group/default.php +++ b/views/php/group/default.php @@ -1,14 +1,11 @@ \ No newline at end of file +echo elgg_view('export/entity', $vars); \ No newline at end of file diff --git a/views/php/messages/exceptions/exception.php b/views/php/messages/exceptions/exception.php index 4e66eb016..c8f549734 100644 --- a/views/php/messages/exceptions/exception.php +++ b/views/php/messages/exceptions/exception.php @@ -1,15 +1,14 @@ \ No newline at end of file +echo serialize($vars['object']); \ No newline at end of file diff --git a/views/php/object/default.php b/views/php/object/default.php index d976764d9..1c8440d4a 100644 --- a/views/php/object/default.php +++ b/views/php/object/default.php @@ -1,14 +1,11 @@ \ No newline at end of file +echo elgg_view('export/entity', $vars); \ No newline at end of file diff --git a/views/php/pageshells/pageshell.php b/views/php/pageshells/pageshell.php index a956a4432..d6a924c2f 100644 --- a/views/php/pageshells/pageshell.php +++ b/views/php/pageshells/pageshell.php @@ -1,13 +1,12 @@ \ No newline at end of file +echo $vars['body']; \ No newline at end of file diff --git a/views/php/search/entity_list.php b/views/php/search/entity_list.php index 9e5737bbe..35f4341f8 100644 --- a/views/php/search/entity_list.php +++ b/views/php/search/entity_list.php @@ -1,18 +1,16 @@ 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); +$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 +} \ No newline at end of file diff --git a/views/php/site/default.php b/views/php/site/default.php index a5cc56917..0cfa8b49a 100644 --- a/views/php/site/default.php +++ b/views/php/site/default.php @@ -1,19 +1,15 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/views/php/user/default.php b/views/php/user/default.php index d976764d9..1c8440d4a 100644 --- a/views/php/user/default.php +++ b/views/php/user/default.php @@ -1,14 +1,11 @@ \ No newline at end of file +echo elgg_view('export/entity', $vars); \ No newline at end of file diff --git a/views/rss/annotation/default.php b/views/rss/annotation/default.php index 1433ba9b0..8ff34b7fa 100644 --- a/views/rss/annotation/default.php +++ b/views/rss/annotation/default.php @@ -1,50 +1,46 @@ entity_guid); +$title = substr($vars['annotation']->value, 0, 32); +if (strlen($vars['annotation']->value) > 32) { + $title .= " ..."; +} - * @author Curverider Ltd - - * @link http://elgg.org/ - * - */ - - - $vars['entity'] = get_entity($vars['annotation']->entity_guid); - $title = substr($vars['annotation']->value,0,32); - if (strlen($vars['annotation']->value) > 32) - $title .= " ..."; - ?> - getURL(); ?>#id; ?> - time_created) ?> - getURL(); ?>#id; ?> - <![CDATA[<?php echo $title; ?>]]> - value)); ?>]]> - owner); - if ($owner) - { + getURL(); ?>#id; ?> + time_created) ?> + getURL(); ?>#id; ?> + <![CDATA[<?php echo $title; ?>]]> + value)); ?>]]> + owner); + if ($owner) { ?> - name; ?> + name; ?> - getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - - + } + ?> + getLongitude()) && + ($vars['entity']->getLatitude()) + ) { + ?> + getLatitude(); ?> getLongitude(); ?> + + + \ No newline at end of file diff --git a/views/rss/canvas/default.php b/views/rss/canvas/default.php index a5c30fe52..0cfa8b49a 100644 --- a/views/rss/canvas/default.php +++ b/views/rss/canvas/default.php @@ -1,21 +1,15 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/views/rss/group/default.php b/views/rss/group/default.php index 6ab14ecce..68247f3ca 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -1,43 +1,39 @@ - - getURL()); ?> - time_created) ?> - getURL()); ?> - <![CDATA[<?php echo (($vars['entity']->name)); ?>]]> - description)); ?>]]> - getOwnerEntity(); - if ($owner) - { + +getURL()); ?> +time_created) ?> +getURL()); ?> +<![CDATA[<?php echo (($vars['entity']->name)); ?>]]> +description)); ?>]]> +getOwnerEntity(); + if ($owner) { ?> - name; ?> +name; ?> - getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - - + } +?> +getLongitude()) && + ($vars['entity']->getLatitude()) + ) { + ?> + getLatitude(); ?> getLongitude(); ?> + + + diff --git a/views/rss/object/default.php b/views/rss/object/default.php index 060e471c4..5d11599dc 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -1,51 +1,48 @@ title; - if (empty($title)) { - $subtitle = strip_tags($vars['entity']->description); - $title = substr($subtitle,0,32); - if (strlen($subtitle) > 32) - $title .= " ..."; +$title = $vars['entity']->title; +if (empty($title)) { + $subtitle = strip_tags($vars['entity']->description); + $title = substr($subtitle,0,32); + if (strlen($subtitle) > 32) { + $title .= " ..."; } +} ?> - - getURL()); ?> - time_created) ?> - getURL()); ?> - <![CDATA[<?php echo $title; ?>]]> - description)); ?>]]> - getOwnerEntity(); - if ($owner) - { + +getURL()); ?> +time_created) ?> +getURL()); ?> +<![CDATA[<?php echo $title; ?>]]> +description)); ?>]]> +getOwnerEntity(); + if ($owner) { ?> - name; ?> +name; ?> - getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - - + } +?> +getLongitude()) && + ($vars['entity']->getLatitude()) + ) { + ?> + getLatitude(); ?> getLongitude(); ?> + + + diff --git a/views/rss/page_elements/contentwrapper.php b/views/rss/page_elements/contentwrapper.php index 15397d552..9d8a1392e 100644 --- a/views/rss/page_elements/contentwrapper.php +++ b/views/rss/page_elements/contentwrapper.php @@ -1,5 +1,9 @@ \ No newline at end of file +echo $vars['body']; \ No newline at end of file diff --git a/views/rss/pageshells/pageshell.php b/views/rss/pageshells/pageshell.php index 2abb83c5a..6faf85ead 100644 --- a/views/rss/pageshells/pageshell.php +++ b/views/rss/pageshells/pageshell.php @@ -1,44 +1,40 @@ \n"; - header("Content-Type: text/xml"); - - echo "\n"; +// Set title +if (empty($vars['title'])) { + $title = $vars['config']->sitename; +} else if (empty($vars['config']->sitename)) { + $title = $vars['title']; +} else { + $title = $vars['config']->sitename . ": " . $vars['title']; +} - - - // Set title - if (empty($vars['title'])) { - $title = $vars['config']->sitename; - } else if (empty($vars['config']->sitename)) { - $title = $vars['title']; - } else { - $title = $vars['config']->sitename . ": " . $vars['title']; - } - - // Remove RSS from URL - $url = str_replace('?view=rss','',full_url()); - $url = str_replace('&view=rss','',full_url()); +// Remove RSS from URL +$url = str_replace('?view=rss','',full_url()); +$url = str_replace('&view=rss','',full_url()); ?> > - - <![CDATA[<?php echo $title; ?>]]> - - - + <![CDATA[<?php echo $title; ?>]]> + + + - + echo $vars['body']; + + ?> + \ No newline at end of file diff --git a/views/rss/river/item/list.php b/views/rss/river/item/list.php index c74a99f97..5ac43c544 100644 --- a/views/rss/river/item/list.php +++ b/views/rss/river/item/list.php @@ -1,16 +1,20 @@ 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()); @@ -18,25 +22,23 @@ $url = $vars['url']; } $title = strip_tags($body); - -?> + + ?> - - - - <![CDATA[<?php echo $title; ?>]]> - ]]> + + + + <![CDATA[<?php echo $title; ?>]]> + ]]> -= $vars['limit']) break; - + if ($i >= $vars['limit']) { + break; + } } - } - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/views/rss/search/entity_list.php b/views/rss/search/entity_list.php index 8864b62da..05e90904f 100644 --- a/views/rss/search/entity_list.php +++ b/views/rss/search/entity_list.php @@ -1,9 +1,14 @@ 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); +$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 +} \ No newline at end of file diff --git a/views/rss/user/default.php b/views/rss/user/default.php index b3418538a..dd8fb43ed 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -1,34 +1,31 @@ - - getURL(); ?> - time_created) ?> - getURL(); ?> - <![CDATA[<?php echo (($vars['entity']->name)); ?>]]> - description)); ?>]]> - getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - getLatitude(); ?> getLongitude(); ?> - - - + +getURL(); ?> +time_created) ?> +getURL(); ?> +<![CDATA[<?php echo (($vars['entity']->name)); ?>]]> +description)); ?>]]> +getLongitude()) && + ($vars['entity']->getLatitude()) + ) { + ?> + getLatitude(); ?> getLongitude(); ?> + + + diff --git a/views/xml/api/output.php b/views/xml/api/output.php index 07b300073..c2385b6e3 100644 --- a/views/xml/api/output.php +++ b/views/xml/api/output.php @@ -1,17 +1,16 @@ export(); - - echo serialise_object_to_xml($export, "elgg"); -?> \ No newline at end of file +$result = $vars['result']; +$export = $result->export(); + +echo serialise_object_to_xml($export, "elgg"); \ No newline at end of file diff --git a/views/xml/messages/exceptions/exception.php b/views/xml/messages/exceptions/exception.php index eae45f397..f13457e7c 100644 --- a/views/xml/messages/exceptions/exception.php +++ b/views/xml/messages/exceptions/exception.php @@ -1,31 +1,28 @@ - \ No newline at end of file diff --git a/views/xml/pageshells/pageshell.php b/views/xml/pageshells/pageshell.php index e633a7bca..6e89e389a 100644 --- a/views/xml/pageshells/pageshell.php +++ b/views/xml/pageshells/pageshell.php @@ -1,15 +1,14 @@ \ No newline at end of file +header("Content-Type: text/xml"); +header("Content-Length: " . strlen($vars['body'])); +echo $vars['body']; \ No newline at end of file diff --git a/views/xml/xml-rpc/output.php b/views/xml/xml-rpc/output.php index 31c888c3c..d3ea5bc97 100644 --- a/views/xml/xml-rpc/output.php +++ b/views/xml/xml-rpc/output.php @@ -1,14 +1,13 @@ \ No newline at end of file +$result = $vars['result']; + +echo "$result"; \ No newline at end of file -- cgit v1.2.3