From 8a64083900b86e67f86f34c5e360e882096bc2ef Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 15 Jul 2008 15:41:22 +0000 Subject: Closes #145: Override getURL on imported entities. git-svn-id: https://code.elgg.org/elgg/trunk@1428 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/opendd/start.php | 19 ++++++++------- .../widgets/opendd_friends_elsewhere/view.php | 4 ++-- mod/opendd/viewuuid.php | 28 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 mod/opendd/viewuuid.php (limited to 'mod/opendd') diff --git a/mod/opendd/start.php b/mod/opendd/start.php index ff2e751bd..d9e3ee9f7 100644 --- a/mod/opendd/start.php +++ b/mod/opendd/start.php @@ -196,7 +196,7 @@ */ function opendd_odd_to_elgg(ODDDocument $element) { - global $uuid_array, $elgg_array; + global $uuid_array, $elgg_array, $CONFIG; $count = $element->getNumElements(); @@ -249,7 +249,6 @@ $tmp = array(); // Go through the elements - $spoo; foreach ($element as $e) { $uuid = $e->getAttribute('uuid'); @@ -257,7 +256,7 @@ // if entity then create if ($e instanceof ODDEntity) { $tmp[$uuid] = oddentity_to_elggentity($e); - $spoo = $uuid; + $tmp[$uuid]->setURL($CONFIG->url . "mod/opendd/viewuuid.php?uuid=" . urlencode($uuid)); } // if metadata then add to entity @@ -278,10 +277,7 @@ /** * ISSUES * - * - opendd feed doesn't work * - all entities need to be public on target - * - setobject on statement is incorrect - * - NEED WAY TO GET CLASS! * */ @@ -298,8 +294,15 @@ */ function opendd_aggregate_remote_river(array $feeds, $limit = 10, $offset = 0) { - global $uuid_array, $elgg_array; - + global $uuid_array, $elgg_array, $CONFIG; + + // if this not an array, turn it into one + if (!is_array($feeds)) + $feeds = array($feeds); + + // ensure there are no duplicates + $feeds = array_unique($feeds); + $river = array(); $opendd_elements = array(); $opendd_published = array(); diff --git a/mod/opendd/views/default/widgets/opendd_friends_elsewhere/view.php b/mod/opendd/views/default/widgets/opendd_friends_elsewhere/view.php index 9edeabc09..3cbcc51e3 100644 --- a/mod/opendd/views/default/widgets/opendd_friends_elsewhere/view.php +++ b/mod/opendd/views/default/widgets/opendd_friends_elsewhere/view.php @@ -8,9 +8,9 @@ * @copyright Curverider Ltd 2008 * @link http://elgg.com/ */ -include ("../../../../../../engine/start.php"); +//include ("../../../../../../engine/start.php"); -$vars['entity'] = get_entity(80); +//$vars['entity'] = get_entity(80); $owner = page_owner_entity(); $limit = 8; diff --git a/mod/opendd/viewuuid.php b/mod/opendd/viewuuid.php new file mode 100644 index 000000000..2772c9d66 --- /dev/null +++ b/mod/opendd/viewuuid.php @@ -0,0 +1,28 @@ + \ No newline at end of file -- cgit v1.2.3