Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

eztemplatelogicoperator.php
Go to the documentation of this file.
1 <?php
67 class eZTemplateLogicOperator
68 {
72 public function __construct()
73 {
74 $this->Operators = array( 'lt', 'gt', 'le', 'ge', 'eq', 'ne',
75 'null', 'not',
76 'or', 'and',
77 'true', 'false', 'choose' );
78 foreach ( $this->Operators as $operator )
79 {
80 $name = $operator . 'Name';
81 $name[0] = $name[0] & "\xdf";
82 $this->$name = $operator;
83 }
84 }
85
89 function operatorList()
90 {
91 return $this->Operators;
92 }
93
97 function namedParameterPerOperator()
98 {
99 return true;
100 }
101
102 function operatorTemplateHints()
103 {
104 return array( $this->LtName => array( 'input' => true,
105 'output' => true,
106 'parameters' => 1,
107 'element-transformation' => true,
108 'transform-parameters' => true,
109 'input-as-parameter' => true,
110 'element-transformation-func' => 'logicalComparisonTransformation'),
111 $this->GtName => array( 'input' => true,
112 'output' => true,
113 'parameters' => 1,
114 'element-transformation' => true,
115 'transform-parameters' => true,
116 'input-as-parameter' => true,
117 'element-transformation-func' => 'logicalComparisonTransformation'),
118 $this->LeName => array( 'input' => true,
119 'output' => true,
120 'parameters' => 1,
121 'element-transformation' => true,
122 'transform-parameters' => true,
123 'input-as-parameter' => true,
124 'element-transformation-func' => 'logicalComparisonTransformation'),
125 $this->GeName => array( 'input' => true,
126 'output' => true,
127 'parameters' => 1,
128 'element-transformation' => true,
129 'transform-parameters' => true,
130 'input-as-parameter' => true,
131 'element-transformation-func' => 'logicalComparisonTransformation'),
132
133 $this->EqName => array( 'input' => true,
134 'output' => true,
135 'parameters' => true,
136 'element-transformation' => true,
137 'transform-parameters' => true,
138 'input-as-parameter' => true,
139 'element-transformation-func' => 'logicalComparisonTransformation'),
140 $this->NeName => array( 'input' => true,
141 'output' => true,
142 'parameters' => true,
143 'element-transformation' => true,
144 'transform-parameters' => true,
145 'input-as-parameter' => true,
146 'element-transformation-func' => 'logicalComparisonTransformation'),
147
148 $this->NullName => array( 'input' => true,
149 'output' => true,
150 'parameters' => false ),
151
152 $this->OrName => array( 'input' => true,
153 'output' => true,
154 'parameters' => true,
155 'element-transformation' => true,
156 'transform-parameters' => true,
157 'input-as-parameter' => true,
158 'element-transformation-func' => 'logicalComparisonTransformation'),
159 $this->AndName => array( 'input' => true,
160 'output' => true,
161 'parameters' => true,
162 'element-transformation' => true,
163 'transform-parameters' => true,
164 'input-as-parameter' => true,
165 'element-transformation-func' => 'logicalComparisonTransformation'),
166
167 $this->NotName => array( 'input' => true,
168 'output' => true,
169 'parameters' => true,
170 'element-transformation' => true,
171 'transform-parameters' => true,
172 'input-as-parameter' => true,
173 'element-transformation-func' => 'negateTransformation'),
174
175 $this->ChooseName => array( 'input' => true,
176 'output' => true,
177 'parameters' => true,
178 'element-transformation' => true,
179 'transform-parameters' => true,
180 'input-as-parameter' => 'always',
181 'element-transformation-func' => 'chooseTransformation'),
182 $this->TrueName => array( 'input' => false,
183 'output' => true,
184 'parameters' => false,
185 'static' => true,
186 'element-transformation' => true,
187 'transform-parameters' => true,
188 'input-as-parameter' => true,
189 'element-transformation-func' => 'trueFalseTransformation'),
190 $this->FalseName => array( 'input' => false,
191 'output' => true,
192 'parameters' => false,
193 'static' => true,
194 'element-transformation' => true,
195 'transform-parameters' => true,
196 'input-as-parameter' => true,
197 'element-transformation-func' => 'trueFalseTransformation') );
198 }
199
200 function operatorCompiledStaticData( $operatorName )
201 {
202 switch( $operatorName )
203 {
204 case $this->TrueName:
205 {
206 return true;
207 } break;
208 case $this->FalseName:
209 {
210 return false;
211 } break;
212 }
213 return false;
214 }
215
219 function namedParameterList()
220 {
221 return array( $this->LtName => array( "threshold" => array( "type" => "mixed",
222 "required" => true,
223 "default" => false ) ),
224 $this->GtName => array( "threshold" => array( "type" => "mixed",
225 "required" => true,
226 "default" => false ) ),
227 $this->LeName => array( "threshold" => array( "type" => "mixed",
228 "required" => true,
229 "default" => false ) ),
230 $this->GeName => array( "threshold" => array( "type" => "mixed",
231 "required" => true,
232 "default" => false ) ) );
233 }
234
235
236 function logicalComparisonTransformation( $operatorName, &$node, $tpl, &$resourceData,
237 $element, $lastElement, $elementList, $elementTree, &$parameters )
238 {
239 $values = array();
240 $function = $operatorName;
241 $minParameterCount = $maxParameterCount = 2;
242
243 switch ( $operatorName )
244 {
245 case 'lt':
246 $operator = '<';
247 break;
248 case 'le':
249 $operator = '<=';
250 break;
251 case 'gt':
252 $operator = '>';
253 break;
254 case 'ge':
255 $operator = '>=';
256 break;
257 case 'eq':
258 $operator = '==';
259 break;
260 case 'ne':
261 $operator = '!=';
262 break;
263 case 'and':
264 $operator = 'and';
265 $maxParameterCount = false;
266 break;
267 case 'or':
268 $operator = 'or';
269 $maxParameterCount = false;
270 break;
271 }
272 if ( ( count( $parameters ) < 2 ) ||
273 ( $maxParameterCount && ( count( $parameters ) > $maxParameterCount ) ) )
274 {
275 return false;
276 }
277 $newElements = array();
278
279 if ( $operatorName == 'or' )
280 {
281 $staticResult = false;
282 $staticValue = null;
283 $dynamicParameters = array();
284 $addDynamic = false;
285 $lastValue = null;
286 foreach ( $parameters as $parameter )
287 {
288 if ( $addDynamic )
289 {
290 $dynamicParameters[] = $parameter;
291 continue;
292 }
293 if ( eZTemplateNodeTool::isConstantElement( $parameter ) )
294 {
295 $parameterValue = eZTemplateNodeTool::elementConstantValue( $parameter );
296 if ( $staticValue === null )
297 {
298 $staticValue = $parameterValue;
299 }
300 else
301 {
302 $staticValue = ( $staticValue or $parameterValue );
303 }
304 $lastValue = $parameterValue;
305 if ( $parameterValue )
306 {
307 $staticResult = true;
308 break;
309 }
310 continue;
311 }
312 $addDynamic = true;
313 $dynamicParameters[] = $parameter;
314 $staticValue = null;
315 }
316 if ( count( $dynamicParameters ) == 0 )
317 {
318 if ( !$staticResult )
319 $lastValue = false;
320 $newElements[] = eZTemplateNodeTool::createConstantElement( $lastValue );
321 return $newElements;
322 }
323
324 $code = '';
325 $counter = 0;
326 foreach ( $dynamicParameters as $parameter )
327 {
328 if ( $counter++ )
329 {
330 $code .= "else ";
331 }
332 $code .= ( "if ( %$counter% )\n" .
333 " %output% = %$counter%;\n" );
334 $values[] = $parameter;
335 }
336 $code .= ( "else\n" .
337 " %output% = false;\n" );
338 }
339 else if ( $operatorName == 'and' )
340 {
341 $staticResult = false;
342 $staticValue = null;
343 $dynamicParameters = array();
344 $addDynamic = false;
345 $lastValue = null;
346 foreach ( $parameters as $parameter )
347 {
348 if ( $addDynamic )
349 {
350 $dynamicParameters[] = $parameter;
351 continue;
352 }
353 if ( eZTemplateNodeTool::isConstantElement( $parameter ) )
354 {
355 $parameterValue = eZTemplateNodeTool::elementConstantValue( $parameter );
356 if ( $staticValue === null )
357 {
358 $staticValue = $parameterValue;
359 }
360 else
361 {
362 $staticValue = ( $staticValue and $parameterValue );
363 }
364 $lastValue = $parameterValue;
365 if ( !$parameterValue )
366 {
367 $lastValue = false;
368 $staticResult = true;
369 break;
370 }
371 continue;
372 }
373 $addDynamic = true;
374 $dynamicParameters[] = $parameter;
375 $staticValue = null;
376 }
377 if ( count( $dynamicParameters ) == 0 )
378 {
379 $newElements[] = eZTemplateNodeTool::createConstantElement( $lastValue );
380 return $newElements;
381 }
382
383 $code = '';
384 $counter = 0;
385 foreach ( $dynamicParameters as $parameter )
386 {
387 if ( $counter++ )
388 {
389 $code .= "else ";
390 }
391 $code .= ( "if ( !%$counter% )\n" .
392 " %output% = false;\n" );
393 $values[] = $parameter;
394 }
395 $code .= ( "else\n" .
396 " %output% = %$counter%;\n" );
397 }
398 else
399 {
400 $code = '%output% = (';
401 $counter = 0;
402 $allStatic = true;
403 foreach ( $parameters as $parameter )
404 {
405 if ( !eZTemplateNodeTool::isConstantElement( $parameter ) )
406 $allStatic = false;
407 }
408 if ( $allStatic )
409 {
410 switch ( $operatorName )
411 {
412 case 'lt':
413 {
414 $evalStatus = ( eZTemplateNodeTool::elementConstantValue( $parameters[0] ) <
415 eZTemplateNodeTool::elementConstantValue( $parameters[1] ) );
416 } break;
417
418 case 'le':
419 {
420 $evalStatus = ( eZTemplateNodeTool::elementConstantValue( $parameters[0] ) <=
421 eZTemplateNodeTool::elementConstantValue( $parameters[1] ) );
422 } break;
423
424 case 'gt':
425 {
426 $evalStatus = ( eZTemplateNodeTool::elementConstantValue( $parameters[0] ) >
427 eZTemplateNodeTool::elementConstantValue( $parameters[1] ) );
428 } break;
429
430 case 'ge':
431 {
432 $evalStatus = ( eZTemplateNodeTool::elementConstantValue( $parameters[0] ) >=
433 eZTemplateNodeTool::elementConstantValue( $parameters[1] ) );
434 } break;
435
436 case 'eq':
437 {
438 $staticParameters = array();
439 foreach ( $parameters as $parameter )
440 {
441 $staticParameters[] = eZPHPCreator::variableText( eZTemplateNodeTool::elementConstantValue( $parameter ),
442 0, 0, false );
443 }
444 eval( '$evalStatus = ( ' . implode( ' == ', $staticParameters ) . ' );' );
445 } break;
446
447 case 'ne':
448 {
449 $staticParameters = array();
450 foreach ( $parameters as $parameter )
451 {
452 $staticParameters[] = eZPHPCreator::variableText( eZTemplateNodeTool::elementConstantValue( $parameter ),
453 0, 0, false );
454 }
455 eval( '$evalStatus = ( ' . implode( ' != ', $staticParameters ) . ' );' );
456 } break;
457 break;
458 }
459 $newElements[] = eZTemplateNodeTool::createBooleanElement( $evalStatus );
460 return $newElements;
461 }
462
463 foreach ( $parameters as $parameter )
464 {
465 if ( !eZTemplateNodeTool::isConstantElement( $parameter ) )
466 $allStatic = false;
467 if ( $counter++ )
468 {
469 $code .= " $operator";
470 }
471 $code .= " ( %$counter% )";
472 $values[] = $parameter;
473 }
474 $code .= " );\n";
475 }
476 $newElements[] = eZTemplateNodeTool::createCodePieceElement( $code, $values );
477 return $newElements;
478 }
479
480 function negateTransformation( $operatorName, &$node, $tpl, &$resourceData,
481 $element, $lastElement, $elementList, $elementTree, &$parameters )
482 {
483 $values = array();
484 $function = $operatorName;
485
486 if ( ( count( $parameters ) != 1) )
487 {
488 return false;
489 }
490 $newElements = array();
491
492 $values[] = $parameters[0];
493 $code = "%output% = !( %1% );\n";
494
495 $newElements[] = eZTemplateNodeTool::createCodePieceElement( $code, $values );
496 return $newElements;
497 }
498
499 function trueFalseTransformation( $operatorName, &$node, $tpl, &$resourceData,
500 $element, $lastElement, $elementList, $elementTree, &$parameters )
501 {
502 $values = array();
503 if ( ( count( $parameters ) != 0 ) )
504 {
505 return false;
506 }
507 $newElements = array();
508
509 $value = false;
510 if ( $operatorName == $this->TrueName )
511 $value = true;
512 $newElements[] = eZTemplateNodeTool::createBooleanElement( $value );
513 return $newElements;
514 }
515
516 function chooseTransformation( $operatorName, &$node, $tpl, &$resourceData,
517 $element, $lastElement, $elementList, $elementTree, &$parameters )
518 {
519 $values = array();
520 $function = $operatorName;
521
522 if ( ( count( $parameters ) < 2) )
523 {
524 return false;
525 }
526
527 $tmpValues = false;
528 $newElements = array();
529 if ( eZTemplateNodeTool::isConstantElement( $parameters[0] ) )
530 {
531 $selected = eZTemplateNodeTool::elementConstantValue( $parameters[0] );
532
533 if ( $selected < 0 or $selected > ( count( $parameters ) - 1 ) )
534 {
535 return false;
536 }
537
538 return $parameters[$selected + 1];
539 }
540 else
541 {
542 $values[] = $parameters[0];
543 $array = $parameters;
544 unset( $array[0] );
545
546 $count = count( $parameters ) - 1;
547 $operatorNameText = eZPHPCreator::variableText( $operatorName );
548
549 if ( count( $parameters ) == ( 2 + 1 ) )
550 {
551 $code = "%output% = %1% ? %3% : %2%;\n";
552 $values[] = $parameters[1];
553 $values[] = $parameters[2];
554 }
555 else
556 {
557 $code = ( "if ( %1% < 0 and\n" .
558 " %1% >= $count )\n" .
559 "{\n" .
560 " \$tpl->error( $operatorNameText, \"Index \" . %1% . \" out of range\" );\n" .
561 " %output% = false;\n" .
562 "}\n" );
563 $code .= "else switch ( %1% )\n{\n";
564 $valueNumber = 2;
565 for ( $i = 0; $i < $count; ++$i )
566 {
567 $parameterNumber = $i + 1;
568 $code .= " case $i:";
569 if ( eZTemplateNodeTool::isConstantElement( $parameters[$parameterNumber] ) )
570 {
571 $value = eZTemplateNodeTool::elementConstantValue( $parameters[$parameterNumber] );
572 $valueText = eZPHPCreator::variableText( $value, 0, 0, false );
573 $code .= " %output% = $valueText; break;\n";
574 }
575 else
576 {
577 $code .= "\n {\n";
578 $code .= "%code$valueNumber%\n";
579 $code .= "%output% = %$valueNumber%;\n";
580 $code .= " } break;\n";
581 $values[] = $parameters[$parameterNumber];
582 ++$valueNumber;
583 }
584 }
585 $code .= "}\n";
586 }
587 }
588 $newElements[] = eZTemplateNodeTool::createCodePieceElement( $code, $values, eZTemplateNodeTool::extractVariableNodePlacement( $node ), false );
589 return $newElements;
590 }
591
596 function getValueCount( $val )
597 {
598 $val_cnt = false;
599
600 if ( $val === null )
601 {
602 $val_cnt = 0;
603 }
604 else if ( $val === true || $val === false )
605 {
606 $val_cnt = (int)$val;
607 }
608 else if ( is_array( $val ) )
609 {
610 $val_cnt = count( $val );
611 }
612 else if ( is_object( $val ) and
613 method_exists( $val, "attributes" ) )
614 {
615 $val_cnt = count( $val->attributes() );
616 }
617 else if ( is_numeric( $val ) )
618 {
619 $val_cnt = $val;
620 }
621 else if ( is_string( $val ) )
622 {
623 $val_cnt = strlen( $val );
624 }
625 return $val_cnt;
626 }
627
631 function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters,
632 $placement )
633 {
634 if ( $operatorName == $this->LtName or $operatorName == $this->GtName or
635 $operatorName == $this->LeName or $operatorName == $this->GeName )
636 {
637 $val = $namedParameters["threshold"];
638
639 if ( ( $val_cnt = $this->getValueCount( $val ) ) === false )
640 {
641 $tpl->warning( $operatorName, "Unsupported input type: " . gettype( $val ) . "( $val ), must be either array, attribute object or numerical", $placement );
642 return;
643 }
644 }
645 switch ( $operatorName )
646 {
647 case $this->TrueName:
648 case $this->FalseName:
649 {
650 $value = ( $operatorName == $this->TrueName );
651 } break;
652 case $this->NeName:
653 {
654 if ( count( $operatorParameters ) >= 1 )
655 {
656 if ( count( $operatorParameters ) == 1 )
657 {
658 $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
659 $value = ( $lastOperand != $value );
660 }
661 else
662 {
663 $similar = false;
664 $value = false;
665 $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
666 for ( $i = 1; $i < count( $operatorParameters ); ++$i )
667 {
668 $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
669 if ( $operand != $lastOperand )
670 {
671 $value = true;
672 break;
673 }
674 unset( $lastOperand );
675 $lastOperand =& $operand;
676 }
677 }
678 }
679 else
680 {
681 $value = false;
682 $tpl->warning( $operatorName, "Requires one parameter for input checking or two or more for parameter checking", $placement );
683 }
684 } break;
685 case $this->EqName:
686 {
687 if ( count( $operatorParameters ) >= 1 )
688 {
689 if ( count( $operatorParameters ) == 1 )
690 {
691 $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
692 $value = ( $lastOperand == $value );
693 }
694 else
695 {
696 $similar = false;
697 $value = true;
698 $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
699 for ( $i = 1; $i < count( $operatorParameters ); ++$i )
700 {
701 $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
702 if ( $operand != $lastOperand )
703 {
704 $value = false;
705 break;
706 }
707 unset( $lastOperand );
708 $lastOperand =& $operand;
709 }
710 }
711 }
712 else
713 {
714 $value = false;
715 $tpl->warning( $operatorName, "Requires one parameter for input checking or two or more for parameter checking", $placement );
716 }
717 } break;
718 case $this->OrName:
719 {
720 for ( $i = 0; $i < count( $operatorParameters ); ++$i )
721 {
722 $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
723 $operand_logic = false;
724 if ( $operand === null )
725 $operand_logic = false;
726 else if ( $operand === true || $operand === false )
727 $operand_logic = $operand;
728 else if ( is_array( $operand ) )
729 $operand_logic = count( $operand ) > 0;
730 else if ( is_numeric( $operand ) )
731 $operand_logic = $operand != 0;
732 else if ( is_object( $operand ) )
733 $operand_logic = ( method_exists( $operand, "attributes" ) and
734 method_exists( $operand, "attribute" ) );
735 else if ( is_string( $operand ) )
736 $operand_logic = strlen(trim($operand)) > 0;
737 if ( $operand_logic )
738 {
739 $value = $operand;
740 return;
741 }
742 }
743 $value = false;
744 } break;
745 case $this->AndName:
746 {
747 $operand = null;
748 for ( $i = 0; $i < count( $operatorParameters ); ++$i )
749 {
750 $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
751 $operand_logic = false;
752 if ( $operand === null || $operand === '' )
753 $operand_logic = false;
754 else if ( $operand === true || $operand === false )
755 $operand_logic = $operand;
756 else if ( is_array( $operand ) )
757 $operand_logic = count( $operand ) > 0;
758 else if ( is_numeric( $operand ) )
759 $operand_logic = $operand != 0;
760 else if ( is_object( $operand ) )
761 $operand_logic = ( method_exists( $operand, "attributes" ) and
762 method_exists( $operand, "attribute" ) );
763 else if ( is_string( $operand ) )
764 $operand_logic = strlen(trim($operand)) > 0;
765 if ( !$operand_logic )
766 {
767 $value = false;
768 return;
769 }
770 }
771 $value = $operand;
772 } break;
773 case $this->ChooseName:
774 {
775 if ( $value === null )
776 $index = 0;
777 else if ( is_array( $value ) or
778 ( is_object( $value ) and
779 method_exists( $value, "attributes" ) ) )
780 {
781 $tpl->error( $operatorName, "Only supports numeric and boolean values", $placement );
782 return;
783 }
784 else if ( is_numeric( $value ) )
785 $index = $value;
786 else
787 $index = $value ? 1 : 0;
788 if ( $index < 0 or
789 $index > count( $operatorParameters ) - 1 )
790 {
791 $tpl->error( $operatorName, "Index $index out of range 0 => " . ( count( $operatorParameters ) - 1 ),
792 $placement );
793 $value = false;
794 return;
795 }
796 $value = $tpl->elementValue( $operatorParameters[$index], $rootNamespace, $currentNamespace, $placement );
797 } break;
798 case $this->LtName:
799 case $this->GtName:
800 case $this->LeName:
801 case $this->GeName:
802 {
803 if ( $value !== null )
804 {
805 $operandA = $value;
806 $operandB = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
807 }
808 else
809 {
810 $operandA = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
811 $operandB = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace, $placement );
812 }
813
814 if ( ( $cnt = $this->getValueCount( $operandA ) ) === false )
815 {
816 $tpl->warning( $operatorName, "Unsupported input type: " . gettype( $operandA ) . "( $operandA ), must be either array, attribute object or numerical", $placement );
817 return;
818 }
819 if ( ( $val_cnt = $this->getValueCount( $operandB ) ) === false )
820 {
821 $tpl->warning( $operatorName, "Unsupported input type: " . gettype( $operandB ) . "( $operandB ), must be either array, attribute object or numerical", $placement );
822 return;
823 }
824 if ( $operatorName == $this->LtName )
825 $value = ( $cnt < $val_cnt );
826 else if ( $operatorName == $this->GtName )
827 $value = ( $cnt > $val_cnt );
828 else if ( $operatorName == $this->LeName )
829 $value = ( $cnt <= $val_cnt );
830 else if ( $operatorName == $this->GeName )
831 $value = ( $cnt >= $val_cnt );
832 } break;
833 case $this->NullName:
834 {
835 $value = $value === null;
836 } break;
837 case $this->NotName:
838 {
839 if ( $value === null and isset( $operatorParameters[0] ) )
840 {
841 $operand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
842 }
843 else
844 {
845 $operand = $value;
846 }
847 if ( $operand === null )
848 $operand = true;
849 else if ( is_array( $operand ) )
850 $operand = ( count( $operand ) == 0 );
851 else if ( is_object( $operand ) and
852 method_exists( $operand, "attributes" ) )
853 $operand = ( count( $operand->attributes() ) == 0 );
854 else if ( is_numeric( $operand ) )
855 $operand = ( $operand == 0 );
856 else if ( is_string( $operand ) )
857 $operand = ( strlen( $operand ) == 0 );
858 else
859 $operand = !$operand;
860 $value = $operand;
861 } break;
862 }
863 }
864
867 public $Operators;
869 public $LtName;
871 public $GtName;
873 public $LeName;
875 public $GeName;
877 public $EqName;
879 public $NeName;
881 public $NullName;
883 public $NotName;
885 public $OrName;
887 public $AndName;
889 public $TrueName;
891 public $FalseName;
893 public $ChooseName;
894 }
895
896 ?>
eZTemplateLogicOperator
Logical operators for creating and manipulating booleans.
Definition: eztemplatelogicoperator.php:68
eZTemplateLogicOperator\namedParameterList
namedParameterList()
Definition: eztemplatelogicoperator.php:219
eZTemplateLogicOperator\namedParameterPerOperator
namedParameterPerOperator()
Definition: eztemplatelogicoperator.php:97
eZTemplateLogicOperator\$GeName
$GeName
The "greater than or equal" name.
Definition: eztemplatelogicoperator.php:875
eZTemplateLogicOperator\chooseTransformation
chooseTransformation( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
Definition: eztemplatelogicoperator.php:516
eZTemplateLogicOperator\$NeName
$NeName
The "not equal" name.
Definition: eztemplatelogicoperator.php:879
eZTemplateLogicOperator\getValueCount
getValueCount( $val)
Definition: eztemplatelogicoperator.php:596
eZTemplateLogicOperator\$TrueName
$TrueName
The "true" name.
Definition: eztemplatelogicoperator.php:889
eZTemplateLogicOperator\$Operators
$Operators
Definition: eztemplatelogicoperator.php:867
eZTemplateLogicOperator\operatorCompiledStaticData
operatorCompiledStaticData( $operatorName)
Definition: eztemplatelogicoperator.php:200
eZTemplateLogicOperator\__construct
__construct()
Definition: eztemplatelogicoperator.php:72
eZTemplateLogicOperator\$OrName
$OrName
The "or" name.
Definition: eztemplatelogicoperator.php:885
eZTemplateLogicOperator\$AndName
$AndName
The "and" name.
Definition: eztemplatelogicoperator.php:887
eZTemplateLogicOperator\$LeName
$LeName
The "less than or equal" name.
Definition: eztemplatelogicoperator.php:873
eZTemplateLogicOperator\$NotName
$NotName
The "not" name.
Definition: eztemplatelogicoperator.php:883
eZTemplateLogicOperator\modify
modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters, $placement)
Definition: eztemplatelogicoperator.php:631
eZTemplateLogicOperator\$LtName
$LtName
The "less than" name.
Definition: eztemplatelogicoperator.php:869
eZTemplateLogicOperator\$ChooseName
$ChooseName
The "choose" name.
Definition: eztemplatelogicoperator.php:893
eZTemplateLogicOperator\logicalComparisonTransformation
logicalComparisonTransformation( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
Definition: eztemplatelogicoperator.php:236
eZTemplateLogicOperator\trueFalseTransformation
trueFalseTransformation( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
Definition: eztemplatelogicoperator.php:499
eZTemplateLogicOperator\operatorList
operatorList()
Definition: eztemplatelogicoperator.php:89
eZTemplateLogicOperator\negateTransformation
negateTransformation( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
Definition: eztemplatelogicoperator.php:480
eZTemplateLogicOperator\$NullName
$NullName
The "null" name.
Definition: eztemplatelogicoperator.php:881
eZTemplateLogicOperator\operatorTemplateHints
operatorTemplateHints()
Definition: eztemplatelogicoperator.php:102
eZTemplateLogicOperator\$GtName
$GtName
The "greater than" name.
Definition: eztemplatelogicoperator.php:871
eZTemplateLogicOperator\$FalseName
$FalseName
The "false" name.
Definition: eztemplatelogicoperator.php:891
eZTemplateLogicOperator\$EqName
$EqName
The "equal" name.
Definition: eztemplatelogicoperator.php:877
eZTemplateNodeTool\elementConstantValue
static elementConstantValue( $elements)
Definition: eztemplatenodetool.php:197
eZTemplateNodeTool\createCodePieceElement
static createCodePieceElement( $codePiece, $values=false, $placement=false, $tmpValues=false, $knownTypes=true)
Definition: eztemplatenodetool.php:437
eZTemplateNodeTool\createConstantElement
static createConstantElement( $constant, $variablePlacement=false)
Definition: eztemplatenodetool.php:61
eZTemplateNodeTool\createBooleanElement
static createBooleanElement( $boolean, $variablePlacement=false)
Definition: eztemplatenodetool.php:133
eZTemplateNodeTool\extractVariableNodePlacement
static extractVariableNodePlacement(&$node)
Definition: eztemplatenodetool.php:714
eZTemplateNodeTool\isConstantElement
static isConstantElement( $elements)
Definition: eztemplatenodetool.php:233
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.