<% page = request.querystring("page") ' Create Dynamic size arrays Dim menuTitleArray() Dim subMenuTitleArray() Dim subMenuPageArray() ' Set the array to one element onle ReDim menuTitleArray(0) ReDim subMenuTitleArray(0) ReDim subMenuPageArray(0) currentMenuIndex = 0 SUB addMenu(menuTitle) size = ubound(menuTitleArray) menuTitleArray(size) = menuTitle currentMenuIndex = size ReDim Preserve menuTitleArray(size+1) ReDim Preserve subMenuTitleArray(size+1) ReDim Preserve subMenuPageArray(size+1) END SUB SUB addSubMenu(submenuTitle, submenuPage) comma = "," if subMenuTitleArray(currentMenuIndex) = "" then comma = "" subMenuTitleArray(currentMenuIndex) = subMenuTitleArray(currentMenuIndex) + comma + submenuTitle subMenuPageArray(currentMenuIndex) = subMenuPageArray(currentMenuIndex) + comma + submenuPage END SUB SUB writeMenu(i, status) if menuTitleArray(i) = "" then writeSepMenu(i) exit sub end if %>
<% tempTitleArray = split(submenuTitleArray(i), ",") tempPageArray = split(submenuPageArray(i), ",") for ii = 0 to ubound(tempTitleArray) %> <% next %>
    <%=tempTitleArray(ii)%>
<% END SUB SUB writeSepMenu(i) %>   <% END SUB %>
<% addMenu("Animated text") addSubMenu "Edit", "animated_edit" addMenu("Home") addSubMenu "Add", "home_add" addSubMenu "Edit / Delete", "home_edit" addMenu("General") addSubMenu "Add", "general_add" addSubMenu "Edit / Delete", "general_edit" addMenu("Training") addSubMenu "Add", "training_add" addSubMenu "Edit / Delete", "training_edit" addMenu("Research") addSubMenu "Add", "research_add" addSubMenu "Edit / Delete", "research_edit" addMenu("Teaching") addSubMenu "Add", "teaching_add" addSubMenu "Edit / Delete", "teaching_edit" addMenu("Community Services") addSubMenu "Add", "communityServices_add" addSubMenu "Edit / Delete", "communityServices_edit" addMenu("Consulting") addSubMenu "Add", "consulting_add" addSubMenu "Edit / Delete", "consulting_edit" addMenu("links") addSubMenu "Add", "links_add" addSubMenu "Edit / Delete", "links_edit" addMenu("Current Semester") addSubMenu "Add", "currentSemester_add" addSubMenu "Edit / Delete", "currentSemester_edit" addMenu("") // to add seperator //addMenu("Menu Items") //addSubMenu "Add", "Menu Item" addMenu("Statistics") addSubMenu "Show", "stat_info" addMenu("Admin Info") addSubMenu "Edit", "admin_info" for i = 0 to ubound(menuTitleArray) -1 if page = "" then status = "collapsed" else if instr(submenuPageArray(i), page) then status = "expanded" selectedCategoryID = i // Get the selected category to change its color else status = "collapsed" end if end if writeMenu i, status next if selectedCategoryID = "" then selectedCategoryID = -1 %>
 
  • Logout