Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezmultioption2type.php
Go to the documentation of this file.
1 <?php
32 class eZMultiOption2Type extends eZDataType
33 {
34 const DEFAULT_NAME_VARIABLE = "_ezmultioption2_default_name_";
35 const MAX_CHILD_LEVEL = 50;
36 const DATA_TYPE_STRING = "ezmultioption2";
37
41 public function __construct()
42 {
43 parent::__construct( self::DATA_TYPE_STRING, ezpI18n::tr( 'kernel/classes/datatypes', "Multi-option2", 'Datatype name' ),
44 array( 'serialize_supported' => true ) );
45 }
46
51 function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
52 {
53 return eZInputValidator::STATE_ACCEPTED;
54 }
55
59 function storeObjectAttribute( $contentObjectAttribute )
60 {
61 $optiongroup = $contentObjectAttribute->content();
62 $contentObjectAttribute->setAttribute( "data_text", $optiongroup->xmlString() );
63 }
64
68 function objectAttributeContent( $contentObjectAttribute )
69 {
70 $optiongroup = new eZMultiOption2( "" );
71 $optiongroup->decodeXML( $contentObjectAttribute->attribute( "data_text" ) );
72 return $optiongroup;
73 }
74
75 function isIndexable()
76 {
77 return true;
78 }
79
83 function metaData( $contentObjectAttribute )
84 {
85 return $contentObjectAttribute->attribute( "data_text" );
86 }
87
91 function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
92 {
93 $editMode = $http->postVariable( $base . "_data_edit_mode_" . $contentObjectAttribute->attribute( "id" ) );
94 if( $editMode == 'rules' )
95 {
96 $optiongroup = $contentObjectAttribute->content();
97
98 $optionRulesArray = $http->hasPostVariable( $base . "_data_multioption_rule_for" )
99 ? $http->postVariable( $base . "_data_multioption_rule_for" )
100 : array();
101 $rules = array();
102 foreach( $optionRulesArray as $ruleFor )
103 {
104 $parentMultioptionIDList = $http->postVariable( $base . "_data_rule_parent_multioption_id_" . $ruleFor );
105 $rule = array();
106 foreach ( $parentMultioptionIDList as $parentMultioptionID )
107 {
108 $parentMultioptionData = $optiongroup->findMultiOption( $parentMultioptionID );
109 $parentMultioptionGroup = $parentMultioptionData['group'];
110
111 $parentMultioptionOptionList = $parentMultioptionGroup->Options[$parentMultioptionData['id']]['optionlist'];
112
113 $ruleData = $http->hasPostVariable( $base . "_data_multioption_rule_" . $ruleFor . '_' . $parentMultioptionID )
114 ? $http->postVariable( $base . "_data_multioption_rule_" . $ruleFor . '_' . $parentMultioptionID )
115 : array();
116 if ( count( $parentMultioptionOptionList ) == count( $ruleData ) )
117 continue;
118 $rule[$parentMultioptionID] = $ruleData;
119 }
120 if ( count( $rule ) )
121 $rules[$ruleFor] = $rule;
122 }
123 $optiongroup->Rules = $rules;
124 $contentObjectAttribute->setContent( $optiongroup );
125 return true;
126 }
127
128 $optiongroup = new eZMultiOption2( '' );
129
130 $oldoptiongroup = $contentObjectAttribute->content();
131 if ( $oldoptiongroup->Rules )
132 $optiongroup->Rules = $oldoptiongroup->Rules;
133 $this->fetchHTTPInputForGroup( $optiongroup, $http, $base, $contentObjectAttribute );
134 $optiongroup->initCountersRecursive();
135 $contentObjectAttribute->setContent( $optiongroup );
136 return true;
137 }
138
139 function fetchHTTPInputForGroup( $parentOptionGroup, $http, $base, $contentObjectAttribute, $depth = 0 )
140 {
141
142 $optionGroupIDArray = $http->hasPostVariable( $base . "_data_optiongroup_id_" .
143 $contentObjectAttribute->attribute( "id" ) . '_' .
144 $parentOptionGroup->attribute( 'group_id' ) )
145 ? $http->postVariable( $base . "_data_optiongroup_id_" .
146 $contentObjectAttribute->attribute( "id" ) . '_' .
147 $parentOptionGroup->attribute( 'group_id' ) )
148 : array();
149 $optionGroupNameList = count( $optionGroupIDArray ) > 0
150 ? $http->postVariable( $base . "_data_optiongroup_name_" .
151 $contentObjectAttribute->attribute( "id" ) . '_' .
152 $parentOptionGroup->attribute( 'group_id' ) )
153 : array();
154 foreach ( $optionGroupIDArray as $key => $optionGroupID )
155 {
156 unset( $optionGroup );
157 $optionGroup = new eZMultiOption2( $optionGroupNameList[$key], 0,0,0, $optionGroupID );
158
159 if ( $http->hasPostVariable( $base . "_data_optiongroup_id_parent_multioption_" .
160 $contentObjectAttribute->attribute( "id" ) . '_' .
161 $optionGroupID ) )
162 {
163 $parentMultioptionID = $http->postVariable( $base . "_data_optiongroup_id_parent_multioption_" .
164 $contentObjectAttribute->attribute( "id" ) . '_' .
165 $optionGroupID );
166 $parentOptionGroup->addChildGroup( $optionGroup, $parentMultioptionID );
167 }
168 else
169 {
170 $parentOptionGroup->addChildGroup( $optionGroup );
171 }
172 if ( $optionGroupID == 0 )
173 continue ;
174
175 $multioptionIDArray = $http->hasPostVariable( $base . "_data_multioption_id_" .
176 $contentObjectAttribute->attribute( "id" ) . '_' .
177 $optionGroupID )
178 ? $http->postVariable( $base . "_data_multioption_id_" .
179 $contentObjectAttribute->attribute( "id" ). '_' .
180 $optionGroupID )
181 : array();
182 foreach( $multioptionIDArray as $multioptionID )
183 {
184
185 $multioptionName = $http->postVariable( $base . "_data_multioption_name_" .
186 $contentObjectAttribute->attribute( "id" ). '_' .
187 $optionGroupID . '_' . $multioptionID );
188
189 $defaultValue = $http->hasPostVariable( $base . "_data_default_option_" .
190 $contentObjectAttribute->attribute( "id" ). '_' .
191 $optionGroupID . '_' . $multioptionID )
192 ? $http->postVariable( $base . "_data_default_option_" .
193 $contentObjectAttribute->attribute( "id" ). '_' .
194 $optionGroupID . '_' . $multioptionID )
195 : '';
196
197 $multiOptionPriority = 0;
198
199 $newID = $optionGroup->addMultiOption( $multioptionName, $multiOptionPriority, $defaultValue, $multioptionID );
200
201
202 $optionCountArray = $http->hasPostVariable( $base . "_data_option_option_id_" .
203 $contentObjectAttribute->attribute( "id" ) . '_' .
204 $optionGroupID . '_' . $multioptionID )
205 ? $http->postVariable( $base . "_data_option_option_id_" .
206 $contentObjectAttribute->attribute( "id" ) . '_' .
207 $optionGroupID . '_' . $multioptionID )
208 : array();
209
210 $optionValueArray = $http->hasPostVariable( $base . "_data_option_value_" .
211 $contentObjectAttribute->attribute( "id" ) . '_' .
212 $optionGroupID . '_' . $multioptionID )
213 ? $http->postVariable( $base . "_data_option_value_" .
214 $contentObjectAttribute->attribute( "id" ) . '_' .
215 $optionGroupID . '_' . $multioptionID )
216 : array();
217 $http->postVariable( $base . "_data_option_value_" .
218 $contentObjectAttribute->attribute( "id" ) . '_' .
219 $optionGroupID . '_' . $multioptionID );
220 $http->postVariable( $base . "_data_option_additional_price_" .
221 $contentObjectAttribute->attribute( "id" ) . '_' .
222 $optionGroupID . '_' . $multioptionID );
223 $optionAdditionalPriceArray = $http->hasPostVariable( $base . "_data_option_additional_price_" .
224 $contentObjectAttribute->attribute( "id" ) . '_' .
225 $optionGroupID . '_' . $multioptionID )
226 ? $http->postVariable( $base . "_data_option_additional_price_" .
227 $contentObjectAttribute->attribute( "id" ) . '_' .
228 $optionGroupID . '_' . $multioptionID )
229 : array();
230 for ( $i = 0; $i < count( $optionCountArray ); $i++ )
231 {
232 $isSelectable = $http->hasPostVariable( $base . "_data_option_is_selectable_" .
233 $contentObjectAttribute->attribute( "id" ) . '_' .
234 $optionGroupID . '_' . $multioptionID . '_' . $optionCountArray[$i] )
235 ? 0 : 1;
236 $objectID = $http->hasPostVariable( $base . "_data_option_object_" .
237 $contentObjectAttribute->attribute( "id" ) . '_' .
238 $optionGroupID . '_' . $multioptionID . '_' . $optionCountArray[$i] )
239 ? $http->postVariable( $base . "_data_option_object_" .
240 $contentObjectAttribute->attribute( "id" ) . '_' .
241 $optionGroupID . '_' . $multioptionID . '_' . $optionCountArray[$i] ) : 0;
242 $optionGroup->addOption( $newID, $optionCountArray[$i], $optionValueArray[$i], $optionAdditionalPriceArray[$i], $isSelectable, $objectID );
243 }
244 }
245 if ( $depth > self::MAX_CHILD_LEVEL)
246 die('max recursion level has been reached');
247 $this->fetchHTTPInputForGroup( $optionGroup, $http, $base, $contentObjectAttribute, $depth+1 );
248
249 $parentOptionGroup->initCounters( $optionGroup );
250
251 }
252
253 }
254
255
270 function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute, $parameters )
271 {
272 $actionlist = explode( "_", $action );
273 if ( $actionlist[0] == "new-option" )
274 {
275 $rootGroup = $contentObjectAttribute->content();
276 $groupID = $actionlist[1];
277 $multioptionID = $actionlist[2];
278 $optionID = $rootGroup->addOptionForMultioptionID( $multioptionID, "", "", "" );
279
280 $group = $rootGroup->findGroup( $groupID );
281
282 $rootGroup->addOptionToRules( $multioptionID, $optionID );
283
284 $rootGroup->initCounters( $group );
285 $rootGroup->initCountersRecursive();
286 $contentObjectAttribute->setContent( $rootGroup );
287 $contentObjectAttribute->store();
288 }
289 else if ( $actionlist[0] == "new-sublevel" )
290 {
291 $rootGroup = $contentObjectAttribute->content();
292 $groupID = $actionlist[1];
293 $multioptionID = $actionlist[2];
294
295 $group = $rootGroup->findGroup( $groupID );
296 if ( !$group )
297 return;
298 $childGroup = new eZMultiOption2( '', 0, $rootGroup->getMultiOptionIDCounter(),$rootGroup->getOptionCounter() );
299
300 $group->addChildGroup( $childGroup, $multioptionID );
301
302 $newID = $childGroup->addMultiOption( "", 0, false , '' );
303 $childGroup->addOption( $newID, "", "", "" );
304 $rootGroup->initCounters( $childGroup );
305
306 $rootGroup->initCountersRecursive();
307
308 $contentObjectAttribute->setContent( $rootGroup );
309 $contentObjectAttribute->store();
310 }
311 else if ( $actionlist[0] == "new-group" )
312 {
313 $rootGroup = $contentObjectAttribute->content();
314 $childGroup = new eZMultiOption2( '', 0, $rootGroup->getMultiOptionIDCounter(),$rootGroup->getOptionCounter() );
315 $rootGroup->addChildGroup( $childGroup );
316 $newID = $childGroup->addMultiOption( "", 0, false , '' );
317 $childGroup->addOption( $newID, "", "", "" );
318 $rootGroup->initCounters( $childGroup );
319 $rootGroup->initCountersRecursive();
320
321 $contentObjectAttribute->setContent( $rootGroup );
322 $contentObjectAttribute->store();
323 }
324 else if ( $actionlist[0] == "remove-selected-option" )
325 {
326 $rootGroup = $contentObjectAttribute->content();
327 $groupID = $actionlist[1];
328 $multioptionID = $actionlist[2];
329 $postvarname = "ContentObjectAttribute" . "_data_option_remove_" . $contentObjectAttribute->attribute( "id" ) . "_" .
330 $groupID . "_" . $multioptionID;
331 $array_remove = $http->hasPostVariable( $postvarname ) ? $http->postVariable( $postvarname ) : array();
332
333 $group = $rootGroup->findGroup( $groupID );
334
335 if ( $group )
336 {
337 $group->removeOptions( $array_remove, $multioptionID );
338 $rootGroup->cleanupRules();
339 $contentObjectAttribute->setContent( $rootGroup );
340 $contentObjectAttribute->store();
341 }
342 }
343 else if ( $actionlist[0] == "new-multioption" )
344 {
345 $rootGroup = $contentObjectAttribute->content();
346 $groupID = $actionlist[1];
347 $group = $rootGroup->findGroup( $groupID );
348 if ( !$group )
349 return;
350
351 $newID = $group->addMultiOption( "" ,0,false, '' );
352 $group->addOption( $newID, "", "", "" );
353 $group->addOption( $newID, "" ,"", "" );
354 $rootGroup->initCounters( $group );
355 $rootGroup->initCountersRecursive();
356 $contentObjectAttribute->setContent( $rootGroup );
357 $contentObjectAttribute->store();
358
359 }
360 else if ( $actionlist[0] == "remove-selected-multioption" )
361 {
362 $rootGroup = $contentObjectAttribute->content();
363 $groupID = $actionlist[1];
364 $postvarname = "ContentObjectAttribute" . "_data_multioption_remove_" . $contentObjectAttribute->attribute( "id" ) . "_" . $groupID;
365 $array_remove = $http->hasPostVariable( $postvarname ) ? $http->postVariable( $postvarname ) : array();
366
367 $group = $rootGroup->findGroup( $groupID );
368
369 if ( $group )
370 {
371 $group->removeMultiOptions( $array_remove );
372 $rootGroup->cleanupRules();
373 if ( count( $group->attribute( 'multioption_list') ) == 0 )
374 {
375 $rootGroup->removeChildGroup( $group->attribute( 'group_id' ) );
376 }
377 $contentObjectAttribute->setContent( $rootGroup );
378 $contentObjectAttribute->store();
379 }
380
381 }
382 else if ( $actionlist[0] == "switch-mode" )
383 {
384 $editMode = $actionlist[1];
385 $sessionVarName = 'eZEnhancedMultioption_edit_mode_' . $contentObjectAttribute->attribute( 'id' );
386 $http->setSessionVariable( $sessionVarName, $editMode );
387 $rootGroup = $contentObjectAttribute->content();
388 $contentObjectAttribute->setContent( $rootGroup );
389 }
390 else if ( $actionlist[0] == "reset-rules" )
391 {
392 $rootGroup = $contentObjectAttribute->content();
393 $rootGroup->Rules = array();
394 $contentObjectAttribute->setContent( $rootGroup );
395 $contentObjectAttribute->store();
396
397 }
398 else if ( $actionlist[0] == "set-object" )
399 {
400
401 if ( $http->hasPostVariable( 'BrowseActionName' ) and
402 $http->postVariable( 'BrowseActionName' ) == ( 'AddRelatedObject_' . $contentObjectAttribute->attribute( 'id' ) ) and
403 $http->hasPostVariable( "SelectedObjectIDArray" ) )
404 {
405 if ( !$http->hasPostVariable( 'BrowseCancelButton' ) )
406 {
407 $selectedObjectArray = $http->hasPostVariable( "SelectedObjectIDArray" );
408 $selectedObjectIDArray = $http->postVariable( "SelectedObjectIDArray" );
409 $rootGroup = $contentObjectAttribute->content();
410 $groupID = $actionlist[1];
411 $multioptionID = $actionlist[2];
412 $optionID = $actionlist[3];
413
414 $objectID = $selectedObjectIDArray[0];
415
416 $rootGroup->setObjectForOption( $multioptionID, $optionID, $objectID );
417 $contentObjectAttribute->setContent( $rootGroup );
418 $contentObjectAttribute->store();
419
420 }
421 }
422 }
423 else if ( $actionlist[0] == "browse-object" )
424 {
425 $module = $parameters['module'];
426
427 $redirectionURI = $parameters['current-redirection-uri'];
428 $ini = eZINI::instance( 'content.ini' );
429
430 $browseType = 'AddRelatedObjectToDataType';
431 $browseTypeINIVariable = $ini->variable( 'ObjectRelationDataTypeSettings', 'ClassAttributeStartNode' );
432 foreach( $browseTypeINIVariable as $value )
433 {
434 list( $classAttributeID, $type ) = explode( ';',$value );
435 if ( $classAttributeID == $contentObjectAttribute->attribute( 'contentclassattribute_id' ) && strlen( $type ) > 0 )
436 {
437 $browseType = $type;
438 break;
439 }
440 }
441 eZContentBrowse::browse( array( 'action_name' => 'AddRelatedObject_' . $contentObjectAttribute->attribute( 'id' ),
442 'type' => $browseType,
443 'browse_custom_action' => array( 'name' => 'CustomActionButton[' . $contentObjectAttribute->attribute( 'id' ) .
444 '_set-object_'. $actionlist[1] . '_' . $actionlist[2] . '_' .$actionlist[3] . ']',
445 'value' => $contentObjectAttribute->attribute( 'id' ) ),
446 'persistent_data' => array( 'HasObjectInput' => 0 ),
447 'from_page' => $redirectionURI ),
448 $module );
449
450 }
451 else if ( $actionlist[0] == "remove-object" )
452 {
453
454
455 $rootGroup = $contentObjectAttribute->content();
456 $groupID = $actionlist[1];
457 $multioptionID = $actionlist[2];
458 $optionID = $actionlist[3];
459
460 $rootGroup->removeObjectFromOption( $multioptionID, $optionID );
461
462 $contentObjectAttribute->setContent( $rootGroup );
463 $contentObjectAttribute->store();
464
465
466 }
467 else
468 {
469 eZDebug::writeError( "Unknown custom HTTP action: " . $action, "eZMultiOptionType" );
470 }
471 }
472
476 function productOptionInformation( $objectAttribute, $optionID, $productItem )
477 {
478 $optiongroup = $objectAttribute->attribute( 'content' );
479
480 $option = $optiongroup->findOption( false, $optionID );
481 if ( $option )
482 {
483 return array( 'id' => $option['option_id'],
484 'name' => $option['multioption_name'],
485 'value' => $option['value'],
486 'additional_price' => $option['additional_price'] );
487 }
488 return null;
489 }
490
491
495 function hasObjectAttributeContent( $contentObjectAttribute )
496 {
497 $groups = $contentObjectAttribute->content();
498 $grouplist = $groups->attribute( 'optiongroup_list' );
499 return count( $grouplist ) > 0;
500 }
501
505 function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
506 {
507 if ( $currentVersion == false )
508 {
509 $optiongroup = $contentObjectAttribute->content();
510 if ( $optiongroup )
511 {
512 $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
513 $optiongroup->setName( $contentClassAttribute->attribute( 'data_text1' ) );
514 $contentObjectAttribute->setAttribute( "data_text", $optiongroup->xmlString() );
515 $contentObjectAttribute->setContent( $optiongroup );
516 }
517 }
518 else
519 {
520 $dataText = $originalContentObjectAttribute->attribute( "data_text" );
521 $contentObjectAttribute->setAttribute( "data_text", $dataText );
522 }
523 }
524
525 function fetchClassAttributeHTTPInput( $http, $base, $classAttribute )
526 {
527 return false;
528 }
529
530
535 function validateAddToBasket( $objectAttribute, $data, &$errors )
536 {
537
538 $optiongroup = $objectAttribute->attribute( 'content' );
539 $rules = $optiongroup->Rules;
540
541 $validationErrors = array();
542
543
544 foreach( $data as $moptionID => $selectedItem )
545 {
546 $failedOptionData = $optiongroup->findMultiOption( $moptionID );
547 $failedMultiOption = $failedOptionData['group']->Options[$failedOptionData['id']];
548 $failedOption = $optiongroup->findOption( $failedMultiOption, $selectedItem );
549 if ( $failedOption['is_selectable'] != 1 )
550 {
551 $objectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
552 "You cannot choose option value \"%1\" from \"%2\" because it is unselectable " ),
553 $failedOption['value'],
554 $failedMultiOption['name'] );
555 $validationErrors[] = $objectAttribute->attribute( 'validation_error' );
556 }
557 if ( ! isset( $rules[$selectedItem] ) )
558 continue;
559
560 $rulesForOption = $rules[$selectedItem];
561 foreach( array_keys( $rulesForOption ) as $ruleKey )
562 {
563
564 if ( isset( $data[$ruleKey] ) )
565 {
566 $selectedMultioptionValue = $data[$ruleKey];
567 $canSelectIfIdArray = $rulesForOption[$ruleKey];
568 if ( !in_array( $data[$ruleKey], $canSelectIfIdArray ) )
569 {
570 $wrongParentData = $optiongroup->findMultiOption( $ruleKey );
571 $wrongParentMultiOption = $wrongParentData['group']->Options[$wrongParentData['id']];
572
573 $wrongParentOptionID = $data[$ruleKey];
574 $wrongParentOption = $optiongroup->findOption( $wrongParentMultiOption, $wrongParentOptionID );
575
576 $objectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
577 "You cannot choose option value \"%1\" from \"%2\" \n if you selected option \"%3\" from \"%4\" " ),
578 $failedOption['value'],
579 $failedMultiOption['name'],
580 $wrongParentOption['value'],
581 $wrongParentMultiOption['name'] );
582 $validationErrors[] = $objectAttribute->attribute( 'validation_error' );
583
584 }
585 }
586 }
587 }
588
589 if ( count( $validationErrors ) > 0 )
590 {
591 $errors = $validationErrors;
592 return eZInputValidator::STATE_INVALID;
593 }
594 return eZInputValidator::STATE_ACCEPTED;
595 }
596
600 function isAddToBasketValidationRequired()
601 {
602 return true;
603 }
604
605 function serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
606 {
607 $defaultValue = $classAttribute->attribute( 'data_text1' );
608 $dom = $attributeParametersNode->ownerDocument;
609 $defaultValueNode = $dom->createElement( 'default-value' );
610 $defaultValueNode->appendChild( $dom->createTextNode( $defaultValue ) );
611 $attributeParametersNode->appendChild( $defaultValueNode );
612 }
613
614 function unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
615 {
616 $defaultValue = $attributeParametersNode->getElementsByTagName( 'default-value' )->item( 0 )->textContent;
617 $classAttribute->setAttribute( 'data_text1', $defaultValue );
618 }
619
620 function serializeContentObjectAttribute( $package, $objectAttribute )
621 {
622 $node = $this->createContentObjectAttributeDOMNode( $objectAttribute );
623
624 $dom = new DOMDocument( '1.0', 'utf-8' );
625 $success = $dom->loadXML( $objectAttribute->attribute( 'data_text' ) );
626
627 $importedNode = $node->ownerDocument->importNode( $dom->documentElement, true );
628 $node->appendChild( $importedNode );
629
630 return $node;
631 }
632
633 function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
634 {
635 $rootNode = $attributeNode->getElementsByTagName( 'ezmultioption2' )->item( 0 );
636 $xmlString = $attributeNode->ownerDocument->saveXML( $rootNode );
637 $objectAttribute->setAttribute( 'data_text', $xmlString );
638 }
639
648 function editTemplate( $contentObjectAttribute )
649 {
650 $http = eZHTTPTool::instance();
651 $sessionVarName = 'eZEnhancedMultioption_edit_mode_' . $contentObjectAttribute->attribute( 'id' );
652 if ( $http->hasSessionVariable( $sessionVarName ) && $http->sessionVariable( $sessionVarName ) == 'rules' )
653 {
654 return $this->DataTypeString . '_rules';
655 }
656 return $this->DataTypeString;
657 }
658
659 function supportsBatchInitializeObjectAttribute()
660 {
661 return true;
662 }
663
664 function batchInitializeObjectAttributeData( $classAttribute )
665 {
666 $optionGroup = new eZMultiOption2( $classAttribute->attribute( 'data_text1' ) );
667 $db = eZDB::instance();
668 return array( 'data_text' => "'" . $db->escapeString( $optionGroup->xmlString() ) . "'" );
669 }
670 }
671
672 eZDataType::register( eZMultiOption2Type::DATA_TYPE_STRING, "eZMultiOption2Type" );
673
674 ?>
eZContentBrowse\browse
static browse( $parameters=array(), &$module)
Definition: ezcontentbrowse.php:89
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZDataType
Base class for content datatypes.
Definition: ezdatatype.php:46
eZDataType\register
static register( $dataTypeString, $className)
Definition: ezdatatype.php:203
eZDataType\$DataTypeString
$DataTypeString
The datatype string ID, used for uniquely identifying a datatype.
Definition: ezdatatype.php:1515
eZDataType\createContentObjectAttributeDOMNode
createContentObjectAttributeDOMNode( $objectAttribute)
Definition: ezdatatype.php:1371
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZHTTPTool\instance
static instance()
Definition: ezhttptool.php:189
eZInputValidator\STATE_ACCEPTED
const STATE_ACCEPTED
Definition: ezinputvalidator.php:79
eZInputValidator\STATE_INVALID
const STATE_INVALID
Definition: ezinputvalidator.php:81
eZMultiOption2Type
A datatype which works with multiple options.
Definition: ezmultioption2type.php:33
eZMultiOption2Type\fetchHTTPInputForGroup
fetchHTTPInputForGroup( $parentOptionGroup, $http, $base, $contentObjectAttribute, $depth=0)
Definition: ezmultioption2type.php:139
eZMultiOption2Type\isAddToBasketValidationRequired
isAddToBasketValidationRequired()
Definition: ezmultioption2type.php:600
eZMultiOption2Type\initializeObjectAttribute
initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
Definition: ezmultioption2type.php:505
eZMultiOption2Type\metaData
metaData( $contentObjectAttribute)
Definition: ezmultioption2type.php:83
eZMultiOption2Type\supportsBatchInitializeObjectAttribute
supportsBatchInitializeObjectAttribute()
Definition: ezmultioption2type.php:659
eZMultiOption2Type\validateObjectAttributeHTTPInput
validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute)
Definition: ezmultioption2type.php:51
eZMultiOption2Type\validateAddToBasket
validateAddToBasket( $objectAttribute, $data, &$errors)
Definition: ezmultioption2type.php:535
eZMultiOption2Type\fetchObjectAttributeHTTPInput
fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute)
Definition: ezmultioption2type.php:91
eZMultiOption2Type\productOptionInformation
productOptionInformation( $objectAttribute, $optionID, $productItem)
Definition: ezmultioption2type.php:476
eZMultiOption2Type\DEFAULT_NAME_VARIABLE
const DEFAULT_NAME_VARIABLE
Definition: ezmultioption2type.php:34
eZMultiOption2Type\objectAttributeContent
objectAttributeContent( $contentObjectAttribute)
Definition: ezmultioption2type.php:68
eZMultiOption2Type\unserializeContentObjectAttribute
unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode)
Definition: ezmultioption2type.php:633
eZMultiOption2Type\unserializeContentClassAttribute
unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode)
Definition: ezmultioption2type.php:614
eZMultiOption2Type\isIndexable
isIndexable()
Definition: ezmultioption2type.php:75
eZMultiOption2Type\__construct
__construct()
Definition: ezmultioption2type.php:41
eZMultiOption2Type\serializeContentObjectAttribute
serializeContentObjectAttribute( $package, $objectAttribute)
Definition: ezmultioption2type.php:620
eZMultiOption2Type\hasObjectAttributeContent
hasObjectAttributeContent( $contentObjectAttribute)
Definition: ezmultioption2type.php:495
eZMultiOption2Type\batchInitializeObjectAttributeData
batchInitializeObjectAttributeData( $classAttribute)
Definition: ezmultioption2type.php:664
eZMultiOption2Type\storeObjectAttribute
storeObjectAttribute( $contentObjectAttribute)
Definition: ezmultioption2type.php:59
eZMultiOption2Type\fetchClassAttributeHTTPInput
fetchClassAttributeHTTPInput( $http, $base, $classAttribute)
Definition: ezmultioption2type.php:525
eZMultiOption2Type\MAX_CHILD_LEVEL
const MAX_CHILD_LEVEL
Definition: ezmultioption2type.php:35
eZMultiOption2Type\serializeContentClassAttribute
serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode)
Definition: ezmultioption2type.php:605
eZMultiOption2Type\editTemplate
editTemplate( $contentObjectAttribute)
Definition: ezmultioption2type.php:648
eZMultiOption2Type\DATA_TYPE_STRING
const DATA_TYPE_STRING
Definition: ezmultioption2type.php:36
eZMultiOption2Type\customObjectAttributeHTTPAction
customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute, $parameters)
Definition: ezmultioption2type.php:270
eZMultiOption2
Encapsulates multiple options in one datatype.
Definition: ezmultioption2.php:17
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+.