Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezxmlinputhandler.php
Go to the documentation of this file.
1 <?php
18 class eZXMLInputHandler
19 {
27 public function __construct( $xmlData, $aliasedType, $contentObjectAttribute )
28 {
29 $this->XMLData = preg_replace( '/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', '', $xmlData, -1, $count );
30 if ( $count > 0 )
31 {
32 eZDebug::writeWarning( "$count invalid character(s) detected. They have been removed from input.", __METHOD__ );
33 }
34 $this->ContentObjectAttribute = $contentObjectAttribute;
35 $this->AliasedHandler = null;
36 // use of $aliasedType is deprecated as of 4.1 and setting is ignored in aliased_handler
37 $this->AliasedType = $aliasedType;
38 }
39
43 function attributes()
44 {
45 return array( 'input_xml',
46 'aliased_type',
47 'aliased_handler',
48 'edit_template_name',
49 'information_template_name' );
50 }
51
55 function hasAttribute( $name )
56 {
57 return in_array( $name, $this->attributes() );
58 }
59
63 function attribute( $name )
64 {
65 switch ( $name )
66 {
67 case 'input_xml':
68 {
69 return $this->inputXML();
70 } break;
71 case 'edit_template_name':
72 {
73 return $this->editTemplateName();
74 }break;
75 case 'information_template_name':
76 {
77 return $this->informationTemplateName();
78 }break;
79 case 'aliased_type':
80 {
81 eZDebug::writeWarning( "'aliased_type' is deprecated as of 4.1 and not in use anymore, meaning it will always return false.", __METHOD__ );
82 return $this->AliasedType;
83 }break;
84 case 'aliased_handler':
85 {
86 if ( $this->AliasedHandler === null )
87 {
88 $this->AliasedHandler = eZXMLText::inputHandler( $this->XMLData,
89 $this->AliasedType,
90 false,
91 $this->ContentObjectAttribute );
92 }
93 return $this->AliasedHandler;
94 }break;
95 default:
96 {
97 eZDebug::writeError( "Attribute '$name' does not exist", __METHOD__ );
98 return null;
99 }break;
100 }
101 }
102
106 function editTemplateName()
107 {
108 $name = 'ezxmltext';
109 $suffix = $this->editTemplateSuffix( $this->ContentObjectAttribute );
110 if ( $suffix !== false )
111 {
112 $name .= '_' . $suffix;
113 }
114 return $name;
115 }
116
120 function informationTemplateName()
121 {
122 $name = 'ezxmltext';
123 $suffix = $this->informationTemplateSuffix( $this->ContentObjectAttribute );
124 if ( $suffix !== false )
125 {
126 $name .= '_' . $suffix;
127 }
128 return $name;
129 }
130
136 function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute )
137 {
138 }
139
145 function isValid()
146 {
147 return true;
148 }
149
154 function editTemplateSuffix( &$contentobjectAttribute )
155 {
156 return false;
157 }
158
163 function informationTemplateSuffix( &$contentobjectAttribute )
164 {
165 return false;
166 }
167
171 function xmlData()
172 {
173 return $this->XMLData;
174 }
175
180 function validateInput( $http, $base, $contentObjectAttribute )
181 {
182 return eZInputValidator::STATE_INVALID;
183 }
184
190 function convertInput( $text )
191 {
192 return null;
193 }
194
200 function inputXML()
201 {
202 return null;
203 }
204
207 public $XMLData;
208 public $AliasedType;
209 public $AliasedHandler;
210 public $ContentObjectAttribute;
211 }
212
213 ?>
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\writeWarning
static writeWarning( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:502
eZInputValidator\STATE_INVALID
const STATE_INVALID
Definition: ezinputvalidator.php:81
eZXMLInputHandler
The class eZXMLInputHandler does.
Definition: ezxmlinputhandler.php:19
eZXMLInputHandler\informationTemplateSuffix
informationTemplateSuffix(&$contentobjectAttribute)
Definition: ezxmlinputhandler.php:163
eZXMLInputHandler\$ContentObjectAttribute
$ContentObjectAttribute
Definition: ezxmlinputhandler.php:210
eZXMLInputHandler\hasAttribute
hasAttribute( $name)
Definition: ezxmlinputhandler.php:55
eZXMLInputHandler\$AliasedHandler
$AliasedHandler
Definition: ezxmlinputhandler.php:209
eZXMLInputHandler\attributes
attributes()
Definition: ezxmlinputhandler.php:43
eZXMLInputHandler\$XMLData
$XMLData
Definition: ezxmlinputhandler.php:207
eZXMLInputHandler\inputXML
inputXML()
Definition: ezxmlinputhandler.php:200
eZXMLInputHandler\isValid
isValid()
Definition: ezxmlinputhandler.php:145
eZXMLInputHandler\xmlData
xmlData()
Definition: ezxmlinputhandler.php:171
eZXMLInputHandler\$AliasedType
$AliasedType
Definition: ezxmlinputhandler.php:208
eZXMLInputHandler\customObjectAttributeHTTPAction
customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute)
Definition: ezxmlinputhandler.php:136
eZXMLInputHandler\__construct
__construct( $xmlData, $aliasedType, $contentObjectAttribute)
Definition: ezxmlinputhandler.php:27
eZXMLInputHandler\convertInput
convertInput( $text)
Definition: ezxmlinputhandler.php:190
eZXMLInputHandler\editTemplateName
editTemplateName()
Definition: ezxmlinputhandler.php:106
eZXMLInputHandler\editTemplateSuffix
editTemplateSuffix(&$contentobjectAttribute)
Definition: ezxmlinputhandler.php:154
eZXMLInputHandler\informationTemplateName
informationTemplateName()
Definition: ezxmlinputhandler.php:120
eZXMLInputHandler\attribute
attribute( $name)
Definition: ezxmlinputhandler.php:63
eZXMLInputHandler\validateInput
validateInput( $http, $base, $contentObjectAttribute)
Definition: ezxmlinputhandler.php:180
eZXMLText\inputHandler
static inputHandler(&$xmlData, $type=false, $useAlias=true, $contentObjectAttribute=false)
Definition: ezxmltext.php:116
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.