PEEL Shopping
Open source ecommerce : PEEL Shopping
basexml.php
Go to the documentation of this file.
1 <?php
2 /*
3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4  * Copyright (C) 2003-2010 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 ( $_GET['Command'] == 'FileUpload' )
69  SendUploadResults( $number, "", "", $text ) ;
70 
71  if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
72  {
73  SendErrorNode( $number, $text ) ;
74  CreateXmlFooter() ;
75  }
76  else
77  {
78  SetXmlHeaders() ;
79 
80  // Create the XML document header
81  echo '<?xml version="1.0" encoding="utf-8" ?>' ;
82 
83  echo '<Connector>' ;
84 
85  SendErrorNode( $number, $text ) ;
86 
87  echo '</Connector>' ;
88  }
89  exit ;
90 }
91 
92 function SendErrorNode( $number, $text )
93 {
94  if ($text)
95  echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
96  else
97  echo '<Error number="' . $number . '" />' ;
98 }
99 ?>
ConvertToXmlAttribute($value)
Definition: util.php:60
CreateXmlHeader($command, $resourceType, $currentFolder)
Definition: basexml.php:45
SendError($number, $text)
Definition: basexml.php:66
SendUploadResults($errorNumber, $fileUrl= '', $fileName= '', $customMsg= '')
Definition: io.php:283
GetUrlFromPath($resourceType, $folderPath, $sCommand)
Definition: io.php:59
CreateXmlFooter()
Definition: basexml.php:61
SetXmlHeaders()
Definition: basexml.php:26
$GLOBALS['page_columns_count']
SendErrorNode($number, $text)
Definition: basexml.php:92

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:30:08 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.