2008-01-09 15:51:35 +00:00
|
|
|
<?php
|
2010-10-09 08:20:14 +00:00
|
|
|
/*
|
|
|
|
* Used in:
|
|
|
|
* - populartags.php
|
|
|
|
* - bookmarks.php
|
|
|
|
* - alltags.php
|
|
|
|
* - tags.php
|
|
|
|
*/
|
2008-12-05 07:25:04 +00:00
|
|
|
/* Service creation: only useful services are created */
|
2009-10-23 17:13:16 +00:00
|
|
|
$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag');
|
2008-01-09 15:51:35 +00:00
|
|
|
|
2008-04-17 09:10:30 +00:00
|
|
|
require_once('sidebar.linkedtags.inc.php');
|
2008-01-09 15:51:35 +00:00
|
|
|
|
2008-05-10 08:59:41 +00:00
|
|
|
/* Manage input */
|
|
|
|
$user = isset($user)?$user:'';
|
|
|
|
$userid = isset($userid)?$userid:0;
|
|
|
|
$currenttag = isset($currenttag)?$currenttag:'';
|
2010-10-09 08:20:14 +00:00
|
|
|
//$summarizeLinkedTags = isset($summarizeLinkedTags)?$summarizeLinkedTags:false;
|
2008-05-10 08:59:41 +00:00
|
|
|
|
2008-01-09 15:51:35 +00:00
|
|
|
$logged_on_userid = $userservice->getCurrentUserId();
|
2010-10-09 08:20:14 +00:00
|
|
|
$editingMode = $logged_on_userid !== false;
|
2008-01-09 15:51:35 +00:00
|
|
|
?>
|
2010-10-09 08:20:14 +00:00
|
|
|
<h2><?php echo T_('Linked Tags'); ?></h2>
|
|
|
|
<div id="related">
|
2008-03-14 14:24:43 +00:00
|
|
|
<?php
|
2010-10-09 08:20:14 +00:00
|
|
|
if ($editingMode) {
|
2009-01-06 16:39:02 +00: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 08:20:14 +00:00
|
|
|
?>
|
2010-10-09 11:03:55 +00:00
|
|
|
<div id="related-content" />
|
2010-10-09 10:09:39 +00:00
|
|
|
<script type="text/javascript"><![CDATA[
|
2010-10-09 11:03:55 +00:00
|
|
|
jQuery("#related-content")
|
2010-10-09 08:20:14 +00:00
|
|
|
.jstree({
|
|
|
|
"themes" : {
|
|
|
|
"theme": "default",
|
|
|
|
"dots": false,
|
|
|
|
"icons": true,
|
2010-10-09 15:04:52 +00:00
|
|
|
"url": '<?php echo ROOT ?>js/jstree-1.0-rc2/themes/default/style.css'
|
2010-10-09 08:20:14 +00:00
|
|
|
},
|
|
|
|
"json_data" : {
|
|
|
|
"ajax" : {
|
|
|
|
"url": function(node) {
|
|
|
|
//-1 is root
|
|
|
|
parent = "";
|
|
|
|
if (node == -1 ) {
|
|
|
|
node = <?php echo json_encode($currenttag); ?>;
|
2010-10-09 10:09:39 +00:00
|
|
|
parent = "&parent=true";
|
2010-10-09 08:20:14 +00:00
|
|
|
} 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"]
|
|
|
|
});
|
2010-10-09 10:09:39 +00:00
|
|
|
]]></script>
|
2010-10-09 08:20:14 +00:00
|
|
|
</div>
|