home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / alpha / iifilthd.asp < prev    next >
Text File  |  1999-10-14  |  8KB  |  326 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. Const L_ENTERINTEGER_ERRORMESSAGE = "整数を入力してください"
  11. Const L_FILTERS_TEXT = "ISAPI フィルタ"
  12. Const L_FILTERORDER_TEXT = "ここでインストールされたフィルタはこの Web サイトでのみアクティブです。次に一覧表示された順番でフィルタを実行します:"
  13. Const L_FILTER_TEXT = "フィルタ"
  14. Const L_STATUS_TEXT = "状態"
  15. Const L_EXE_TEXT = "実行可能"
  16. Const L_PRIORITY_TEXT = "優先順位"
  17. Const L_ACCESSDENIED_TEXT = "アクセスは拒否されました" 
  18. Const L_HIGH_TEXT = "高"
  19. Const L_MEDIUM_TEXT = "中"
  20. Const L_LOW_TEXT = "低"
  21. Const L_SELECTITEM_TEXT = "削除するフィルタを選択してください。"
  22.  
  23. Const L_LOADED_TEXT = "読み込み済み"
  24. Const L_LOADING_TEXT = "読み込み中"
  25. Const L_UNLOADED_TEXT = "アンロード済み"
  26. Const L_UNLOADING_TEXT = "アンロード中"
  27.  
  28.  
  29. On Error Resume Next 
  30.  
  31. Dim path, currentobj
  32.  
  33. path = Session("spath")
  34. Session("path") = Session("spath")
  35. Set currentobj = GetObject(path)
  36. Session("SpecObj")=path & "/Filters"
  37. Session("SpecProps")=""
  38.  
  39. function heading(width,thestring)
  40.     Dim i
  41.     width = width - len(thestring)
  42.     for i = width to 0 step -1
  43.         thestring = thestring & " "
  44.     Next
  45.     heading = thestring
  46. end function
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  %>
  53.  
  54. <!--#include file="iiset.inc"-->
  55.  
  56. <HTML>
  57. <HEAD>
  58.     <TITLE></TITLE>
  59.     <FONT SIZE=2>
  60.  
  61. <SCRIPT LANGUAGE="JavaScript">
  62.     top.title.Global.helpFileName="iipy_31";
  63.     top.title.Global.siteProperties = true;
  64.  
  65.     function SetList(){
  66.         self.location.href = "iiapphd.asp"
  67.     }
  68.  
  69.     function isNum(txtcntrl) {
  70.         str = txtcntrl.value;
  71.         for (var i = 0; i < str.length; i++) {
  72.               var ch = str.substring(i, i + 1);
  73.               if ((ch < "0" || "9" < ch) && ch != ',') {
  74.                    alert("整数を入力してください。");
  75.                 txtcntrl.focus()
  76.             return false;
  77.               }
  78.          }
  79.         return true;
  80.     }
  81.     
  82.  
  83.  
  84.     function disableDefault(dir,fromCntrl, toCntrl){
  85.         if (!dir){
  86.             if (fromCntrl.value != ""){
  87.                 toCntrl.value = fromCntrl.value;
  88.                 fromCntrl.value = "";
  89.             }
  90.         }
  91.         else{
  92.             if (toCntrl.value != ""){
  93.                 fromCntrl.value = toCntrl.value;
  94.                 toCntrl.value = "";
  95.             }
  96.         }
  97.     }
  98.  
  99.     function enableDefault(chkCntrl){
  100.         chkCntrl.checked = true;
  101.     }
  102.  
  103. </SCRIPT>
  104. </HEAD>
  105.  
  106. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" onLoad="loadList();" LINK="#000000" VLINK="#000000" STYLE="font-size:10pt;">
  107. <FORM NAME="userform" onSubmit="return false"><FONT SIZE=2>
  108. <B><%= L_FILTERS_TEXT %></B><P>
  109.  
  110. <%= L_FILTERORDER_TEXT %><P>
  111.  
  112. <TABLE BORDER = 1 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#CCCCCC" BORDERCOLORLIGHT="#CCCCCC"  CELLPADDING = 2 CELLSPACING = 0>
  113. <TR>
  114. <TD WIDTH = 70 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000"><FONT SIZE=2>
  115.  
  116.         <%= heading(0,L_STATUS_TEXT) %>
  117.  
  118. </TD>
  119. <TD WIDTH = 70 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000"><FONT SIZE=2>
  120.  
  121.         <%= heading(0,L_PRIORITY_TEXT) %>
  122.  
  123. </TD>
  124. <TD WIDTH = 110 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" ><FONT SIZE=2>
  125.  
  126.         <%= heading(5,L_FILTER_TEXT) %>
  127.  
  128. </TD>
  129. <TD WIDTH = 226 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000"><FONT SIZE=2>
  130.  
  131.         <%= heading(5,L_EXE_TEXT) %>
  132.  
  133. </TD>
  134. </TR>
  135. </TABLE>
  136.  
  137. <SCRIPT LANGUAGE="JavaScript">
  138.  
  139.     function loadList(){
  140.         parent.list.location.href = "iifiltls.asp";
  141.     }
  142.  
  143.  
  144.     function moveItem(dir){
  145.         sel = eval(listFunc.sel);
  146.         if (sel > -1){
  147.             if (!cachedList[sel].deleted){
  148.                 if ((sel + dir >= 0) && (sel + dir < (cachedList.length))){                
  149.                     cachedList[sel].id += dir;
  150.                     cachedList[sel].updated = true;
  151.                     sel += dir;
  152.                     cachedList[sel].id -= dir;
  153.                 
  154.                     listFunc.sel = sel;
  155.                     cachedList.sort(sortOrder);
  156.                     loadList();
  157.                 }
  158.             }
  159.         }
  160.     }
  161.     
  162.     function sortOrder(a,b){
  163.         x=a.id - b.id
  164.         return x
  165.     }
  166.     
  167.  
  168.     function addItem(){
  169.         i = cachedList.length   
  170.         cachedList[i] = new listObj(i,"新規フィルタ", 4, "", "","");
  171.         cachedList[i].newitem = true;
  172.         cachedList[i].updated = true;
  173.         listFunc.sel = i;
  174.         loadList();
  175.     }
  176.  
  177.     function delItem(){
  178.         sel = eval(listFunc.sel);
  179.         if (sel < 0){
  180.             alert("<%= L_SELECTITEM_TEXT %>");
  181.         }
  182.         else{
  183.             cachedList[sel].deleted = true;
  184.             cachedList[sel].updated = true;
  185.             sel = sel-1;
  186.             
  187.             <% 'run through the list to find the Next non-deleted item %>
  188.             loadList();
  189.         }
  190.     }
  191.     
  192.     function crop(thestring,size)
  193.         {
  194.         <% if Session("FONTSIZE") = "LARGE" then %>
  195.             size = size-10;
  196.         <% end if %>
  197.         if (thestring.length > size)
  198.             {
  199.             thestring = thestring.substring(0,size) + "...";
  200.             }
  201.         return thestring;
  202.         }        
  203.  
  204.     function buildListForm(){
  205.         numrows = 0;
  206.                 
  207.         for (var i = 0; i < cachedList.length; i++) {
  208.             if (!cachedList[i].deleted){        
  209.                 numrows = numrows + 1;
  210.             }
  211.         }
  212.         qstr = "numrows="+numrows;
  213.         qstr = qstr+"&cols=FilterName&cols=FilterPath";
  214.  
  215.         parent.parent.hlist.location.href = "iihdn.asp?"+qstr;
  216.  
  217.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  218.     }
  219.  
  220.     function SetListVals(){
  221.         listForm = parent.parent.hlist.document.hiddenlistform;    
  222.         j = 0;
  223.         for (var i = 0; i < cachedList.length; i++) {
  224.             if (!cachedList[i].deleted){
  225.                 listForm.elements[j++].value = cachedList[i].filter;
  226.                 listForm.elements[j++].value = cachedList[i].filterpath;
  227.                 cachedList[i].updated = false;
  228.             }
  229.         }
  230.     }
  231.  
  232.     function listFuncs(){
  233.         this.sel = -1;
  234.         this.addItem = addItem;
  235.         this.delItem = delItem;
  236.         this.writeList = buildListForm;
  237.         this.SetListVals = SetListVals;
  238.     }
  239.     
  240.     function statMsg(num){
  241.         if (num == 0){
  242.             return "<%= L_LOADED_TEXT %>"
  243.         }
  244.         if (num == 3){
  245.             return "<%= L_LOADING_TEXT %>"        
  246.         }
  247.         if (num == 4){
  248.             return "<%= L_UNLOADED_TEXT %>"        
  249.         }
  250.         if (num == 2){
  251.             return "<%= L_UNLOADING_TEXT %>"        
  252.         }
  253.     }
  254.  
  255.     function listObj(id,f,s,e,en,p){
  256.         this.id = id;
  257.         this.filter = f;
  258.         this.status=s;
  259.         this.displaystatus = statMsg(s); 
  260.         this.filterpath=e;
  261.         this.displayexe = crop(e,35);
  262.         this.enabled = en;
  263.         this.priority = p;    
  264.         this.order = id;
  265.         this.deleted = false;
  266.         this.newitem = false;
  267.         this.updated = false;
  268.         
  269.         this.crop = crop;
  270.     }
  271.  
  272. cachedList = new Array();
  273.  
  274. <% 
  275.  
  276.     Dim filterspath, filtersCollection, loadOrder, i, filtername, fltr, priority
  277.     
  278.     filterspath = path & "/Filters"
  279.     Set filtersCollection = GetObject(filterspath)
  280.     if err = 0 then
  281.     
  282.         'bugbug... hack to get around MMC not setting Filters key type...
  283.         filtersCollection.KeyType = "IIsFilters"
  284.         filtersCollection.SetInfo        
  285.         filtersCollection.GetInfo    
  286.         
  287.         loadOrder = filtersCollection.FilterLoadOrder
  288.  
  289.         i = 0
  290.     
  291.         do while len(loadOrder) > 0 
  292.             if InStr(loadOrder,",") then
  293.                 filtername = Trim(Left(loadOrder,InStr(loadOrder,",")-1))
  294.                 loadOrder = Trim(Mid(loadOrder,InStr(loadOrder,",")+1))
  295.             else
  296.                 filtername = Trim(loadOrder)
  297.                 loadOrder = ""
  298.             end if
  299.  
  300.             if filtername <> "" then
  301.                 Set fltr = GetObject(filterspath & "/" & filtername)
  302.  
  303.                 if err = 0 then                
  304.                     if fltr.NotifyOrderHigh then
  305.                         priority = L_HIGH_TEXT
  306.                     elseif fltr.NotifyOrderMedium then
  307.                         priority = L_MEDIUM_TEXT                    
  308.                     elseif fltr.NotifyOrderLow then
  309.                         priority = L_LOW_TEXT                    
  310.                     else
  311.                         priority = L_LOW_TEXT                    
  312.                     end if
  313.                      %>cachedList[<%= i %>] = new listObj(<%= i %>,"<%= filtername %>","<%= fltr.FilterState %>","<%= replace(fltr.FilterPath,"\","\\") %>","<%= fltr.FilterEnabled %>","<%= priority %>");<%                  
  314.                     i = i+1
  315.                 end if
  316.             end if
  317.         loop
  318.     end if
  319.  %>
  320.  
  321. listFunc = new listFuncs();
  322. </SCRIPT>
  323. </BODY>
  324. </HTML>
  325. <% end if %>
  326.