You can select a form from the home page or a PT application menu, or by passing the form name as a URL parameter. Each of these actions calls gate.asp, which starts the process of building the frameset that presents the application's screens. The SRC attribute of the MENUBAR frame specifies an .asp file that dynamically builds application menus. This file, menu.asp, runs each time the application presents a screen.
The following line of code from en-us\gate.asp contains the call to menu.asp in the SRC attribute:
frames('menubar').src= '../menu/menu.asp?lang=' + '<%= lang %>';
After menu.asp runs, the resulting HTML is sent to the browser to implement a row of menu names. When a user clicks each name, menu items appear in a Popup ActiveX control. The XSL transformation that menu.asp executes also generates scripts for the menu.
The following code declares and sets the variables that menu.asp uses to manipulate the XML file that stores the names of menus and items, and the XSL file that transforms it into HTML:
Dim item,oXML,oXSL,rootResult,perr,errXML,errXSL
Dim language,personAlias,personType,posDelimiter
Dim oRs
Set oXML= Server.CreateObject("Microsoft.XMLDOM")
Set oXSL= Server.CreateObject("Microsoft.XMLDOM")
oXML.async = False
oXSL.async = False
language = Request.QueryString("lang")
If (IsEmpty(language) Or language="") Then language = "en-us"
Note This document uses the convention *menu.xml to refer to the XML files that store menus for the evaluator, auditor, and individual roles. In the menu subdirectory for each locale the application supports, there is one XML file for each of these roles—emenu.xml for evaluators, amenu.xml for auditors, and imenu.xml for individuals.
To manipulate the XML and XSL files, the PT application requires two instances of the XML Document Object Model (XML DOM). The application changes the async property of the two instances of the XML DOM to FALSE. This ensures that the application waits until the two files are loaded into the objects before beginning the transformation.
To determine the language in which the browser displays content, the code calls the QueryString collection of the ASP Request object to retrieve the correct language. Passing the parameter lang retrieves the language from the HTTP query string.
The following block of code loads the necessary XML and XSL files into the object variables. The MapPath method on the ASP Server object specifies the location of the files to retrieve.
personType = "E"
oXML.load(Server.MapPath("../" & language & "/menu/" & personType & "menu.xml"))
oXSL.load(Server.MapPath("menu.xsl"))
call makeMenuXML()
Note For the U.S. English locale, the PT Admin application builds menus from emenu.xml—the file that contains the XML for menus for evaluators. The preceding code hard-codes this value by adding an "E" to the beginning of the string "menu.xml". The PT User application will probably implement a more dynamic approach to retrieving the appropriate *menu.xml file.
Next, the code continues with a call to the MakeMenuXML function.