<% 'open data connection Call OpenConn() %> <%'Include Utility Scripts%> <% 'close data connection Call CloseConn() %> <% dim intSectionId dim strAction 'get the action this section tree form is to perform strAction = Trim(Request.QueryString("action")) 'if the strAction variable is empty (the section tree is displayed to manage the sections) then... If strAction = "" Then 'assign the strAction variable the "manage" string strAction = "manage" End If If Request.QueryString("mode") = "delete" Then 'BEGIN: DELETE URL 'dim strMode - The strMode variable is defined in the header_inc.asp file. dim intUrlId intUrlId = Trim(Request.QueryString("id")) strMode = Trim(Request.QueryString("mode")) 'open data connection Call OpenConn() 'delete the related file Call DeleteUrlFile(CInt(intUrlId)) 'delete Url and related sections Call DeleteUrl(CInt(intUrlId)) Call DeleteRelatedSection(CInt(intUrlId)) 'set related section's url_id field to NULL 'Call SetURLidToNull(CInt(intUrlId)) 'close data connection Call CloseConn() 'give the user feedback with regards to the success of the delete database transaction Session("FeedbackMode") = LCase(strMode) Session("FeedbackError") = err.number Session("FeedbackModule") = "url" Response.Write("") Response.Write("") 'END: DELETE URL Else 'BEGIN: DISPLAY URL INDEX 'open data connection OpenConn() On Error Resume Next dim iTotal, sLeftIndent dim bLoaded Dim bLoadSubItems Dim objDocument Dim sOpenFolders iTotal = 0 sLeftIndent = "" 'Check if we clicked an "on demand" folder if (Request.Form <> "") then bLoadSubItems = true else bLoadSubItems = false end if bLoaded = LoadAllSections(objDocument, bLoadSubItems) if (bLoaded = true) then 'Start building the menu table structure%>
      - or -

Select an Existing Url:
<% sOpenFolders = Request.Form("hdnOpenFolders") 'This subroutine generates the HTML for the menu based on 'data loaded into the XML object DisplayNode objDocument.childNodes, iTotal, sLeftIndent, sOpenFolders%>

<% Select Case LCase(strAction) 'if the section tree is displayed for the user to manage (edit/delete) a section (as opposed to only selecting a section) then... Case "manage" %>    <% 'if the section tree is displayed for the user to manage (edit/delete) a section (as opposed to only selecting a section) then... Case "select" %>    <% End Select %>
<% end if %> <% 'Release memory reserved by XML object Set objDocument = Nothing if err <> 0 then 'We got an error, so display the message Response.Write err.description end if %> <% 'close data connection CloseConn() 'END: DISPLAY URl INDEX End If %>