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.

377 lines
16 KiB

  1. <% '==================================================
  2. ' Microsoft Server Appliance
  3. '
  4. ' Serves tabs and help links
  5. '
  6. ' Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved.
  7. '================================================== %>
  8. <%
  9. on error resume next
  10. Dim strSourceNameLoc
  11. strSourceNameLoc = "sakitmsg.dll"
  12. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  13. if Err.number <> 0 then
  14. Response.Write "Error in localizing the web content "
  15. Response.End
  16. end if
  17. '-----------------------------------------------------
  18. 'START of localization content
  19. dim L_HELPTOOLTIP_TEXT
  20. dim L_ABOUTLABEL_TEXT
  21. L_HELPTOOLTIP_TEXT = objLocMgr.GetString(strSourceNameLoc,"&H40010023", varReplacementStrings)
  22. L_ABOUTLABEL_TEXT = objLocMgr.GetString(strSourceNameLoc,"&H40010025", varReplacementStrings)
  23. 'End of localization content
  24. '-----------------------------------------------------
  25. Set ObjLocMgr = nothing
  26. '----------------------------------------------------------------------------
  27. '
  28. ' Function : ServeTabBar
  29. '
  30. ' Synopsis : Gets the tabs to display from elementmgr and calls
  31. ' CreateTabHTML to display them.
  32. '
  33. ' Arguments: None
  34. '
  35. ' Returns : None
  36. '
  37. '----------------------------------------------------------------------------
  38. Function ServeTabBar
  39. dim objElements
  40. dim intTabCount, i, intCurTab
  41. dim strActiveTabImage, strInactiveTabImage
  42. dim objItem
  43. dim strArrSource()
  44. dim strArrTabText()
  45. dim strArrTabURL()
  46. dim strArrTabStyle()
  47. dim strArrTabImage()
  48. strActiveTabImage = m_VirtualRoot & "images/light_spacer.gif"
  49. strInactiveTabImage = m_VirtualRoot &"images/dark_spacer.gif"
  50. on Error resume next
  51. Set objElements = GetElements("TABS")
  52. intTabCount = objElements.Count
  53. if Err<>0 then
  54. intTabCount=0
  55. end if
  56. redim strArrSource(intTabCount)
  57. redim strArrTabText(intTabCount)
  58. redim strArrTabURL(intTabCount)
  59. redim strArrTabStyle(intTabCount)
  60. redim strArrTabImage(intTabCount)
  61. intCurTab = GetCurrentTab()
  62. i=0
  63. for each objItem in objElements
  64. strArrSource(i) = objItem.GetProperty("Source")
  65. if Err<>0 then
  66. strArrSource(i) = ""
  67. end if
  68. strArrTabText(i) = GetLocString(strArrSource(i), objItem.GetProperty("CaptionRID"), "")
  69. if Err<>0 then
  70. strArrTabText(i) = ""
  71. end if
  72. strArrTabURL(i) = objItem.GetProperty("URL")
  73. if Err<>0 then
  74. strArrTabURL(i) = ""
  75. else
  76. strArrTabURL(i) = m_VirtualRoot & strArrTabURL(i)
  77. end if
  78. if i=intCurTab then
  79. strArrTabStyle(i) = "ACTIVETAB"
  80. strArrTabImage(i)= strActiveTabImage
  81. else
  82. strArrTabStyle(i) = "INACTIVETAB"
  83. strArrTabImage(i)= strInactiveTabImage
  84. end if
  85. i = i + 1
  86. next
  87. Call CreateTabHTML(i, strArrSource, strArrTabText, strArrTabURL, strArrTabStyle, strArrTabImage)
  88. End Function
  89. '----------------------------------------------------------------------------
  90. '
  91. ' Function : CreateTabHTML
  92. '
  93. ' Synopsis : Generates HTML to display the tabs.
  94. '
  95. ' Arguments: intNumTabs(IN) - number of tab to be displayed
  96. ' strArrSource(IN) - resource dll for each tab string (array)
  97. ' strArrTabText(IN) - text on tab (array)
  98. ' strArrTabURL(IN) - URL for each tab(array)
  99. ' strArrTabStyle(IN) - state of tab - current tab or not(array)
  100. ' strArrTabImage(IN) - image on tab - current tab or not(array)
  101. '
  102. ' Returns : None
  103. '
  104. '----------------------------------------------------------------------------
  105. Function CreateTabHTML(intNumTabs, strArrSource, strArrTabText, strArrTabURL, strArrTabStyle, strArrTabImage)
  106. on error resume next
  107. dim i
  108. dim objElements
  109. dim objItem
  110. dim objLocMgr
  111. dim intCaptionIDNav
  112. dim strCaptionText
  113. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  114. %>
  115. <SCRIPT LANGUAGE="JAVASCRIPT">
  116. function GetTabURL(newTab)
  117. {
  118. var arrTabURL = new Array();
  119. <%
  120. for i = 0 to intNumTabs-1
  121. If Left(Trim(strArrTabURL(i)),1) <> "/" Then
  122. strArrTabURL(i) = "/" & Trim(strArrTabURL(i))
  123. End If
  124. Response.Write "arrTabURL[" & i & "]='" & strArrTabURL(i) & "'; "
  125. Next
  126. %>
  127. return arrTabURL[newTab] + "?Tab=" + newTab + "&R=" + Math.random();
  128. }
  129. function ClickTab(newTab)
  130. {
  131. var arrTabURL = new Array();
  132. <%
  133. for i = 0 to intNumTabs-1
  134. If Left(Trim(strArrTabURL(i)),1) <> "/" Then
  135. strArrTabURL(i) = "/" & Trim(strArrTabURL(i))
  136. End If
  137. Response.Write "arrTabURL[" & i & "]='" & strArrTabURL(i) & "'; "
  138. Next
  139. %>
  140. parent.location = arrTabURL[newTab] + "?Tab=" + newTab + "&R=" + Math.random();
  141. }
  142. function OpenHelpMenu()
  143. {
  144. var winHelp;
  145. var strOptions;
  146. var strIEModalOptions;
  147. var HELPWINNAME = "ExpressNetwork_Help";
  148. var L_ABOUTMENU_TEXT = "<%=EscapeQuotes(L_ABOUTLABEL_TEXT)%>";
  149. var winMenuTarget = top;
  150. var strMenuWidth = 300;
  151. var strMenuLeft;
  152. strOptions = "height=250,width=175,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0";
  153. strOptions += ",left=200,top=50";
  154. strIEModalOptions = "center:1;maximize:0;minimize:0;help:0;status:0;dialogWidth:200px;dialogHeight:290px;resizable:0;";
  155. if (IsIE())
  156. {
  157. if (winMenuTarget.document.readyState!='complete')
  158. {
  159. return;
  160. }
  161. var strMenuHTML;
  162. strMenuLeft = document.body.clientWidth - strMenuWidth - 5;
  163. var divMenu = winMenuTarget.document.all("divMenu");
  164. if (divMenu == null)
  165. {
  166. strMenuHTML = '<div ID="divMenu" class="MENU" nowrap style="position:absolute; left:' + strMenuLeft + '; width:' + strMenuWidth + '; top:30px; visibility:hidden;Filter:revealTrans(duration=0.25,transition=5);"';
  167. strMenuHTML += ' onMouseOut="';
  168. strMenuHTML += "if (window.event.clientX < this.offsetLeft || window.event.clientX >= this.offsetLeft+this.offsetWidth || window.event.clientY > this.offsetTop + this.offsetHeight) this.style.display='none';" + '"';
  169. strMenuHTML += ' onkeydown="';
  170. strMenuHTML += "if (window.event.keyCode == 27) { this.style.display='none';} " + '"' ;
  171. strMenuHTML += '>';
  172. <%
  173. Set objElements = GetElements("MS_Help")
  174. for Each objItem in objElements
  175. intCaptionIDNav = "&H" & objItem.GetProperty("CaptionRID")
  176. strSourceName = ""
  177. strSourceName = objItem.GetProperty ("Source")
  178. If strSourceName = "" Then
  179. strSourceName = "svrapp"
  180. End If
  181. strCaptionText = objLocMgr.GetString(strSourceName, intCaptionIDNav, varReplacementStrings)
  182. If strCaptionText <> "" Then
  183. %>
  184. strMenuHTML += '<a href="' + top.location + '"' +
  185. 'onfocus="x.className=' + "'" + "MENUhover" + "'" + ';" ' +
  186. 'onblur="x.className=' + "'" + "MENU" + "'" + ';" ' +
  187. 'onkeydown = "if (window.event.keyCode == 13) {window.open(' + "'" + '<% =objItem.GetProperty("URL") %>' + "'" + ');}"' +
  188. '>';
  189. strMenuHTML += '<div ID="x" class="MENU" onMouseOver="this.className=' + "'" + "MENUhover" + "'" + ';" onMouseOut="this.className=' + "'" + "MENU" + "'" + ';" onClick="window.open(' + "'" + '<%=m_VirtualRoot%>' + '<% =objItem.GetProperty("URL") %>' + "'" + ');">';
  190. strMenuHTML += '&nbsp;<%=EscapeQuotes(strCaptionText)%></div></A>';
  191. strMenuHTML += '<div style="font-size:1px;line-height:1;background-color:#FFFFFF;width:100%">&nbsp;</div>';
  192. <%
  193. End If
  194. Next
  195. Set objElements = Nothing
  196. Set objItem = Nothing
  197. %>
  198. strMenuHTML += '<a href="' + top.location + '" ' +
  199. 'onfocus="spanHelp2.className=' + "'" + "MENUhover" + "'" + ';" ' +
  200. 'onblur="spanHelp2.className=' + "'" + "MENU" + "'" + ';" ' +
  201. 'onkeydown = "if (window.event.keyCode == 13) {window.open(' + "'" + "<%=m_VirtualRoot%>about.asp'" + ', ' + "'about_asp'" + ',' + 'height=400,width=560,left=30,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0' + ' ); }" ' +
  202. '>'+
  203. '<div ' +
  204. 'class="MENU" ' +
  205. 'ID="spanHelp2" ' +
  206. 'onMouseOver="this.className=' + "'" + "MENUhover" + "'" + ';" ' +
  207. 'onMouseOut="this.className=' + "'" + "MENU" + "'" + ';" ' +
  208. 'onClick="window.open(';
  209. strMenuHTML += "'<%=m_VirtualRoot%>about.asp','about_asp','height=400,width=560,left=30,top=15,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0'";
  210. strMenuHTML += ');">&nbsp;' + L_ABOUTMENU_TEXT + '</div></A>';
  211. strMenuHTML += '</div>';
  212. strMenuHTML += '<IFRAME ID=launchWin WIDTH=10 HEIGHT=10 style="display:none;" SRC=""></IFRAME>';
  213. winMenuTarget.document.body.insertAdjacentHTML('beforeEnd',strMenuHTML); // beforeEnd
  214. divMenu = winMenuTarget.document.all("divMenu");
  215. }
  216. else
  217. {
  218. divMenu.style.left=strMenuLeft;
  219. divMenu.style.display="";
  220. }
  221. divMenu.style.left = document.body.clientWidth - divMenu.clientWidth - 5;
  222. divMenu.style.visibility = "visible";
  223. divMenu.focus();
  224. }
  225. else
  226. {
  227. // Navigator code
  228. document.menu.moveTo(window.innerWidth - 265, 35);
  229. document.menu.visibility = "show";
  230. }
  231. }
  232. </SCRIPT>
  233. <table CLASS=TABBAR border="0" cellpadding="0" cellspacing="0" width="100%" height=50 >
  234. <TR >
  235. <td valign=bottom width=100%>
  236. <table CLASS=TABBAR border="0" cellpadding="0" cellspacing="0" width="100%">
  237. <tr>
  238. <TD CLASS=TABBAR WIDTH="15" NOWRAP>&nbsp;</TD>
  239. <%if intNumTabs=0 then%>
  240. <TD NOWRAP BGCOLOR="#000000" CLASS="TABLINK">
  241. --------
  242. </TD>
  243. <%else%>
  244. <% for i=0 to intNumTabs-1 step 1 %>
  245. <TD HEIGHT="25" ALIGN="left" VALIGN="MIDDLE" NOWRAP CLASS="<%=strArrTabStyle(i)%>">
  246. <A HREF="" CLASS="<%=strArrTabStyle(i)%>" onclick="ClickTab(<%=i%>); return false;" onMouseOver="window.status=''; return true;">&nbsp;&nbsp;<%=strArrTabText(i)%></A>
  247. </TD>
  248. <TD CLASS="<%=strArrTabStyle(i)%>">
  249. <IMG SRC="<%=strArrTabImage(i)%>" border=0>
  250. </TD>
  251. <TD CLASS=TABBAR WIDTH="5" NOWRAP>&nbsp;</TD>
  252. <% next %>
  253. <TD CLASS=TABBAR NOWRAP VALIGN="middle" ALIGN="center" WIDTH="100%">&nbsp;</TD>
  254. <%end if%>
  255. </tr></table></td>
  256. <td>
  257. <table CLASS=TABBAR border="0" cellpadding="0" cellspacing="0" width="100%" height=50 >
  258. <tr>
  259. <TD CLASS=TABBAR NOWRAP VALIGN="middle" ALIGN="right" class="tablink">
  260. <A HREF=""
  261. class="TABLINK"
  262. title="<%=L_HELPTOOLTIP_TEXT%>"
  263. onClick="OpenHelpMenu(); return false;"
  264. onMouseOver="window.status='<%=EscapeQuotes(L_HELPTOOLTIP_TEXT)%>'; return true;">
  265. <IMG SRC="<%=m_VirtualRoot%>images/help_about.gif" BORDER=0 HEIGHT=22 WIDTH=22>
  266. </A>
  267. &nbsp;&nbsp;
  268. <A HREF="http://www.microsoft.com/windows/serverappliance" TARGET="_blank">
  269. <IMG SRC="<%=m_VirtualRoot%>images/winnte_logo.gif" BORDER=0 HEIGHT=45></A>
  270. &nbsp;
  271. </TD>
  272. </TR>
  273. </table></td></tr>
  274. <tr CLASS=ACTIVETAB>
  275. <TD WIDTH="15" HEIGHT="6" NOWRAP><font size=-4>&nbsp;</font></TD>
  276. <TD HEIGHT="6" NOWRAP><font size=-4>&nbsp;</font></TD>
  277. </TR>
  278. </table>
  279. <% if not isIE() then %>
  280. <layer bgcolor="#999966" ID="x" name="menu" left=100 top=0 width="300px" class="MENU" nowrap visibility="hide" z-Index="9"
  281. onMouseOut="BlurLayer()" onkeydown="'if (window.event.keyCode == 27) BlurLayer()">
  282. <%
  283. Set objElements = GetElements("MS_Help")
  284. for Each objItem in objElements
  285. intCaptionIDNav = "&H" & objItem.GetProperty("CaptionRID")
  286. strSourceName = ""
  287. strSourceName = objItem.GetProperty ("Source")
  288. If strSourceName = "" Then
  289. strSourceName = "svrapp"
  290. End If
  291. strCaptionText = objLocMgr.GetString(strSourceName, intCaptionIDNav, varReplacementStrings)
  292. If strCaptionText <> "" Then
  293. %>
  294. <a href="#" onfocus=""spanHelp2.className='MENUhover'" onblur="spanHelp2.className='MENU'"
  295. onkeydown = "if (window.event.keyCode == 13) window.open('<%=m_VirtualRoot%><%=objItem.GetProperty("URL")%>');"
  296. class="MENU" ID="spanHelp2" onMouseOver="this.className='MENUhover'"
  297. onMouseOut="this.className='MENU'"
  298. onClick="window.open('<%=m_VirtualRoot%><%=objItem.GetProperty("URL")%>');">
  299. <%=strCaptionText%>
  300. </a>
  301. <%
  302. End If
  303. Next
  304. Set objElements = Nothing
  305. Set objItem = Nothing
  306. %>
  307. <a href="#" onfocus="spanHelp2.className='MENUhover'" onblur="spanHelp2.className='MENU'"
  308. onkeydown = "if (window.event.keyCode == 13) window.open('/about.asp');"
  309. class="MENU" ID="spanHelp2" onMouseOver="this.className='MENUhover'"
  310. onMouseOut="this.className='MENU'"
  311. onClick="window.open('<%=m_VirtualRoot%>about.asp','about_asp','height=400,width=560,left=30,top=15,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0');">
  312. <%=L_ABOUTLABEL_TEXT %></a>
  313. </layer>
  314. <% end if%>
  315. <%
  316. End Function
  317. '----------------------------------------------------------------------------
  318. '
  319. ' Function : GetCurrentTab
  320. '
  321. ' Synopsis : Return index of current tab
  322. '
  323. ' Arguments: None
  324. '
  325. ' Returns : Zero-based index of current tab
  326. '
  327. '----------------------------------------------------------------------------
  328. Function GetCurrentTab
  329. dim intTab
  330. intTab = Request.QueryString("Tab")
  331. if (intTab = "") then
  332. intTab=0
  333. end if
  334. GetCurrentTab = CInt(intTab)
  335. End Function
  336. %>