Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

346 lines
10 KiB

  1. <%@ LANGUAGE="VBSCRIPT"%>
  2. <%Response.Expires = 0%>
  3. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HEAD>
  4. <META HTTP-EQUIV="Content-Type"
  5. CONTENT="text/html; CHARSET=iso-8859-1">
  6. <META NAME="GENERATOR"
  7. CONTENT="Microsoft Frontpage 2.0">
  8. <HEAD>
  9. <TITLE>Tasks Page</TITLE>
  10. <%
  11. Dim objTask
  12. Dim objTaskCol
  13. Dim objLocMgr
  14. Dim strCaption
  15. Dim strTaskSrc
  16. Dim strTaskUrl
  17. Dim strCaptionRID
  18. Dim intCaptionID
  19. Dim varReplacementStrings
  20. Dim strTasks
  21. Dim strTaskLinks
  22. On Error Resume Next
  23. Dim objRetriever
  24. Err.Clear
  25. 'Get the values sent by main page and store them in session variables
  26. Dim strCurrentPage
  27. Dim strPageCount
  28. Dim strFocusItem
  29. strCurrentPage = Request.QueryString("CurrentPage")
  30. strPageCount = Request.QueryString("PageCount")
  31. strFocusItem = Request.QueryString("FocusItem")
  32. If strCurrentPage <> "" Then
  33. Session("Main_CurrentPage") = strCurrentPage
  34. End If
  35. If strPageCount <> "" Then
  36. Session("Main_PageCount") = strPageCount
  37. End If
  38. If strFocusItem <> "" Then
  39. Session("Main_FocusItem") = strFocusItem
  40. End If
  41. 'reset the focus for network page
  42. Session("Network_FocusItem") = ""
  43. 'reset the hostname value for hostname page
  44. Session("Hostname_Hostname") = ""
  45. Set objRetriever = Server.CreateObject("Elementmgr.ElementRetriever")
  46. Set objTaskCol = objRetriever.GetElements(1, "LOCAL_UI_TASKS")
  47. If objTaskCol.Count=0 or Err.Number <> 0 Then
  48. Err.Clear
  49. Else
  50. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  51. strTasks = ""
  52. strTaskLinks = ""
  53. For Each objTask in objTaskCol
  54. strTaskSrc = ""
  55. strTaskUrl = ""
  56. strTaskSrc = objTask.GetProperty("Source")
  57. strTaskUrl = objTask.GetProperty("URL")
  58. strCaptionRID = objTask.GetProperty("CaptionRID")
  59. strCaption = ""
  60. intCaptionID = 0
  61. intCaptionID = "&H" & strCaptionRID
  62. strCaption = objLocMgr.GetString(strTaskSrc, intCaptionID, varReplacementStrings)
  63. If strCaption <> "" and strTaskUrl <> "" Then
  64. strTasks = strTasks & "<option>" & strCaption
  65. strTaskLinks = strTaskLinks & "<option>" & strTaskUrl
  66. End If
  67. Next
  68. End If
  69. Set objLocMgr = Nothing
  70. Set objTask = Nothing
  71. Set objTaskCol = Nothing
  72. %>
  73. <SCRIPT LANGUAGE="VBScript">
  74. <!--
  75. Option Explicit
  76. public iTaskCount
  77. public iPageCount
  78. public iCurrentPage
  79. public iCurrentTask
  80. public iIdleTimeOut
  81. Sub window_onload()
  82. Dim iOffSet
  83. Dim iFocus
  84. Dim objKeypad
  85. Set objKeypad = CreateObject("Ldm.SAKeypadController")
  86. objKeypad.Setkey 0,9,TRUE
  87. objKeypad.Setkey 1,9,FALSE
  88. objKeypad.Setkey 2,37,FALSE
  89. objKeypad.Setkey 3,39,FALSE
  90. objKeypad.Setkey 4,27,FALSE
  91. objKeypad.Setkey 5,13,FALSE
  92. Set objKeypad = Nothing
  93. iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
  94. iTaskCount = tasks.length
  95. iPageCount = (iTaskCount-1)\5 + 1
  96. if CurrentPage.value<> "" Then
  97. iCurrentPage = CInt(CurrentPage.value)
  98. Else
  99. iCurrentPage = 0
  100. End If
  101. if CurrentTask.value<> "" Then
  102. iCurrentTask = CInt(CurrentTask.value)
  103. Else
  104. iCurrentTask = 0
  105. End If
  106. if FocusItem.value<> "" Then
  107. iFocus = CInt(FocusItem.value)
  108. Else
  109. iFocus = 0
  110. End If
  111. If iTaskCount > 0 Then
  112. indicator.style.display = ""
  113. indicator.style.top = iCurrentTask * 10
  114. If iPageCount > 1 Then
  115. PageInfo.style.display = ""
  116. PageInfo.innertext = (iCurrentPage+1)&" of "&(iPageCount)
  117. End If
  118. iOffSet = iCurrentPage * 5
  119. task1.innertext = Tasks.options(iOffSet).text
  120. task1.hRef = TaskLinks.options(iOffSet).text
  121. iOffSet = iOffSet + 1
  122. If iOffSet < iTaskCount Then
  123. task2.innertext = Tasks.options(iOffSet).text
  124. task2.hRef = TaskLinks.options(iOffSet).text
  125. End If
  126. iOffSet = iOffSet + 1
  127. If iOffSet < iTaskCount Then
  128. task3.innertext = Tasks.options(iOffSet).text
  129. task3.hRef = TaskLinks.options(iOffSet).text
  130. End If
  131. iOffSet = iOffSet + 1
  132. If iOffSet < iTaskCount Then
  133. task4.innertext = Tasks.options(iOffSet).text
  134. task4.hRef = TaskLinks.options(iOffSet).text
  135. End If
  136. iOffSet = iOffSet + 1
  137. If iOffSet < iTaskCount Then
  138. task5.innertext = Tasks.options(iOffSet).text
  139. task5.hRef = TaskLinks.options(iOffSet).text
  140. End If
  141. If iFocus = 0 Then
  142. task1.focus
  143. End If
  144. If iFocus = 1 Then
  145. task2.focus
  146. End If
  147. If iFocus = 2 Then
  148. task3.focus
  149. End If
  150. If iFocus = 3 Then
  151. task4.focus
  152. End If
  153. If iFocus = 4 Then
  154. task5.focus
  155. End If
  156. End If
  157. End Sub
  158. Sub ArrowVisible(intIndex)
  159. FocusItem.value = intIndex
  160. indicator.style.top = intIndex * 10 + 1
  161. CurrentTask.value = intIndex
  162. End Sub
  163. Sub keydown()
  164. window.clearTimeOut(iIdleTimeOut)
  165. iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
  166. Dim iOffSet
  167. If iPageCount > 1 and (window.event.keycode = 39 or window.event.keycode = 37) Then
  168. 'right arrow
  169. If window.event.keycode = 39 Then
  170. iCurrentPage = iCurrentPage + 1
  171. If iCurrentPage = iPageCount Then
  172. iCurrentPage = 0
  173. End If
  174. PageInfo.innertext = (iCurrentPage+1)&" of "&(iPageCount)
  175. End If
  176. If window.event.keycode = 37 Then
  177. iCurrentPage = iCurrentPage - 1
  178. If iCurrentPage = -1 Then
  179. iCurrentPage = iPageCount-1
  180. End If
  181. PageInfo.innertext = (iCurrentPage+1)&" of "&(iPageCount)
  182. End If
  183. iCurrentTask = 0
  184. CurrentPage.value = iCurrentPage
  185. CurrentTask.value = iCurrentTask
  186. iOffSet = iCurrentPage * 5
  187. task1.innertext = Tasks.options(iOffSet).text
  188. task1.hRef = TaskLinks.options(iOffSet).text
  189. iOffSet = iOffSet + 1
  190. If iOffSet < iTaskCount Then
  191. task2.innertext = Tasks.options(iOffSet).text
  192. task2.hRef = TaskLinks.options(iOffSet).text
  193. End If
  194. iOffSet = iOffSet + 1
  195. If iOffSet < iTaskCount Then
  196. task3.innertext = Tasks.options(iOffSet).text
  197. task3.hRef = TaskLinks.options(iOffSet).text
  198. End If
  199. iOffSet = iOffSet + 1
  200. If iOffSet < iTaskCount Then
  201. task4.innertext = Tasks.options(iOffSet).text
  202. task4.hRef = TaskLinks.options(iOffSet).text
  203. End If
  204. iOffSet = iOffSet + 1
  205. If iOffSet < iTaskCount Then
  206. task5.innertext = Tasks.options(iOffSet).text
  207. task5.hRef = TaskLinks.options(iOffSet).text
  208. End If
  209. End If
  210. If window.event.keycode = 27 Then
  211. window.navigate "localui_main.asp"
  212. End If
  213. End Sub
  214. Sub IdleHandler()
  215. window.navigate "localui_main.asp"
  216. End Sub
  217. Sub GotoTask(iTaskID)
  218. Dim strLink
  219. If iTaskID = 1 Then
  220. strLink = Task1.hRef
  221. ElseIf iTaskID = 2 Then
  222. strLink = Task2.hRef
  223. ElseIf iTaskID = 3 Then
  224. strLink = Task3.hRef
  225. ElseIf iTaskID = 4 Then
  226. strLink = Task4.hRef
  227. ElseIf iTaskID = 5 Then
  228. strLink = Task5.hRef
  229. End If
  230. If strLink <> "" Then
  231. window.event.returnValue = false
  232. strLink = strLink+"?CurrentPage="+CurrentPage.value+"&"+"CurrentTask="+CurrentTask.value+"&"+"FocusItem="+FocusItem.value
  233. window.navigate strLink
  234. End If
  235. End Sub
  236. -->
  237. </SCRIPT>
  238. </HEAD>
  239. <body RIGHTMARGIN=0 LEFTMARGIN=0 onkeydown="keydown">
  240. <select id="tasks" STYLE="display:none;">
  241. <%=strTasks%>
  242. </select>
  243. <select id="tasklinks" STYLE="display:none;">
  244. <%=strTaskLinks%>
  245. </select>
  246. <IMG id="indicator" STYLE="position:absolute; top:0; left=0; display:none;"
  247. SRC="localui_indicator.bmp" BORDER=0>
  248. <A STYLE="position:absolute; top:0; left:10; font-size:10; font-family=arial;" OnClick="GotoTask(1)"
  249. id="Task1" OnFocus="ArrowVisible(0)" HIDEFOCUS=true onkeydown="keydown">
  250. </A>
  251. <A STYLE="position:absolute; top:10; left:10; font-size:10; font-family=arial;" OnClick="GotoTask(2)"
  252. id="Task2" OnFocus="ArrowVisible(1)" HIDEFOCUS=true onkeydown="keydown">
  253. </A>
  254. <A STYLE="position:absolute; top:20; left:10; font-size:10; font-family=arial;" OnClick="GotoTask(3)"
  255. id="Task3" OnFocus="ArrowVisible(2)" HIDEFOCUS=true onkeydown="keydown">
  256. </A>
  257. <A STYLE="position:absolute; top:30; left:10; font-size:10; font-family=arial;" OnClick="GotoTask(4)"
  258. id="Task4" OnFocus="ArrowVisible(3)" HIDEFOCUS=true onkeydown="keydown">
  259. </A>
  260. <A STYLE="position:absolute; top:40; left:10; font-size:10; font-family=arial;" OnClick="GotoTask(5)"
  261. id="Task5" OnFocus="ArrowVisible(4)" HIDEFOCUS=true onkeydown="keydown">
  262. </A>
  263. <A STYLE="position:absolute; top:50; right:0; font-size:10; font-family=arial; display:none;"
  264. id="PageInfo">
  265. </A>
  266. <INPUT TYPE=HIDDEN Name="CurrentPage" value="<%=Session("Task_CurrentPage")%>">
  267. <INPUT TYPE=HIDDEN Name="CurrentTask" value="<%=Session("Task_CurrentTask")%>">
  268. <INPUT TYPE=HIDDEN Name="FocusItem" value="<%=Session("Task_FocusItem")%>">
  269. </body>
  270. </html>