~alexharrington/xibo/pyclient-1.1.0a22

« back to all changes in this revision

Viewing changes to server/3rdparty/fckeditor/editor/filemanager/connectors/php/basexml.php

  • Committer: Alex Harrington
  • Date: 2009-03-02 17:27:19 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: alex@longhill.org.uk-20090302172719-7qigtqo1mjydo4b3
[core] Created folder to hold code used for central services to Xibo instances

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 
 * Copyright (C) 2003-2007 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
 
 * These functions define the base of the XML response sent by the PHP
23
 
 * connector.
24
 
 */
25
 
 
26
 
function SetXmlHeaders()
27
 
{
28
 
        ob_end_clean() ;
29
 
 
30
 
        // Prevent the browser from caching the result.
31
 
        // Date in the past
32
 
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
33
 
        // always modified
34
 
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
35
 
        // HTTP/1.1
36
 
        header('Cache-Control: no-store, no-cache, must-revalidate') ;
37
 
        header('Cache-Control: post-check=0, pre-check=0', false) ;
38
 
        // HTTP/1.0
39
 
        header('Pragma: no-cache') ;
40
 
 
41
 
        // Set the response format.
42
 
        header( 'Content-Type: text/xml; charset=utf-8' ) ;
43
 
}
44
 
 
45
 
function CreateXmlHeader( $command, $resourceType, $currentFolder )
46
 
{
47
 
        SetXmlHeaders() ;
48
 
 
49
 
        // Create the XML document header.
50
 
        echo '<?xml version="1.0" encoding="utf-8" ?>' ;
51
 
 
52
 
        // Create the main "Connector" node.
53
 
        echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
54
 
 
55
 
        // Add the current folder node.
56
 
        echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ;
57
 
 
58
 
        $GLOBALS['HeaderSent'] = true ;
59
 
}
60
 
 
61
 
function CreateXmlFooter()
62
 
{
63
 
        echo '</Connector>' ;
64
 
}
65
 
 
66
 
function SendError( $number, $text )
67
 
{
68
 
        if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
69
 
        { 
70
 
                SendErrorNode( $number, $text ) ;
71
 
                CreateXmlFooter() ;
72
 
        }
73
 
        else
74
 
        {
75
 
                SetXmlHeaders() ;
76
 
 
77
 
                // Create the XML document header
78
 
                echo '<?xml version="1.0" encoding="utf-8" ?>' ;
79
 
 
80
 
                echo '<Connector>' ;
81
 
                
82
 
                SendErrorNode( $number, $text ) ;
83
 
                
84
 
                echo '</Connector>' ;
85
 
        }
86
 
        exit ;
87
 
}
88
 
 
89
 
function SendErrorNode(  $number, $text )
90
 
{
91
 
        echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
92
 
}
 
1
<?php
 
2
/*
 
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 
4
 * Copyright (C) 2003-2007 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
 * These functions define the base of the XML response sent by the PHP
 
23
 * connector.
 
24
 */
 
25
 
 
26
function SetXmlHeaders()
 
27
{
 
28
        ob_end_clean() ;
 
29
 
 
30
        // Prevent the browser from caching the result.
 
31
        // Date in the past
 
32
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
 
33
        // always modified
 
34
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
 
35
        // HTTP/1.1
 
36
        header('Cache-Control: no-store, no-cache, must-revalidate') ;
 
37
        header('Cache-Control: post-check=0, pre-check=0', false) ;
 
38
        // HTTP/1.0
 
39
        header('Pragma: no-cache') ;
 
40
 
 
41
        // Set the response format.
 
42
        header( 'Content-Type: text/xml; charset=utf-8' ) ;
 
43
}
 
44
 
 
45
function CreateXmlHeader( $command, $resourceType, $currentFolder )
 
46
{
 
47
        SetXmlHeaders() ;
 
48
 
 
49
        // Create the XML document header.
 
50
        echo '<?xml version="1.0" encoding="utf-8" ?>' ;
 
51
 
 
52
        // Create the main "Connector" node.
 
53
        echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
 
54
 
 
55
        // Add the current folder node.
 
56
        echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ;
 
57
 
 
58
        $GLOBALS['HeaderSent'] = true ;
 
59
}
 
60
 
 
61
function CreateXmlFooter()
 
62
{
 
63
        echo '</Connector>' ;
 
64
}
 
65
 
 
66
function SendError( $number, $text )
 
67
{
 
68
        if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
 
69
        { 
 
70
                SendErrorNode( $number, $text ) ;
 
71
                CreateXmlFooter() ;
 
72
        }
 
73
        else
 
74
        {
 
75
                SetXmlHeaders() ;
 
76
 
 
77
                // Create the XML document header
 
78
                echo '<?xml version="1.0" encoding="utf-8" ?>' ;
 
79
 
 
80
                echo '<Connector>' ;
 
81
                
 
82
                SendErrorNode( $number, $text ) ;
 
83
                
 
84
                echo '</Connector>' ;
 
85
        }
 
86
        exit ;
 
87
}
 
88
 
 
89
function SendErrorNode(  $number, $text )
 
90
{
 
91
        echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
 
92
}
93
93
?>
 
 
b'\\ No newline at end of file'