<% ' +--------------------------------------------------------------------------------------------+ ' | General Settings | ' +--------------------------------------------------------------------------------------------+ ' Here are any ASP based settings that might be tweaked for easy project administration ' setting_openAllMenus: when this is true, then for the current open section all sub menus will be expanded automatically setting_openAllMenus = false ' setting_boldLinkPath: When enabled, all links leading to current page are bolded setting_boldLinkPath = true ' setting_disableCurrentLink: Should the link for the current page be disabled? setting_disableCurrentLink = true ' setting_boldCurrentLink: Should current link be bolded (if boldLinkPath is enabled, this option is ignored). ' This setting is meant to allow bolding of current link even if linkPath is not bolded. setting_boldCurrentLink = true ' +--------------------------------------------------------------------------------------------+ ' | Navigation Logic | ' +--------------------------------------------------------------------------------------------+ Dim strParentPages strParentPages = foundation_pageParentPath If foundation_sessionKey <> "" Then 'Preview Mode Token="&" Else 'Published Token=" " End If 'FUNCTION TO CHECK IF NAV ITEMS IS "ACTIVE" Function isActive(strURL) 'Checks if strURL is anywhere in the strParentPages string. If instr(strURL, Token & "pageguid=")>0 Then If instr(strParentPages,Mid(strURL,instrrev(strURL,Token & "pageguid="),42))>0 Then isActive=True Else isActive=False End If Else isActive=False End If End Function 'Test if a Target Container is in use on this Web page & set page title dim pageTitle pageTitle = "" If foundation_pageID <> foundation_pageIDTC Then 'display headline of body-page pageTitle = getPageName( foundation_pageGUIDTC ) Else pageTitle = foundation_pageTitle End If 'Check current page ID, used to highlight nav dim pageID pageID = foundation_pageID set objIO = Server.CreateObject("RDCMSASP.RdPageData") objIO.XmlServerClassName = "RDCMSServer.XmlServer" set objXMLDOM = Server.CreateObject("Microsoft.XMLDOM") ' Set session ID once sessKey = getSessionKey("publisher", "publisher") function countElements( obj ) if isObject( obj ) or isArray( obj ) then count = 0 for each o in obj count = count + 1 next countElements = count else countElements = -1 end if end function function getLinkGUID( pageGUID, elemName ) ' Using this RQL XML string, fetch all elements on this page xmlString = "" resXML = objIO.ServerExecuteXML( xmlString, sError ) objXMLDOM.LoadXml( resXML ) ' Extract all elements from RedDot XML result set elements = objXMLDOM.getElementsByTagName("LINK") res = "" for each elem in elements eName = elem.getAttribute( "name" ) eGUID = elem.getAttribute( "guid" ) if strComp( eName, elemName, 1 ) = 0 then res = eGUID ' If we found an element by the required name, no more searching is necessary exit for end if next getLinkGUID = res end function function getPageName( pageGUID ) ' Using this RQL XML string, fetch all elements on this page xmlString = "" resXML = objIO.ServerExecuteXML( xmlString, sError ) objXMLDOM.LoadXml( resXML ) ' Extract all elements from RedDot XML result set elements = objXMLDOM.getElementsByTagName("PAGE") res = "" for each elem in elements res = elem.getAttribute( "headline" ) exit for ' Just need one iteration in this case (not an array, so can't just access element 0) next getPageName = res end function function getSessionKey( username, password ) 'if sessKey <> "" then ' sessionKey = sessKey 'elseif foundation_sessionKey = "" then xmlString = "" resXML = objIO.ServerExecuteXML( xmlString, sError ) loginGUID = objIO.getAttribute("LOGIN","guid", resXML) xmlString = "" &_ "" resXML = objIO.ServerExecuteXML( xmlString, sError ) sessionKey = objIO.getAttribute("SERVER", "key", resXML) 'else ' sessionKey = foundation_sessionKey 'end if getSessionKey = sessionKey end function function getPageGUIDFromLink( link ) dim pos pos = InStr(link, "&pageguid=") if pos = 0 then getPageGUIDFromLink = "" else getPageGUIDFromLink = Mid(link, pos+10, 32) end if end function function isLinkEmpty( link, emptyLinkGUID ) dim linkPageGUID linkPageGUID = getPageGUIDFromLink( link ) if emptyLinkGUID = linkPageGUID AND ( emptyLinkGUID <> "" OR link = "" ) then isLinkEmpty = true else isLinkEmpty = false end if end function 'Set Global Variables isActiveDefined = true isCurrentDefined = true 'Checks if we are in preview or publication modes; logic is slightly different for each If "" <> "" Then 'Preview Mode Token="&" Else 'Publication mode Token=" " End If 'FUNCTION TO CHECK IF NAV ITEMS IS "ACTIVE" Function isActive(strURL) 'Checks if strURL is anywhere in the strParentPages string If inStr(strURL, Token & "pageguid=") > 0 Then If inStr(strParentPages ,Mid(strURL, inStrRev(strURL, Token & "pageguid="), 42)) > 0 Then isActive=True Else isActive=False End If Else isActive=False End If End Function 'FUNCTION TO CHECK IF NAV ITEMS IS "CURRENT" (links to the current page) Function isCurrent(strURL) 'Checks if strURL is the current page If instr(strURL, Token & "pageguid=") > 0 Then If inStr("/21stcenturyscholars/2256.htm", Mid(strURL, inStrRev(strURL, Token & "pageguid="), 42)) > 0 Then isCurrent=True Else isCurrent=False End If Else isCurrent=False End If End Function %>