%'Include Data Connection%> <%'Include ADO constants include file for VBScript%> <% 'open data connection OpenConn() %> <%'Include Utility Scripts%> <% 'dim strMode - The strMode variable is defined in the header_inc.asp file. 'dim strDelimiter - The strDelimiter variable is defined in the common_utils.asp file. dim strSectionName dim intSectionId dim intUrlId dim intParentId dim intPositionId dim strSectionOrderList dim strReferer dim bolSectionIsEditable dim strAction 'the 2 possible values for strAction (in this context) are 'manage' and 'select'. 'select' would mean that the interface has been called from a Page (URL) admin interface. ' 'manage' would mean that this interface was called from a Menu Item (Section) Admin interface. 'get the action for this inteface strAction = Right(Request.Querystring("referer"), (Len(Request.Querystring("referer"))- InStr(Request.Querystring("referer"), "="))) If Request.Form <> "" Then 'begin add/edit (db transactions) dim strDel dim arDisplayTypes dim strUserFeedback 'get form elements values strMode = Request.Form("txtMode") strSectionName = Request.Form("txtName") intSectionId = Request.Form("txtId") intParentId = Request.Form("txtParentId") intUrlId = Request.Form("selURLs") strReferer = Request.Form("txtReferer") Select Case LCase(strMode) Case "edit" 'if the application is in 'edit' mode 'modify section Call ModifySection(intSectionId, strSectionName, intUrlId) 'if the sort order has been modified then... If Trim(Request.Form("txtSectionsList")) <> "" Then 'modify section sort order Call ModifySectionSortOrder(Trim(Request.Form("txtSectionsList")), strDelimiter) End If Case "add" 'if the application is in 'add' mode 'get the new section's sort order (last) intPositionId = GetSubsectionCount(intParentId) + 1 'add section Call AddSection(strSectionName, intPositionId, intUrlId, intParentId) End Select '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 Server.Execute("/admin/feedback.asp") 'end add/edit (db transactions) Else 'begin input (add/edit) strMode = Trim(Request.QueryString("mode")) strReferer = Trim(Request.QueryString("referer")) 'if application is in edit mode then... If LCase(strMode) = "edit" Then 'begin get current Section info to be edited dim rsSection dim intSectionCount intSectionId = Trim(Request.QueryString("id")) intSectionCount = GetSubsectionCount(GetParent(intSectionId)) 'if intSectionId is not a valid value then... If Not IsNumeric(intSectionId) or Not (intSectionId <> "") Then 'close the window Response.write("") 'if intSectionId is a valid value then... Else 'cast the intSectionId variable into an integer data type intSectionId = CInt(intSectionId) 'get the related Posting Type information Set rsSection = GetSelectedSection(intSectionId) End If 'if intSectionId does not relate to an existing Section id then... If rsSection.EOF Then 'release the recordset from memory rsSection.Close set rsSection = Nothing 'release the connection object from memory before closing the window conn.Close Set conn = Nothing 'close the window Response.write("") 'if intSectionId does relate to an existing Section id then... Else 'get the section values into the relevant variables strSectionName = rsSection("SECTION_NAME_ENG") intUrlId = rsSection("URL_ID") intParentId = rsSection("PARENT_ID") 'if the SECTION_ORDER for the Menu Item is not null then... If Not IsNull(rsSection("SECTION_ORDER")) Then 'set the intPositionId variable with the SECTION_ORDER value intPositionId = rsSection("SECTION_ORDER") Else 'set the intPositionId variable to zero (0) 'intPositionId = 0 End If bolSectionIsEditable = rsSection("SECTION_IS_EDITABLE") 'release the recordset from memory rsSection.Close set rsSection = Nothing End If 'end get current posting type info to be edited 'if application is in add mode then... Else bolSectionIsEditable = True strSectionName = "" End If %>