From ba96de15a07753e06f02b777d1cfcb0c981d2986 Mon Sep 17 00:00:00 2001 From: icewing Date: Mon, 14 Apr 2008 10:02:33 +0000 Subject: Marcus Povey * Relationships added to GUID browser git-svn-id: https://code.elgg.org/elgg/trunk@441 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/guidbrowser/index.php | 18 ++++++++----- mod/guidbrowser/start.php | 3 ++- .../views/default/guidbrowser/entity_full.php | 31 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/mod/guidbrowser/index.php b/mod/guidbrowser/index.php index 5b0a8c09d..d842367a5 100644 --- a/mod/guidbrowser/index.php +++ b/mod/guidbrowser/index.php @@ -24,20 +24,26 @@ $key = get_input('key'); $value = get_input('value'); - echo "ACTION $callaction"; + $relationship = get_input('relationship'); + $guid2 = get_input('guid2'); switch ($callaction) { - case 'metadata' : echo "META"; + case 'metadata' : if (!create_metadata($eguid, $key, $value)) - echo "Could not create metadata with $guid:$key:$value"; + echo "Could not create metadata with $eguid:$key:$value"; break; - case 'annotations' : echo "ANNO"; + case 'annotations' : if (!create_annotation($eguid, $key, $value)) - echo "Could not create metadata with $guid:$key:$value"; - break; + echo "Could not create metadata with $eguid:$key:$value"; + break; + + case 'relationship' : + if (!add_entity_relationship($eguid, $relationship, $guid2)) + echo "Could not create relationship between $eguid:$relationship:$guid2"; + break; } // Get the current page's owner diff --git a/mod/guidbrowser/start.php b/mod/guidbrowser/start.php index ef68ed9a3..602fa5741 100644 --- a/mod/guidbrowser/start.php +++ b/mod/guidbrowser/start.php @@ -30,7 +30,8 @@ array( 'entity' => $entity, 'metadata' => get_metadata_for_entity($entity->guid), - 'annotations' => get_annotations($entity->guid) + 'annotations' => get_annotations($entity->guid), + 'relationships' => get_entity_relationships($entity->guid) ) ) ) diff --git a/mod/guidbrowser/views/default/guidbrowser/entity_full.php b/mod/guidbrowser/views/default/guidbrowser/entity_full.php index 13bdb7280..817443d23 100644 --- a/mod/guidbrowser/views/default/guidbrowser/entity_full.php +++ b/mod/guidbrowser/views/default/guidbrowser/entity_full.php @@ -12,6 +12,7 @@ $entity = $vars['entity']; $metadata = $vars['metadata']; $annotations = $vars['annotations']; + $relationships = $vars['relationships']; ?>
@@ -90,4 +91,34 @@
+ + +
+

Relationships

+ +
+ + + + + +
relationship; ?>guid_two; ?>
+
+ + +
+
+ + + + Relationship : + Guid : + +
+
\ No newline at end of file -- cgit v1.2.3