From 3c685aa352587b752af61c6e80b1645ca3830316 Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 20 Nov 2008 13:42:03 +0000 Subject: New feature: Dynamic tree of tags using Dojo toolkit (used by a menu2 sidebar box) [Config file modified: ] git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@165 b3834d28-1941-0410-a4f8-b48e95affb8f --- ajax/getlinkedtags.php | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ajax/getlinkedtags.php (limited to 'ajax/getlinkedtags.php') diff --git a/ajax/getlinkedtags.php b/ajax/getlinkedtags.php new file mode 100644 index 0000000..fa8f2d0 --- /dev/null +++ b/ajax/getlinkedtags.php @@ -0,0 +1,63 @@ +isLoggedOn()) { + $loggedon = true; + $currentUser = $userservice->getCurrentUser(); + $currentUserID = $userservice->getCurrentUserId(); +} + +function displayTag($tag, $uId) { + $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService'); + $output = '{ id:'.rand().', name:\''.$tag.'\''; + + $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId); + if(count($linkedTags) > 0) { + $output.= ', children: ['; + foreach($linkedTags as $linkedTag) { + $output.= displayTag($linkedTag, $uId); + } + $output.= "]"; + } + + $output.= '},'; + return $output; +} + +?> + +{ label: 'name', identifier: 'id', items: [ + +] } -- cgit v1.2.3