event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / fckeditor / editor / filemanager / browser / default / connectors / perl / basexml.pl
1 #####\r
2 #  FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
3 #  Copyright (C) 2003-2007 Frederico Caldeira Knabben\r
4 #\r
5 #  == BEGIN LICENSE ==\r
6 #\r
7 #  Licensed under the terms of any of the following licenses at your\r
8 #  choice:\r
9 #\r
10 #   - GNU General Public License Version 2 or later (the "GPL")\r
11 #     http://www.gnu.org/licenses/gpl.html\r
12 #\r
13 #   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
14 #     http://www.gnu.org/licenses/lgpl.html\r
15 #\r
16 #   - Mozilla Public License Version 1.1 or later (the "MPL")\r
17 #     http://www.mozilla.org/MPL/MPL-1.1.html\r
18 #\r
19 #  == END LICENSE ==\r
20 #\r
21 #  This is the File Manager Connector for Perl.\r
22 #####\r
23 \r
24 sub CreateXmlHeader\r
25 {\r
26         local($command,$resourceType,$currentFolder) = @_;\r
27 \r
28         # Create the XML document header.\r
29         print '<?xml version="1.0" encoding="utf-8" ?>';\r
30 \r
31         # Create the main "Connector" node.\r
32         print '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';\r
33 \r
34         # Add the current folder node.\r
35         print '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType,$currentFolder)) . '" />';\r
36 }\r
37 \r
38 sub CreateXmlFooter\r
39 {\r
40         print '</Connector>';\r
41 }\r
42 \r
43 sub SendError\r
44 {\r
45         local( $number, $text ) = @_;\r
46 \r
47         print << "_HTML_HEAD_";\r
48 Content-Type:text/xml; charset=utf-8\r
49 Pragma: no-cache\r
50 Cache-Control: no-cache\r
51 Expires: Thu, 01 Dec 1994 16:00:00 GMT\r
52 \r
53 _HTML_HEAD_\r
54 \r
55         # Create the XML document header\r
56         print '<?xml version="1.0" encoding="utf-8" ?>' ;\r
57 \r
58         print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ;\r
59 \r
60         exit ;\r
61 }\r
62 \r
63 1;\r