PageRenderTime 13ms CodeModel.GetById 6ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/pigeoncms/Plugins/fckeditor/editor/filemanager/connectors/cfm/cf_basexml.cfm

http://pigeoncms.googlecode.com/
ColdFusion | 72 lines | 44 code | 6 blank | 22 comment | 0 complexity | 0780da443ca739472a7aeaea941e5e1b MD5 | raw file
 1<cfsetting enablecfoutputonly="Yes">
 2<!---
 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 4 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
 5 *
 6 * == BEGIN LICENSE ==
 7 *
 8 * Licensed under the terms of any of the following licenses at your
 9 * choice:
10 *
11 *  - GNU General Public License Version 2 or later (the "GPL")
12 *    http://www.gnu.org/licenses/gpl.html
13 *
14 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 *    http://www.gnu.org/licenses/lgpl.html
16 *
17 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18 *    http://www.mozilla.org/MPL/MPL-1.1.html
19 *
20 * == END LICENSE ==
21 *
22 * This file include the functions that create the base XML output by the ColdFusion Connector (MX 6.0 and above).
23--->
24
25<cffunction name="SetXmlHeaders" returntype="void">
26	<cfheader name="Expires" value="#GetHttpTimeString(Now())#">
27	<cfheader name="Pragma" value="no-cache">
28	<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">
29	<cfcontent reset="true" type="text/xml; charset=UTF-8">
30</cffunction>
31
32<cffunction name="CreateXmlHeader" returntype="void" output="true">
33	<cfargument name="command" required="true">
34	<cfargument name="resourceType" required="true">
35	<cfargument name="currentFolder" required="true">
36
37	<cfset SetXmlHeaders()>
38	<cfoutput><?xml version="1.0" encoding="utf-8" ?></cfoutput>
39	<cfoutput><Connector command="#ARGUMENTS.command#" resourceType="#ARGUMENTS.resourceType#"></cfoutput>
40	<cfoutput><CurrentFolder path="#HTMLEditFormat(ARGUMENTS.currentFolder)#" url="#HTMLEditFormat( GetUrlFromPath( resourceType, currentFolder, command ) )#" /></cfoutput>
41	<cfset REQUEST.HeaderSent = true>
42</cffunction>
43
44<cffunction name="CreateXmlFooter" returntype="void" output="true">
45	<cfoutput></Connector></cfoutput>
46</cffunction>
47
48<cffunction name="SendError" returntype="void" output="true">
49	<cfargument name="number" required="true" type="Numeric">
50	<cfargument name="text" required="true">
51	<cfif isDefined("REQUEST.HeaderSent") and REQUEST.HeaderSent>
52		<cfset SendErrorNode( ARGUMENTS.number, ARGUMENTS.text )>
53		<cfset CreateXmlFooter() >
54	<cfelse>
55		<cfset SetXmlHeaders()>
56		<cfoutput><?xml version="1.0" encoding="utf-8" ?></cfoutput>
57		<cfoutput><Connector></cfoutput>
58		<cfset SendErrorNode( ARGUMENTS.number, ARGUMENTS.text )>
59		<cfset CreateXmlFooter() >
60	</cfif>
61	<cfabort>
62</cffunction>
63
64<cffunction name="SendErrorNode" returntype="void" output="true">
65	<cfargument name="number" required="true" type="Numeric">
66	<cfargument name="text" required="true">
67	<cfif Len(ARGUMENTS.text)>
68		<cfoutput><Error number="#ARGUMENTS.number#" text="#htmleditformat(ARGUMENTS.text)#" /></cfoutput>
69	<cfelse>
70		<cfoutput><Error number="#ARGUMENTS.number#" /></cfoutput>
71	</cfif>
72</cffunction>