%@ Language=VBScript %> <% Option Explicit %> <% '------------------------------------------------------------------------- ' folder_delete.asp: deletes the selected folder(s) ' ' Copyright (c) Microsoft Corporation. All rights reserved. ' ' Date Description ' 17-Jan-2001 Creation date ' 21-Mar-2001 Modification date '------------------------------------------------------------------------- %> <% '------------------------------------------------------------------------- ' Global Variables '------------------------------------------------------------------------- Dim rc 'Page variable Dim page 'Page variable Dim G_strFolders 'List of all folders selected Dim F_ParentFolder Dim G_objService 'WMI connection '====================================================== ' Entry point '====================================================== set G_objService = getWMIConnection(CONST_WMI_WIN32_NAMESPACE) ' Create a Property Page rc = SA_CreatePage( L_TASKTITLE_DELETE_TEXT, "", PT_PROPERTY, page ) If rc = 0 then ' Serve the page SA_ShowPage( page ) End If '====================================================== ' Web Framework Event Handlers '====================================================== '------------------------------------------------------------------------- 'Function name: OnInitPage 'Description: Called to signal first time processing for this page. Use this method ' to do first time initialization tasks. 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: TRUE to indicate initialization was successful. FALSE to indicate ' errors. Returning FALSE will cause the page to be abandoned. 'Global Variables: Out:F_ParentFolder ' In:None '------------------------------------------------------------------------- Public Function OnInitPage(ByRef PageIn, ByRef EventArg) Call GetOTSTableValues F_ParentFolder = Request.QueryString("parent") Call SA_MungeURL(mstrReturnURL, "PKey", F_ParentFolder) OnInitPage = True End Function '------------------------------------------------------------------------- 'Function name: OnServePropertyPage 'Description: Called when the page needs to be served. Use this method to ' serve content. 'Input Variables: None 'Output Variables: None 'Returns: TRUE to indicate initialization was successful. FALSE to indicate ' errors. Returning FALSE will cause the page to be abandoned. 'Global Variables: Out:None ' In:None '------------------------------------------------------------------------- Public Function OnServePropertyPage(ByRef PageIn, ByRef EventArg) ' Emit Javascript functions required by Web Framework Call ServeCommonJavaScript() Call ConfirmMessage() OnServePropertyPage = TRUE End Function '------------------------------------------------------------------------- 'Function name: OnPostBackPage 'Description: Called to signal that the page has been posted-back. A post-back ' occurs in tabbed property pages and wizards as the user navigates ' through pages. It is differentiated from a Submit or Close operation ' in that the user is still working with the page. 'Input Variables: None 'Output Variables: None 'Returns: TRUE to indicate initialization was successful. FALSE to indicate ' errors. Returning FALSE will cause the page to be abandoned. 'Global Variables: Out:None ' In:None '------------------------------------------------------------------------- Public Function OnPostBackPage(ByRef PageIn, ByRef EventArg) ' Get Folder name from previous form G_strFolders = Request.Form("hdnFolderName") OnPostBackPage = TRUE End Function '------------------------------------------------------------------------- 'Function name: OnSubmitPage 'Description: Called when the page has been submitted for processing. Use ' this method to process the submit request. 'Input Variables: None 'Output Variables: None 'Returns: TRUE if the submit was successful, FALSE to indicate error(s). ' Returning FALSE will cause the page to be served again using ' a call to OnServePropertyPage. 'Global Variables: Out:None ' In:None '------------------------------------------------------------------------- Public Function OnSubmitPage(ByRef PageIn, ByRef EventArg) OnSubmitPage = DeleteFolder() End Function '------------------------------------------------------------------------- 'Function name: OnClosePage 'Description: Called when the page is about to be closed. Use this method ' to perform clean-up processing. 'Input Variables: None 'Output Variables: None 'Returns: TRUE to allow close, FALSE to prevent close. Returning FALSE ' will result in a call to OnServePropertyPage. 'Global Variables: Out:None ' In:None '------------------------------------------------------------------------- Public Function OnClosePage(ByRef PageIn, ByRef EventArg) OnClosePage = TRUE End Function '====================================================== ' Private Functions '====================================================== '------------------------------------------------------------------------- 'Function: ServeCommonJavaScript 'Description: Serves in initializing the values,setting the form ' data and validating the form values 'Input Variables: None 'Output Variables: None 'Returns: None 'Global Variables: None '------------------------------------------------------------------------- Function ServeCommonJavaScript() %> <% End Function '------------------------------------------------------------------------- 'Subroutine name: ConfirmMessage 'Description: Serves in displaying the confirm message 'Input Variables: None 'Output Variables: None 'Returns: GetFolder true/false and F_FolderExists true/false 'Global Variables: In:G_strFolders ' In:L_DELETECONFIRM_TEXT, L_CONTINUE_TEXT ' '------------------------------------------------------------------------- Sub ConfirmMessage Err.Clear On Error Resume Next Dim arrFolderNames Dim nCount Dim objFolder Dim ObjSubFold Dim bFolder_exists_flag Dim bDel_msg_flag Set objFolder=CreateObject("Scripting.Filesystemobject") 'Getting the File system Object If Err.number <>0 Then SA_SetErrMsg L_FILESYSTEMOBJECTNOTCREATED_ERRORMESSAGE & "(" & Hex(Err.Number) & ")" Exit Sub End If arrFolderNames = Split(G_strFolders,chr(1)) %>
<%=L_DELETEFOLDERCONFIRM_TEXT%> | |||||||||
<%=L_PATH_TEXT%> | <%=L_ATTRIBUTE_TEXT%> | <%=L_SHARED_TEXT%> | |||||||
<%=arrFolderNames(nCount)%> | <%=L_READ_ONLY_TEXT%> | <%=arrFolderNames(nShrcnt)%> | <%Else%><%=arrFolderNames(nCount)%> | <%=L_READ_ONLY_TEXT%> | <%End If %> | ||||
<%=arrFolderNames(nCount)%> | <%=arrFolderNames(nShrcnt)%> | ||||||||
<%=L_FOLDER_NOTEXISTS_TEXT%> | |||||||||
<%= L_CONTINUE_TEXT %> |