Peter Holemans
WB12 - AWP-Mode and Nation() July 09, 2008 12:38PM |
Peter Holemans
Re: WB12 - AWP-Mode and Nation() - Getting closer but still... July 09, 2008 04:00PM |
//Project variables GLOBAL gstr_AWPSessionApplicationMode is string //Manages the type of application: Travel GiftLists or Honeymoons (Identical apps except for execution languages NL/212 FR/205 UK/203) gstr_AWPSessionLanguage is string //Manages the languages //############################################################### //AWP Mode //############################################################### IF InAWPMode() THEN //Manage context variables used by pages in AWP mode ConfigureAWPContext(ctxDisk,ctxIDCookieURL) IF NOT DeclareAWPContext(gstr_AWPSessionLanguage) THEN gstr_AWPSessionLanguage = "NL" //Dutch is default language IF NOT DeclareAWPContext(gstr_AWPSessionApplicationMode) THEN gstr_AWPSessionApplicationMode = "HNM"//Honeymooners is default mode (HNM <> GFT) //Check if a parameter is passed to the AWP page, then cookie, then default gstr_AWPSessionLanguage=PageParameter("Language") IF gstr_AWPSessionLanguage~="" THEN gstr_AWPSessionLanguage = CookieRead("UHM_LANGUAGE") IF gstr_AWPSessionLanguage ~= "" THEN gstr_AWPSessionLanguage = "NL" CookieWrite("UHM_LANGUAGE","NL",90) END END gstr_AWPSessionApplicationMode=PageParameter("ApplicationMode") IF gstr_AWPSessionApplicationMode~="" THEN gstr_AWPSessionApplicationMode = CookieRead("UHM_APPLICATIONMODE") IF gstr_AWPSessionApplicationMode ~= "" THEN gstr_AWPSessionApplicationMode = "HNM" CookieWrite("UHM_APPLICATIONMODE","HNM",0) END END //Now set the execution language for the AWP pages //Detect the requested page sCurrentPage is string = SysEnvironment("SCRIPT_NAME") sCurrentPage = fExtractPath(Replace(sCurrentPage, "/", "\"), fFileName+fExtension) SWITCH gstr_AWPSessionApplicationMode CASE "GFT" SWITCH gstr_AWPSessionLanguage CASE "NL" ScriptDisplay("../L212/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) CASE "FR" ScriptDisplay("../L205/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) CASE "EN" ScriptDisplay("../L203/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) OTHER CASE ScriptDisplay("../L212/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) END OTHER CASE SWITCH gstr_AWPSessionLanguage CASE "NL" ScriptDisplay("../NL/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) CASE "FR" ScriptDisplay("../FR/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) CASE "EN" ScriptDisplay("../UK/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) OTHER CASE ScriptDisplay("../NL/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse)) END END ELSE //############################################################### //CLASSIC DYNAMIC MODE //############################################################### //Declare objects to store session and caddy info gobj_Session is objSession gobj_Caddy is objCaddy //Now make sure a language and application mode is set IF gstr_AWPSessionLanguage~="" THEN ...