-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconnections.asp
More file actions
134 lines (116 loc) · 4.17 KB
/
Copy pathconnections.asp
File metadata and controls
134 lines (116 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="expires" content="-1"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="copyright" content="2013, Web Solutions"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<title>Page Connections</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<style type="text/css">
body
{
padding: 10px;
}
</style>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="rqlconnector/Rqlconnector.js"></script>
<script type="text/javascript">
function GotoTreeSegment(sGuid, sType)
{
top.opener.parent.top.opener.parent.frames.ioTreeData.location = "../../ioRDLevel1.asp?Action=GotoTreeSegment&Guid=" + sGuid + "&Type=" + sType + "&CalledFromRedDot=0";
}
</script>
<script type="text/javascript">
var LoginGuid = '<%= session("loginguid") %>';
var SessionKey = '<%= session("sessionkey") %>';
var RqlConnectorObj = new RqlConnector(LoginGuid, SessionKey);
var _PageGuid = GetUrlVars()['pageguid'];
$(document).ready(function() {
DisplayPageConnections(_PageGuid);
$("#connections").on("click", ".display-in-tree", function(event){
GotoTreeSegment($(this).attr('data-guid'), 'link');
});
$("#connections").on("click", ".reference-page", function(event){
ReferenceLinkToPage($(this).attr('data-guid'), _PageGuid);
});
});
function GetUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
function DisplayPageConnections(PageGuid)
{
var strRQLXML = '<PAGE guid="' + PageGuid + '"><LINKSFROM action="load"/></PAGE>';
RqlConnectorObj.SendRql(strRQLXML, false, function(data){
$(data).find('LINK').each(function(){
var ButtonHTML = '';
ButtonHTML = '<button class="btn display-in-tree" data-guid="' + $(this).attr('guid') + '" title="Display in Tree"><i class="icon-share-alt"></i></button>';
var PageHeadline = $(this).attr('pageheadline');
var ElementNameAndConnectionType = '<span>' + $(this).attr('value') + '</span> ';
if($(this).attr('ismainlink') != '0')
{
// is mainlink
ElementNameAndConnectionType += '<i class="icon-home" title="Mainlink"></i>';
}
else
{
var elttype = parseInt($(this).attr("elttype"));
if((elttype == 26) || (elttype == 27))
{
ButtonHTML += '<button class="btn btn-info reference-page" data-guid="' + $(this).attr('guid') + '" title="Reference Page"><i class="icon-arrow-right"></i></button>';
}
}
if($(this).attr('connectedbykeyword') == '1')
{
// is connected via keyword
ElementNameAndConnectionType += '<i class="icon-info-sign" title="Connected via Keyword"></i>';
}
AddPageConnection($(this).attr('pageheadline'), ElementNameAndConnectionType, ButtonHTML);
});
});
}
function AddPageConnection(ParentPageHeadline, ConnectedElementHtml, ActionsHtml)
{
var ConnectionHTML = '';
ConnectionHTML += '<tr>';
ConnectionHTML += '<td>' + ParentPageHeadline + '</td>'
ConnectionHTML += '<td>' + ConnectedElementHtml + '</td>';
ConnectionHTML += '<td>' + ActionsHtml + '</td>';
ConnectionHTML += '</tr>';
$('#connections tbody').append(ConnectionHTML);
}
function ReferenceLinkToPage(LinkGuid, PageGuid)
{
var strRQLXML = '<CLIPBOARD action="ReferenceToPage" guid="' + LinkGuid + '" type="link"><ENTRY guid="' + PageGuid + '" type="page" /></CLIPBOARD>';
RqlConnectorObj.SendRql(strRQLXML, false, function(data){
RefreshPage();
});
}
function RefreshPage()
{
location.reload();
}
</script>
</head>
<body>
<table class="table table-hover" id="connections">
<tbody>
<tr class="info">
<td><strong>Parent Page</strong></td>
<td><strong>Connected to Element</strong></td>
<td><strong>Actions</strong></td>
</tr>
</tbody>
</table>
</body>
</html>