Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 rsolanki 1
<%
2
'===================================================================
3
'						_treeNavigation
4
'===================================================================
5
%>
6
<%
7
'------------ VARIABLE DEFINITION -------------
8
Dim arrRoot
9
Dim arrAppProperties
10
Dim parTree
11
Dim nLevel
12
'------------ CONSTANTS DECLARATION -----------
13
Const UNDERLINE = "_"
14
Const IMG_INDENT1 = "<img src='images/spacer.gif' width='18' height='5' align='absmiddle' border='0'>"
15
Const IMG_INDENT2 = "<img src='images/spacer.gif' width='36' height='5' align='absmiddle' border='0'>"
16
Const IMG_INDENT3 = "<img src='images/spacer.gif' width='54' height='5' align='absmiddle' border='0'>"
17
Const IMG_APPLICATIONS = "<img src='images/i_application.gif' width='15' height='17' hspace='4' border='0' align='absmiddle'>"
18
Const IMG_DISK = "<img src='images/i_disk.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
19
Const IMG_USER = "<img src='images/i_user.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
20
Const IMG_USER_DISABLED = "<img src='images/i_user_disabled.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
21
Const IMG_ROLE = "<img src='images/i_role.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
22
Const IMG_CONTROL = "<img src='images/i_control.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
23
Const IMG_PAGE = "<img src='images/i_page.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
24
Const IMG_FOLDER = "<img src='images/i_folder.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"
25
Const IMG_USER_ACCOUNTS = "<img src='images/i_accounts.gif' width='16' height='14' hspace='4' border='0' align='absmiddle'>"
26
Const IMG_COMPUTERS = "<img src='images/i_computer.gif' width='11' height='16' hspace='6' border='0' align='absmiddle'>"
27
Const IMG_LOGIN = "<img src='images/spacer.gif' width='5' height='16' hspace='1' border='0' align='absmiddle'>"
28
'------------ VARIABLE INIT -------------------
29
parTree = Request("tree")
30
	'[1] Name
31
	'[2] ID
32
	'[3] Link
33
	'[4] JavaScript Event e.g. "onClick='...'"
34
	'[5] Image Selected
35
	'[6] Child SQL statement
36
 
37
Const inxTNName = 0
38
Const inxTNid 	= 1
39
Const inxTNLink = 2
40
Const inxTNEventHandler = 3
41
Const inxTNImage = 4
42
Const inxChildSQL = 5
43
 
44
Const nNumberofProperties = 6
45
 
46
arrRoot = Array ( "Applications", _
47
				  "1", _
48
				  "ApplicationList.asp", _
49
				  "", _
50
				  IMG_APPLICATIONS, _
51
				  "ApplicationsList.sql", _
52
 
53
				  "User Accounts", _
54
				  "2", _
55
				  "UserAccounts.asp", _
56
				  "", _
57
				  IMG_USER_ACCOUNTS, _
58
				  NULL, _
59
 
60
				  "Computers", _
61
				  "3", _
62
				  "ComputerList.asp", _
63
				  "", _
64
				  IMG_COMPUTERS, _
65
				  NULL, _
66
 
67
				  "Login Trail", _
68
				  "4", _
69
				  "LoginTrail.asp", _
70
				  "", _
71
				  IMG_LOGIN, _
72
				  NULL _
73
				)
74
 
75
arrAppProperties = Array ( "Users", _
76
						   "1", _
77
						   "UserList.asp", _
78
						   "", _
79
						   IMG_FOLDER, _
80
						   "AppUserList.sql", _
81
 
82
						   "Roles", _
83
						   "2", _
84
						   "RoleList.asp", _
85
						   "", _
86
						   IMG_FOLDER, _
87
						   "AppRoleList.sql", _
88
 
89
						   "Actions", _
90
						   "3", _
91
						   "ControlList.asp", _
92
						   "", _
93
						   IMG_FOLDER, _
94
						   "AppControlList.sql" _
95
						   )
96
						   ', _
97
 
98
						   '"Pages", _
99
						   '"4", _
100
						   '"PageList.asp", _
101
						   '"", _
102
						   'IMG_FOLDER, _
103
						   '"AppPageList.sql" _
104
 
105
'----------------------------------------------
106
%>
107
<%
108
'--------------------------------------------------------------------------------------------------------------------------------
109
Function LoadFromSQL ( sQuery )
110
	Dim rsQry, tempArr(), rowCnt, newDim
111
 
112
	Set rsQry = OraDatabase.DbCreateDynaset( sQuery , ORADYN_DEFAULT )
113
 
114
	ReDim tempArr( -1 )		' Default empty array
115
	rowCnt = 1
116
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
117
		newDim = nNumberofProperties * rowCnt
118
 
119
		ReDim Preserve tempArr( newDim - 1 )
120
 
121
		tempArr ( inxTNName + newDim - nNumberofProperties ) 			= rsQry("item_name")
122
		tempArr ( inxTNid + newDim - nNumberofProperties ) 				= rsQry("item_id")
123
		tempArr ( inxTNImage + newDim - nNumberofProperties ) 			= Eval(rsQry("item_image"))
124
		tempArr ( inxTNLink + newDim - nNumberofProperties ) 			= rsQry("file_name") &"?"& rsQry("param")
125
 
126
		rowCnt = rowCnt + 1
127
		rsQry.MoveNext
128
	WEnd
129
 
130
	LoadFromSQL = tempArr
131
 
132
	rsQry.Close
133
	Set rsQry = Nothing
134
End Function
135
'--------------------------------------------------------------------------------------------------------------------------------
136
Sub RenderSQL ( sQuery, Indent, sParent )
137
	Dim rsQry
138
 
139
	Set rsQry = OraDatabase.DbCreateDynaset( sQuery , ORADYN_DEFAULT )
140
 
141
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
142
		Response.write "<tr>"
143
        Response.write "	<td nowrap>"& Indent &"<a href='"& SCRIPT_NAME &"?tree="& sParent & UNDERLINE & rsQry("item_id") &"' class='menu_link'><img src='images/i_plus.gif' width='9' height='9' align='absmiddle' border='0'>"& Eval(rsQry("item_image"))  &  rsQry("item_name")  &"</a></td>"
144
      	Response.write "</tr>"
145
 
146
		rsQry.MoveNext
147
	WEnd
148
 
149
	rsQry.Close
150
	Set rsQry = Nothing
151
End Sub
152
'--------------------------------------------------------------------------------------------------------------------------------
153
Sub RenderList ( aList )
154
	Dim nLastItem, item, i
155
	nLastItem = Ubound( aList )
156
 
157
	For item = 0 To nLastItem Step nNumberofProperties
158
 
159
		' Render Item
160
		Response.write "<tr>"
161
        Response.write "	<td nowrap><a href='"& aList( inxTNLink + item ) &"' class='menu_link'>"& aList( inxTNImage + item )  &  aList( inxTNName + item )  &"</a></td>"
162
      	Response.write "</tr>"
163
 
164
	Next
165
 
166
End Sub
167
'--------------------------------------------------------------------------------------------------------------------------------
168
Sub NodeRoot ()
169
	Dim nLastItem, item, arrTree, aSQL, sqlINX, selected
170
	nLastItem = Ubound( arrRoot )
171
 
172
 
173
	For item = 0 To nLastItem Step nNumberofProperties
174
		selected = FALSE
175
		If parTree = arrRoot( inxTNid + item ) Then  selected = TRUE
176
		' Render Item
177
		Response.write "<tr>"
178
        Response.write "	<td nowrap><a href='"& arrRoot( inxTNLink + item ) &"?tree="& arrRoot( inxTNid + item ) &"' class='manu_link'>"& Expander ( selected )  &  arrRoot( inxTNImage + item )  &"<SPAN class='"& SelectorStyle( selected ) &"'>"&  arrRoot( inxTNName + item ) &"</SPAN></a></td>"
179
      	Response.write "</tr>"
180
 
181
		' Render Kids
182
		If selected AND NOT IsNull( arrRoot( inxChildSQL + item ) ) Then
183
 
184
			aSQL = LoadFromSQL ( GetQuery( arrRoot( inxChildSQL + item ) ) )
185
 
186
			For sqlINX = 0 To Ubound( aSQL ) Step nNumberofProperties
187
				Response.write "<tr>"
188
		        Response.write "	<td nowrap><a href='"& aSQL( inxTNLink + sqlINX ) &"&tree="& arrRoot( inxTNid + item ) &"_"& aSQL( inxTNid + sqlINX ) &"' class='menu_link'>"& IMG_INDENT1  &  Expander ( FALSE )  &  aSQL( inxTNImage + sqlINX )  &  aSQL( inxTNName + sqlINX )  &"</a></td>"
189
		      	Response.write "</tr>"
190
 
191
			Next
192
 
193
 
194
		End If
195
 
196
 
197
 
198
	Next
199
 
200
End Sub
201
'--------------------------------------------------------------------------------------------------------------------------------
202
Sub NodeApplicationProperties ()
203
	Dim rootINX, appINX, appPropINX, arrTree, selected
204
	Dim aAppList
205
	arrTree = Split( parTree, UNDERLINE ) 
206
	aAppList = LoadFromSQL ( GetQuery("ApplicationsList.sql") )
207
 
208
	For rootINX = 0 To Ubound( arrRoot ) Step nNumberofProperties
209
		selected = FALSE
210
		If arrTree( 0 ) = arrRoot( inxTNid + rootINX ) Then  selected = TRUE
211
 
212
 
213
		' Render Item
214
		Response.write "<tr>"
215
        Response.write "	<td nowrap><a href='"& arrRoot( inxTNLink + rootINX ) &"?tree="& arrRoot( inxTNid + rootINX ) &"' class='menu_link'>"& Expander ( selected )  &  arrRoot( inxTNImage + rootINX )  &  arrRoot( inxTNName + rootINX ) &"</a></td>"
216
      	Response.write "</tr>"
217
 
218
 
219
		If selected Then
220
			' Applications List
221
			For appINX = 0 To Ubound( aAppList ) Step nNumberofProperties
222
				selected = FALSE
223
				If arrTree( 1 ) = aAppList( inxTNid + appINX ) Then  selected = TRUE
224
 
225
				Response.write "<tr>"
226
		        Response.write "	<td nowrap><a href='Application_Default.asp?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"' class='menu_link'>"& IMG_INDENT1  &  Expander ( selected )  &  aAppList( inxTNImage + appINX )    &"<SPAN class='"& SelectorStyle( selected ) &"'>"&  aAppList( inxTNName + appINX ) &"</SPAN></a></td>"
227
		      	Response.write "</tr>"
228
 
229
 
230
				If selected Then
231
					' Application Properties
232
					For appPropINX = 0 To Ubound( arrAppProperties ) Step nNumberofProperties
233
						Response.write "<tr>"
234
				        Response.write "	<td nowrap><a href='"& arrAppProperties( inxTNLink + appPropINX ) &"?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"_"& arrAppProperties( inxTNid + appPropINX ) &"' class='menu_link'>"& IMG_INDENT2  &  Expander ( FALSE )  &  arrAppProperties( inxTNImage + appPropINX )   &  arrAppProperties( inxTNName + appPropINX ) &"</a></td>"
235
				      	Response.write "</tr>"
236
 
237
					Next
238
 
239
 
240
				End If
241
 
242
 
243
			Next
244
 
245
		End If
246
 
247
 
248
	Next
249
End Sub
250
'--------------------------------------------------------------------------------------------------------------------------------
251
Sub NodeApplicationProperty ()
252
	Dim rootINX, appINX, appPropINX, arrTree, aSQL, sqlINX, selected, query
253
	Dim aAppList
254
	arrTree = Split( parTree, UNDERLINE ) 
255
	aAppList = LoadFromSQL ( GetQuery("ApplicationsList.sql") )
256
 
257
	For rootINX = 0 To Ubound( arrRoot ) Step nNumberofProperties
258
		selected = FALSE
259
		If arrTree( 0 ) = arrRoot( inxTNid + rootINX ) Then  selected = TRUE
260
 
261
 
262
		' Render Item
263
		Response.write "<tr>"
264
        Response.write "	<td nowrap><a href='"& arrRoot( inxTNLink + rootINX ) &"?tree="& arrRoot( inxTNid + rootINX ) &"' class='menu_link'>"& Expander ( selected )  &  arrRoot( inxTNImage + rootINX )  &  arrRoot( inxTNName + rootINX )  &"</a></td>"
265
      	Response.write "</tr>"
266
 
267
		If selected Then
268
			' Applications List
269
			For appINX = 0 To Ubound( aAppList ) Step nNumberofProperties
270
				selected = FALSE
271
				If arrTree( 1 ) = aAppList( inxTNid + appINX ) Then  selected = TRUE
272
 
273
 
274
				Response.write "<tr>"
275
		        Response.write "	<td nowrap><a href='Application_Default.asp?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"' class='menu_link'>"& IMG_INDENT1  &  Expander ( selected )  &  aAppList( inxTNImage + appINX )  &  aAppList( inxTNName + appINX )  &"</a></td>"
276
		      	Response.write "</tr>"
277
 
278
 
279
 
280
				If selected Then
281
					' Application Properties
282
					For appPropINX = 0 To Ubound( arrAppProperties ) Step nNumberofProperties
283
						selected = FALSE
284
						If arrTree( 2 ) = arrAppProperties( inxTNid + appPropINX ) Then  selected = TRUE
285
 
286
						Response.write "<tr>"
287
				        Response.write "	<td nowrap><a href='"& arrAppProperties( inxTNLink + appPropINX ) &"?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"_"& arrAppProperties( inxTNid + appPropINX ) &"' class='menu_link'>"& IMG_INDENT2  &  Expander ( selected )  &  arrAppProperties( inxTNImage + appPropINX )   &"<SPAN class='"& SelectorStyle( selected ) &"'>"&  arrAppProperties( inxTNName + appPropINX ) &"</SPAN></a></td>"
288
				      	Response.write "</tr>"
289
 
290
						'If selected Then
291
						'	query = GetQuery( arrAppProperties( inxChildSQL + appPropINX ) )
292
						'	query = Replace( query, ":APP_ID", aAppList( inxTNid + appINX ) )
293
						'	
294
						'	aSQL = LoadFromSQL ( query )
295
						'	
296
						'	If Not IsNull( aSQL ) Then
297
						'		For sqlINX = 0 To Ubound( aSQL ) Step nNumberofProperties
298
						'			Response.write "<tr>"
299
						'	        Response.write "	<td nowrap><a href='"& aSQL( inxTNLink + sqlINX ) &"&app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"_"& arrAppProperties( inxTNid + appPropINX ) &"_"& aSQL( inxTNid + sqlINX ) &"' class='menu_link'>"& IMG_INDENT3  &  Expander ( NULL )  &  aSQL( inxTNImage + sqlINX )  &  aSQL( inxTNName + sqlINX )  &"</a></td>"
300
						'	      	Response.write "</tr>"
301
						'			
302
						'		Next
303
						'	End If
304
						'	
305
						'End If
306
 
307
 
308
					Next
309
 
310
 
311
				End If
312
 
313
 
314
			Next
315
 
316
		End If
317
 
318
 
319
	Next
320
End Sub
321
'--------------------------------------------------------------------------------------------------------------------------------
322
Function SelectorStyle ( bSelected )
323
 
324
	SelectorStyle = "menu_link"
325
 
326
	If bSelected Then
327
		SelectorStyle = "menu_linkselect"
328
	End If
329
 
330
End Function
331
'--------------------------------------------------------------------------------------------------------------------------------
332
'Sub RenderTree ( Node )
333
'	Select Case Node
334
'		Case "ROOT"
335
'			Call NodeRoot ()
336
'		Case "APPLICATION_PROPERTIES"
337
'			Call NodeApplicationProperties ()
338
'		Case "PROPERTY"
339
'			Call NodeApplicationProperty ()
340
'		
341
'	End Select
342
'End Sub
343
'--------------------------------------------------------------------------------------------------------------------------------
344
Sub RenderTree ( sParTree )
345
	Select Case UBound( Split( sParTree, "_" ) )
346
		Case 1
347
			Call NodeApplicationProperties ()
348
		Case 2, 3
349
			Call NodeApplicationProperty ()
350
		Case Else
351
			Call NodeRoot ()
352
	End Select
353
End Sub
354
'--------------------------------------------------------------------------------------------------------------------------------
355
%>
356
<%
357
'------------ RUN BEFORE CONTROL RENDER -------
358
'----------------------------------------------
359
%>
360
<table width="100%"  border="0" cellspacing="0" cellpadding="8">
6 ghuddy 361
  <%If LCASE(SCRIPT_NAME) = "userlist.asp" Then
362
      Response.Write("<form name=""myform"" method=""get"" action="& SCRIPT_NAME &">")
363
    Else
364
      Response.Write("<form name=""myform"" method=""get"" action=""UserAccounts.asp"">")
365
      Call objPMod.StoreParameter("tree", "2")
366
    End If
367
  %>
2 rsolanki 368
  <tr>
369
    <td background="images/bg_drk_bage_pane.gif" nowrap><span class="fav_txt">Find in Access Manager:</span><br>
370
      <input name="filter" type="text" class="form_iname" size="22" value="<%=Request("filter")%>">
371
      <input name="btn" type="submit" class="form_iname" value="Find"></td>
372
  </tr>
6 ghuddy 373
  <%=objPMod.ComposeHiddenTagsWithout("user_id")%>
2 rsolanki 374
  </form>
375
</table>
376
<table width="100%"  border="0" cellspacing="5" cellpadding="0">
377
  <tr>
378
    <td>
379
		<table width="100%"  border="0" cellspacing="2" cellpadding="0">
380
		<%Call RenderTree ( parTree )%>
381
    	</table>
382
	</td>
383
  </tr>
384
</table>
385
<%
386
'------------ RUN AFTER CONTROL RENDER --------
387
'----------------------------------------------
388
%>