|
From: creedon <icr...@us...> - 2006-01-17 23:26:13
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/search/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12309 Modified Files: searchPage Log Message: minor formatting tweaks close p and input tags, XHTML compliance replaced manilaSuite.unTaint with mainResponder.neuterText Index: searchPage =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/search/server/searchPage,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** searchPage 26 Mar 2005 21:46:12 -0000 1.1.1.1 --- searchPage 17 Jan 2006 23:26:03 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:mainResponder.search.server.searchPage ! on searchPage (altColor="", flShowSiteNames=true, flFeedback=false) { ÇChanges: Ç8/3/02; 2:37:48 AM by JES ÇCreated. Generalized search page for mainResponder. Based on workspace.sampleSearch. Original change notes below. Ç01/31/00; 1:40:00 PM by PBS ÇAdded the closing </form> tag, so the Edit this Page button will work. Ç01/27/00; 1:40:08 PM by PBS ÇThis is a safe macro which displays a search page. You can specify an alternate altColor by supplying the third parameter. You can turn off display of site names by supplying the flShowSiteNames parameter and setting it to false. bundle { //deal with defaults if altColor == "" { altColor = "gainsboro"}}; local (pta = html.getPageTableAddress ()); //get the address of the current page table local (indexName = "Index.root"); //change this if you want to use a different index local (adrFilterCallback); if defined (pta^.responderAttributes.adrSearchFilterCallback) { adrFilterCallback = pta^.responderAttributes.adrSearchFilterCallback}; local (flRunSearch = false); //will be true if a search should be run local (actionUrl); //the action URL for the form bundle { //get the action URL actionUrl = pta^.uri; if defined (pta^.pathArgs) { //there may also be a $xxx component if pta^.pathArgs != "" { if not (actionUrl endsWith "$") { actionUrl = actionUrl + "$"}; actionUrl = actionUrl + pta^.pathArgs}}}; local (htmlText); //htmlText will contain the HTML that will be returned on add (s) { //subroutine for adding a string to htmlText htmlText = htmlText + s}; local (queryString = "", displayQueryString = ""); bundle { //get the query string and display query string local (argTable); new (tableType, @argTable); if defined (pta^.searchArgs) and pta^.searchArgs != "" { flRunSearch = true; webserver.parseArgs (pta^.searchArgs, @argTable); //parse the search args into a local table if defined (argTable.q) { //q is the element which contains the query string from the browser queryString = string.trimWhiteSpace (argTable.q); //trim it up local (adrIsoTable); if system.environment.isMac { adrIsoTable = @html.data.iso8859.mac}; if system.environment.isWindows { adrIsoTable = @html.data.iso8859.win}; displayQueryString = string.iso8859Encode (queryString, adrIsoTable); //encode characters as HTML entities ÇVarious additional filterings are necessary to get this to show up correctly in the input field. displayQueryString = string.replaceAll (displayQueryString, "\"", """); displayQueryString = string.replaceAll (displayQueryString, "<", "<"); displayQueryString = string.replaceAll (displayQueryString, ">", ">"); displayQueryString = string.replaceAll (displayQueryString, "+", " ")}}}; on addSearchForm () { //build the search form -- you might want to customize the display of this add ("<form method=\"get\" action=\"" + actionUrl + "\">\r"); //it's a GET method form add ("Search for: \r"); add ("<input type=\"text\" name=\"q\" size=\"30\" value=\"" + displayQueryString + "\"> "); add ("<input type=\"submit\" value=\"Search\"><p>\r"); add ("</form>")}; //PBS 01/31/00: close the form. addSearchForm (); if flRunSearch { //display the search results if a search should be run add (mainResponder.search.server.htmlSearch (pta, actionUrl, flShowSiteNames, altColor, flFeedback, indexName, adrFilterCallback))}; ÇMake sure this page is totally secure -- no macros may be run. htmlText = manilaSuite.unTaint (htmlText); htmltext = string.replaceAll (htmltext, "<%", "<%"); return (htmlText)} //return the text of the page \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:mainResponder.search.server.searchPage ! on searchPage (altColor="", flShowSiteNames=true, flFeedback=false) { ÇChanges Ç1/16/06; 12:50:49 PM by TAC Çminor formatting tweaks Çclose p and input tags, XHTML compliance Çreplaced manilaSuite.unTaint with mainResponder.neuterText Ç8/3/02; 2:37:48 AM by JES ÇCreated. Generalized search page for mainResponder. Based on workspace.sampleSearch. Original change notes below. Ç01/31/00; 1:40:00 PM by PBS ÇAdded the closing </form> tag, so the Edit this Page button will work. Ç01/27/00; 1:40:08 PM by PBS ÇThis is a safe macro which displays a search page. You can specify an alternate altColor by supplying the third parameter. You can turn off display of site names by supplying the flShowSiteNames parameter and setting it to false. bundle { //deal with defaults if altColor == "" { altColor = "gainsboro"}}; local (pta = html.getPageTableAddress ()); //get the address of the current page table local (indexName = "Index.root"); //change this if you want to use a different index local (adrFilterCallback); if defined (pta^.responderAttributes.adrSearchFilterCallback) { adrFilterCallback = pta^.responderAttributes.adrSearchFilterCallback}; local (flRunSearch = false); //will be true if a search should be run local (actionUrl); //the action URL for the form bundle { //get the action URL actionUrl = pta^.URI; if defined (pta^.pathArgs) { //there may also be a $xxx component if pta^.pathArgs != "" { if not (actionUrl endsWith "$") { actionUrl = actionUrl + "$"}; actionUrl = actionUrl + pta^.pathArgs}}}; local (htmlText); //htmlText will contain the HTML that will be returned on add (s) { //subroutine for adding a string to htmlText htmlText = htmlText + s}; local (queryString = "", displayQueryString = ""); bundle { //get the query string and display query string local (argTable); new (tableType, @argTable); if defined (pta^.searchArgs) and pta^.searchArgs != "" { flRunSearch = true; webserver.parseArgs (pta^.searchArgs, @argTable); //parse the search args into a local table if defined (argTable.q) { //q is the element which contains the query string from the browser queryString = string.trimWhiteSpace (argTable.q); //trim it up local (adrIsoTable); if system.environment.isMac { adrIsoTable = @html.data.iso8859.mac}; if system.environment.isWindows { adrIsoTable = @html.data.iso8859.win}; displayQueryString = string.iso8859Encode (queryString, adrIsoTable); //encode characters as HTML entities ÇVarious additional filterings are necessary to get this to show up correctly in the input field. displayQueryString = string.replaceAll (displayQueryString, "\"", """); displayQueryString = string.replaceAll (displayQueryString, "<", "<"); displayQueryString = string.replaceAll (displayQueryString, ">", ">"); displayQueryString = string.replaceAll (displayQueryString, "+", " ")}}}; on addSearchForm () { //build the search form -- you might want to customize the display of this add ("<form method=\"get\" action=\"" + actionUrl + "\">\r"); //it's a GET method form add ("Search for: \r"); add ("<input type=\"text\" name=\"q\" size=\"30\" value=\"" + displayQueryString + "\" /> "); add ("<input type=\"submit\" value=\"Search\" /><p />\r"); add ("</form>")}; //PBS 01/31/00: close the form. addSearchForm (); if flRunSearch { //display the search results if a search should be run add (mainResponder.search.server.htmlSearch (pta, actionUrl, flShowSiteNames, altColor, flFeedback, indexName, adrFilterCallback))}; ÇMake sure this page is totally secure -- no macros may be run. htmlText = mainResponder.neuterText (htmlText, flNeuterTags: false); htmlText = string.replaceAll (htmlText, "<%", "<%"); return (htmlText)} //return the text of the page \ No newline at end of file |