<%'Include Data Connection%> <%'Include ADO constants include file for VBScript%> <% 'open data connection OpenConn() %> <%'Include Utility Scripts%> <% 'close data connection Call CloseConn() %> <% dim intSectionId dim strAction dim strReferer '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 SECTION 'dim strMode - The strMode variable is defined in the header_inc.asp file. intUrlId = Trim(Request.QueryString("url_id")) intSectionId = Trim(Request.QueryString("id")) strMode = Trim(Request.QueryString("mode")) strReferer = Trim(Request.QueryString("referer")) 'open data connection Call OpenConn() 'delete the selected section Call DeleteSection(intSectionId) ' If the section's Url can be deleted (if it has been passed in the queryString) If intUrlId <> "" and IsNumeric(intUrlId) Then 'delete the url and its file Call DeleteUrlFile(CInt(intUrlId)) Call DeleteUrl(CInt(intUrlId)) End If '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") = "section" Session("Referer") = strReferer Response.Write("") Response.Write("") 'END: DELETE SECTION Else 'BEGIN: DISPLAY SECTION 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%>

Add a New Menu Item to the Navigation

      - or -

Select an Existing Menu Item:
<% 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 SECTION INDEX End If %>