Source code of Windows XP (NT5)
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.

258 lines
6.4 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <!-- Document that displays the tree-structured TOC-->
  5. <% if Session("FONTSIZE") = "" then %>
  6. <!--#include file="iito.inc"-->
  7. <% else %>
  8. <%
  9. ' Copyright (c) 1998 Microsoft Corporation
  10. '
  11. ' Module Name:
  12. ' iisrvls.asp
  13. ' Abstract:
  14. ' Displays the tree view list stored by iihd.asp
  15. ' Author:
  16. ' Lara Dillingham (larad)
  17. ' Revision History:
  18. ' 30-Oct-1998 taylorw added support for multi-select
  19. Const STR_SUPPORT_MULTI_SELECT = "hasDHTML"
  20. %>
  21. <!--#include file="iisrvls.str"-->
  22. <!--#include file="iisetfnt.inc"-->
  23. <HTML>
  24. <BODY BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#000000" ALINK="#000000">
  25. <SCRIPT LANGUAGE="JavaScript">
  26. var theList = top.title.nodeList;
  27. var gVars = top.title.Global;
  28. var gListInterface = top.title.nodeListInterface
  29. var listLength = theList.length;
  30. document.write("<TABLE WIDTH='" + gVars.tblWdith + "' BORDER=0><TR><TD>");
  31. for (i=0; i < listLength; i++) {
  32. if (!theList[i].deleted){
  33. theParent=theList[i].parent;
  34. theLevel=theList[i].level;
  35. if (theParent==null) {
  36. writeSelected(theList[i].selected);
  37. }
  38. else{
  39. curParent=theParent;
  40. isOpen=true;
  41. while(isOpen){
  42. if (theList[curParent].parent==null){
  43. isOpen=(theList[curParent].open);
  44. break;
  45. }
  46. if (!theList[curParent].open){
  47. isOpen=false;
  48. break;
  49. }
  50. curParent=theList[curParent].parent;
  51. }
  52. if (isOpen){
  53. writeSelected(theList[i].selected);
  54. }
  55. }
  56. }
  57. }
  58. document.write("</TD></TR></TABLE>");
  59. // This will cause the browser window to activate on IE5.
  60. // To workaround we can just pass in a query string parameter but this
  61. // isn't show-stopped for B3 so we won't do it now.
  62. self.location.href="iisrvls.asp#here";
  63. function writeSelected(isSelected){
  64. writeStr = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>";
  65. for (x=1; x < theLevel; x++) {
  66. gParent=getGrandParent(i,theLevel-x)
  67. if (theList[gParent].lastChild){
  68. writeStr += "<IMG SRC='"+gVars.spaceImg+"' WIDTH=16>";
  69. }
  70. else{
  71. writeStr += "<IMG SRC='"+gVars.lineImg+"' WIDTH=16>";
  72. }
  73. }
  74. writeStr += "</TD><TD>";
  75. if (((i+1) < listLength) && (theList[i+1].parent==i) && (!theList[i+1].deleted) || (!theList[i].isCached)) {
  76. if (theList[i].open){
  77. writeStr += "<A HREF='javascript:expand("+i+")'><IMG SRC='";
  78. if (!theList[i].lastChild){
  79. writeStr += gVars.minusImg;
  80. }
  81. else{
  82. writeStr += gVars.minusImgLast;
  83. }
  84. writeStr += "' WIDTH=16 HEIGHT=18 Border=0 ALT='<%= L_COLLAPSE_TEXT %>'></A>";
  85. }
  86. else{
  87. writeStr += "<A HREF='javascript:expand("+i+")'><IMG SRC='";
  88. if (!theList[i].lastChild){
  89. writeStr += gVars.plusImg;
  90. }
  91. else{
  92. writeStr += gVars.plusImgLast;
  93. }
  94. writeStr += "' WIDTH=16 HEIGHT=18 Border=0 ALT='<%= L_EXPAND_TEXT %>'></A>";
  95. }
  96. }
  97. else{
  98. writeStr += "<IMG SRC='";
  99. if (theList[i].lastChild){
  100. writeStr += gVars.emptyImgLast;
  101. }
  102. else{
  103. writeStr += gVars.emptyImg;
  104. }
  105. writeStr += "' WIDTH=16 HEIGHT=18 Border=0>";
  106. }
  107. writeStr += "</TD>";
  108. if (isSelected){
  109. if( gVars.selCount == 1 )
  110. {
  111. writeStr += "<TD><A NAME='here'></A><A HREF='javascript:editItem("+i+")'";
  112. }
  113. else
  114. {
  115. writeStr += "<TD><A NAME='here'></A><A HREF='javascript:selectItem("+i+")'";
  116. }
  117. <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  118. writeStr += " onClick='handleClickEvent(" + i + ")'";
  119. <% end if %>
  120. writeStr += ">"
  121. if (theList[i].icon !=""){
  122. if (theList[i].isCached){
  123. writeStr += "<IMG BORDER=0 SRC='"+theList[i].icon+theList[i].state+".gif'><IMG BORDER=0 SRC='"+gVars.spaceImg+"' HSPACE="+gVars.hSpace+"></TD>";
  124. }
  125. else{
  126. writeStr += "<IMG BORDER=0 SRC='"+theList[i].icon+theList[i].state+".gif' ALT='<%= L_CACHE_TEXT %>'><IMG BORDER=0 SRC='"+gVars.spaceImg+"' HSPACE="+gVars.hSpace+"></TD>";
  127. }
  128. }
  129. writeStr += "</A></TD>";
  130. writeStr += "<TD BGCOLOR='Silver'>";
  131. writeStr += "<%= sFont("","","",True) %>";
  132. if( gVars.selCount == 1 )
  133. {
  134. writeStr += "<A HREF='javascript:editItem("+i+")'";
  135. }
  136. else
  137. {
  138. writeStr += "<A HREF='javascript:selectItem("+i+")'";
  139. }
  140. <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  141. writeStr += " onClick='handleClickEvent(" + i + ")'";
  142. <% end if %>
  143. writeStr += ">"
  144. writeStr += theList[i].title;
  145. if (theList[i].vtype == "server"){writeStr += " " + gVars.displaystate[theList[i].state];}
  146. writeStr += "</A>"
  147. writeStr += "</TD>";
  148. }
  149. else{
  150. writeStr += "<TD><A HREF='javascript:selectItem("+i+")'";
  151. <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  152. writeStr += " onClick='handleClickEvent(" + i + ")'";
  153. <% end if %>
  154. writeStr += ">"
  155. if (theList[i].icon !=""){
  156. if (theList[i].isCached){
  157. writeStr += "<IMG BORDER=0 SRC='"+theList[i].icon+theList[i].state+".gif'><IMG BORDER=0 SRC='"+gVars.spaceImg+"' HSPACE="+gVars.hSpace+"></TD>";
  158. }
  159. else{
  160. writeStr += "<IMG BORDER=0 SRC='"+theList[i].icon+theList[i].state+".gif' ALT='<%= L_CACHE_TEXT %>'><IMG BORDER=0 SRC='"+gVars.spaceImg+"' HSPACE="+gVars.hSpace+"></TD>";
  161. }
  162. }
  163. writeStr += "</A></TD>";
  164. writeStr += "<TD>";
  165. writeStr += "<%= sFont("","","",True) %>";
  166. writeStr += "<A HREF='javascript:selectItem("+i+")'";
  167. <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  168. writeStr += " onClick='handleClickEvent(" + i + ")'";
  169. <% end if %>
  170. writeStr += ">"
  171. writeStr += theList[i].title;
  172. if (theList[i].vtype == "server"){writeStr += " " + gVars.displaystate[theList[i].state];}
  173. writeStr += "</A></TD>";
  174. }
  175. writeStr += "</TR></TABLE>";
  176. document.write(writeStr);
  177. }
  178. function getGrandParent(item,numLevels){
  179. var theItem=item;
  180. for (z=0; z < numLevels; z++) {
  181. theItem=theList[theItem].parent;
  182. }
  183. return theItem;
  184. }
  185. function expand(item)
  186. {
  187. gListInterface.selectItem(item);
  188. if (theList[item].isCached)
  189. {
  190. theList[item].open=!(theList[item].open);
  191. self.location.href="iisrvls.asp";
  192. }
  193. else
  194. {
  195. theList[item].cache(item);
  196. }
  197. }
  198. function selectItem(item)
  199. {
  200. <% if Not Session(STR_SUPPORT_MULTI_SELECT) then %>
  201. gListInterface.selectItem(item);
  202. <% end if %>
  203. self.location.href="iisrvls.asp";
  204. }
  205. <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  206. function handleClickEvent( item )
  207. {
  208. if( event.ctrlKey )
  209. {
  210. gListInterface.selectMulti(item);
  211. }
  212. else
  213. {
  214. gListInterface.selectItem(item);
  215. }
  216. }
  217. <% end if %>
  218. function editItem(item)
  219. {
  220. if( gVars.selCount == 1 )
  221. {
  222. theList[item].openLocation();
  223. }
  224. }
  225. </SCRIPT>
  226. </BODY>
  227. </HTML>
  228. <% end if %>