Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezinisettingtype.php
Go to the documentation of this file.
1 <?php
21 class eZIniSettingType extends eZDataType
22 {
23 const DATA_TYPE_STRING = 'ezinisetting';
24
25 const CLASS_TYPE = '_ezinisetting_type_';
26 const CLASS_FILE = '_ezinisetting_file_';
27 const CLASS_SECTION = '_ezinisetting_section_';
28 const CLASS_PARAMETER = '_ezinisetting_parameter_';
29 const CLASS_INI_INSTANCE = '_ezinisetting_ini_instance_';
30
31 const CLASS_FILE_FIELD = 'data_text1';
32 const CLASS_SECTION_FIELD = 'data_text2';
33 const CLASS_PARAMETER_FIELD = 'data_text3';
34 const CLASS_TYPE_FIELD = 'data_int1';
35 const CLASS_INI_INSTANCE_FIELD = 'data_text4';
36 const SITE_ACCESS_LIST_FIELD = 'data_text5';
37
38 const CLASS_TYPE_ARRAY = 6;
39
40 public function __construct()
41 {
42 parent::__construct( self::DATA_TYPE_STRING, ezpI18n::tr( 'kernel/classes/datatypes', 'Ini Setting', 'Datatype name' ),
43 array( 'translation_allowed' => false,
44 'serialize_supported' => true ) );
45 }
46
47 function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
48 {
49 if ( $http->hasPostVariable( $base . '_ini_setting_' . $contentObjectAttribute->attribute( 'id' ) ) )
50 {
51 $contentClassAttribute = $contentObjectAttribute->attribute( 'contentclass_attribute' );
52 $iniFile = eZIniSettingType::iniFile( $contentClassAttribute );
53 $iniSection = eZIniSettingType::iniSection( $contentClassAttribute );
54 $iniParameterName = eZIniSettingType::iniParameterName( $contentClassAttribute );
55
56 $config = eZINI::instance( $iniFile );
57 if ( $config == null )
58 {
59 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
60 'Could not locate the ini file.' ) );
61 return eZInputValidator::STATE_INVALID;
62 }
63
64 if ( $contentClassAttribute->attribute( self::CLASS_TYPE_FIELD ) == self::CLASS_TYPE_ARRAY )
65 {
66 $iniArray = array();
67 // if ( eZIniSettingType::parseArrayInput( $contentObjectAttribute->attribute( 'data_text' ), $iniArray ) === false )
68 if ( eZIniSettingType::parseArrayInput( $http->postVariable( $base . '_ini_setting_' . $contentObjectAttribute->attribute( 'id' ) ), $iniArray ) === false )
69 {
70 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Wrong text field value.' ) );
71
72 return eZInputValidator::STATE_INVALID;
73 }
74 }
75 }
76 return eZInputValidator::STATE_ACCEPTED;
77 }
78
79 function validateClassAttributeHTTPInput( $http, $base, $classAttribute )
80 {
81 $fileParam = $base . self::CLASS_FILE . $classAttribute->attribute( 'id' );
82 $sectionParam = $base . self::CLASS_SECTION . $classAttribute->attribute( 'id' );
83 $parameterParam = $base . self::CLASS_PARAMETER . $classAttribute->attribute( 'id' );
84 $typeParam = $base . self::CLASS_TYPE . $classAttribute->attribute( 'id' );
85 $iniInstanceParam = $base . self::CLASS_INI_INSTANCE . $classAttribute->attribute( 'id' );
86
87 if ( $http->hasPostVariable( $fileParam ) &&
88 $http->hasPostVariable( $sectionParam ) &&
89 $http->hasPostVariable( $parameterParam ) &&
90 $http->hasPostVariable( $typeParam ) &&
91 $http->hasPostVariable( $iniInstanceParam ) )
92 {
93 $iniFile = $http->postVariable( $fileParam );
94 $iniSection = $http->postVariable( $sectionParam );
95
96 $config = eZINI::instance( $iniFile );
97 if ( $config == null )
98 {
99 return eZInputValidator::STATE_INVALID;
100 }
101
102 if ( !$config->hasGroup( $iniSection ) )
103 {
104 return eZInputValidator::STATE_INVALID;
105 }
106 return eZInputValidator::STATE_ACCEPTED;
107 }
108
109 eZDebug::writeNotice( 'Could not validate parameters: ' . "\n" .
110 $fileParam . ': ' . $http->postVariable( $fileParam ) . "\n" .
111 $sectionParam . ': ' . $http->postVariable( $sectionParam ) . "\n" .
112 $parameterParam . ': ' . $http->postVariable( $parameterParam ) . "\n" .
113 $typeParam . ': ' . $http->postVariable( $typeParam ). "\n" .
114 $iniInstanceParam. ': '. $http->postVariable( $iniInstanceParam ), 'eZIniSettingType::validateClassAttributeHTTPInput',
115 'eZIniSettingType::validateClassAttributeHTTPInput' );
116 return eZInputValidator::STATE_INVALID;
117 }
118
119 function initializeClassAttribute( $classAttribute )
120 {
121 eZIniSettingType::setSiteAccessList( $classAttribute );
122 }
123
124 function initializeObjectAttribute( $objectAttribute, $currentVersion, $originalContentObjectAttribute )
125 {
126 if ( $currentVersion != false )
127 {
128 $objectAttribute->setAttribute( 'data_text', $originalContentObjectAttribute->attribute( 'data_text' ) );
129 }
130 else
131 {
132 $contentClassAttribute = $objectAttribute->attribute( 'contentclass_attribute' );
133 $iniInstanceArray = explode( ';', $contentClassAttribute->attribute( self::CLASS_INI_INSTANCE_FIELD ) );
134 $siteAccessArray = explode( ';', $contentClassAttribute->attribute( self::SITE_ACCESS_LIST_FIELD ) );
135 $filename = $contentClassAttribute->attribute( self::CLASS_FILE_FIELD );
136 $section = $contentClassAttribute->attribute( self::CLASS_SECTION_FIELD );
137 $parameter = $contentClassAttribute->attribute( self::CLASS_PARAMETER_FIELD );
138
139 if ( ! in_array( 0, $iniInstanceArray ) ) /* Makes sure it check 'settings' and 'settings/override' last */
140 array_unshift( $iniInstanceArray, 0 );
141 array_unshift( $iniInstanceArray, -1 );
142
143 $configArray = array();
144
145 foreach ( $iniInstanceArray as $iniInstance )
146 {
147 if ( $iniInstance == -1 )
148 $path = 'settings';
149 else if ( $iniInstance == 0 )
150 $path = 'settings/override';
151 else
152 $path = 'settings/siteaccess/' . $siteAccessArray[$iniInstance];
153
154 if ( !eZINI::parameterSet( $filename, $path, $section, $parameter ) )
155 continue;
156
157 $config = eZINI::instance( $filename, $path, null, null, null, true );
158
159 $configValue = $config->variable( $section, $parameter );
160
161 if ( is_array( $configValue ) )
162 {
163 foreach ( array_keys( $configValue ) as $key )
164 {
165 $configArray[$key] = $configValue[$key];
166 }
167 }
168 else
169 {
170 $objectAttribute->setAttribute( 'data_text', $configValue );
171 eZDebug::writeNotice( "Loaded following values from $path/$filename:\n $configValue", __METHOD__ );
172 }
173 }
174
175 if ( count( $configArray ) > 0 )
176 {
177 $data = '';
178 foreach( array_keys( $configArray ) as $key )
179 {
180 if ( is_int( $key ) )
181 {
182 $data .= '=' . $configArray[$key] . "\n" ;
183 }
184 else
185 {
186 $data .= $key . '=' . $configArray[$key] . "\n" ;
187 }
188 }
189 $objectAttribute->setAttribute( 'data_text', $data );
190 }
191 }
192 }
193
194 function fetchClassAttributeHTTPInput( $http, $base, $classAttribute )
195 {
196 $fileParam = $base . self::CLASS_FILE . $classAttribute->attribute( 'id' );
197 $sectionParam = $base . self::CLASS_SECTION . $classAttribute->attribute( 'id' );
198 $paramParam = $base . self::CLASS_PARAMETER . $classAttribute->attribute( 'id' );
199 $typeParam = $base . self::CLASS_TYPE . $classAttribute->attribute( 'id' );
200 $iniInstanceParam = $base . self::CLASS_INI_INSTANCE . $classAttribute->attribute( 'id' );
201
202 if ( $http->hasPostVariable( $fileParam ) &&
203 $http->hasPostVariable( $sectionParam ) &&
204 $http->hasPostVariable( $paramParam ) &&
205 $http->hasPostVariable( $typeParam ) &&
206 $http->hasPostVariable( $iniInstanceParam ) )
207 {
208 $file = $http->postVariable( $fileParam );
209 $section = $http->postVariable( $sectionParam );
210 $parameter = $http->postVariable( $paramParam );
211 $type = $http->postVariable( $typeParam );
212
213 $iniInstanceArray = $http->postVariable( $iniInstanceParam );
214 if ( is_array( $iniInstanceArray ) )
215 {
216 $iniInstance = '';
217 foreach ( $iniInstanceArray as $idx => $instance )
218 {
219 if ( $idx > 0 )
220 $iniInstance .= ';';
221 $iniInstance .= $instance;
222 }
223 }
224 else
225 {
226 $iniInstance = $iniInstanceArray;
227 }
228
229 eZIniSettingType::setSiteAccessList( $classAttribute );
230 $classAttribute->setAttribute( self::CLASS_FILE_FIELD, $file );
231 $classAttribute->setAttribute( self::CLASS_SECTION_FIELD, $section );
232 $classAttribute->setAttribute( self::CLASS_PARAMETER_FIELD, $parameter );
233 $classAttribute->setAttribute( self::CLASS_TYPE_FIELD, $type );
234 $classAttribute->setAttribute( self::CLASS_INI_INSTANCE_FIELD, $iniInstance );
235
236 return true;
237 }
238 return false;
239 }
240
241 function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
242 {
243 if ( $http->hasPostVariable( $base . '_ini_setting_' . $contentObjectAttribute->attribute( "id" ) ) )
244 {
245 $data = $http->postVariable( $base . '_ini_setting_' . $contentObjectAttribute->attribute( "id" ) );
246 $contentObjectAttribute->setAttribute( 'data_text', trim( $data ) );
247 if ( $http->hasPostVariable( $base . '_ini_setting_make_empty_array_' . $contentObjectAttribute->attribute( "id" ) ) )
248 {
249 $isChecked = $http->postVariable( $base . '_ini_setting_make_empty_array_' . $contentObjectAttribute->attribute( "id" ) );
250 if ( isset( $isChecked ) )
251 $isChecked = 1;
252 $contentObjectAttribute->setAttribute( 'data_int', $isChecked );
253 }
254 else
255 {
256 $contentObjectAttribute->setAttribute( 'data_int', 0 );
257 }
258 return true;
259 }
260 return false;
261 }
262
263 function onPublish( $contentObjectAttribute, $contentObject, $publishedNodes )
264 {
265 $contentClassAttribute = $contentObjectAttribute->attribute( 'contentclass_attribute' );
266 $section = $contentClassAttribute->attribute( self::CLASS_SECTION_FIELD );
267 $parameter = $contentClassAttribute->attribute( self::CLASS_PARAMETER_FIELD );
268 $iniInstanceArray = explode( ';', $contentClassAttribute->attribute( self::CLASS_INI_INSTANCE_FIELD ) );
269 $siteAccessArray = explode( ';', $contentClassAttribute->attribute( self::SITE_ACCESS_LIST_FIELD ) );
270 $filename = $contentClassAttribute->attribute( self::CLASS_FILE_FIELD );
271 $makeEmptyArray = $contentObjectAttribute->attribute( 'data_int' );
272
273 foreach ( $iniInstanceArray as $iniInstance )
274 {
275 if ( $iniInstance == 0 )
276 $path = 'settings/override';
277 else
278 $path = 'settings/siteaccess/' . $siteAccessArray[$iniInstance];
279
280 $config = new eZINI( $filename . '.append', $path, null, false, null, true, true );
281
282 if ( $config == null )
283 {
284 eZDebug::writeError( 'Could not open ' . $path . '/' . $filename );
285 continue;
286 }
287 if ( $contentClassAttribute->attribute( self::CLASS_TYPE_FIELD ) == self::CLASS_TYPE_ARRAY )
288 {
289 if ( $contentObjectAttribute->attribute( 'data_text' ) != null )
290 {
291 $iniArray = array();
292 eZIniSettingType::parseArrayInput( $contentObjectAttribute->attribute( 'data_text' ), $iniArray, $makeEmptyArray );
293 $config->setVariable( $section, $parameter, $iniArray );
294 }
295 else
296 {
297 $config->removeSetting( $section, $parameter );
298 }
299 }
300 else
301 {
302 $config->setVariable( $section, $parameter, $contentObjectAttribute->attribute( 'data_text' ) );
303 eZDebug::writeNotice( 'Saved ini settings to file: ' . $path . '/' . $filename . "\n" .
304 ' ['. $section . ']' . "\n" .
305 ' ' . $parameter . '=' . $contentObjectAttribute->attribute( 'data_text' ),
306 __METHOD__ );
307 }
308 $config->save();
309 }
310 }
311
321 function parseArrayInput( $inputText, &$outputArray, $makeEmptyArray = false )
322 {
323 $lineArray = explode( "\n", $inputText );
324
325 if( $makeEmptyArray )
326 {
327 $outputArray[] = "";
328 }
329
330 foreach ( array_keys( $lineArray ) as $key )
331 {
332 $line = str_replace( "\r", '', $lineArray[$key] );
333
334 if ( strlen( $line ) <= 2 )
335 continue;
336
337 if ( strstr( $line, '=' ) === false )
338 return false;
339
340 $lineElements = explode( '=', $line );
341 if ( count( $lineElements ) == 1 )
342 {
343 $outputArray[] = $lineElements[0];
344 }
345 else
346 {
347 if ( $lineElements[0] != '' )
348 {
349 $outputArray[ $lineElements[0] ] = implode( '=', array_slice( $lineElements, 1 ) );
350 }
351 else
352 $outputArray[] = implode( '=', array_slice( $lineElements, 1 ) );
353 }
354 }
355 return true;
356 }
357
358 function objectAttributeContent( $contentObjectAttribute )
359 {
360 $contentClassAttribute = $contentObjectAttribute->attribute( 'contentclass_attribute' );
361 $section = $contentClassAttribute->attribute( self::CLASS_SECTION_FIELD );
362 $parameter = $contentClassAttribute->attribute( self::CLASS_PARAMETER_FIELD );
363
364 $iniInstanceArray = explode( ';', $contentClassAttribute->attribute( self::CLASS_INI_INSTANCE_FIELD ) );
365 $siteAccessArray = explode( ';', $contentClassAttribute->attribute( self::SITE_ACCESS_LIST_FIELD ) );
366 $filename = $contentClassAttribute->attribute( self::CLASS_FILE_FIELD );
367
368 $modified = array();
369
370 $contentObject = $contentObjectAttribute->attribute( 'object' );
371 foreach ( $iniInstanceArray as $iniInstance )
372 {
373 if ( $iniInstance == 0 )
374 $path = 'settings/override';
375 else
376 $path = 'settings/siteaccess/' . $siteAccessArray[$iniInstance];
377
378 if ( !eZINI::parameterSet( $filename, $path, $section, $parameter ) )
379 continue;
380
381 $config = eZINI::instance( $filename, $path, null, null, null, true );
382
383 if ( is_array( $config->variable( $section, $parameter ) ) )
384 {
385 $objectIniArray = array();
386 eZIniSettingType::parseArrayInput( $contentObjectAttribute->attribute( 'data_text' ), $objectIniArray );
387 $existingIniArray = $config->variable( $section, $parameter );
388 foreach ( array_keys( $existingIniArray ) as $key )
389 {
390 if ( !is_int( $key ) && $existingIniArray[$key] != $objectIniArray[$key] )
391 {
392 $modified[] = array( 'ini_value' => $parameter . '[' . $key . ']=' . $existingIniArray[$key],
393 'file' => $path . '/' . $filename );
394 }
395 }
396 }
397 else if ( $config->variable( $section, $parameter ) != $contentObjectAttribute->attribute( 'data_text' ) )
398 {
399 $modified[] = array( 'ini_value' => $parameter . '=' . $config->variable( $section, $parameter ),
400 'file' => $path . '/' . $filename );
401 }
402 }
403
404 $data = array( 'data' => $contentObjectAttribute->attribute( 'data_text' ),
405 'modified' => $modified );
406 return $data;
407 }
408
409 function title( $contentObjectAttribute, $name = null )
410 {
411 return $contentObjectAttribute->attribute( 'data_text' );
412 }
413
414 function hasObjectAttributeContent( $contentObjectAttribute )
415 {
416 return true;
417 }
418
419 function serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
420 {
421 $file = $classAttribute->attribute( self::CLASS_FILE_FIELD );
422 $section = $classAttribute->attribute( self::CLASS_SECTION_FIELD );
423 $parameter = $classAttribute->attribute( self::CLASS_PARAMETER_FIELD );
424 $type = $classAttribute->attribute( self::CLASS_TYPE_FIELD );
425 $iniInstance = $classAttribute->attribute( self::CLASS_INI_INSTANCE_FIELD );
426 $siteAccess = $classAttribute->attribute( self::SITE_ACCESS_LIST_FIELD );
427
428 $dom = $attributeParametersNode->ownerDocument;
429 $fileNode = $dom->createElement( 'file' );
430 $fileNode->appendChild( $dom->createTextNode( $file ) );
431 $attributeParametersNode->appendChild( $fileNode );
432 $sectionNode = $dom->createElement( 'section' );
433 $sectionNode->appendChild( $dom->createTextNode( $section ) );
434 $attributeParametersNode->appendChild( $sectionNode );
435 $parameterNode = $dom->createElement( 'parameter' );
436 $parameterNode->appendChild( $dom->createTextNode( $parameter ) );
437 $attributeParametersNode->appendChild( $parameterNode );
438 $typeNode = $dom->createElement( 'type' );
439 $typeNode->appendChild( $dom->createTextNode( $type ) );
440 $attributeParametersNode->appendChild( $typeNode );
441 $iniInstanceNode = $dom->createElement( 'ini_instance' );
442 $iniInstanceNode->appendChild( $dom->createTextNode( $iniInstance ) );
443 $attributeParametersNode->appendChild( $iniInstanceNode );
444 $siteAccessListNode = $dom->createElement( 'site_access_list' );
445 $siteAccessListNode->appendChild( $dom->createTextNode( $siteAccess ) );
446 $attributeParametersNode->appendChild( $siteAccessListNode );
447 }
448
453 function unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
454 {
455 $file = $attributeParametersNode->getElementsByTagName( 'file' )->item( 0 )->textContent;
456 $section = $attributeParametersNode->getElementsByTagName( 'section' )->item( 0 )->textContent;
457 $parameter = $attributeParametersNode->getElementsByTagName( 'parameter' )->item( 0 )->textContent;
458 $type = $attributeParametersNode->getElementsByTagName( 'type' )->item( 0 )->textContent;
459
460 $classAttribute->setAttribute( self::CLASS_FILE_FIELD, $file );
461 $classAttribute->setAttribute( self::CLASS_SECTION_FIELD, $section );
462 $classAttribute->setAttribute( self::CLASS_PARAMETER_FIELD, $parameter );
463 $classAttribute->setAttribute( self::CLASS_TYPE_FIELD, $type );
464
465
466 /* Get and check if site access settings exist in this setup */
467 $remoteIniInstanceList = $attributeParametersNode->getElementsByTagName( 'ini_instance' )->item( 0 )->textContent;
468 $remoteSiteAccessList = $attributeParametersNode->getElementsByTagName( 'site_access_list' )->item( 0 )->textContent;
469 $remoteIniInstanceArray = explode( ';', $remoteIniInstanceList );
470 $remoteSiteAccessArray = explode( ';', $remoteSiteAccessList );
471
472 $config = eZINI::instance( 'site.ini' );
473 $localSiteAccessArray = array_merge( array( 'override' ), $config->variable( 'SiteAccessSettings', 'AvailableSiteAccessList' ) );
474
475 $localIniInstanceArray = array();
476 foreach ( $remoteIniInstanceArray as $remoteIniInstance )
477 {
478 if ( isset( $remoteSiteAccessArray[$remoteIniInstance] ) and in_array( $remoteSiteAccessArray[$remoteIniInstance], $localSiteAccessArray ) )
479 {
480 $localSiteAccessArray[] = array_keys( $localSiteAccessArray, $remoteSiteAccessArray[$remoteIniInstance] );
481 }
482 }
483
484 if ( count( $localSiteAccessArray ) == 0 )
485 {
486 $localIniInstanceArray = array( 0 );
487 }
488
489 $iniInstance = '';
490 foreach( $localIniInstanceArray as $idx => $localIniInstance )
491 {
492 if ( $idx > 0 )
493 $iniInstance .= ';';
494 $iniInstance .= $localIniInstance;
495 }
496
497 $siteAccess = '';
498 foreach( $localSiteAccessArray as $idx => $localSiteAccess )
499 {
500 if ( $idx > 0 )
501 $siteAccess .= ';';
502 $siteAccess .= $localSiteAccess;
503 }
504
505 $classAttribute->setAttribute( self::CLASS_INI_INSTANCE_FIELD, $iniInstance );
506 $classAttribute->setAttribute( self::SITE_ACCESS_LIST_FIELD, $siteAccess );
507 }
508
509
516 function iniParameterName( $contentClassAttribute )
517 {
518 return $contentClassAttribute->attribute( self::CLASS_PARAMETER_FIELD );
519 }
520
527 function iniFile( $contentClassAttribute )
528 {
529 return $contentClassAttribute->attribute( self::CLASS_FILE_FIELD );
530 }
531
538 function iniSection( $contentClassAttribute )
539 {
540 return $contentClassAttribute->attribute( self::CLASS_SECTION_FIELD );
541 }
542
550 function setSiteAccessList( $contentClassAttribute )
551 {
552 $config = eZINI::instance( 'site.ini' );
553 $siteAccessArray = $config->variable( 'SiteAccessSettings', 'AvailableSiteAccessList' );
554 $siteAccessList = 'override';
555 foreach ( $siteAccessArray as $idx => $siteAccess )
556 {
557 $siteAccessList .= ';' . $siteAccess;
558 }
559
560 $contentClassAttribute->setAttribute( self::SITE_ACCESS_LIST_FIELD, $siteAccessList );
561 }
562
563 function toString( $contentObjectAttribute )
564 {
565 $makeEmptyArray = $contentObjectAttribute->attribute( 'data_int' );
566 $value = $contentObjectAttribute->attribute( 'data_text' );
567 return implode( '|', array( $value, $makeEmptyArray ) );
568 }
569
570
571 function fromString( $contentObjectAttribute, $string )
572 {
573 if ( $string == '' )
574 return true;
575 $iniData = explode( '|', $string );
576
577 $contentObjectAttribute->setAttribute( 'data_text', $iniData[0] );
578 if ( isset ( $iniData[1] ) )
579 $contentObjectAttribute->setAttribute( 'data_int', $iniData[1] );
580 return true;
581 }
582
583 function serializeContentObjectAttribute( $package, $objectAttribute )
584 {
585 $node = $this->createContentObjectAttributeDOMNode( $objectAttribute );
586 $makeEmptyArray = $objectAttribute->attribute( 'data_int' );
587 $value = $objectAttribute->attribute( 'data_text' );
588
589 $dom = $node->ownerDocument;
590
591 $makeEmptyArrayNode = $dom->createElement( 'make_empty_array' );
592 $makeEmptyArrayNode->appendChild( $dom->createTextNode( $makeEmptyArray ) );
593 $node->appendChild( $makeEmptyArrayNode );
594 $valueNode = $dom->createElement( 'value' );
595 $valueNode->appendChild( $dom->createTextNode( $value ) );
596 $node->appendChild( $valueNode );
597
598 return $node;
599 }
600
601 function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
602 {
603 $makeEmptyArray = $attributeNode->getElementsByTagName( 'make_empty_array' )->item( 0 )->textContent;
604 $value = $attributeNode->getElementsByTagName( 'value' )->item( 0 )->textContent;
605
606 if ( $makeEmptyArray === false )
607 $makeEmptyArray = 0;
608
609 if ( $value === false )
610 $value = '';
611
612 $objectAttribute->setAttribute( 'data_int', $makeEmptyArray );
613 $objectAttribute->setAttribute( 'data_text', $value );
614 }
615
616 function diff( $old, $new, $options = false )
617 {
618 return null;
619 }
620 }
621
622 eZDataType::register( eZIniSettingType::DATA_TYPE_STRING, 'eZIniSettingType' );
623
624 ?>
eZDataType
Base class for content datatypes.
Definition: ezdatatype.php:46
eZDataType\register
static register( $dataTypeString, $className)
Definition: ezdatatype.php:203
eZDataType\createContentObjectAttributeDOMNode
createContentObjectAttributeDOMNode( $objectAttribute)
Definition: ezdatatype.php:1371
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\writeNotice
static writeNotice( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:459
eZINI
Reads and writes .ini style configuration files.
eZIniSettingType
A content datatype for setting ini file settings.
Definition: ezinisettingtype.php:22
eZIniSettingType\initializeClassAttribute
initializeClassAttribute( $classAttribute)
Definition: ezinisettingtype.php:119
eZIniSettingType\validateObjectAttributeHTTPInput
validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute)
Definition: ezinisettingtype.php:47
eZIniSettingType\CLASS_FILE
const CLASS_FILE
Definition: ezinisettingtype.php:26
eZIniSettingType\CLASS_SECTION_FIELD
const CLASS_SECTION_FIELD
Definition: ezinisettingtype.php:32
eZIniSettingType\diff
diff( $old, $new, $options=false)
Definition: ezinisettingtype.php:616
eZIniSettingType\CLASS_INI_INSTANCE
const CLASS_INI_INSTANCE
Definition: ezinisettingtype.php:29
eZIniSettingType\CLASS_INI_INSTANCE_FIELD
const CLASS_INI_INSTANCE_FIELD
Definition: ezinisettingtype.php:35
eZIniSettingType\validateClassAttributeHTTPInput
validateClassAttributeHTTPInput( $http, $base, $classAttribute)
Definition: ezinisettingtype.php:79
eZIniSettingType\serializeContentObjectAttribute
serializeContentObjectAttribute( $package, $objectAttribute)
Definition: ezinisettingtype.php:583
eZIniSettingType\CLASS_TYPE_ARRAY
const CLASS_TYPE_ARRAY
Definition: ezinisettingtype.php:38
eZIniSettingType\__construct
__construct()
Definition: ezinisettingtype.php:40
eZIniSettingType\iniFile
iniFile( $contentClassAttribute)
Definition: ezinisettingtype.php:527
eZIniSettingType\setSiteAccessList
setSiteAccessList( $contentClassAttribute)
Definition: ezinisettingtype.php:550
eZIniSettingType\CLASS_TYPE
const CLASS_TYPE
Definition: ezinisettingtype.php:25
eZIniSettingType\unserializeContentClassAttribute
unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode)
Definition: ezinisettingtype.php:453
eZIniSettingType\CLASS_FILE_FIELD
const CLASS_FILE_FIELD
Definition: ezinisettingtype.php:31
eZIniSettingType\CLASS_SECTION
const CLASS_SECTION
Definition: ezinisettingtype.php:27
eZIniSettingType\fetchObjectAttributeHTTPInput
fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute)
Definition: ezinisettingtype.php:241
eZIniSettingType\SITE_ACCESS_LIST_FIELD
const SITE_ACCESS_LIST_FIELD
Definition: ezinisettingtype.php:36
eZIniSettingType\objectAttributeContent
objectAttributeContent( $contentObjectAttribute)
Definition: ezinisettingtype.php:358
eZIniSettingType\toString
toString( $contentObjectAttribute)
Definition: ezinisettingtype.php:563
eZIniSettingType\iniSection
iniSection( $contentClassAttribute)
Definition: ezinisettingtype.php:538
eZIniSettingType\initializeObjectAttribute
initializeObjectAttribute( $objectAttribute, $currentVersion, $originalContentObjectAttribute)
Definition: ezinisettingtype.php:124
eZIniSettingType\parseArrayInput
parseArrayInput( $inputText, &$outputArray, $makeEmptyArray=false)
Definition: ezinisettingtype.php:321
eZIniSettingType\onPublish
onPublish( $contentObjectAttribute, $contentObject, $publishedNodes)
Definition: ezinisettingtype.php:263
eZIniSettingType\unserializeContentObjectAttribute
unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode)
Definition: ezinisettingtype.php:601
eZIniSettingType\fromString
fromString( $contentObjectAttribute, $string)
Definition: ezinisettingtype.php:571
eZIniSettingType\iniParameterName
iniParameterName( $contentClassAttribute)
Definition: ezinisettingtype.php:516
eZIniSettingType\hasObjectAttributeContent
hasObjectAttributeContent( $contentObjectAttribute)
Definition: ezinisettingtype.php:414
eZIniSettingType\serializeContentClassAttribute
serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode)
Definition: ezinisettingtype.php:419
eZIniSettingType\CLASS_PARAMETER
const CLASS_PARAMETER
Definition: ezinisettingtype.php:28
eZIniSettingType\CLASS_TYPE_FIELD
const CLASS_TYPE_FIELD
Definition: ezinisettingtype.php:34
eZIniSettingType\DATA_TYPE_STRING
const DATA_TYPE_STRING
Definition: ezinisettingtype.php:23
eZIniSettingType\fetchClassAttributeHTTPInput
fetchClassAttributeHTTPInput( $http, $base, $classAttribute)
Definition: ezinisettingtype.php:194
eZIniSettingType\title
title( $contentObjectAttribute, $name=null)
Definition: ezinisettingtype.php:409
eZIniSettingType\CLASS_PARAMETER_FIELD
const CLASS_PARAMETER_FIELD
Definition: ezinisettingtype.php:33
eZInputValidator\STATE_ACCEPTED
const STATE_ACCEPTED
Definition: ezinputvalidator.php:79
eZInputValidator\STATE_INVALID
const STATE_INVALID
Definition: ezinputvalidator.php:81
ezpI18n\tr
static tr( $context, $source, $comment=null, $arguments=null)
Definition: ezpi18n.php:86
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.