From a89a4c07b811ceda200c7913d9629466f345d674 Mon Sep 17 00:00:00 2001 From: buckaroo-labs Date: Wed, 20 Dec 2023 19:16:51 -0800 Subject: bundle sscuttlizr theme --- .../sscuttlizr/sidebar.linkedtags.inc.php | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 data/templates/sscuttlizr/sidebar.linkedtags.inc.php (limited to 'data/templates/sscuttlizr/sidebar.linkedtags.inc.php') diff --git a/data/templates/sscuttlizr/sidebar.linkedtags.inc.php b/data/templates/sscuttlizr/sidebar.linkedtags.inc.php new file mode 100644 index 0000000..020d0f0 --- /dev/null +++ b/data/templates/sscuttlizr/sidebar.linkedtags.inc.php @@ -0,0 +1,84 @@ + '', 'stoplist' => $stopList); + } + + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); + $tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); + + // link '>' + if($level>1) { + if($editingMode) { + $link = '> '; + } else { + $link = '> '; + } + } else { + $link = ''; + } + + $output = ''; + $output.= ''; + $output.= ''; + $output.= ''; + $output.= $level == 1?'':''; + $output.= str_repeat(' ', $level*2) .$link.''; + $output.= $level == 1?'':''; + //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId); + + $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId); + $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags); + sort($synonymTags); + $synonymList = ''; + foreach($synonymTags as $synonymTag) { + //$output.= ", ".$synonymTag; + $synonymList.= $synonymTag.' '; + } + if(count($synonymTags)>0) { + $output.= ', '.$synonymTags[0]; + } + if(count($synonymTags)>1) { + $output.= ', etc'; + } + + /*if($editingMode) { + $output.= ' ('; + $output.= '+'; + if(1) { + $output.= ' - '; + $output.= '-'; + } + $output.= ')'; + }*/ + $output.= ''; + $output.= ''; + + $tags = array($tag); + $tags = array_merge($tags, $synonymTags); + foreach($tags as $tag) { + + if(!in_array($tag, $stopList)) { + $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId); + $precedentTag = $tag; + $stopList[] = $tag; + foreach($linkedTags as $linkedTag) { + $displayLinkedTags = displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level + 1, $stopList); + $output.= $displayLinkedTags['output']; + } + if(isset($displayLinkedTags) && is_array($displayLinkedTags['stopList'])) { + $stopList = array_merge($stopList, $displayLinkedTags['stopList']); + $stopList = array_unique($stopList); + } + } + + } + return array('output' => $output, 'stopList' => $stopList); +} + +?> -- cgit v1.2.3-54-g00ecf