diff options
author | 2008-04-17 08:02:09 +0000 | |
---|---|---|
committer | 2008-04-17 08:02:09 +0000 | |
commit | 3e2854611b5d73687a701b24dc58fd56d79be09d (patch) | |
tree | 4fad2b7ffa9e126613519a5e6d08a491d4723284 /templates/sidebar.block.menu.php | |
parent | 39cf52851529c0d91d69307186c6bf5e9f362735 (diff) | |
download | scuttle-3e2854611b5d73687a701b24dc58fd56d79be09d.tar.gz scuttle-3e2854611b5d73687a701b24dc58fd56d79be09d.zip |
New feature: menu box which displays tags included into the special tag menu [Config modified]
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@105 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'templates/sidebar.block.menu.php')
-rw-r--r-- | templates/sidebar.block.menu.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/templates/sidebar.block.menu.php b/templates/sidebar.block.menu.php new file mode 100644 index 0000000..20db5e0 --- /dev/null +++ b/templates/sidebar.block.menu.php @@ -0,0 +1,64 @@ +<?php +$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService'); +$userservice =& ServiceFactory::getServiceInstance('UserService'); + +require_once('sidebar.linkedtags.inc.php'); + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + +// editing mode +if(($logged_on_userid != null) && ($userid === $logged_on_userid)) { + $editingMode = true; +} else { + $editingMode = false; +} + +if(strlen($user)==0) { + $cat_url = createURL('tags', '%2$s'); +} + +$menuTags = $tag2tagservice->getMenuTags($userid); +if (sizeof($menuTags) > 0) { +?> + +<h2> +<?php + echo '<span title="'.sprintf(T_('Tags included into the tag \'%s\''), $GLOBALS['menuTag']).'">'.T_('Menu Tags').'</span> '; + $cUser = $userservice->getUser($userid); + echo '<small span title="'.T_('See all tags').'"><a href="'.createURL('alltags', $cUser['username']).'">('.T_('all tags').')</a></small>'; + //} +?> +</h2> + + +<div id="related"> +<table> +<?php + if($editingMode) { + echo '<tr><td></td><td>'; + echo ' (<a href="'. createURL('tag2tagadd','') .'" rel="tag">'.T_('Add new link').'</a>) '; + echo ' (<a href="'. createURL('tag2tagdelete','') .'" rel="tag">'.T_('Delete link').'</a>)'; + echo '</td></tr>'; + } + + $stopList = array(); + foreach($menuTags as $menuTag) { + $tag = $menuTag['tag']; + if(!in_array($tag, $stopList)) { + $displayLinkedTags = displayLinkedTags($tag, '>', $userid, $cat_url, $user, $editingMode, null, 1); + echo $displayLinkedTags['output']; + if(is_array($displayLinkedTags['stopList'])) { + $stopList = array_merge($stopList, $displayLinkedTags['stopList']); + } + } + } +?> +</table> +</div> + +<?php +} +?> |