aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/opendd/start.php19
-rw-r--r--mod/opendd/views/default/widgets/opendd_friends_elsewhere/view.php4
-rw-r--r--mod/opendd/viewuuid.php28
3 files changed, 41 insertions, 10 deletions
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 @@
+<?php
+ /**
+ * Elgg OpenDD aggregator
+ *
+ * @package ElggOpenDD
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+ // The uuid to retrieve
+ $uuid = get_input('uuid');
+
+ // Fetch the UUID as an object
+ $entity = opendd_fetch_to_elgg($uuid);
+
+ // If entity then render
+ if ($entity)
+ $body = elgg_view_entity($entity, "", true);
+
+ $body = elgg_view_layout('one_column',$body);
+
+ // Finally draw the page
+ page_draw($uuid, $body);
+?> \ No newline at end of file