Changeset 273
- Timestamp:
- 12/15/06 19:07:21 (2 years ago)
- Files:
-
- 1 modified
-
framework/trunk/verbs/relocate.cfm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
framework/trunk/verbs/relocate.cfm
r267 r273 70 70 // type - server|client - default client 71 71 if (structKeyExists(fb_.verbInfo.attributes,"type")) { 72 if (listFind("server,client",fb_.verbInfo.attributes.type) eq 0) { 72 // FB51: adds moved and javascript types: 73 if (listFind("server,client,moved,javascript",fb_.verbInfo.attributes.type) eq 0) { 73 74 fb_throw("fusebox.badGrammar.invalidAttributeValue", 74 75 "Attribute has invalid value", 75 "The attribute 'type' must either be ""server"" or ""client"", for a 'relocate' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");76 "The attribute 'type' must either be ""server"", ""client"", ""moved"" or ""javascript"", for a 'relocate' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#."); 76 77 } 77 78 } else { … … 88 89 89 90 // compile <relocate> 90 if (fb_.verbInfo.attributes.type is "server") { 91 switch (fb_.verbInfo.attributes.type) { 92 93 case "server": 91 94 fb_appendLine('<cfset getPageContext().forward("#fb_.verbInfo.attributes.url#")>'); 92 } else { 95 break; 96 97 case "client": 93 98 fb_appendLine('<cflocation url="#fb_.verbInfo.attributes.url#" addtoken="#fb_.verbInfo.attributes.addtoken#">'); 99 break; 100 101 case "moved": 102 fb_appendLine('<cfheader statuscode="301" statustext="Moved Permanently">'); 103 fb_appendLine('<cfheader name="Location" value="#fb_.verbInfo.attributes.url#">'); 104 break; 105 106 case "javascript": 107 fb_appendLine('<cfoutput><script type="text/javascript">( document.location.replace ) ? ' & 108 'document.location.replace("#fb_verbInfo.attributes.url#") : ' & 109 'document.location.href = "#fb_.verbInfo.attributes.url#";</script></cfoutput>'); 110 break; 111 94 112 } 95 113 fb_appendLine('<cfabort>');
