2008-04-17 08:02:09 +00:00
< ? php
$tag2tagservice =& ServiceFactory :: getServiceInstance ( 'Tag2TagService' );
$userservice =& ServiceFactory :: getServiceInstance ( 'UserService' );
2008-04-17 09:10:30 +00:00
require_once ( 'sidebar.linkedtags.inc.php' );
2008-04-17 08:02:09 +00:00
$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 );
2008-04-24 08:48:57 +00:00
if ( sizeof ( $menuTags ) > 0 || ( $userid != 0 && $userid === $logged_on_userid )) {
2008-04-17 08:02:09 +00:00
?>
< h2 >
< ? php
echo '<span title="' . sprintf ( T_ ( 'Tags included into the tag \'%s\'' ), $GLOBALS [ 'menuTag' ]) . '">' . T_ ( 'Menu Tags' ) . '</span> ' ;
//}
?>
</ h2 >
< div id = " related " >
< table >
< ? php
if ( $editingMode ) {
echo '<tr><td></td><td>' ;
2008-04-24 08:48:57 +00:00
echo ' (<a href="' . createURL ( 'tag2tagadd' , 'menu' ) . '" rel="tag">' . T_ ( 'Add new link' ) . '</a>) ' ;
echo ' (<a href="' . createURL ( 'tag2tagdelete' , 'menu' ) . '" rel="tag">' . T_ ( 'Delete link' ) . '</a>)' ;
2008-04-17 08:02:09 +00:00
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 >
2008-04-24 08:48:57 +00:00
< ? php $cUser = $userservice -> getUser ( $userid ); ?>
< p style = " text-align:right " >< a href = " <?php echo createURL('alltags', $cUser['username'] ); ?> " title = " <?php echo T_('See all your tags')?> " >< ? php echo T_ ( 'all your tags' ); ?> </a> →</p>
2008-04-17 08:02:09 +00:00
</ div >
< ? php
}
?>