2008-01-09 16:51:35 +01:00
|
|
|
<?php
|
2010-10-09 10:20:14 +02:00
|
|
|
/*
|
|
|
|
* Used in:
|
|
|
|
* - populartags.php
|
|
|
|
* - bookmarks.php
|
|
|
|
* - alltags.php
|
|
|
|
* - tags.php
|
|
|
|
*/
|
2008-12-05 08:25:04 +01:00
|
|
|
/* Service creation: only useful services are created */
|
2009-10-23 19:13:16 +02:00
|
|
|
$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag');
|
2008-01-09 16:51:35 +01:00
|
|
|
|
2008-04-17 11:10:30 +02:00
|
|
|
require_once('sidebar.linkedtags.inc.php');
|
2008-01-09 16:51:35 +01:00
|
|
|
|
2008-05-10 10:59:41 +02:00
|
|
|
/* Manage input */
|
|
|
|
$user = isset($user)?$user:'';
|
|
|
|
$userid = isset($userid)?$userid:0;
|
|
|
|
$currenttag = isset($currenttag)?$currenttag:'';
|
2010-10-09 10:20:14 +02:00
|
|
|
//$summarizeLinkedTags = isset($summarizeLinkedTags)?$summarizeLinkedTags:false;
|
2008-05-10 10:59:41 +02:00
|
|
|
|
2008-01-09 16:51:35 +01:00
|
|
|
$logged_on_userid = $userservice->getCurrentUserId();
|
2010-10-09 10:20:14 +02:00
|
|
|
$editingMode = $logged_on_userid !== false;
|
2008-01-09 16:51:35 +01:00
|
|
|
?>
|
2010-10-09 10:20:14 +02:00
|
|
|
<h2><?php echo T_('Linked Tags'); ?></h2>
|
|
|
|
<div id="related">
|
2008-03-14 15:24:43 +01:00
|
|
|
<?php
|
2010-10-09 10:20:14 +02:00
|
|
|
if ($editingMode) {
|
2009-01-06 17:39:02 +01:00
|
|
|
echo '<p style="margin-bottom: 13px;text-align:center;">';
|
|
|
|
echo ' (<a href="'. createURL('tag2tagadd','') .'" rel="tag">'.T_('Add new link').'</a>) ';
|
|
|
|
echo ' (<a href="'. createURL('tag2tagdelete','') .'" rel="tag">'.T_('Delete link').'</a>)';
|
|
|
|
echo '</p>';
|
|
|
|
}
|
2010-10-09 10:20:14 +02:00
|
|
|
?>
|
|
|
|
<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-1.4.2.js"></script>
|
|
|
|
<script type="text/javascript" src="<?php echo ROOT ?>js/jquery.jstree.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
jQuery("#related")
|
|
|
|
.jstree({
|
|
|
|
"themes" : {
|
|
|
|
"theme": "default",
|
|
|
|
"dots": false,
|
|
|
|
"icons": true,
|
|
|
|
"url": '<?php echo ROOT ?>js/themes/default/style.css'
|
|
|
|
},
|
|
|
|
"json_data" : {
|
|
|
|
"ajax" : {
|
|
|
|
"url": function(node) {
|
|
|
|
//-1 is root
|
|
|
|
parent = "";
|
|
|
|
if (node == -1 ) {
|
|
|
|
node = <?php echo json_encode($currenttag); ?>;
|
|
|
|
parent = "&parent=true";
|
|
|
|
} else if (node.attr('rel')) {
|
|
|
|
node = node.attr('rel');
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return "<?php echo ROOT ?>ajax/getlinkedtags.php?tag=" + node + parent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
plugins : [ "themes", "json_data"]
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</div>
|