From a210d4401a00ab875bf29aa189735525551ab7eb Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 3 Apr 2008 13:52:16 +0000 Subject: Marcus Povey * Basic guid browser git-svn-id: https://code.elgg.org/elgg/trunk@391 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/guidbrowser/index.php | 35 ++++++++- mod/guidbrowser/start.php | 28 +++++++- .../views/default/guidbrowser/browser.php | 25 +++++++ .../views/default/guidbrowser/entity.php | 21 +++++- .../views/default/guidbrowser/entity_full.php | 82 +++++++++++++++++++++- .../views/default/guidbrowser/navbar.php | 3 - .../views/default/guidbrowser/prevnext.php | 20 ++++++ 7 files changed, 205 insertions(+), 9 deletions(-) create mode 100644 mod/guidbrowser/views/default/guidbrowser/browser.php delete mode 100644 mod/guidbrowser/views/default/guidbrowser/navbar.php create mode 100644 mod/guidbrowser/views/default/guidbrowser/prevnext.php diff --git a/mod/guidbrowser/index.php b/mod/guidbrowser/index.php index 71b852bb6..5b0a8c09d 100644 --- a/mod/guidbrowser/index.php +++ b/mod/guidbrowser/index.php @@ -9,12 +9,43 @@ * @link http://elgg.com/ */ - // Load Elgg engine - require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + require_once("../../engine/start.php"); + + $_SESSION['guid'] = 2; + $_SESSION['id'] = 2; + + $eguid = get_input('eguid'); + $limit = get_input('limit', 10); + $offset = get_input('offset'); + $type = get_input('type'); + $subtype = get_input('subtype'); + + $action = get_input('subtype'); + $key = get_input('key'); + $value = get_input('value'); + + echo "ACTION $callaction"; + + + switch ($callaction) + { + case 'metadata' : echo "META"; + if (!create_metadata($eguid, $key, $value)) + echo "Could not create metadata with $guid:$key:$value"; + break; + + case 'annotations' : echo "ANNO"; + if (!create_annotation($eguid, $key, $value)) + echo "Could not create metadata with $guid:$key:$value"; + break; + } // Get the current page's owner $page_owner = page_owner_entity(); + // Display + $body = guidbrowser_display($offset, $limit, $type, $subtype); + // Display page page_draw(elgg_echo("guidbrowser"), $body); ?> \ No newline at end of file diff --git a/mod/guidbrowser/start.php b/mod/guidbrowser/start.php index e5a08f02e..2beaf6d89 100644 --- a/mod/guidbrowser/start.php +++ b/mod/guidbrowser/start.php @@ -10,13 +10,37 @@ function guidbrowser_displayentity($entity) { - // display summary - // display full on clickdown + return elgg_view("guidbrowser/entity", + array( + 'entity_guid' => $entity->guid, + 'type' => $entity->type, + 'subtype' => $entity->getSubtype(), + 'full' => elgg_view( + "guidbrowser/entity_full", + array( + 'entity' => $entity, + 'metadata' => get_metadata_for_entity($entity->guid), + 'annotations' => get_annotations($entity->guid) + ) + ) + ) + ); } function guidbrowser_display($offset = 0, $limit = 10, $type = "", $subtype = "") { + $entities = get_entities($type, $subtype, page_owner(), "time_created desc", $limit, $offset); + $display = ""; + + foreach ($entities as $e) + $display .= guidbrowser_displayentity($e); + return elgg_view("guidbrowser/browser", + array( + 'entities' => $display, + 'prevnext' => elgg_view("guidbrowser/prevnext", array("limit" => $limit, "offset" => $offset)) + ) + ); } diff --git a/mod/guidbrowser/views/default/guidbrowser/browser.php b/mod/guidbrowser/views/default/guidbrowser/browser.php new file mode 100644 index 000000000..d947698e4 --- /dev/null +++ b/mod/guidbrowser/views/default/guidbrowser/browser.php @@ -0,0 +1,25 @@ + + + +
+
+ +
+ + +
\ No newline at end of file diff --git a/mod/guidbrowser/views/default/guidbrowser/entity.php b/mod/guidbrowser/views/default/guidbrowser/entity.php index 15c5adc7f..75e2ad025 100644 --- a/mod/guidbrowser/views/default/guidbrowser/entity.php +++ b/mod/guidbrowser/views/default/guidbrowser/entity.php @@ -1,3 +1,22 @@ -?> \ No newline at end of file +
+ + + + + + + +
+
+ +
\ No newline at end of file diff --git a/mod/guidbrowser/views/default/guidbrowser/entity_full.php b/mod/guidbrowser/views/default/guidbrowser/entity_full.php index 15c5adc7f..4514a3644 100644 --- a/mod/guidbrowser/views/default/guidbrowser/entity_full.php +++ b/mod/guidbrowser/views/default/guidbrowser/entity_full.php @@ -1,3 +1,83 @@ +
+ $v) + { +?> +
+ + + + + +
+
+ +
+
+

Metadata

+ +
+ + + + + +
name; ?>value; ?>
+
+ + +
+
+ + + + Key : + Value : + +
+
+ +
-?> \ No newline at end of file +
+

Annotations

+ +
+ + + + + +
name; ?>value; ?>
+
+ + +
+
+ + + + Key : + Value : + +
+
+
\ No newline at end of file diff --git a/mod/guidbrowser/views/default/guidbrowser/navbar.php b/mod/guidbrowser/views/default/guidbrowser/navbar.php deleted file mode 100644 index 15c5adc7f..000000000 --- a/mod/guidbrowser/views/default/guidbrowser/navbar.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/mod/guidbrowser/views/default/guidbrowser/prevnext.php b/mod/guidbrowser/views/default/guidbrowser/prevnext.php new file mode 100644 index 000000000..c8e599f80 --- /dev/null +++ b/mod/guidbrowser/views/default/guidbrowser/prevnext.php @@ -0,0 +1,20 @@ + + +
+ + + + + +
0){?>PreviousNext
+
\ No newline at end of file -- cgit v1.2.3