2008-01-09 16:51:35 +01:00
|
|
|
<?php
|
|
|
|
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
|
|
|
|
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
|
|
|
|
2008-04-17 10:02:09 +02:00
|
|
|
require_once('sidebar.linkedtags.inc.php');
|
2008-01-09 16:51:35 +01:00
|
|
|
|
|
|
|
$logged_on_userid = $userservice->getCurrentUserId();
|
|
|
|
if ($logged_on_userid === false) {
|
|
|
|
$logged_on_userid = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
$explodedTags = array();
|
|
|
|
if ($currenttag) {
|
|
|
|
$explodedTags = explode('+', $currenttag);
|
|
|
|
} else {
|
2008-01-23 15:47:35 +01:00
|
|
|
if($summarizeLinkedTags == true) {
|
2008-01-22 17:16:06 +01:00
|
|
|
$orphewTags = $tag2tagservice->getOrphewTags('>', $userid, 4, "nb");
|
2008-01-23 15:47:35 +01:00
|
|
|
} else {
|
|
|
|
$orphewTags = $tag2tagservice->getOrphewTags('>', $userid);
|
2008-01-22 17:16:06 +01:00
|
|
|
}
|
|
|
|
|
2008-01-09 16:51:35 +01:00
|
|
|
foreach($orphewTags as $orphewTag) {
|
|
|
|
$explodedTags[] = $orphewTag['tag'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2008-03-14 15:24:43 +01:00
|
|
|
<?php
|
|
|
|
if(($logged_on_userid != null) && ($userid === $logged_on_userid)) {
|
|
|
|
$editingMode = true;
|
|
|
|
} else {
|
|
|
|
$editingMode = false;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php if(count($explodedTags)>0 || $editingMode):?>
|
|
|
|
|
2008-01-22 17:16:06 +01:00
|
|
|
<h2>
|
|
|
|
<?php
|
|
|
|
echo T_('Linked Tags').' ';
|
|
|
|
//if($userid != null) {
|
|
|
|
$cUser = $userservice->getUser($userid);
|
2008-04-17 10:02:09 +02:00
|
|
|
echo '<small><a href="'.createURL('alltags', $cUser['username']).'">('.T_('all tags').')</a></small>';
|
2008-01-22 17:16:06 +01:00
|
|
|
//}
|
|
|
|
?>
|
|
|
|
</h2>
|
2008-03-14 15:24:43 +01:00
|
|
|
<?php //endif?>
|
2008-01-22 17:16:06 +01:00
|
|
|
|
2008-01-09 16:51:35 +01:00
|
|
|
<div id="linked">
|
|
|
|
<table>
|
|
|
|
<?php
|
2008-02-05 14:30:33 +01:00
|
|
|
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>';
|
|
|
|
}
|
|
|
|
|
2008-02-20 14:43:06 +01:00
|
|
|
if(strlen($user)==0) {
|
|
|
|
$cat_url = createURL('tags', '%2$s');
|
|
|
|
}
|
|
|
|
|
2008-01-28 15:55:07 +01:00
|
|
|
$stopList = array();
|
2008-01-09 16:51:35 +01:00
|
|
|
foreach($explodedTags as $explodedTag) {
|
2008-01-28 15:55:07 +01:00
|
|
|
if(!in_array($explodedTag, $stopList)) {
|
|
|
|
// fathers tag
|
|
|
|
$fatherTags = $tag2tagservice->getLinkedTags($explodedTag, '>', $userid, true);
|
|
|
|
if(count($fatherTags)>0) {
|
|
|
|
foreach($fatherTags as $fatherTag) {
|
2008-01-28 16:02:58 +01:00
|
|
|
echo '<tr><td></td><td>';
|
2008-01-28 15:55:07 +01:00
|
|
|
echo '<a href="'. sprintf($cat_url, filter($user, 'url'), filter($fatherTag, 'url')) .'" rel="tag">('. filter($fatherTag) .')</a>';
|
|
|
|
echo '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-28 16:02:58 +01:00
|
|
|
$displayLinkedTags = displayLinkedTags($explodedTag, '>', $userid, $cat_url, $user, $editingMode, null, 1);
|
2008-01-28 15:55:07 +01:00
|
|
|
echo $displayLinkedTags['output'];
|
|
|
|
if(is_array($displayLinkedTags['stopList'])) {
|
|
|
|
$stopList = array_merge($stopList, $displayLinkedTags['stopList']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-09 16:51:35 +01:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
</div>
|
2008-02-20 14:47:33 +01:00
|
|
|
|
|
|
|
<?php endif?>
|