<% Timeout(1) if Request("MenuSectionID") <> Empty and IsNumeric(Request("MenuSectionID")) then i_MenuSectionID = CInt(Request("MenuSectionID")) elseif Session("MenuSectionID") = Empty then i_MenuSectionID = 1 else i_MenuSectionID = Session("MenuSectionID") end if Session("MenuSectionID") = i_MenuSectionID i_MenuLevels = 3 i_MenuOptions = NULL set con = server.createobject("ADODB.Connection") con.open Application("CString") con.CommandTimeout = 1000 if request.form("Posted") = "Y" then if Not IsNumeric(request("MainMenuID")) then strSQL = " SELECT COUNT(MenuID) + 1 AS 'TheCount' FROM CMS_Menu WHERE MenuSectionID = "& Session("MenuSectionID") &" AND MainMenuID IS NULL" else strSQL = "UPDATE CMS_Menu SET PageID = NULL, Frame = NULL WHERE MenuID = "& request("MainMenuID") con.execute(strSQL) strSQL = "SELECT COUNT(MenuID) + 1 AS 'TheCount' FROM CMS_Menu WHERE MenuSectionID = "& Session("MenuSectionID") &" AND MainMenuID = "& Request("MainMenuID") end if set rsCount = con.execute(strSQL) rsCount.movefirst strSQL = "INSERT INTO CMS_Menu(MenuSectionID, MenuName, MenuOrder, MainMenuID) VALUES("& Session("MenuSectionID") &", '"& Replace(request("MenuName"), "'", "''") &"', "& rsCount("TheCount") &", "& Request("MainMenuID") &")" con.execute(strSQL) set rsCount = nothing con.close set con = nothing response.redirect("Menu.asp?menuid=" & Request("menuid") & "&buster="& server.URLEncode(now)) end if if request("menuID") <> empty and IsNumeric(request("menuID")) and request("pageID") <> empty and request("Redirect") <> empty then strSQL = "UPDATE CMS_Menu SET NewsID = "& request("pageID") &", Redirect = "& request("Redirect") &" WHERE MenuID = "& request("menuID") con.execute(strSQL) con.close set con = nothing response.redirect("Menu.asp?buster="& server.URLEncode(now)) end if strSQL = "(SELECT *, 1 AS 'Subs' "&_ "FROM CMS_Menu "&_ "WHERE MenuSectionID = "& Session("MenuSectionID") &" AND MainMenuID IS NULL AND "&_ "MenuID IN (SELECT DISTINCT MainMenuID "&_ " FROM CMS_Menu "&_ " WHERE MenuSectionID = "& Session("MenuSectionID") &" AND MainMenuID IS NOT NULL)) "&_ "UNION "&_ "(SELECT *, 0 AS 'Subs' "&_ "FROM CMS_Menu "&_ "WHERE MenuSectionID = "& Session("MenuSectionID") &" AND MainMenuID IS NULL AND "&_ "MenuID NOT IN (SELECT DISTINCT MainMenuID "&_ " FROM CMS_Menu "&_ " WHERE MenuSectionID = "& Session("MenuSectionID") &" AND MainMenuID IS NOT NULL)) "&_ "ORDER BY MenuOrder" set rsMenu = con.execute(strSQL) %> Website Administration
Add New Menu Option
<% s_AllPageIDs = "0" if IsNull(i_MenuLevels) or i_MenuLevels > 0 then %> <% end if %>

Attach new option to:

Enter option's name:


">
Navigation Maintenance (Click on a Folder to view it's sub-menus)
<% if Request.QueryString("Msg") = "Done" then %>

The menu has been successfully generated.

<% end if %> <% counterx = 0 if rsMenu.EOF then %> <%counterx=0%> <% else intMaxCount = 0 'MaxLevels 0, intMaxCount, 0 intMaxCount = 1 if Request("menuid") <> Empty then arrTMP = Split(Request("menuid"), "|") intMaxCount = UBound(arrTMP) end if strSQL = "SELECT PageID, Heading, [FileName], Redirect FROM CMS_Page WHERE PageID IN (" & s_AllPageIDs & ")" Set rsAllPages = con.execute(strSQL) Dim arrPages() i_ArrayIndex = 0 ReDim arrPages(3, i_ArrayIndex) do while not rsAllPages.EOF i_PageID = rsAllPages("PageID") s_Heading = rsAllPages("Heading") s_FileName = rsAllPages("FileName") s_Redirect = rsAllPages("Redirect") i_ArrayIndex = i_ArrayIndex + 1 ReDim Preserve arrPages(3, i_ArrayIndex) arrPages(0, i_ArrayIndex - 1) = i_PageID if Not IsNull(s_Redirect) then arrPages(1, i_ArrayIndex - 1) = s_Redirect & " (" & s_Heading & ")" arrPages(2, i_ArrayIndex - 1) = 0 elseif Not IsNull(s_FileName) then arrPages(1, i_ArrayIndex - 1) = s_Heading & " (Doc)" arrPages(2, i_ArrayIndex - 1) = 0 else arrPages(1, i_ArrayIndex - 1) = s_Heading & " (Page)" arrPages(2, i_ArrayIndex - 1) = 1 end if rsAllPages.MoveNext Loop Set rsAllPages = Nothing %> <%for i = 1 to intMaxCount%> <%Next%> <%for i = 1 to intMaxCount%> <%Next%> <% i_MainLoopCounter = 0 do while not rsMenu.EOF i_MenuID = rsMenu("MenuID") i_MenuSectionID = rsMenu("MenuSectionID") s_MenuName = rsMenu("MenuName") i_MenuOrder = rsMenu("MenuOrder") i_MainMenuID = rsMenu("MainMenuID") i_PageID = rsMenu("PageID") s_Frame = rsMenu("Frame") b_Subs = rsMenu("Subs") b_ShowIcons = True b_ShowIconsTop = True strMenuID = "|" & i_MenuID & "|" %> <%if b_ShowIconsTop then%> <%else%> <%end if%> <% if b_Subs then Response.Write("") else if IsNull(i_PageID) then %> <% else For x = 0 to UBound(arrPages, 2) if CLng(arrPages(0, x)) = CLng(i_PageID) then %> <% if CInt(arrPages(2, x)) <> 1 then Response.Write("") else %> <% end if %> <% Exit For end if Next end if end if %> <% if i_MainLoopCounter > 0 then %> <% else %> <% end if if not rsMenu.EOF then %> <% else %> <% end if %> <%for i = 1 to (intMaxCount - 1)%> <%Next%> <%if b_ShowIconsTop then%> <%if CInt(b_Subs) = 0 then%> <%else%> <%end if%> <%end if%> <% if rsMenu.EOF then b_MenuEOF = "0," else b_MenuEOF = "1," end if if InStr(Request("menuid"), "|" & i_MenuID & "|") > 0 then if CInt(b_Subs) = 1 then GetSubMenus i_MenuID, 0, counterx, b_MenuEOF, strMenuID end if %> <%i_MainLoopCounter = i_MainLoopCounter + 1%> <%loop%> <%end if%>

Menu Root

The are no menu options.

Menu PageLevel <%=i%> 

Menu Root

Edit

<%rsMenu.movenext%> <%if rsMenu.EOF then%> <%else%> <%end if%> <%if CInt(b_Subs) = 1 then%> <%if InStr(Request("menuid"), "|" & i_MenuID & "|") > 0 then%> <%else%> <%end if%> <%else%> <%end if%> <%=s_MenuName%>

  &buster=<%=server.URLEncode(now)%>','_self');">Edit', 150)" onClick="javascript:window.open('../../content.asp?PageID=<%=i_PageID%>','_blank');" >View&buster=<%=Server.URLEncode(Now())%>','_self');">Move Up&buster=<%=Server.URLEncode(Now())%>','_self');">Move Down

<% if counterx > 0 then %>
<% end if %> ">

 

<% set rsMenu = nothing con.close set con = nothing %>