-
Notifications
You must be signed in to change notification settings - Fork 1
/
cbrbList_dlg.asp
180 lines (163 loc) · 5.6 KB
/
cbrbList_dlg.asp
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<%
'Copyright (C) Stefan Buchali, UDG United Digital Group, www.udg.de
'
'This software is licensed under a
'Creative Commons GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/)
'Some rights reserved.
'
'You should have received a copy of the GNU General Public License
'along with cbrbList. If not, see http://www.gnu.org/licenses/.
Response.ContentType = "text/html"
Response.Charset = "utf-8"
'get session information
SessionKey=request.form("Sessionkey")
RedakteurLoginGUID=request.form("LoginGUID")
AktuelleSeiteGUID = request.form("PageGUID")
if SessionKey="" then
SessionKey=Session("SessionKey")
end if
if RedakteurLoginGUID="" then
RedakteurLoginGUID=Session("LoginGUID")
end if
if AktuelleSeiteGUID="" then
AktuelleSeiteGUID = Session("PageGUID")
end if
'get the required parameters
allItems=request.form("allItems")
selectedItems=request.form("selectedItems")
saveEltTemplateName=request.form("saveEltTemplateName")
'get the optional parameters
pluginTitle=request.form("pluginTitle")
eltDescription=request.form("eltDescription")
cbrbtype=request.form("cbrbtype")
savetype=request.form("savetype")
'set the optional parameters to default, if empty
if pluginTitle="" then pluginTitle="Element bearbeiten" end if
if eltDescription="" then eltDescription="Bitte wählen" end if
if cbrbtype="" then cbrbtype="checkbox" end if
if savetype="" then savetype="std" end if
'predefine variables
listString=""
count=0
'set the fieldset flag to "false"
fieldsets=false
for each singleItem in split(allItems,",")
'In case of a fieldset create fieldset and legend tag, and set the fieldset flag to "true"
if left(trim(singleItem),9)="fieldset:" then
'first, close a previous fieldset, if existing (marked by the fieldset flag)
if fieldsets then listString=listString&"</fieldset>" end if
fieldsets=true
arrFieldset = split(singleItem,":")
listString=listString&"<fieldset><legend>" & arrFieldset(1) & "</legend>"
'Otherwise create the input field and label
else
count=count+1
if inStr(singleItem,"|") then
arrSingleItem = split(singleItem,"|")
itemValue=trim(arrSingleItem(0))
itemLabel=trim(arrSingleItem(1))
else
itemValue=trim(singleItem)
itemLabel=trim(singleItem)
end if
listString=listString&"<input type="""&cbrbtype&""" name=""cbrbList"" id=""cbrbList"&count&""" value="""&itemValue&""""
if cbrbtype="checkbox" then
if inStr("," &selectedItems& ",", "," &itemValue& ",")>0 then
listString=listString&" checked=""checked"""
end if
else
if selectedItems=itemValue then
listString=listString&" checked=""checked"""
end if
end if
listString=listString&" /><label for=""cbrbList"&count&""">"&itemLabel&"</label><br />"&vbcrlf
end if
next
'close the last fieldset, if existing (marked by the fieldset flag)
if fieldsets then listString=listString&"</fieldset>" end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../../stylesheets/ioStyleSheet.css" />
<style type="text/css">
button {
border: 1px solid black;
background: #EEEEEE;
}
fieldset {
margin-bottom: 1em;
padding: 0.5em 0;
}
legend {
font-weight: bold;
}
</style>
<script type="text/javascript">
var submitOK=true;
function absenden() {
if(submitOK) {
submitOK=false;
document.getElementById("btn1").disabled=true;
document.getElementById("btn2").disabled=true;
document.cbrbForm.submit();
}
}
</script>
<title><%=pluginTitle %></title>
</head>
<body link="navy" alink="navy" vlink="navy" bgcolor="#ffffff" background="../../icons/back5.gif">
<form name="cbrbForm" method="post" action="cbrbList_do.asp">
<input type="hidden" name="saveEltTemplateName" value="<%= saveEltTemplateName %>" />
<input type="hidden" name="SessionKey" value="<%= SessionKey %>" />
<input type="hidden" name="RedakteurLoginGUID" value="<%= RedakteurLoginGUID %>" />
<input type="hidden" name="AktuelleSeiteGUID" value="<%= AktuelleSeiteGUID %>" />
<input type="hidden" name="savetype" value="<%= savetype %>" />
<table class="tdgrey" border="0" align="center" width="400" cellspacing="0" cellpadding="3">
<tr>
<td width="100%">
<table class="tdgreylight" border="0" width="100%" cellspacing="0" cellpadding="1">
<tr>
<td width="100%" align="left" valign="top" height="50">
<table border="0" width="100%">
<tr><td class="titlebar" width="100%"><%=pluginTitle %></td></tr>
</table>
</td>
</tr>
<tr>
<td width="100%" align="left" valign="top" height="80">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="25"><img src="../../icons/transparent.gif" width="25" height="1" border="0" alt=""></td>
<td align="left" valign="top" class="label" width="100%"><%= eltDescription %></td>
<td width="25"><img src="../../icons/transparent.gif" width="25" height="1" border="0" alt=""></td>
</tr>
<tr>
<td height="5" colspan="3"></td>
</tr>
<tr>
<td></td>
<td class="normal"><%=listString%></td>
<td></td>
</tr>
<tr>
<td height="20" colspan="3"><img src="../../icons/transparent.gif" width="1" height="20" border="0" alt=""></td>
</tr>
<tr>
<td width="25"><img src="../../icons/transparent.gif" width="25" height="1" border="0" alt=""></td>
<td align="right" valign="top"><button id="btn1" type="button" onclick="absenden()">OK</button> <button id="btn2" type="button" onclick="self.close()">Abbrechen</button></td>
<td width="25"><img src="../../icons/transparent.gif" width="25" height="1" border="0" alt=""></td>
</tr>
<tr>
<td height="15" colspan="3"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>