home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iisrvls.asp < prev    next >
Text File  |  1997-11-12  |  6KB  |  217 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <!-- Document that displays the tree-structured TOC-->
  6. <% 
  7. Const L_CACHE_TEXT=""
  8. Const L_CONNECTED_TEXT="(connected)"
  9. Const L_EXPAND_TEXT="+"
  10. Const L_COLLAPSE_TEXT="-"
  11.  
  12.  
  13. %>
  14.  
  15. <HTML>
  16. <BODY BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#000000" ALINK="#000000">
  17.  
  18.  
  19. <SCRIPT LANGUAGE="JavaScript">
  20.     var theList=top.title.nodeList;
  21.     var gVars=top.title.Global;
  22.     var listLength=theList.length; 
  23.     document.write("<TABLE  WIDTH='" + gVars.tblWdith + "' BORDER=0><TR><TD>");
  24.  
  25.     for (i=0; i < listLength; i++) {
  26.         if (!theList[i].deleted){
  27.             theParent=theList[i].parent;
  28.             theLevel=theList[i].level;
  29.     
  30.             if (theParent==null) {
  31.                 writeSelected(theList[i].selected);    
  32.             }
  33.             else{
  34.                 curParent=theParent;
  35.                 isOpen=true;
  36.                 while(isOpen){
  37.                     if (theList[curParent].parent==null){
  38.                         isOpen=(theList[curParent].open);
  39.     
  40.                         break;
  41.                     }
  42.                     if (!theList[curParent].open){
  43.                         isOpen=false;
  44.                         break;
  45.                     }
  46.                     curParent=theList[curParent].parent;
  47.                 }
  48.     
  49.                 if (isOpen){    
  50.     
  51.                     writeSelected(theList[i].selected);    
  52.                 }
  53.             }
  54.         }
  55.  
  56.         
  57.     }
  58.     document.write("</TD></TR></TABLE>");
  59.     
  60.     <% if not Session("IsIE") then %>
  61.         <% if not Session("IsMac") then %>
  62.         self.location.href = "iisrvls.asp#here"
  63.         <% end if %>
  64.     <% end if %>
  65.  
  66.     function writeSelected(isSelected){
  67.         writeStr = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>";
  68.  
  69.         for (x=1; x < theLevel; x++) {
  70.  
  71.             gParent=getGrandParent(i,theLevel-x)
  72.             if (theList[gParent].lastChild){
  73.                 writeStr += "<IMG SRC='"+gVars.spaceImg+"' WIDTH=16>";
  74.             }
  75.             else{        
  76.                 writeStr += "<IMG SRC='"+gVars.lineImg+"' WIDTH=16>";
  77.             }
  78.         }
  79.  
  80.         writeStr += "</TD><TD>";
  81.  
  82.         if (((i+1) < listLength) && (theList[i+1].parent==i) && (!theList[i+1].deleted) || (!theList[i].isCached)) {
  83.             if (theList[i].open){
  84.                 writeStr += "<A HREF='javascript:expand("+i+")'><IMG SRC='";
  85.                 if (!theList[i].lastChild){
  86.                     writeStr += gVars.minusImg;    
  87.                 }
  88.                 else{
  89.                     writeStr += gVars.minusImgLast;    
  90.                 }
  91.                 writeStr += "' WIDTH=16 HEIGHT=18 Border=0 ALT='<%= L_COLLAPSE_TEXT %>'></A>";
  92.             }
  93.             else{
  94.                 writeStr += "<A HREF='javascript:expand("+i+")'><IMG SRC='";
  95.                 if (!theList[i].lastChild){
  96.                 writeStr += gVars.plusImg;
  97.                 }
  98.                 else{
  99.                     writeStr += gVars.plusImgLast;
  100.                 }
  101.                 writeStr += "' WIDTH=16 HEIGHT=18  Border=0 ALT='<%= L_EXPAND_TEXT %>'></A>";
  102.             }
  103.         }
  104.         else{
  105.             writeStr += "<IMG SRC='";
  106.             if (theList[i].lastChild){
  107.                 writeStr += gVars.emptyImgLast;    
  108.             }
  109.             else{
  110.                 writeStr += gVars.emptyImg;    
  111.             }
  112.             writeStr += "' WIDTH=16 HEIGHT=18 Border=0>";            
  113.         }
  114.  
  115.         writeStr += "</TD>";
  116.  
  117.  
  118.         if (isSelected){
  119.             writeStr += "<TD><A NAME='here'></A><A HREF='javascript:editItem("+i+")'>";
  120.             if (theList[i].icon !=""){
  121.  
  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='"+gVars.selTColor+"'>";
  131.             writeStr += "<FONT FACE="+gVars.face+" SIZE="+gVars.fSize+" COLOR='"+gVars.selFColor+"'>";
  132.             writeStr += "<A HREF='javascript:editItem("+i+")'>";
  133.             writeStr += theList[i].title;
  134.             if (theList[i].vtype == "server"){writeStr += " " + gVars.displaystate[theList[i].state];}
  135.             writeStr += "</A></TD>";
  136.         }
  137.         else{
  138.             writeStr += "<TD><A HREF='javascript:selectItem("+i+")'>";
  139.             if (theList[i].icon !=""){
  140.                 if (theList[i].isCached){
  141.                     writeStr += "<IMG BORDER=0 SRC='"+theList[i].icon+theList[i].state+".gif'><IMG BORDER=0 SRC='"+gVars.spaceImg+"' HSPACE="+gVars.hSpace+"></TD>";
  142.                 }
  143.                 else{
  144.                     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>";
  145.                 }
  146.             }
  147.             writeStr += "</A></TD>";
  148.             
  149.             writeStr += "<TD>";
  150.             writeStr += "<FONT FACE="+gVars.face+" SIZE="+gVars.fSize+" COLOR='"+gVars.selFColor+"'>";
  151.             writeStr += "<A HREF='javascript:selectItem("+i+")'>";
  152.             writeStr += theList[i].title;
  153.             if (theList[i].vtype == "server"){writeStr += " " + gVars.displaystate[theList[i].state];}
  154.             writeStr += "</A></TD>";
  155.         }
  156.  
  157.  
  158.         writeStr += "</TR></TABLE>";
  159.         
  160.         document.write(writeStr);
  161.     }
  162.  
  163.     function getGrandParent(item,numLevels){
  164.         var theItem=item;
  165.         for (z=0; z < numLevels; z++) {
  166.             theItem=theList[theItem].parent;    
  167.         }
  168.         
  169.         return theItem;
  170.     }
  171.  
  172.     function expand(item){
  173.         if (theList[item].isCached){
  174.             theList[item].open=!(theList[item].open);
  175.             selectItem(item);
  176.             self.location.href=self.location.href;
  177.         }
  178.         else{
  179.             theList[gVars.selId].selected=false;
  180.             gVars.selId=item;
  181.             theList[item].selected=true;
  182.             theList[item].cache(item);
  183.         }
  184.         
  185.     }
  186.  
  187.     function selectItem(item){
  188.             
  189.             theList[gVars.selId].selected=false;
  190.             gVars.selId=item;
  191.             theList[item].selected=true;
  192.             <% if Session("isAdmin") then %>
  193.  
  194.             if (theList[item].stype=="ftp"){
  195.                 top.body.menu.document.mnuform.SvcType.options.selectedIndex=1;
  196.             }
  197.             else{
  198.                 top.body.menu.document.mnuform.SvcType.options.selectedIndex=0;            
  199.             }
  200.             <% end if %>
  201.             
  202.             <% if Session("Browser") = "IE3" then %>        
  203.                 self.location.href="iisrvls.asp#here";
  204.             <% else %>
  205.                 self.location.href="iisrvls.asp";            
  206.             <% end if %>
  207.             
  208.     }
  209.  
  210.     function editItem(item){
  211.         theList[item].openLocation();
  212.     }
  213.     
  214. </SCRIPT>
  215. </BODY>
  216. </HTML>
  217.