3 * FCKeditor - The text editor for internet
4 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
6 * Licensed under the terms of the GNU Lesser General Public License:
7 * http://www.opensource.org/licenses/lgpl-license.php
9 * For further information visit:
10 * http://www.fckeditor.net/
12 * "Support Open Source software. What about a donation today?"
14 * File Name: basexml.php
15 * These functions define the base of the XML response sent by the PHP
19 * Frederico Caldeira Knabben (fredck@fckeditor.net)
22 function SetXmlHeaders()
26 // Prevent the browser from caching the result.
28 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
30 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
32 header('Cache-Control: no-store, no-cache, must-revalidate') ;
33 header('Cache-Control: post-check=0, pre-check=0', false) ;
35 header('Pragma: no-cache') ;
37 // Set the response format.
38 header( 'Content-Type:text/xml; charset=utf-8' ) ;
41 function CreateXmlHeader( $command, $resourceType, $currentFolder )
45 // Create the XML document header.
46 echo '<?xml version="1.0" encoding="utf-8" ?>' ;
48 // Create the main "Connector" node.
49 echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
51 // Add the current folder node.
52 echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder ) ) . '" />' ;
55 function CreateXmlFooter()
60 function SendError( $number, $text )
64 // Create the XML document header
65 echo '<?xml version="1.0" encoding="utf-8" ?>' ;
67 echo '<Connector><Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" /></Connector>' ;