From a11432db93dbfdb0dbc78e1dd384663439799559 Mon Sep 17 00:00:00 2001
From: Christian Weiske
Date: Mon, 23 May 2011 06:53:31 +0200
Subject: first try to implement theming support, which currently does not work
at all
---
data/templates/default/sidebar.linkedtags.inc.php | 84 +++++++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 data/templates/default/sidebar.linkedtags.inc.php
(limited to 'data/templates/default/sidebar.linkedtags.inc.php')
diff --git a/data/templates/default/sidebar.linkedtags.inc.php b/data/templates/default/sidebar.linkedtags.inc.php
new file mode 100644
index 0000000..020d0f0
--- /dev/null
+++ b/data/templates/default/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.''. filter($tag) .'';
+ $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