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
|
|
|
?>
|
2010-10-09 13:03:55 +02:00
|
|
|
<div id="related-content" />
|
2010-10-09 12:09:39 +02:00
|
|
|
<script type="text/javascript"><![CDATA[
|
2010-10-09 13:03:55 +02:00
|
|
|
jQuery("#related-content")
|
2010-10-09 10:20:14 +02:00
|
|
|
.jstree({
|
|
|
|
"themes" : {
|
|
|
|
"theme": "default",
|
|
|
|
"dots": false,
|
|
|
|
"icons": true,
|
2010-10-13 19:01:49 +02:00
|
|
|
"url": '<?php echo ROOT_JS ?>themes/default/style.css'
|
2010-10-09 10:20:14 +02:00
|
|
|
},
|
|
|
|
"json_data" : {
|
|
|
|
"ajax" : {
|
|
|
|
"url": function(node) {
|
|
|
|
//-1 is root
|
2010-10-13 19:18:42 +02:00
|
|
|
parentparam = "";
|
2010-10-09 10:20:14 +02:00
|
|
|
if (node == -1 ) {
|
|
|
|
node = <?php echo json_encode($currenttag); ?>;
|
2010-10-13 19:18:42 +02:00
|
|
|
parentparam = "&parent=true";
|
2010-10-09 10:20:14 +02:00
|
|
|
} else if (node.attr('rel')) {
|
|
|
|
node = node.attr('rel');
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
2010-10-13 19:18:42 +02:00
|
|
|
|
|
|
|
return "<?php echo ROOT ?>ajax/getlinkedtags.php?tag=" + node
|
|
|
|
+ parentparam;
|
2010-10-09 10:20:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
plugins : [ "themes", "json_data"]
|
|
|
|
});
|
2010-10-09 12:09:39 +02:00
|
|
|
]]></script>
|
2010-10-09 10:20:14 +02:00
|
|
|
</div>
|