Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

eztemplate.php
Go to the documentation of this file.
1 <?php
198 class eZTemplate
199 {
200 const RESOURCE_FETCH = 1;
201 const RESOURCE_QUERY = 2;
202
203 const ELEMENT_TEXT = 1;
204 const ELEMENT_SINGLE_TAG = 2;
205 const ELEMENT_NORMAL_TAG = 3;
206 const ELEMENT_END_TAG = 4;
207 const ELEMENT_VARIABLE = 5;
208 const ELEMENT_COMMENT = 6;
209
210 const NODE_ROOT = 1;
211 const NODE_TEXT = 2;
212 const NODE_VARIABLE = 3;
213 const NODE_FUNCTION = 4;
214 const NODE_OPERATOR = 5;
215
216
217 const NODE_INTERNAL = 100;
218 const NODE_INTERNAL_CODE_PIECE = 101;
219
220 const NODE_INTERNAL_VARIABLE_SET = 105;
221 const NODE_INTERNAL_VARIABLE_UNSET = 102;
222
223 const NODE_INTERNAL_NAMESPACE_CHANGE = 103;
224 const NODE_INTERNAL_NAMESPACE_RESTORE = 104;
225
226 const NODE_INTERNAL_WARNING = 120;
227 const NODE_INTERNAL_ERROR = 121;
228
229 const NODE_INTERNAL_RESOURCE_ACQUISITION = 140;
230 const NODE_OPTIMIZED_RESOURCE_ACQUISITION = 141;
231
232 const NODE_INTERNAL_OUTPUT_ASSIGN = 150;
233 const NODE_INTERNAL_OUTPUT_READ = 151;
234 const NODE_INTERNAL_OUTPUT_INCREASE = 152;
235 const NODE_INTERNAL_OUTPUT_DECREASE = 153;
236
237 const NODE_INTERNAL_OUTPUT_SPACING_INCREASE = 160;
238 const NODE_INTERNAL_SPACING_DECREASE = 161;
239
240 const NODE_OPTIMIZED_INIT = 201;
241
242
243 const NODE_USER_CUSTOM = 1000;
244
245
246 const TYPE_VOID = 0;
247 const TYPE_STRING = 1;
248 const TYPE_NUMERIC = 2;
249 const TYPE_IDENTIFIER = 3;
250 const TYPE_VARIABLE = 4;
251 const TYPE_ATTRIBUTE = 5;
252 const TYPE_OPERATOR = 6;
253 const TYPE_BOOLEAN = 7;
254 const TYPE_ARRAY = 8;
255 const TYPE_DYNAMIC_ARRAY = 9;
256
257 const TYPE_INTERNAL = 100;
258 const TYPE_INTERNAL_CODE_PIECE = 101;
259 const TYPE_PHP_VARIABLE = 102;
260
261 const TYPE_OPTIMIZED_NODE = 201;
262 const TYPE_OPTIMIZED_ARRAY_LOOKUP = 202;
263 const TYPE_OPTIMIZED_CONTENT_CALL = 203;
264 const TYPE_OPTIMIZED_ATTRIBUTE_LOOKUP = 204;
265
266 const TYPE_INTERNAL_STOP = 999;
267
268
269 const TYPE_STRING_BIT = 1;
270 const TYPE_NUMERIC_BIT = 2;
271 const TYPE_IDENTIFIER_BIT = 4;
272 const TYPE_VARIABLE_BIT = 8;
273 const TYPE_ATTRIBUTE_BIT = 16;
274 const TYPE_OPERATOR_BIT = 32;
275
276 const TYPE_NONE = 0;
277
278 const TYPE_ALL = 63;
279
280 const TYPE_BASIC = 47;
281
282 const TYPE_MODIFIER_MASK = 48;
283
284 const NAMESPACE_SCOPE_GLOBAL = 1;
285 const NAMESPACE_SCOPE_LOCAL = 2;
286 const NAMESPACE_SCOPE_RELATIVE = 3;
287
288 const DEBUG_INTERNALS = false;
289
290 const FILE_ERRORS = 1;
291
296 public function __construct()
297 {
298 $this->Tree = array( eZTemplate::NODE_ROOT, false );
299 $this->LDelim = "{";
300 $this->RDelim = "}";
301
302 $this->IncludeText = array();
303 $this->IncludeOutput = array();
304
305 $this->registerLiteral( "literal" );
306
307 $res = new eZTemplateFileResource();
308 $this->DefaultResource = $res;
309 $this->registerResource( $res );
310
311 $this->Resources = array();
312 $this->Text = null;
313
314 $this->IsCachingAllowed = true;
315
316 $this->resetErrorLog();
317
318 $this->AutoloadPathList = array( 'lib/eztemplate/classes/' );
319 $this->Variables = array();
320 $this->LocalVariablesNamesStack = array();
321 $this->CurrentLocalVariablesNames = null;
322 $this->Functions = array();
323 $this->FunctionAttributes = array();
324
325 $this->TestCompile = false;
326
327 $ini = eZINI::instance( 'template.ini' );
328 if ( $ini->hasVariable( 'ControlSettings', 'MaxLevel' ) )
329 $this->MaxLevel = $ini->variable( 'ControlSettings', 'MaxLevel' );
330
331 $this->MaxLevelWarning = ezpI18n::tr( 'lib/template',
332 'The maximum nesting level of %max has been reached. The execution is stopped to avoid infinite recursion.',
333 '',
334 array( '%max' => $this->MaxLevel ) );
335 eZDebug::createAccumulatorGroup( 'template_total', 'Template Total' );
336
337 $this->TemplatesUsageStatistics = array();
338 // Array of templates which are used in a single fetch()
339 $this->TemplateFetchList = array();
340
341 $this->ForeachCounter = 0;
342 $this->ForCounter = 0;
343 $this->WhileCounter = 0;
344 $this->DoCounter = 0;
345 $this->ElseifCounter = 0;
346 }
347
351 function leftDelimiter()
352 {
353 return $this->LDelim;
354 }
355
359 function rightDelimiter()
360 {
361 return $this->RDelim;
362 }
363
367 function setLeftDelimiter( $delim )
368 {
369 $this->LDelim = $delim;
370 }
371
375 function setRightDelimiter( $delim )
376 {
377 $this->RDelim = $delim;
378 }
379
384 function display( $template = false, $extraParameters = false )
385 {
386 $output = $this->fetch( $template, $extraParameters );
387 if ( $this->ShowDetails )
388 {
389 echo '<h1>Result:</h1>' . "\n";
390 echo '<hr/>' . "\n";
391 }
392 echo "$output";
393 if ( $this->ShowDetails )
394 {
395 echo '<hr/>' . "\n";
396 }
397 if ( $this->ShowDetails )
398 {
399 echo "<h1>Template data:</h1>";
400 echo "<p class=\"filename\">" . $template . "</p>";
401 echo "<pre class=\"example\">" . htmlspecialchars( $this->Text ) . "</pre>";
402 reset( $this->IncludeText );
403 while ( ( $key = key( $this->IncludeText ) ) !== null )
404 {
405 $item = $this->IncludeText[$key];
406 echo "<p class=\"filename\">" . $key . "</p>";
407 echo "<pre class=\"example\">" . htmlspecialchars( $item ) . "</pre>";
408 next( $this->IncludeText );
409 }
410 echo "<h1>Result text:</h1>";
411 echo "<p class=\"filename\">" . $template . "</p>";
412 echo "<pre class=\"example\">" . htmlspecialchars( $output ) . "</pre>";
413 reset( $this->IncludeOutput );
414 while ( ( $key = key( $this->IncludeOutput ) ) !== null )
415 {
416 $item = $this->IncludeOutput[$key];
417 echo "<p class=\"filename\">" . $key . "</p>";
418 echo "<pre class=\"example\">" . htmlspecialchars( $item ) . "</pre>";
419 next( $this->IncludeOutput );
420 }
421 }
422 }
423
428 function createLocalVariablesList()
429 {
430 $this->LocalVariablesNamesStack[] = array();
431 $this->CurrentLocalVariablesNames =& $this->LocalVariablesNamesStack[ count( $this->LocalVariablesNamesStack ) - 1];
432 }
433
437 function hasLocalVariable( $varName, $rootNamespace )
438 {
439 return ( array_key_exists( $rootNamespace, $this->CurrentLocalVariablesNames ) &&
440 array_key_exists( $varName, $this->CurrentLocalVariablesNames[$rootNamespace] ) );
441 }
442
446 function setLocalVariable( $varName, $varValue, $rootNamespace )
447 {
448 $this->CurrentLocalVariablesNames[$rootNamespace][$varName] = 1;
449 $this->setVariable( $varName, $varValue, $rootNamespace );
450 }
451
455 function unsetLocalVariable( $varName, $rootNamespace )
456 {
457 if ( !$this->hasLocalVariable( $varName, $rootNamespace ) )
458 return;
459
460 $this->unsetVariable( $varName, $rootNamespace );
461 unset( $this->CurrentLocalVariablesNames[$rootNamespace][$varName] );
462 }
463
467 function unsetLocalVariables()
468 {
469 foreach ( $this->CurrentLocalVariablesNames as $ns => $vars )
470 {
471 foreach ( $vars as $var => $val )
472 $this->unsetLocalVariable( $var, $ns );
473 }
474 }
475
479 function destroyLocalVariablesList()
480 {
481 array_pop( $this->LocalVariablesNamesStack );
482
483 if ( $this->LocalVariablesNamesStack )
484 $this->CurrentLocalVariablesNames =& $this->LocalVariablesNamesStack[ count( $this->LocalVariablesNamesStack ) - 1];
485 else
486 unset( $this->CurrentLocalVariablesNames );
487 }
488
493 function fetch( $template = false, $extraParameters = false, $returnResourceData = false )
494 {
495 $this->resetErrorLog();
496 // Reset fetch list when a new fetch is started
497 $this->TemplateFetchList = array();
498
499 eZDebug::accumulatorStart( 'template_total' );
500 eZDebug::accumulatorStart( 'template_load', 'template_total', 'Template load' );
501 $root = null;
502 if ( is_string( $template ) )
503 {
504 $resourceData = $this->loadURIRoot( $template, true, $extraParameters );
505 if ( $resourceData and
506 $resourceData['root-node'] !== null )
507 $root =& $resourceData['root-node'];
508 }
509 eZDebug::accumulatorStop( 'template_load' );
510 if ( $resourceData['locales'] && !empty( $resourceData['locales'] ) )
511 {
512 $savedLocale = setlocale( LC_CTYPE, null );
513 setlocale( LC_CTYPE, $resourceData['locales'] );
514 }
515
516 $text = "";
517
518 if ( $root !== null or
519 $resourceData['compiled-template'] )
520 {
521 if ( $this->ShowDetails )
522 eZDebug::addTimingPoint( "Process" );
523 eZDebug::accumulatorStart( 'template_processing', 'template_total', 'Template processing' );
524
525 $templateCompilationUsed = false;
526 if ( $resourceData['compiled-template'] )
527 {
528 $textElements = array();
529 if ( $this->executeCompiledTemplate( $resourceData, $textElements, "", "", $extraParameters ) )
530 {
531 $text = implode( '', $textElements );
532 $templateCompilationUsed = true;
533 }
534 }
535 if ( !$templateCompilationUsed )
536 {
537 if ( eZTemplate::isDebugEnabled() )
538 {
539 $fname = $resourceData['template-filename'];
540 eZDebug::writeDebug( "FETCH START URI: $template, $fname" );
541 }
542 $this->process( $root, $text, "", "" );
543 if ( eZTemplate::isDebugEnabled() )
544 eZDebug::writeDebug( "FETCH END URI: $template, $fname" );
545 }
546
547 eZDebug::accumulatorStop( 'template_processing' );
548 if ( $this->ShowDetails )
549 eZDebug::addTimingPoint( "Process done" );
550 }
551
552 eZDebug::accumulatorStop( 'template_total' );
553
554 if ( $resourceData['locales'] && !empty( $resourceData['locales'] ) )
555 {
556 setlocale( LC_CTYPE, $savedLocale );
557 }
558
559 if ( $returnResourceData )
560 {
561 $resourceData['result_text'] = $text;
562 return $resourceData;
563 }
564 return $text;
565 }
566
567 function process( $root, &$text, $rootNamespace, $currentNamespace )
568 {
569 $this->createLocalVariablesList();
570
571 $textElements = array();
572 $this->processNode( $root, $textElements, $rootNamespace, $currentNamespace );
573 if ( is_array( $textElements ) )
574 $text = implode( '', $textElements );
575 else
576 $text = $textElements;
577
578 $this->unsetLocalVariables();
579 $this->destroyLocalVariablesList();
580 }
581
582 function processNode( $node, &$textElements, $rootNamespace, $currentNamespace )
583 {
584 $rslt = null;
585 $nodeType = $node[0];
586 if ( $nodeType == eZTemplate::NODE_ROOT )
587 {
588 $children = $node[1];
589 if ( $children )
590 {
591 foreach ( $children as $child )
592 {
593 $this->processNode( $child, $textElements, $rootNamespace, $currentNamespace );
594 if ( !is_array( $textElements ) )
595 eZDebug::writeError( "Textelements is no longer array: '$textElements'", __METHOD__ . '::root' );
596 }
597 }
598 }
599 else if ( $nodeType == eZTemplate::NODE_TEXT )
600 {
601 $textElements[] = $node[2];
602 }
603 else if ( $nodeType == eZTemplate::NODE_VARIABLE )
604 {
605 $variableData = $node[2];
606 $variablePlacement = $node[3];
607 $this->processVariable( $textElements, $variableData, $variablePlacement, $rootNamespace, $currentNamespace );
608 if ( !is_array( $textElements ) )
609 eZDebug::writeError( "Textelements is no longer array: '$textElements'", __METHOD__ . '::variable' );
610 }
611 else if ( $nodeType == eZTemplate::NODE_FUNCTION )
612 {
613 $functionChildren = $node[1];
614 $functionName = $node[2];
615 $functionParameters = $node[3];
616 $functionPlacement = $node[4];
617 $rslt = $this->processFunction( $functionName, $textElements, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace );
618 if ( !is_array( $textElements ) )
619 eZDebug::writeError( "Textelements is no longer array: '$textElements'", __METHOD__ . "::function( '$functionName' )" );
620 }
621
622 return $rslt;
623 }
624
625 function processVariable( &$textElements, $variableData, $variablePlacement, $rootNamespace, $currentNamespace )
626 {
627 $value = $this->elementValue( $variableData, $rootNamespace, $currentNamespace, $variablePlacement );
628 $this->appendElementText( $textElements, $value, $rootNamespace, $currentNamespace );
629 }
630
631 function processFunction( $functionName, &$textElements, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
632 {
633 // Note: This code piece is replicated in the eZTemplateCompiler,
634 // if this code is changed the replicated code must be updated as well.
635 $func = $this->Functions[$functionName];
636 if ( is_array( $func ) )
637 {
638 $this->loadAndRegisterFunctions( $this->Functions[$functionName] );
639 $func = $this->Functions[$functionName];
640 }
641 if ( isset( $func ) and
642 is_object( $func ) )
643 {
644 if ( eZTemplate::isMethodDebugEnabled() )
645 eZDebug::writeDebug( "START FUNCTION: $functionName" );
646 $value = $func->process( $this, $textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace );
647 if ( eZTemplate::isMethodDebugEnabled() )
648 eZDebug::writeDebug( "END FUNCTION: $functionName" );
649 return $value;
650 }
651 else
652 {
653 $this->warning( "", "Function \"$functionName\" is not registered" );
654 return null;
655 }
656 }
657
658 function fetchFunctionObject( $functionName )
659 {
660 $func = $this->Functions[$functionName];
661 if ( is_array( $func ) )
662 {
663 $this->loadAndRegisterFunctions( $this->Functions[$functionName] );
664 $func = $this->Functions[$functionName];
665 }
666 return $func;
667 }
668
674 function load( $uri, $extraParameters = false, $returnResourceData = false )
675 {
676 $resourceData = $this->loadURIRoot( $uri, true, $extraParameters );
677 if ( !$resourceData or
678 $resourceData['root-node'] === null )
679 {
680 $retValue = null;
681 return $retValue;
682 }
683 else
684 return $resourceData['root-node'];
685 }
686
687 function parse( $sourceText, &$rootElement, $rootNamespace, &$resourceData )
688 {
689 $parser = eZTemplateMultiPassParser::instance();
690 $parser->parse( $this, $sourceText, $rootElement, $rootNamespace, $resourceData );
691 }
692
693 function loadURIData( $resourceObject, $uri, $resourceName, $template, &$extraParameters, $displayErrors = true )
694 {
695 $resourceData = $this->resourceData( $resourceObject, $uri, $resourceName, $template );
696
697 $resourceData['text'] = null;
698 $resourceData['root-node'] = null;
699 $resourceData['compiled-template'] = false;
700 $resourceData['time-stamp'] = null;
701 $resourceData['key-data'] = null;
702 $resourceData['locales'] = null;
703
704 if ( !$resourceObject->handleResource( $this, $resourceData, eZTemplate::RESOURCE_FETCH, $extraParameters ) )
705 {
706 $resourceData = null;
707 if ( $displayErrors )
708 $this->warning( "", "No template could be loaded for \"$template\" using resource \"$resourceName\"" );
709 }
710 return $resourceData;
711 }
712
721 function resourceData( $resourceObject, $uri, $resourceName, $templateName )
722 {
723 $resourceData = array();
724 $resourceData['uri'] = $uri;
725 $resourceData['resource'] = $resourceName;
726 $resourceData['template-name'] = $templateName;
727 $resourceData['template-filename'] = $templateName;
728 $resourceData['handler'] = $resourceObject;
729 $resourceData['test-compile'] = $this->TestCompile;
730 return $resourceData;
731 }
732
740 function loadURIRoot( $uri, $displayErrors, &$extraParameters )
741 {
742 $res = "";
743 $template = "";
744 $resobj = $this->resourceFor( $uri, $res, $template );
745
746 if ( !is_object( $resobj ) )
747 {
748 if ( $displayErrors )
749 $this->warning( "", "No resource handler for \"$res\" and no default resource handler, aborting." );
750 return null;
751 }
752
753 $canCache = true;
754 if ( !$resobj->servesStaticData() )
755 $canCache = false;
756 if ( !$this->isCachingAllowed() )
757 $canCache = false;
758
759 $resourceData = $this->loadURIData( $resobj, $uri, $res, $template, $extraParameters, $displayErrors );
760
761 if ( $resourceData )
762 {
763 eZTemplate::appendTemplateToStatisticsIfNeeded( $resourceData['template-name'], $resourceData['template-filename'] );
764 $this->appendTemplateFetch( $resourceData['template-filename'] );
765
766 if ( !$resourceData['compiled-template'] and
767 $resourceData['root-node'] === null )
768 {
769 $resourceData['root-node'] = array( eZTemplate::NODE_ROOT, false );
770 $templateText = $resourceData["text"];
771 $keyData = $resourceData['key-data'];
772 $this->setIncludeText( $uri, $templateText );
773 $rootNamespace = '';
774 $this->parse( $templateText, $resourceData['root-node'], $rootNamespace, $resourceData );
775
776 if ( eZTemplate::isDebugEnabled() )
777 {
778 $this->appendDebugNodes( $resourceData['root-node'], $resourceData );
779 }
780
781 if ( $canCache )
782 $resobj->setCachedTemplateTree( $keyData, $uri, $res, $template, $extraParameters, $resourceData['root-node'] );
783 }
784 if ( !$resourceData['compiled-template'] and
785 $canCache and
786 $this->canCompileTemplate( $resourceData, $extraParameters ) )
787 {
788 $generateStatus = $this->compileTemplate( $resourceData, $extraParameters );
789 if ( $generateStatus )
790 $resourceData['compiled-template'] = true;
791 }
792 }
793
794 return $resourceData;
795 }
796
797 function processURI( $uri, $displayErrors, &$extraParameters,
798 &$textElements, $rootNamespace, $currentNamespace )
799 {
800 $this->Level++;
801 if ( $this->Level > $this->MaxLevel )
802 {
803 eZDebug::writeError( $this->MaxLevelWarning, __METHOD__ . " Level: $this->Level @ $uri" );
804 $textElements[] = $this->MaxLevelWarning;
805 $this->Level--;
806 return;
807 }
808 $resourceData = $this->loadURIRoot( $uri, $displayErrors, $extraParameters );
809 if ( !$resourceData or
810 ( !$resourceData['compiled-template'] and
811 $resourceData['root-node'] === null ) )
812 {
813 $this->Level--;
814 return;
815 }
816
817 $templateCompilationUsed = false;
818
819 if ( $resourceData['locales'] && !empty( $resourceData['locales'] ) )
820 {
821 $savedLocale = setlocale( LC_CTYPE, null );
822 setlocale( LC_CTYPE, $resourceData['locales'] );
823 }
824
825 if ( $resourceData['compiled-template'] )
826 {
827 if ( $this->executeCompiledTemplate( $resourceData, $textElements, $rootNamespace, $currentNamespace, $extraParameters ) )
828 $templateCompilationUsed = true;
829 }
830 if ( !$templateCompilationUsed )
831 {
832 $text = null;
833 if ( eZTemplate::isDebugEnabled() )
834 {
835 $fname = $resourceData['template-filename'];
836 eZDebug::writeDebug( "START URI: $uri, $fname" );
837 }
838 $this->process( $resourceData['root-node'], $text, $rootNamespace, $currentNamespace );
839 if ( eZTemplate::isDebugEnabled() )
840 eZDebug::writeDebug( "END URI: $uri, $fname" );
841 $this->setIncludeOutput( $uri, $text );
842 $textElements[] = $text;
843 }
844
845 if ( $resourceData['locales'] && !empty( $resourceData['locales'] ) )
846 {
847 setlocale( LC_CTYPE, $savedLocale );
848 }
849 $this->Level--;
850
851 }
852
853 function canCompileTemplate( $resourceData, &$extraParameters )
854 {
855 $resourceObject = $resourceData['handler'];
856 if ( !$resourceObject )
857 return false;
858 $canGenerate = $resourceObject->canCompileTemplate( $this, $resourceData, $extraParameters );
859 return $canGenerate;
860 }
861
867 function validateTemplateFile( $file, $returnResourceData = false )
868 {
869 $this->resetErrorLog();
870
871 if ( !file_exists( $file ) )
872 return false;
873 $resourceHandler = $this->resourceFor( $file, $resourceName, $templateName );
874 if ( !$resourceHandler )
875 return false;
876 $resourceData = $this->resourceData( $resourceHandler, $file, $resourceName, $templateName );
877 $resourceData['key-data'] = "file:" . $file;
878 $extraParameters = array();
879
880 // Disable caching/compiling while fetchin the resource
881 // It will be restored afterwards
882 $isCachingAllowed = $this->IsCachingAllowed;
883 $this->IsCachingAllowed = false;
884
885 $resourceHandler->handleResource( $this, $resourceData, eZTemplate::RESOURCE_FETCH, $extraParameters );
886
887 // Restore previous caching flag
888 $this->IsCachingAllowed = $isCachingAllowed;
889
890 $root =& $resourceData['root-node'];
891 $root = array( eZTemplate::NODE_ROOT, false );
892 $templateText = $resourceData["text"];
893 $rootNamespace = '';
894 $this->parse( $templateText, $root, $rootNamespace, $resourceData );
895 if ( eZTemplate::isDebugEnabled() )
896 {
897 $this->appendDebugNodes( $root, $resourceData );
898 }
899
900 $result = !$this->hasErrors() and !$this->hasWarnings();
901 if ( $returnResourceData )
902 {
903 $resourceData['result'] = $result;
904 $resourceData['errors'] = $this->ErrorLog();
905 $resourceData['warnings'] = $this->WarningLog();
906 return $resourceData;
907 }
908 return $result;
909 }
910
916 function compileTemplateFile( $file, $returnResourceData = false )
917 {
918 $this->resetErrorLog();
919
920 if ( !file_exists( $file ) )
921 return false;
922 $resourceHandler = $this->resourceFor( $file, $resourceName, $templateName );
923 if ( !$resourceHandler )
924 return false;
925 $resourceData = $this->resourceData( $resourceHandler, $file, $resourceName, $templateName );
926 $resourceData['key-data'] = "file:" . $file;
927 $key = md5( $resourceData['key-data'] );
928 $extraParameters = array();
929 $resourceHandler->handleResource( $this, $resourceData, eZTemplate::RESOURCE_FETCH, $extraParameters );
930
931 $isCompiled = false;
932 if ( isset( $resourceData['compiled-template'] ) )
933 $isCompiled = $resourceData['compiled-template'];
934
935 if ( !$isCompiled )
936 {
937 $root =& $resourceData['root-node'];
938 $root = array( eZTemplate::NODE_ROOT, false );
939 $templateText = $resourceData["text"];
940 $rootNamespace = '';
941 $this->parse( $templateText, $root, $rootNamespace, $resourceData );
942 if ( eZTemplate::isDebugEnabled() )
943 {
944 $this->appendDebugNodes( $root, $resourceData );
945 }
946
947 $result = eZTemplateCompiler::compileTemplate( $this, $key, $resourceData );
948 }
949 else
950 {
951 $result = true;
952 }
953
954 if ( $returnResourceData )
955 {
956 $resourceData['result'] = $result;
957 return $resourceData;
958 }
959 return $result;
960 }
961
962 function compileTemplate( &$resourceData, &$extraParameters )
963 {
964 $resourceObject = $resourceData['handler'];
965 if ( !$resourceObject )
966 return false;
967 $keyData = $resourceData['key-data'];
968 $uri = $resourceData['uri'];
969 $resourceName = $resourceData['resource'];
970 $templatePath = $resourceData['template-name'];
971 return $resourceObject->compileTemplate( $this, $keyData, $uri, $resourceName, $templatePath, $extraParameters, $resourceData );
972 }
973
974 function executeCompiledTemplate( &$resourceData, &$textElements, $rootNamespace, $currentNamespace, &$extraParameters )
975 {
976 $resourceObject = $resourceData['handler'];
977 if ( !$resourceObject )
978 return false;
979 $keyData = $resourceData['key-data'];
980 $uri = $resourceData['uri'];
981 $resourceName = $resourceData['resource'];
982 $templatePath = $resourceData['template-name'];
983 $timestamp = $resourceData['time-stamp'];
984 return $resourceObject->executeCompiledTemplate( $this, $textElements,
985 $keyData, $uri, $resourceData, $templatePath,
986 $extraParameters, $timestamp,
987 $rootNamespace, $currentNamespace );
988 }
989
997 function resourceFor( $uri, &$res, &$template )
998 {
999 $args = explode( ":", $uri );
1000 if ( isset( $args[1] ) )
1001 {
1002 $res = $args[0];
1003 $template = $args[1];
1004 }
1005 else
1006 $template = $uri;
1007 if ( eZTemplate::isDebugEnabled() )
1008 {
1009 eZDebug::writeNotice( "eZTemplate: Loading template \"$template\" with resource \"$res\"" );
1010 }
1011 if ( isset( $this->Resources[$res] ) and is_object( $this->Resources[$res] ) )
1012 {
1013 return $this->Resources[$res];
1014 }
1015 return $this->DefaultResource;
1016 }
1017
1022 function resourceHandler( $resourceName )
1023 {
1024 if ( isset( $this->Resources[$resourceName] ) &&
1025 is_object( $this->Resources[$resourceName] ) )
1026 {
1027 return $this->Resources[$resourceName];
1028 }
1029 return $this->DefaultResource;
1030 }
1031
1032 function hasChildren( &$function, $functionName )
1033 {
1034 $hasChildren = $function->hasChildren();
1035 if ( is_array( $hasChildren ) )
1036 return $hasChildren[$functionName];
1037 else
1038 return $hasChildren;
1039 }
1040
1044 function emptyVariable()
1045 {
1046 return array( "type" => "null" );
1047 }
1048
1052 function mergeNamespace( $rootNamespace, $additionalNamespace )
1053 {
1054 $namespace = $rootNamespace;
1055 if ( $namespace == '' )
1056 $namespace = $additionalNamespace;
1057 else if ( $additionalNamespace != '' )
1058 $namespace = "$namespace:$additionalNamespace";
1059 return $namespace;
1060 }
1061
1065 function elementValue( &$dataElements, $rootNamespace, $currentNamespace, $placement = false,
1066 $checkExistance = false, $checkForProxy = false )
1067 {
1068 /*
1069 * We use a small dirty hack in this function...
1070 * To help the caller to determine if the value was a proxy object,
1071 * we store boolean true to $dataElements['proxy-object-found'] in this case.
1072 * (it's up to caller to remove this garbage from $dataElements...)
1073 * This behaviour is enabled by $checkForProxy parameter.
1074 */
1075
1076 $value = null;
1077 if ( !is_array( $dataElements ) )
1078 {
1079 $this->error( "elementValue",
1080 "Missing array data structure, got " . gettype( $dataElements ),
1081 $placement );
1082 return null;
1083 }
1084 foreach ( $dataElements as $dataElement )
1085 {
1086 if ( $dataElement === null )
1087 {
1088 return null;
1089 }
1090 $dataType = $dataElement[0];
1091 switch ( $dataType )
1092 {
1093 case eZTemplate::TYPE_VOID:
1094 {
1095 if ( !$checkExistance )
1096 $this->warning( 'elementValue',
1097 'Found void datatype, should not be used' );
1098 else
1099 {
1100 return null;
1101 }
1102 } break;
1103 case eZTemplate::TYPE_STRING:
1104 case eZTemplate::TYPE_NUMERIC:
1105 case eZTemplate::TYPE_IDENTIFIER:
1106 case eZTemplate::TYPE_BOOLEAN:
1107 case eZTemplate::TYPE_ARRAY:
1108 {
1109 $value = $dataElement[1];
1110 } break;
1111 case eZTemplate::TYPE_VARIABLE:
1112 {
1113 $variableData = $dataElement[1];
1114 $variableNamespace = $variableData[0];
1115 $variableNamespaceScope = $variableData[1];
1116 $variableName = $variableData[2];
1117 if ( $variableNamespaceScope == eZTemplate::NAMESPACE_SCOPE_GLOBAL )
1118 $namespace = $variableNamespace;
1119 else if ( $variableNamespaceScope == eZTemplate::NAMESPACE_SCOPE_LOCAL )
1120 $namespace = $this->mergeNamespace( $rootNamespace, $variableNamespace );
1121 else if ( $variableNamespaceScope == eZTemplate::NAMESPACE_SCOPE_RELATIVE )
1122 $namespace = $this->mergeNamespace( $currentNamespace, $variableNamespace );
1123 else
1124 $namespace = false;
1125 if ( $this->hasVariable( $variableName, $namespace ) )
1126 {
1127 $value = $this->variable( $variableName, $namespace );
1128 }
1129 else
1130 {
1131 if ( !$checkExistance )
1132 $this->error( '', "Unknown template variable '$variableName' in namespace '$namespace'", $placement );
1133 {
1134 return null;
1135 }
1136 }
1137 } break;
1138 case eZTemplate::TYPE_ATTRIBUTE:
1139 {
1140 $attributeData = $dataElement[1];
1141 $attributeValue = $this->elementValue( $attributeData, $rootNamespace, $currentNamespace, $placement, $checkExistance );
1142
1143 if ( $attributeValue !== null )
1144 {
1145 if ( !is_numeric( $attributeValue ) and
1146 !is_string( $attributeValue ) and
1147 !is_bool( $attributeValue ) )
1148 {
1149 if ( !$checkExistance )
1150 $this->error( "",
1151 "Cannot use type " . gettype( $attributeValue ) . " for attribute lookup", $placement );
1152 {
1153 return null;
1154 }
1155 }
1156 if ( is_array( $value ) )
1157 {
1158 if ( array_key_exists( $attributeValue, $value ) )
1159 {
1160 $value = $value[$attributeValue];
1161 }
1162 else
1163 {
1164 if ( !$checkExistance )
1165 {
1166 $arrayAttributeList = array_keys( $value );
1167 $arrayCount = count( $arrayAttributeList );
1168 $errorMessage = "No such attribute for array($arrayCount): $attributeValue";
1169 $chooseText = "Choose one of following: ";
1170 $errorMessage .= "\n$chooseText";
1171 $errorMessage .= $this->expandAttributes( $arrayAttributeList, $chooseText, 25 );
1172 $this->error( "",
1173 $errorMessage, $placement );
1174 }
1175 return null;
1176 }
1177 }
1178 else if ( is_object( $value ) )
1179 {
1180 if ( method_exists( $value, "attribute" ) and
1181 method_exists( $value, "hasAttribute" ) )
1182 {
1183 if ( $value->hasAttribute( $attributeValue ) )
1184 {
1185 $value = $value->attribute( $attributeValue );
1186 }
1187 else
1188 {
1189 if ( !$checkExistance )
1190 {
1191 $objectAttributeList = array();
1192 if ( method_exists( $value, 'attributes' ) )
1193 $objectAttributeList = $value->attributes();
1194 $objectClass= get_class( $value );
1195 $errorMessage = "No such attribute for object($objectClass): $attributeValue";
1196 $chooseText = "Choose one of following: ";
1197 $errorMessage .= "\n$chooseText";
1198 $errorMessage .= $this->expandAttributes( $objectAttributeList, $chooseText, 25 );
1199 $this->error( "",
1200 $errorMessage, $placement );
1201 }
1202 return null;
1203 }
1204 }
1205 else
1206 {
1207 if ( !$checkExistance )
1208 $this->error( "",
1209 "Cannot retrieve attribute of object(" . get_class( $value ) .
1210 "), no attribute functions available",
1211 $placement );
1212 return null;
1213 }
1214 }
1215 else
1216 {
1217 if ( !$checkExistance )
1218 $this->error( "",
1219 "Cannot retrieve attribute of a " . gettype( $value ),
1220 $placement );
1221 return null;
1222 }
1223 }
1224 else
1225 {
1226 if ( !$checkExistance )
1227 $this->error( '',
1228 'Attribute value was null, cannot get attribute',
1229 $placement );
1230 return null;
1231 }
1232 } break;
1233 case eZTemplate::TYPE_OPERATOR:
1234 {
1235 $operatorParameters = $dataElement[1];
1236 $operatorName = $operatorParameters[0];
1237 $operatorParameters = array_splice( $operatorParameters, 1 );
1238 if ( is_object( $value ) and
1239 method_exists( $value, 'templateValue' ) )
1240 {
1241 if ( $checkForProxy )
1242 $dataElements['proxy-object-found'] = true;
1243 $value = $value->templateValue();
1244 }
1245 $valueData = array( 'value' => $value );
1246 $this->processOperator( $operatorName, $operatorParameters, $rootNamespace, $currentNamespace,
1247 $valueData, $placement, $checkExistance );
1248 $value = $valueData['value'];
1249 } break;
1250 default:
1251 {
1252 if ( !$checkExistance )
1253 $this->error( "elementValue",
1254 "Unknown data type: '$dataType'",
1255 $placement );
1256 return null;
1257 }
1258 }
1259 }
1260 if ( is_object( $value ) and
1261 method_exists( $value, 'templateValue' ) )
1262 {
1263 if ( $checkForProxy )
1264 $dataElements['proxy-object-found'] = true;
1265 return $value->templateValue();
1266 }
1267 return $value;
1268 }
1269
1270 function expandAttributes( $attributeList, $chooseText, $maxThreshold, $minThreshold = 1 )
1271 {
1272 $errorMessage = '';
1273 $attributeCount = count( $attributeList );
1274 if ( $attributeCount < $minThreshold )
1275 return $errorMessage;
1276 if ( $attributeCount < $maxThreshold )
1277 {
1278 $chooseLength = strlen( $chooseText );
1279 $attributeText = '';
1280 $i = 0;
1281 foreach ( $attributeList as $attributeName )
1282 {
1283 if ( $i > 0 )
1284 $attributeText .= ",";
1285 if ( strlen( $attributeText ) > 40 )
1286 {
1287 $attributeText .= "\n";
1288 $errorMessage .= $attributeText;
1289 $errorMessage .= str_repeat( ' ', $chooseLength );
1290 $attributeText = '';
1291 }
1292 else if ( $i > 0 )
1293 $attributeText .= " ";
1294 $attributeText .= $attributeName;
1295 ++$i;
1296 }
1297 $errorMessage .= $attributeText;
1298 }
1299 return $errorMessage;
1300 }
1301
1302 function processOperator( $operatorName, $operatorParameters, $rootNamespace, $currentNamespace,
1303 &$valueData, $placement = false, $checkExistance = false )
1304 {
1305 $namedParameters = array();
1306 $operatorParameterDefinition = $this->operatorParameterList( $operatorName );
1307 $i = 0;
1308 foreach ( $operatorParameterDefinition as $parameterName => $parameterType )
1309 {
1310 if ( !isset( $operatorParameters[$i] ) or
1311 !isset( $operatorParameters[$i][0] ) or
1312 $operatorParameters[$i][0] == eZTemplate::TYPE_VOID )
1313 {
1314 if ( $parameterType["required"] )
1315 {
1316 if ( !$checkExistance )
1317 $this->warning( "eZTemplateOperatorElement", "Parameter '$parameterName' ($i) missing",
1318 $placement );
1319 $namedParameters[$parameterName] = $parameterType["default"];
1320 }
1321 else
1322 {
1323 $namedParameters[$parameterName] = $parameterType["default"];
1324 }
1325 }
1326 else
1327 {
1328 $parameterData = $operatorParameters[$i];
1329 $namedParameters[$parameterName] = $this->elementValue( $parameterData, $rootNamespace, $currentNamespace, $placement, $checkExistance );
1330 }
1331 ++$i;
1332 }
1333
1334 if ( isset( $this->Operators[$operatorName] ) )
1335 {
1336 if ( is_array( $this->Operators[$operatorName] ) )
1337 {
1338 $this->loadAndRegisterOperators( $this->Operators[$operatorName] );
1339 }
1340
1341 $op = $this->Operators[$operatorName];
1342
1343 if ( is_object( $op ) and method_exists( $op, 'modify' ) )
1344 {
1345 $value = $valueData['value'];
1346 if ( eZTemplate::isMethodDebugEnabled() )
1347 eZDebug::writeDebug( "START OPERATOR: $operatorName" );
1348 $op->modify( $this, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, $value, $namedParameters,
1349 $placement );
1350 if ( eZTemplate::isMethodDebugEnabled() )
1351 eZDebug::writeDebug( "END OPERATOR: $operatorName" );
1352 $valueData['value'] = $value;
1353 }
1354 else
1355 $this->error( '', "Object problem with operator '$operatorName' ",
1356 $placement );
1357 }
1358 else if ( !$checkExistance )
1359 $this->warning( "", "Operator '$operatorName' is not registered",
1360 $placement );
1361 }
1362
1366 function attributeValue( &$data, $nspace )
1367 {
1368 switch ( $data["type"] )
1369 {
1370 case "map":
1371 {
1372 return $data["content"];
1373 } break;
1374 case "index":
1375 {
1376 return $data["content"];
1377 } break;
1378 case "variable":
1379 {
1380 return $this->elementValue( $data["content"], $nspace );
1381 } break;
1382 default:
1383 {
1384 $this->error( "attributeValue()", "Unknown attribute type: " . $data["type"] );
1385 return null;
1386 }
1387 }
1388 }
1389
1393 function variableText( $var, $namespace = "", $attrs = array() )
1394 {
1395 $txt = "$";
1396 if ( $namespace != "" )
1397 $txt .= "$namespace:";
1398 $txt .= $var;
1399 if ( !empty( $attrs ) )
1400 $txt .= "." . implode( ".", $attrs );
1401 return $txt;
1402 }
1403
1407 function operatorParameterList( $name )
1408 {
1409 $param_list = array();
1410 if ( !isset( $this->Operators[$name] ) )
1411 {
1412 return $param_list;
1413 }
1414
1415 if ( is_array( $this->Operators[$name] ) )
1416 {
1417 $this->loadAndRegisterOperators( $this->Operators[$name] );
1418 }
1419
1420 $op = $this->Operators[$name];
1421 if ( isset( $op ) and is_object( $op ) and
1422 method_exists( $op, "namedParameterList" ) )
1423 {
1424 $param_list = $op->namedParameterList();
1425 if ( method_exists( $op, "namedParameterPerOperator" ) and
1426 $op->namedParameterPerOperator() )
1427 {
1428 if ( !isset( $param_list[$name] ) )
1429 return array();
1430 $param_list = $param_list[$name];
1431 }
1432 }
1433 return $param_list;
1434 }
1435
1440 function doOperator( $element, &$namespace, &$current_nspace, &$value, $operatorName, $operatorParameters, &$named_params )
1441 {
1442 if ( is_array( $this->Operators[$operatorName] ) )
1443 {
1444 $this->loadAndRegisterOperators( $this->Operators[$operatorName] );
1445 }
1446 $op = $this->Operators[$operatorName];
1447 if ( isset( $op ) )
1448 {
1449 $op->modify( $element, $this, $operatorName, $operatorParameters, $namespace, $current_nspace, $value, $named_params );
1450 }
1451 else
1452 $this->warning( "", "Operator \"$operatorName\" is not registered" );
1453 }
1454
1458 function doFunction( $name, $func_obj, $nspace, $current_nspace )
1459 {
1460 $func = $this->Functions[$name];
1461 if ( is_array( $func ) )
1462 {
1463 $this->loadAndRegisterFunctions( $this->Functions[$name] );
1464 $func = $this->Functions[$name];
1465 }
1466 if ( isset( $func ) and
1467 is_object( $func ) )
1468 {
1469 return $func->process( $this, $name, $func_obj, $nspace, $current_nspace );
1470 }
1471 else
1472 {
1473 $this->warning( "", "Function \"$name\" is not registered" );
1474 return false;
1475 }
1476 }
1477
1486 function setVariable( $var, $val, $namespace = '', $scopeSafe = false )
1487 {
1488 if ( $scopeSafe && isset( $this->Variables[$namespace][$var] ) )
1489 {
1490 $safeNamespace = $namespace;
1491 do
1492 {
1493 $safeNamespace .= ':safe';
1494 }
1495 while( isset( $this->Variables[$safeNamespace][$var] ) );
1496
1497 $this->Variables[$safeNamespace][$var] = $this->Variables[$namespace][$var];
1498 }
1499
1500 $this->Variables[$namespace][$var] = $val;
1501 }
1502
1509 function unsetVariable( $var, $namespace = '' )
1510 {
1511 if ( isset( $this->Variables[$namespace] ) &&
1512 array_key_exists( $var, $this->Variables[$namespace] ) )
1513 {
1514 $safeNamespace = "{$namespace}:safe";
1515 if ( isset( $this->Variables[$safeNamespace][$var] ) )
1516 {
1517 // Check if a nested safe namespace for $var
1518 // If true, then add a level of testing and test again
1519 while( isset( $this->Variables["{$safeNamespace}:safe"][$var] ) )
1520 {
1521 $safeNamespace .= ':safe';
1522 }
1523
1524 // Get the $var backup back and delete it
1525 $this->Variables[$namespace][$var] = $this->Variables[$safeNamespace][$var];
1526 unset( $this->Variables[$safeNamespace][$var] );
1527 }
1528 else
1529 {
1530 unset( $this->Variables[$namespace][$var] );
1531 }
1532 }
1533 else
1534 {
1535 $this->warning( "unsetVariable()", "Undefined Variable: \${$namespace}:{$var}, cannot unset" );
1536 }
1537 }
1538
1548 function hasVariable( $var, $namespace = '', $attrs = null )
1549 {
1550 $exists = ( isset( $this->Variables[$namespace] ) &&
1551 array_key_exists( $var, $this->Variables[$namespace] ) );
1552 if ( $exists && $attrs !== null && !empty( $attrs ) )
1553 {
1554 eZDebug::writeStrict( '$attrs parameter is deprecated as of 4.4', __METHOD__ );
1555 $ptr =& $this->Variables[$namespace][$var];
1556 foreach( $attrs as $attr )
1557 {
1558 unset( $tmp );
1559 if ( is_object( $ptr ) )
1560 {
1561 if ( $ptr->hasAttribute( $attr ) )
1562 $tmp = $ptr->attribute( $attr );
1563 else
1564 return false;
1565 }
1566 else if ( is_array( $ptr ) )
1567 {
1568 if ( array_key_exists( $attr, $ptr ) )
1569 $tmp =& $ptr[$attr];
1570 else
1571 return false;
1572 }
1573 else
1574 {
1575 return false;
1576 }
1577 unset( $ptr );
1578 $ptr =& $tmp;
1579 }
1580 }
1581 return $exists;
1582 }
1583
1593 function variable( $var, $namespace = '', $attrs = null )
1594 {
1595 $val = null;
1596 $exists = ( isset( $this->Variables[$namespace] ) &&
1597 array_key_exists( $var, $this->Variables[$namespace] ) );
1598 if ( $exists )
1599 {
1600 if ( $attrs !== null && !empty( $attrs ) )
1601 {
1602 eZDebug::writeStrict( '$attrs parameter is deprecated as of 4.4', __METHOD__ );
1603 $element = $this->Variables[$namespace][$var];
1604 foreach( $attrs as $attr )
1605 {
1606 if ( is_object( $element ) )
1607 {
1608 if ( $element->hasAttribute( $attr ) )
1609 {
1610 $element = $element->attribute( $attr );
1611 }
1612 else
1613 {
1614 return $val;
1615 }
1616 }
1617 else if ( is_array( $element ) )
1618 {
1619 if ( array_key_exists( $attr, $element ) )
1620 {
1621 $val = $element[$attr];
1622 }
1623 else
1624 {
1625 return $val;
1626 }
1627 }
1628 else
1629 {
1630 return $val;
1631 }
1632 $val = $element;
1633 }
1634 }
1635 else
1636 {
1637 $val = $this->Variables[$namespace][$var];
1638 }
1639 }
1640 return $val;
1641 }
1642
1647 function variableAttribute( $var, $attrs )
1648 {
1649 foreach( $attrs as $attr )
1650 {
1651 if ( is_object( $var ) )
1652 {
1653 if ( $var->hasAttribute( $attr ) )
1654 {
1655 $var = $var->attribute( $attr );
1656 }
1657 else
1658 {
1659 return null;
1660 }
1661 }
1662 else if ( is_array( $var ) )
1663 {
1664 if ( isset( $var[$attr] ) )
1665 {
1666 $var = $var[$attr];
1667 }
1668 else
1669 {
1670 return null;
1671 }
1672 }
1673 else
1674 {
1675 return null;
1676 }
1677 }
1678 if ( isset( $var ) )
1679 {
1680 return $var;
1681 }
1682
1683 return null;
1684 }
1685
1686 function appendElement( &$text, $item, $nspace, $name )
1687 {
1688 $this->appendElementText( $textElements, $item, $nspace, $name );
1689 $text .= implode( '', $textElements );
1690 }
1691
1692 function appendElementText( &$textElements, $item, $nspace, $name )
1693 {
1694 if ( !is_array( $textElements ) )
1695 $textElements = array();
1696 if ( is_object( $item ) and
1697 method_exists( $item, 'templateValue' ) )
1698 {
1699 $item = $item->templateValue();
1700 $textElements[] = "$item";
1701 }
1702 else if ( is_object( $item ) )
1703 {
1704 $hasTemplateData = false;
1705 if ( method_exists( $item, 'templateData' ) )
1706 {
1707 $templateData = $item->templateData();
1708 if ( is_array( $templateData ) and
1709 isset( $templateData['type'] ) )
1710 {
1711 if ( $templateData['type'] == 'template' and
1712 isset( $templateData['uri'] ) and
1713 isset( $templateData['template_variable_name'] ) )
1714 {
1715 $templateURI =& $templateData['uri'];
1716 $templateVariableName =& $templateData['template_variable_name'];
1717 $templateText = '';
1718 $this->setVariable( $templateVariableName, $item, $name );
1719 eZTemplateIncludeFunction::handleInclude( $textElements, $templateURI, $this, $nspace, $name );
1720 $hasTemplateData = true;
1721 }
1722 }
1723 }
1724 if ( !$hasTemplateData )
1725 $textElements[] = method_exists( $item, '__toString' ) ? (string)$item : 'Object(' . get_class( $item ) . ')';
1726 }
1727 else
1728 $textElements[] = "$item";
1729 return $textElements;
1730 }
1731
1738 function appendDebugNodes( &$root, &$resourceData )
1739 {
1740 $path = $resourceData['template-filename'];
1741 // Do not ouput debug on pagelayout templates to avoid trigering
1742 // browser quirks mode
1743 if ( isset( $root[1][0][2] ) && is_string( $root[1][0][2] ) && stripos( $root[1][0][2], '<!DOCTYPE' ) === 0 )
1744 return;
1745 $uri = $resourceData['uri'];
1746 $preText = "\n<!-- START: including template: $path ($uri) -->\n";
1747 if ( eZTemplate::isXHTMLCodeIncluded() )
1748 $preText .= "<p class=\"small\">$path</p><br/>\n";
1749 $postText = "\n<!-- STOP: including template: $path ($uri) -->\n";
1750
1751 $preNode = eZTemplateNodeTool::createTextNode( $preText );
1752 $postNode = eZTemplateNodeTool::createTextNode( $postText );
1753
1754 if ( is_array( $root[1] ) )
1755 {
1756 $root[1] = array_merge( array( $preNode ), $root[1] );
1757 }
1758 else
1759 {
1760 $root[1] = array( $preNode );
1761 }
1762 $root[1][] = $postNode;
1763 }
1764
1775 function registerFunctions( &$functionObject )
1776 {
1777 $this->registerFunctionsInternal( $functionObject );
1778 }
1779
1780 function registerAutoloadFunctions( $functionDefinition )
1781 {
1782 if ( ( ( isset( $functionDefinition['function'] ) ||
1783 isset( $functionDefinition['class'] ) ) &&
1784 ( isset( $functionDefinition['function_names_function'] ) ||
1785 isset( $functionDefinition['function_names'] ) ) ) )
1786 {
1787 if ( isset( $functionDefinition['function_names_function'] ) )
1788 {
1789 $functionNamesFunction = $functionDefinition['function_names_function'];
1790 if ( !function_exists( $functionNamesFunction ) )
1791 {
1792 $this->error( 'registerFunctions', "Cannot register function definition, missing function names function '$functionNamesFunction'" );
1793 return;
1794 }
1795 $functionNames = $functionNamesFunction();
1796 }
1797 else
1798 $functionNames = $functionDefinition['function_names'];
1799 foreach ( $functionNames as $functionName )
1800 {
1801 $this->Functions[$functionName] = $functionDefinition;
1802 }
1803 if ( isset( $functionDefinition['function_attributes'] ) )
1804 {
1805 foreach ( $functionDefinition['function_attributes'] as $functionAttributeName )
1806 {
1807 $this->FunctionAttributes[$functionAttributeName] = $functionDefinition;
1808 }
1809 }
1810 }
1811 else
1812 $this->error( 'registerFunctions', 'Cannot register function definition, missing data' );
1813 }
1814
1815 function loadAndRegisterFunctions( $functionDefinition )
1816 {
1817 eZDebug::accumulatorStart( 'template_register_function', 'template_total', 'Template load and register function' );
1818 $functionObject = null;
1819 if ( isset( $functionDefinition['function'] ) )
1820 {
1821 $function = $functionDefinition['function'];
1822 if ( function_exists( $function ) )
1823 $functionObject = $function();
1824 }
1825 else
1826 {
1827 if ( !class_exists( $functionDefinition['class'], false )
1828 && isset( $functionDefinition['script'] ) )
1829 {
1830 include_once( $functionDefinition['script'] );
1831 }
1832 $class = $functionDefinition['class'];
1833 if ( class_exists( $class ) )
1834 $functionObject = new $class();
1835 }
1836 eZDebug::accumulatorStop( 'template_register_function' );
1837 if ( is_object( $functionObject ) )
1838 {
1839 $this->registerFunctionsInternal( $functionObject, true );
1840 return true;
1841 }
1842 return false;
1843 }
1844
1848 function registerFunctionsInternal( $functionObject, $debug = false )
1849 {
1850 if ( !is_object( $functionObject ) or
1851 !method_exists( $functionObject, 'functionList' ) )
1852 return false;
1853 foreach ( $functionObject->functionList() as $functionName )
1854 {
1855 $this->Functions[$functionName] = $functionObject;
1856 }
1857 if ( method_exists( $functionObject, "attributeList" ) )
1858 {
1859 $functionAttributes = $functionObject->attributeList();
1860 foreach ( $functionAttributes as $attributeName => $hasChildren )
1861 {
1862 $this->FunctionAttributes[$attributeName] = $hasChildren;
1863 }
1864 }
1865 return true;
1866 }
1867
1876 function registerFunction( $func_name, $func_obj )
1877 {
1878 $this->Functions[$func_name] = $func_obj;
1879 if ( method_exists( $func_obj, "attributeList" ) )
1880 {
1881 $attrs = $func_obj->attributeList();
1882 foreach ( $attrs as $attr_name => $has_children )
1883 {
1884 $this->FunctionAttributes[$attr_name] = $has_children;
1885 }
1886 }
1887 }
1888
1893 function registerLiteral( $func_name )
1894 {
1895 $this->Literals[$func_name] = true;
1896 }
1897
1901 function unregisterLiteral( $func_name )
1902 {
1903 unset( $this->Literals[$func_name] );
1904 }
1905
1906 function registerAutoloadOperators( $operatorDefinition )
1907 {
1908 if ( ( ( isset( $operatorDefinition['function'] ) ||
1909 isset( $operatorDefinition['class'] ) ) &&
1910 ( isset( $operatorDefinition['operator_names_function'] ) ||
1911 isset( $operatorDefinition['operator_names'] ) ) ) )
1912 {
1913 if ( isset( $operatorDefinition['operator_names_function'] ) )
1914 {
1915 $operatorNamesFunction = $operatorDefinition['operator_names_function'];
1916 if ( !function_exists( $operatorNamesFunction ) )
1917 {
1918 $this->error( 'registerOperators', "Cannot register operator definition, missing operator names function '$operatorNamesFunction'" );
1919 return;
1920 }
1921 $operatorNames = $operatorNamesFunction();
1922 }
1923 else
1924 $operatorNames = $operatorDefinition['operator_names'];
1925 foreach ( $operatorNames as $operatorName )
1926 {
1927 $this->Operators[$operatorName] = $operatorDefinition;
1928 }
1929 }
1930 else
1931 $this->error( 'registerOperators', 'Cannot register operator definition, missing data' );
1932 }
1933
1934 function loadAndRegisterOperators( $operatorDefinition )
1935 {
1936 $operatorObject = null;
1937 if ( isset( $operatorDefinition['function'] ) )
1938 {
1939 $function = $operatorDefinition['function'];
1940 if ( function_exists( $function ) )
1941 $operatorObject = $function();
1942 }
1943 else
1944 {
1945 $class = $operatorDefinition['class'];
1946 if ( !class_exists( $class, false ) && isset( $operatorDefinition['script'] ) )
1947 {
1948 include_once( $operatorDefinition['script'] );
1949 }
1950 if ( class_exists( $class ) )
1951 {
1952 if ( isset( $operatorDefinition['class_parameter'] ) )
1953 $operatorObject = new $class( $operatorDefinition['class_parameter'] );
1954 else
1955 $operatorObject = new $class();
1956 }
1957 }
1958 if ( is_object( $operatorObject ) )
1959 {
1960 $this->registerOperatorsInternal( $operatorObject, true );
1961 return true;
1962 }
1963 return false;
1964 }
1965
1970 function registerOperators( &$operatorObject )
1971 {
1972 $this->registerOperatorsInternal( $operatorObject );
1973 }
1974
1975 function registerOperatorsInternal( $operatorObject, $debug = false )
1976 {
1977 if ( !is_object( $operatorObject ) or
1978 !method_exists( $operatorObject, 'operatorList' ) )
1979 return false;
1980 foreach( $operatorObject->operatorList() as $operatorName )
1981 {
1982 $this->Operators[$operatorName] = $operatorObject;
1983 }
1984 }
1985
1989 function registerOperator( $op_name, $op_obj )
1990 {
1991 $this->Operators[$op_name] = $op_obj;
1992 }
1993
1997 function unregisterOperator( $op_name )
1998 {
1999 if ( is_array( $op_name ) )
2000 {
2001 foreach ( $op_name as $op )
2002 {
2003 $this->unregisterOperator( $op_name );
2004 }
2005 }
2006 else if ( isset( $this->Operators ) )
2007 unset( $this->Operators[$op_name] );
2008 else
2009 $this->warning( "unregisterOpearator()", "Operator $op_name is not registered, cannot unregister" );
2010 }
2011
2015 function registerFilter()
2016 {
2017 }
2018
2023 function registerResource( $res )
2024 {
2025 if ( is_object( $res ) )
2026 $this->Resources[$res->resourceName()] =& $res;
2027 else
2028 $this->warning( "registerResource()", "Supplied argument is not a resource object" );
2029 }
2030
2034 function unregisterResource( $res_name )
2035 {
2036 if ( is_array( $res_name ) )
2037 {
2038 foreach ( $res_name as $res )
2039 {
2040 $this->unregisterResource( $res );
2041 }
2042 }
2043 else if ( isset( $this->Resources[$res_name] ) )
2044 unset( $this->Resources[$res_name] );
2045 else
2046 $this->warning( "unregisterResource()", "Resource $res_name is not registered, cannot unregister" );
2047 }
2048
2054 function setShowDetails( $show )
2055 {
2056 $this->ShowDetails = $show;
2057 }
2058
2062 function missingParameter( $name, $param )
2063 {
2064 $this->warning( $name, "Missing parameter $param" );
2065 }
2066
2070 function extraParameters( $name, $count, $maxCount )
2071 {
2072 $this->warning( $name, "Passed $count parameters but correct count is $maxCount" );
2073 }
2074
2078 function undefinedVariable( $name, $var )
2079 {
2080 $this->warning( $name, "Undefined variable: $var" );
2081 }
2082
2086 function undefinedFunction( $func_name )
2087 {
2088 $this->error( "", "Undefined function: $func_name" );
2089 }
2090
2095 function placementText( $placement = false )
2096 {
2097 $placementText = false;
2098 if ( $placement !== false )
2099 {
2100 if ( isset( $placement['start'] ) and
2101 isset( $placement['stop'] ) and
2102 isset( $placement['templatefile'] ) )
2103 {
2104 $line = $placement['start']['line'];
2105 $column = $placement['start']['column'];
2106 $templateFile = $placement['templatefile'];
2107 }
2108 else
2109 {
2110 $line = $placement[0][0];
2111 $column = $placement[0][1];
2112 $templateFile = $placement[2];
2113 }
2114
2115 $placementText = " @ $templateFile:$line" . "[$column]";
2116 }
2117 return $placementText;
2118 }
2119
2123 function warning( $name, $txt, $placement = false )
2124 {
2125 $this->WarningLog[] = array( 'name' => $name,
2126 'text' => $txt,
2127 'placement' => $placement );
2128
2129 if ( !is_string( $placement ) )
2130 $placementText = $this->placementText( $placement );
2131 else
2132 $placementText = $placement;
2133 $placementText = $this->placementText( $placement );
2134 if ( $name != "" )
2135 eZDebug::writeWarning( $txt, "eZTemplate:$name" . $placementText );
2136 else
2137 eZDebug::writeWarning( $txt, "eZTemplate" . $placementText );
2138 }
2139
2143 function error( $name, $txt, $placement = false )
2144 {
2145 $this->ErrorLog[] = array( 'name' => $name,
2146 'text' => $txt,
2147 'placement' => $placement );
2148
2149 if ( !is_string( $placement ) )
2150 $placementText = $this->placementText( $placement );
2151 else
2152 $placementText = $placement;
2153 if ( $name != "" )
2154 $nameText = "eZTemplate:$name";
2155 else
2156 $nameText = "eZTemplate";
2157 eZDebug::writeError( $txt, $nameText . $placementText );
2158 $hasAppendWarning =& $GLOBALS['eZTemplateHasAppendWarning'];
2159 $ini = $this->ini();
2160 if ( $ini->variable( 'ControlSettings', 'DisplayWarnings' ) == 'enabled' )
2161 {
2162 if ( !isset( $hasAppendWarning ) or
2163 !$hasAppendWarning )
2164 {
2165 if ( function_exists( 'eZAppendWarningItem' ) )
2166 {
2167 eZAppendWarningItem( array( 'error' => array( 'type' => 'template',
2168 'number' => eZTemplate::FILE_ERRORS ),
2169 'text' => ezpI18n::tr( 'lib/eztemplate', 'Some template errors occurred, see debug for more information.' ) ) );
2170 $hasAppendWarning = true;
2171 }
2172 }
2173 }
2174 }
2175
2176
2177 function operatorInputSupported( $operatorName )
2178 {
2179 }
2180
2184 function setIncludeText( $uri, $text )
2185 {
2186 $this->IncludeText[$uri] = $text;
2187 }
2188
2192 function setIncludeOutput( $uri, $output )
2193 {
2194 $this->IncludeOutput[$uri] = $output;
2195 }
2196
2200 function autoloadPathList()
2201 {
2202 return $this->AutoloadPathList;
2203 }
2204
2208 function setAutoloadPathList( $pathList )
2209 {
2210 $this->AutoloadPathList = $pathList;
2211 }
2212
2217 function autoload()
2218 {
2219 $pathList = $this->autoloadPathList();
2220 foreach ( $pathList as $path )
2221 {
2222 $autoloadFile = $path . 'eztemplateautoload.php';
2223 if ( file_exists( $autoloadFile ) )
2224 {
2225 unset( $eZTemplateOperatorArray );
2226 unset( $eZTemplateFunctionArray );
2227 include( $autoloadFile );
2228 if ( isset( $eZTemplateOperatorArray ) &&
2229 is_array( $eZTemplateOperatorArray ) )
2230 {
2231 foreach ( $eZTemplateOperatorArray as $operatorDefinition )
2232 {
2233 $this->registerAutoloadOperators( $operatorDefinition );
2234 }
2235 }
2236 if ( isset( $eZTemplateFunctionArray ) &&
2237 is_array( $eZTemplateFunctionArray ) )
2238 {
2239 foreach ( $eZTemplateFunctionArray as $functionDefinition )
2240 {
2241 $this->registerAutoloadFunctions( $functionDefinition );
2242 }
2243 }
2244 }
2245 else
2246 {
2247 eZDebug::writeWarning( "Path '$path' does not have the file 'eztemplateautoload.php' allthough it reported it had one.\n" .
2248 "Looked for file '" . $autoloadFile . "'\n" .
2249 "Check the setting [TemplateSettings]/ExtensionAutoloadPath or AutoloadPathList in your site.ini settings." );
2250 }
2251 }
2252 }
2253
2257 function resetVariables()
2258 {
2259 $this->Variables = array();
2260 }
2261
2266 function resetElements()
2267 {
2268 foreach ( $this->Functions as $functionName => $functionObject )
2269 {
2270 if ( is_object( $functionObject ) and
2271 method_exists( $functionObject, 'resetFunction' ) )
2272 {
2273 $functionObject->resetFunction( $functionName );
2274 }
2275 }
2276
2277 foreach ( $this->Operators as $operatorName => $operatorObject )
2278 {
2279 if ( is_object( $operatorObject ) and
2280 method_exists( $operatorObject, 'resetOperator' ) )
2281 {
2282 $operatorObject->resetOperator( $operatorName );
2283 }
2284 }
2285 }
2286
2290 function reset()
2291 {
2292 $this->resetVariables();
2293 $this->resetElements();
2294 $this->IsCachingAllowed = true;
2295
2296 $this->resetErrorLog();
2297
2298 $this->TemplatesUsageStatistics = array();
2299 $this->TemplateFetchList = array();
2300 }
2301
2306 function errorCount()
2307 {
2308 return count( $this->ErrorLog );
2309 }
2310
2315 function hasErrors()
2316 {
2317 return $this->errorCount() > 0;
2318 }
2319
2324 function errorLog()
2325 {
2326 return $this->ErrorLog;
2327 }
2328
2333 function warningCount()
2334 {
2335 return count( $this->WarningLog );
2336 }
2337
2342 function hasWarnings()
2343 {
2344 return $this->warningCount() > 0;
2345 }
2346
2351 function warningLog()
2352 {
2353 return $this->WarningLog;
2354 }
2355
2361 public static function instance()
2362 {
2363 if ( self::$instance === null )
2364 {
2365 self::$instance = new eZTemplate();
2366 }
2367 return self::$instance;
2368 }
2369
2380 public static function factory()
2381 {
2382 if ( self::$factory === false )
2383 {
2384 $instance = self::instance();
2385
2386 $ini = eZINI::instance();
2387 if (!isset($GLOBALS['eZTemplateDebugInternalsEnabled']) && $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled' )
2388 eZTemplate::setIsDebugEnabled( true );
2389
2390 $instance->setAutoloadPathList(
2391 array_unique(
2392 array_merge(
2393 $ini->variable( 'TemplateSettings', 'AutoloadPathList' ),
2394 eZExtension::expandedPathList(
2395 $ini->variable( 'TemplateSettings', 'ExtensionAutoloadPath' ),
2396 'autoloads/'
2397 )
2398 )
2399 )
2400 );
2401 $instance->autoload();
2402
2403 $instance->registerResource( eZTemplateDesignResource::instance() );
2404 self::$factory = true;
2405 }
2406 return self::instance();
2407 }
2408
2415 public static function resetInstance()
2416 {
2417 self::$instance = null;
2418 self::$factory = false;
2419 }
2420
2426 public function ini()
2427 {
2428 return eZINI::instance( "template.ini" );
2429 }
2430
2437 static function isXHTMLCodeIncluded()
2438 {
2439 if ( !isset( $GLOBALS['eZTemplateDebugXHTMLCodeEnabled'] ) )
2440 {
2441 $ini = eZINI::instance();
2442 $GLOBALS['eZTemplateDebugXHTMLCodeEnabled'] = $ini->variable( 'TemplateSettings', 'ShowXHTMLCode' ) == 'enabled';
2443 }
2444 return $GLOBALS['eZTemplateDebugXHTMLCodeEnabled'];
2445 }
2446
2451 static function isMethodDebugEnabled()
2452 {
2453 if ( !isset( $GLOBALS['eZTemplateDebugMethodEnabled'] ) )
2454 {
2455 $ini = eZINI::instance();
2456 $GLOBALS['eZTemplateDebugMethodEnabled'] = $ini->variable( 'TemplateSettings', 'ShowMethodDebug' ) == 'enabled';
2457 }
2458 return $GLOBALS['eZTemplateDebugMethodEnabled'];
2459 }
2460
2467 static function isDebugEnabled()
2468 {
2469 if ( !isset( $GLOBALS['eZTemplateDebugInternalsEnabled'] ) )
2470 $GLOBALS['eZTemplateDebugInternalsEnabled'] = eZTemplate::DEBUG_INTERNALS;
2471 return $GLOBALS['eZTemplateDebugInternalsEnabled'];
2472 }
2473
2478 static function setIsDebugEnabled( $debug )
2479 {
2480 $GLOBALS['eZTemplateDebugInternalsEnabled'] = $debug;
2481 }
2482
2488 function isCachingAllowed()
2489 {
2490 return $this->IsCachingAllowed;
2491 }
2492
2500 function setIsCachingAllowed( $allowed )
2501 {
2502 $this->IsCachingAllowed = $allowed;
2503 }
2504
2509 static function isTemplatesUsageStatisticsEnabled()
2510 {
2511 if ( !isset( $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] ) )
2512 {
2513 $ini = eZINI::instance();
2514 $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] = $ini->variable( 'TemplateSettings', 'ShowUsedTemplates' ) == 'enabled';
2515 }
2516 return ( $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] );
2517 }
2518
2524 function setIsTemplatesUsageStatisticsEnabled( $enabled )
2525 {
2526 $wasEnabled = false;
2527 if( isset( $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] ) )
2528 $wasEnabled = $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'];
2529
2530 $GLOBALS['eZTemplateDebugTemplatesUsageStatisticsEnabled'] = $enabled;
2531 return $wasEnabled;
2532 }
2533
2538 function appendTemplateToStatisticsIfNeeded( &$templateName, &$templateFileName )
2539 {
2540 if ( eZTemplate::isTemplatesUsageStatisticsEnabled() )
2541 eZTemplate::appendTemplateToStatistics( $templateName, $templateFileName );
2542 }
2543
2548 function appendTemplateToStatistics( $templateName, $templateFileName )
2549 {
2550 $actualTemplateName = preg_replace( "#^[\w/]+templates/#", '', $templateFileName );
2551 $requestedTemplateName = preg_replace( "#^[\w/]+templates/#", '', $templateName );
2552
2553 $tpl = eZTemplate::instance();
2554 $needToAppend = true;
2555
2556 // don't add template info if it is a duplicate of previous.
2557 $statsSize = count( $tpl->TemplatesUsageStatistics );
2558 if ( $statsSize > 0 )
2559 {
2560 $lastTemplateInfo = $tpl->TemplatesUsageStatistics[$statsSize-1];
2561 if ( $lastTemplateInfo['actual-template-name'] === $actualTemplateName &&
2562 $lastTemplateInfo['requested-template-name'] === $requestedTemplateName &&
2563 $lastTemplateInfo['template-filename'] === $templateFileName )
2564 {
2565 $needToAppend = false;
2566 }
2567 }
2568
2569 if ( $needToAppend )
2570 {
2571 $templateInfo = array( 'actual-template-name' => $actualTemplateName,
2572 'requested-template-name' => $requestedTemplateName,
2573 'template-filename' => $templateFileName );
2574
2575 $tpl->TemplatesUsageStatistics[] = $templateInfo;
2576 }
2577 }
2578
2582 function appendTemplateFetch( $actualTemplateName )
2583 {
2584 $this->TemplateFetchList[] = $actualTemplateName;
2585 $this->TemplateFetchList = array_unique( $this->TemplateFetchList );
2586 }
2587
2591 function resetErrorLog()
2592 {
2593 $this->ErrorLog = array();
2594 $this->WarningLog = array();
2595 }
2596
2601 static function templatesUsageStatistics()
2602 {
2603 $tpl = eZTemplate::instance();
2604 return $tpl->TemplatesUsageStatistics;
2605 }
2606
2610 function templateFetchList()
2611 {
2612 return $this->TemplateFetchList;
2613 }
2614
2621 function setCompileTest( $val )
2622 {
2623 $this->TestCompile = $val;
2624 }
2625
2629 function testCompile()
2630 {
2631 return $this->TestCompile;
2632 }
2633
2636 public $Resources;
2638 public $DefaultResource;
2640 public $Text;
2642 public $IncludeText;
2644 public $IncludeOutput;
2646 public $TimeStamp;
2648 public $LDelim;
2650 public $RDelim;
2651
2653 public $Tree;
2655 public $Variables;
2661 public $LocalVariablesNamesStack;
2662 // Reference to the last element of $LocalVariablesNamesStack.
2663 public $CurrentLocalVariablesNames;
2665 public $Operators;
2667 public $Functions;
2669 public $FunctionAttributes;
2671 public $Literals;
2673 public $ShowDetails = false;
2675 public $IsCachingAllowed;
2676
2678 public $ErrorLog;
2680 public $WarningLog;
2681
2682 public $AutoloadPathList;
2684 public $Level = 0;
2685 public $MaxLevel = 40;
2686
2688 public $TemplatesUsageStatistics;
2689
2690 // counter to make unique names for {foreach} loop variables in com
2691 public $ForeachCounter;
2692 public $ForCounter;
2693 public $WhileCounter;
2694 public $DoCounter;
2695 public $ElseifCounter;
2696
2697 // Flag for setting compilation in test mode
2698 public $TestCompile;
2699
2706 protected static $instance;
2707
2714 protected static $factory = false;
2715
2716 // public $CurrentRelatedResource;
2717 // public $CurrentRelatedTemplateName;
2718
2719 public $MaxLevelWarning;
2720 public $TemplateFetchList;
2721 }
2722
2723 ?>
eZDebug\writeStrict
static writeStrict( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:414
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\writeDebug
static writeDebug( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:588
eZDebug\writeNotice
static writeNotice( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:459
eZDebug\createAccumulatorGroup
static createAccumulatorGroup( $key, $name=false)
Definition: ezdebug.php:1314
eZDebug\writeWarning
static writeWarning( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:502
eZDebug\addTimingPoint
static addTimingPoint( $description="")
Definition: ezdebug.php:676
eZDebug\accumulatorStart
static accumulatorStart( $key, $inGroup=false, $name=false, $recursive=false)
Definition: ezdebug.php:1361
eZDebug\accumulatorStop
static accumulatorStop( $key, $recursive=false)
Definition: ezdebug.php:1389
eZExtension\expandedPathList
static expandedPathList( $extensionList, $subdirectory=false)
Definition: ezextension.php:334
eZTemplateCompiler\compileTemplate
static compileTemplate( $tpl, $key, &$resourceData)
Definition: eztemplatecompiler.php:465
eZTemplateDesignResource\instance
static instance()
Definition: eztemplatedesignresource.php:1026
eZTemplateFileResource
Handles filesystem retrieval of templates.
Definition: eztemplatefileresource.php:20
eZTemplateIncludeFunction\handleInclude
static handleInclude(&$textElements, &$uri, $tpl, $rootNamespace, $name)
Definition: eztemplateincludefunction.php:203
eZTemplateMultiPassParser\instance
static instance()
Definition: eztemplatemultipassparser.php:1379
eZTemplateNodeTool\createTextNode
static createTextNode( $text)
Definition: eztemplatenodetool.php:442
eZTemplate
The main manager for templates.
Definition: eztemplate.php:199
eZTemplate\NAMESPACE_SCOPE_RELATIVE
const NAMESPACE_SCOPE_RELATIVE
Definition: eztemplate.php:286
eZTemplate\resourceData
resourceData( $resourceObject, $uri, $resourceName, $templateName)
Definition: eztemplate.php:721
eZTemplate\undefinedVariable
undefinedVariable( $name, $var)
Definition: eztemplate.php:2078
eZTemplate\NODE_INTERNAL_WARNING
const NODE_INTERNAL_WARNING
Definition: eztemplate.php:226
eZTemplate\setShowDetails
setShowDetails( $show)
Definition: eztemplate.php:2054
eZTemplate\reset
reset()
Definition: eztemplate.php:2290
eZTemplate\setVariable
setVariable( $var, $val, $namespace='', $scopeSafe=false)
Definition: eztemplate.php:1486
eZTemplate\NODE_INTERNAL_VARIABLE_UNSET
const NODE_INTERNAL_VARIABLE_UNSET
Definition: eztemplate.php:221
eZTemplate\display
display( $template=false, $extraParameters=false)
Definition: eztemplate.php:384
eZTemplate\TYPE_OPERATOR
const TYPE_OPERATOR
Definition: eztemplate.php:252
eZTemplate\NODE_INTERNAL_RESOURCE_ACQUISITION
const NODE_INTERNAL_RESOURCE_ACQUISITION
Definition: eztemplate.php:229
eZTemplate\$MaxLevel
$MaxLevel
Definition: eztemplate.php:2685
eZTemplate\TYPE_DYNAMIC_ARRAY
const TYPE_DYNAMIC_ARRAY
Definition: eztemplate.php:255
eZTemplate\attributeValue
attributeValue(&$data, $nspace)
Definition: eztemplate.php:1366
eZTemplate\$ElseifCounter
$ElseifCounter
Definition: eztemplate.php:2695
eZTemplate\rightDelimiter
rightDelimiter()
Definition: eztemplate.php:359
eZTemplate\$Literals
$Literals
An associative array of literal tags.
Definition: eztemplate.php:2671
eZTemplate\appendElementText
appendElementText(&$textElements, $item, $nspace, $name)
Definition: eztemplate.php:1692
eZTemplate\$Level
$Level
include level
Definition: eztemplate.php:2684
eZTemplate\ELEMENT_COMMENT
const ELEMENT_COMMENT
Definition: eztemplate.php:208
eZTemplate\TYPE_VARIABLE
const TYPE_VARIABLE
Definition: eztemplate.php:250
eZTemplate\setIncludeText
setIncludeText( $uri, $text)
Definition: eztemplate.php:2184
eZTemplate\createLocalVariablesList
createLocalVariablesList()
Definition: eztemplate.php:428
eZTemplate\isDebugEnabled
static isDebugEnabled()
Definition: eztemplate.php:2467
eZTemplate\NODE_USER_CUSTOM
const NODE_USER_CUSTOM
Definition: eztemplate.php:243
eZTemplate\validateTemplateFile
validateTemplateFile( $file, $returnResourceData=false)
Definition: eztemplate.php:867
eZTemplate\TYPE_NONE
const TYPE_NONE
Definition: eztemplate.php:276
eZTemplate\NODE_INTERNAL_SPACING_DECREASE
const NODE_INTERNAL_SPACING_DECREASE
Definition: eztemplate.php:238
eZTemplate\mergeNamespace
mergeNamespace( $rootNamespace, $additionalNamespace)
Definition: eztemplate.php:1052
eZTemplate\NODE_INTERNAL_CODE_PIECE
const NODE_INTERNAL_CODE_PIECE
Definition: eztemplate.php:218
eZTemplate\$Operators
$Operators
An associative array of operators.
Definition: eztemplate.php:2665
eZTemplate\isTemplatesUsageStatisticsEnabled
static isTemplatesUsageStatisticsEnabled()
Definition: eztemplate.php:2509
eZTemplate\unregisterResource
unregisterResource( $res_name)
Definition: eztemplate.php:2034
eZTemplate\autoload
autoload()
Definition: eztemplate.php:2217
eZTemplate\NAMESPACE_SCOPE_GLOBAL
const NAMESPACE_SCOPE_GLOBAL
Definition: eztemplate.php:284
eZTemplate\destroyLocalVariablesList
destroyLocalVariablesList()
Definition: eztemplate.php:479
eZTemplate\variable
variable( $var, $namespace='', $attrs=null)
Definition: eztemplate.php:1593
eZTemplate\$factory
static $factory
Definition: eztemplate.php:2714
eZTemplate\$TemplatesUsageStatistics
$TemplatesUsageStatistics
A list of templates used by a rendered page.
Definition: eztemplate.php:2688
eZTemplate\loadAndRegisterFunctions
loadAndRegisterFunctions( $functionDefinition)
Definition: eztemplate.php:1815
eZTemplate\$WhileCounter
$WhileCounter
Definition: eztemplate.php:2693
eZTemplate\appendTemplateToStatistics
appendTemplateToStatistics( $templateName, $templateFileName)
Definition: eztemplate.php:2548
eZTemplate\appendElement
appendElement(&$text, $item, $nspace, $name)
Definition: eztemplate.php:1686
eZTemplate\fetchFunctionObject
fetchFunctionObject( $functionName)
Definition: eztemplate.php:658
eZTemplate\setRightDelimiter
setRightDelimiter( $delim)
Definition: eztemplate.php:375
eZTemplate\$RDelim
$RDelim
The right delimiter used for parsing.
Definition: eztemplate.php:2650
eZTemplate\processNode
processNode( $node, &$textElements, $rootNamespace, $currentNamespace)
Definition: eztemplate.php:582
eZTemplate\hasErrors
hasErrors()
Definition: eztemplate.php:2315
eZTemplate\$Functions
$Functions
An associative array of functions.
Definition: eztemplate.php:2667
eZTemplate\$LocalVariablesNamesStack
$LocalVariablesNamesStack
Definition: eztemplate.php:2661
eZTemplate\$DoCounter
$DoCounter
Definition: eztemplate.php:2694
eZTemplate\TYPE_STRING_BIT
const TYPE_STRING_BIT
Definition: eztemplate.php:269
eZTemplate\warningCount
warningCount()
Definition: eztemplate.php:2333
eZTemplate\$ShowDetails
$ShowDetails
True if output details is to be shown.
Definition: eztemplate.php:2673
eZTemplate\resetElements
resetElements()
Definition: eztemplate.php:2266
eZTemplate\isCachingAllowed
isCachingAllowed()
Definition: eztemplate.php:2488
eZTemplate\TYPE_IDENTIFIER_BIT
const TYPE_IDENTIFIER_BIT
Definition: eztemplate.php:271
eZTemplate\appendTemplateFetch
appendTemplateFetch( $actualTemplateName)
Definition: eztemplate.php:2582
eZTemplate\unsetLocalVariable
unsetLocalVariable( $varName, $rootNamespace)
Definition: eztemplate.php:455
eZTemplate\$DefaultResource
$DefaultResource
Reference to the default resource object.
Definition: eztemplate.php:2638
eZTemplate\instance
static instance()
Definition: eztemplate.php:2361
eZTemplate\TYPE_OPTIMIZED_ARRAY_LOOKUP
const TYPE_OPTIMIZED_ARRAY_LOOKUP
Definition: eztemplate.php:262
eZTemplate\registerOperator
registerOperator( $op_name, $op_obj)
Definition: eztemplate.php:1989
eZTemplate\TYPE_INTERNAL_STOP
const TYPE_INTERNAL_STOP
Definition: eztemplate.php:266
eZTemplate\NODE_INTERNAL_OUTPUT_ASSIGN
const NODE_INTERNAL_OUTPUT_ASSIGN
Definition: eztemplate.php:232
eZTemplate\placementText
placementText( $placement=false)
Definition: eztemplate.php:2095
eZTemplate\$Tree
$Tree
The resulting object tree of the template.
Definition: eztemplate.php:2653
eZTemplate\NODE_INTERNAL_VARIABLE_SET
const NODE_INTERNAL_VARIABLE_SET
Definition: eztemplate.php:220
eZTemplate\setIsTemplatesUsageStatisticsEnabled
setIsTemplatesUsageStatisticsEnabled( $enabled)
Definition: eztemplate.php:2524
eZTemplate\resetVariables
resetVariables()
Definition: eztemplate.php:2257
eZTemplate\NAMESPACE_SCOPE_LOCAL
const NAMESPACE_SCOPE_LOCAL
Definition: eztemplate.php:285
eZTemplate\RESOURCE_QUERY
const RESOURCE_QUERY
Definition: eztemplate.php:201
eZTemplate\TYPE_OPTIMIZED_CONTENT_CALL
const TYPE_OPTIMIZED_CONTENT_CALL
Definition: eztemplate.php:263
eZTemplate\NODE_OPTIMIZED_INIT
const NODE_OPTIMIZED_INIT
Definition: eztemplate.php:240
eZTemplate\setIsCachingAllowed
setIsCachingAllowed( $allowed)
Definition: eztemplate.php:2500
eZTemplate\ELEMENT_NORMAL_TAG
const ELEMENT_NORMAL_TAG
Definition: eztemplate.php:205
eZTemplate\appendTemplateToStatisticsIfNeeded
appendTemplateToStatisticsIfNeeded(&$templateName, &$templateFileName)
Definition: eztemplate.php:2538
eZTemplate\hasLocalVariable
hasLocalVariable( $varName, $rootNamespace)
Definition: eztemplate.php:437
eZTemplate\registerFunction
registerFunction( $func_name, $func_obj)
Definition: eztemplate.php:1876
eZTemplate\registerLiteral
registerLiteral( $func_name)
Definition: eztemplate.php:1893
eZTemplate\resourceHandler
resourceHandler( $resourceName)
Definition: eztemplate.php:1022
eZTemplate\TYPE_PHP_VARIABLE
const TYPE_PHP_VARIABLE
Definition: eztemplate.php:259
eZTemplate\setLocalVariable
setLocalVariable( $varName, $varValue, $rootNamespace)
Definition: eztemplate.php:446
eZTemplate\$Variables
$Variables
An associative array of template variables.
Definition: eztemplate.php:2655
eZTemplate\__construct
__construct()
Definition: eztemplate.php:296
eZTemplate\NODE_TEXT
const NODE_TEXT
Definition: eztemplate.php:211
eZTemplate\NODE_INTERNAL
const NODE_INTERNAL
Definition: eztemplate.php:217
eZTemplate\resetInstance
static resetInstance()
Definition: eztemplate.php:2415
eZTemplate\doFunction
doFunction( $name, $func_obj, $nspace, $current_nspace)
Definition: eztemplate.php:1458
eZTemplate\extraParameters
extraParameters( $name, $count, $maxCount)
Definition: eztemplate.php:2070
eZTemplate\NODE_INTERNAL_NAMESPACE_CHANGE
const NODE_INTERNAL_NAMESPACE_CHANGE
Definition: eztemplate.php:223
eZTemplate\hasWarnings
hasWarnings()
Definition: eztemplate.php:2342
eZTemplate\TYPE_NUMERIC_BIT
const TYPE_NUMERIC_BIT
Definition: eztemplate.php:270
eZTemplate\NODE_OPTIMIZED_RESOURCE_ACQUISITION
const NODE_OPTIMIZED_RESOURCE_ACQUISITION
Definition: eztemplate.php:230
eZTemplate\TYPE_ARRAY
const TYPE_ARRAY
Definition: eztemplate.php:254
eZTemplate\elementValue
elementValue(&$dataElements, $rootNamespace, $currentNamespace, $placement=false, $checkExistance=false, $checkForProxy=false)
Definition: eztemplate.php:1065
eZTemplate\$instance
static $instance
Definition: eztemplate.php:2706
eZTemplate\templateFetchList
templateFetchList()
Definition: eztemplate.php:2610
eZTemplate\missingParameter
missingParameter( $name, $param)
Definition: eztemplate.php:2062
eZTemplate\$WarningLog
$WarningLog
Array containing all warnings occured during a fetch.
Definition: eztemplate.php:2680
eZTemplate\error
error( $name, $txt, $placement=false)
Definition: eztemplate.php:2143
eZTemplate\setAutoloadPathList
setAutoloadPathList( $pathList)
Definition: eztemplate.php:2208
eZTemplate\$IncludeText
$IncludeText
Included texts, usually performed by custom functions.
Definition: eztemplate.php:2642
eZTemplate\doOperator
doOperator( $element, &$namespace, &$current_nspace, &$value, $operatorName, $operatorParameters, &$named_params)
Definition: eztemplate.php:1440
eZTemplate\testCompile
testCompile()
Definition: eztemplate.php:2629
eZTemplate\$CurrentLocalVariablesNames
$CurrentLocalVariablesNames
Definition: eztemplate.php:2663
eZTemplate\processFunction
processFunction( $functionName, &$textElements, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
Definition: eztemplate.php:631
eZTemplate\$LDelim
$LDelim
The left delimiter used for parsing.
Definition: eztemplate.php:2648
eZTemplate\TYPE_BOOLEAN
const TYPE_BOOLEAN
Definition: eztemplate.php:253
eZTemplate\warning
warning( $name, $txt, $placement=false)
Definition: eztemplate.php:2123
eZTemplate\resetErrorLog
resetErrorLog()
Definition: eztemplate.php:2591
eZTemplate\loadURIRoot
loadURIRoot( $uri, $displayErrors, &$extraParameters)
Definition: eztemplate.php:740
eZTemplate\loadAndRegisterOperators
loadAndRegisterOperators( $operatorDefinition)
Definition: eztemplate.php:1934
eZTemplate\registerOperators
registerOperators(&$operatorObject)
Definition: eztemplate.php:1970
eZTemplate\NODE_ROOT
const NODE_ROOT
Definition: eztemplate.php:210
eZTemplate\executeCompiledTemplate
executeCompiledTemplate(&$resourceData, &$textElements, $rootNamespace, $currentNamespace, &$extraParameters)
Definition: eztemplate.php:974
eZTemplate\$ForCounter
$ForCounter
Definition: eztemplate.php:2692
eZTemplate\unregisterOperator
unregisterOperator( $op_name)
Definition: eztemplate.php:1997
eZTemplate\expandAttributes
expandAttributes( $attributeList, $chooseText, $maxThreshold, $minThreshold=1)
Definition: eztemplate.php:1270
eZTemplate\TYPE_INTERNAL_CODE_PIECE
const TYPE_INTERNAL_CODE_PIECE
Definition: eztemplate.php:258
eZTemplate\hasVariable
hasVariable( $var, $namespace='', $attrs=null)
Definition: eztemplate.php:1548
eZTemplate\leftDelimiter
leftDelimiter()
Definition: eztemplate.php:351
eZTemplate\TYPE_INTERNAL
const TYPE_INTERNAL
Definition: eztemplate.php:257
eZTemplate\processOperator
processOperator( $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$valueData, $placement=false, $checkExistance=false)
Definition: eztemplate.php:1302
eZTemplate\isMethodDebugEnabled
static isMethodDebugEnabled()
Definition: eztemplate.php:2451
eZTemplate\$TimeStamp
$TimeStamp
The timestamp of the template when it was last modified.
Definition: eztemplate.php:2646
eZTemplate\$TemplateFetchList
$TemplateFetchList
Definition: eztemplate.php:2720
eZTemplate\TYPE_OPTIMIZED_NODE
const TYPE_OPTIMIZED_NODE
Definition: eztemplate.php:261
eZTemplate\TYPE_ATTRIBUTE_BIT
const TYPE_ATTRIBUTE_BIT
Definition: eztemplate.php:273
eZTemplate\$FunctionAttributes
$FunctionAttributes
An associative array of function attributes.
Definition: eztemplate.php:2669
eZTemplate\process
process( $root, &$text, $rootNamespace, $currentNamespace)
Definition: eztemplate.php:567
eZTemplate\operatorInputSupported
operatorInputSupported( $operatorName)
Definition: eztemplate.php:2177
eZTemplate\$Resources
$Resources
Definition: eztemplate.php:2636
eZTemplate\unsetVariable
unsetVariable( $var, $namespace='')
Definition: eztemplate.php:1509
eZTemplate\ini
ini()
Definition: eztemplate.php:2426
eZTemplate\errorLog
errorLog()
Definition: eztemplate.php:2324
eZTemplate\canCompileTemplate
canCompileTemplate( $resourceData, &$extraParameters)
Definition: eztemplate.php:853
eZTemplate\NODE_VARIABLE
const NODE_VARIABLE
Definition: eztemplate.php:212
eZTemplate\registerResource
registerResource( $res)
Definition: eztemplate.php:2023
eZTemplate\warningLog
warningLog()
Definition: eztemplate.php:2351
eZTemplate\appendDebugNodes
appendDebugNodes(&$root, &$resourceData)
Definition: eztemplate.php:1738
eZTemplate\registerAutoloadOperators
registerAutoloadOperators( $operatorDefinition)
Definition: eztemplate.php:1906
eZTemplate\NODE_OPERATOR
const NODE_OPERATOR
Definition: eztemplate.php:214
eZTemplate\loadURIData
loadURIData( $resourceObject, $uri, $resourceName, $template, &$extraParameters, $displayErrors=true)
Definition: eztemplate.php:693
eZTemplate\TYPE_BASIC
const TYPE_BASIC
Definition: eztemplate.php:280
eZTemplate\$MaxLevelWarning
$MaxLevelWarning
Definition: eztemplate.php:2719
eZTemplate\parse
parse( $sourceText, &$rootElement, $rootNamespace, &$resourceData)
Definition: eztemplate.php:687
eZTemplate\$ErrorLog
$ErrorLog
Array containing all errors occured during a fetch.
Definition: eztemplate.php:2678
eZTemplate\setIncludeOutput
setIncludeOutput( $uri, $output)
Definition: eztemplate.php:2192
eZTemplate\variableText
variableText( $var, $namespace="", $attrs=array())
Definition: eztemplate.php:1393
eZTemplate\NODE_INTERNAL_OUTPUT_READ
const NODE_INTERNAL_OUTPUT_READ
Definition: eztemplate.php:233
eZTemplate\processURI
processURI( $uri, $displayErrors, &$extraParameters, &$textElements, $rootNamespace, $currentNamespace)
Definition: eztemplate.php:797
eZTemplate\registerAutoloadFunctions
registerAutoloadFunctions( $functionDefinition)
Definition: eztemplate.php:1780
eZTemplate\factory
static factory()
Definition: eztemplate.php:2380
eZTemplate\TYPE_ATTRIBUTE
const TYPE_ATTRIBUTE
Definition: eztemplate.php:251
eZTemplate\$IsCachingAllowed
$IsCachingAllowed
true if caching is allowed
Definition: eztemplate.php:2675
eZTemplate\FILE_ERRORS
const FILE_ERRORS
Definition: eztemplate.php:290
eZTemplate\TYPE_VOID
const TYPE_VOID
Definition: eztemplate.php:246
eZTemplate\$TestCompile
$TestCompile
Definition: eztemplate.php:2698
eZTemplate\DEBUG_INTERNALS
const DEBUG_INTERNALS
Definition: eztemplate.php:288
eZTemplate\TYPE_IDENTIFIER
const TYPE_IDENTIFIER
Definition: eztemplate.php:249
eZTemplate\NODE_INTERNAL_NAMESPACE_RESTORE
const NODE_INTERNAL_NAMESPACE_RESTORE
Definition: eztemplate.php:224
eZTemplate\NODE_INTERNAL_ERROR
const NODE_INTERNAL_ERROR
Definition: eztemplate.php:227
eZTemplate\registerFunctionsInternal
registerFunctionsInternal( $functionObject, $debug=false)
Definition: eztemplate.php:1848
eZTemplate\setIsDebugEnabled
static setIsDebugEnabled( $debug)
Definition: eztemplate.php:2478
eZTemplate\autoloadPathList
autoloadPathList()
Definition: eztemplate.php:2200
eZTemplate\variableAttribute
variableAttribute( $var, $attrs)
Definition: eztemplate.php:1647
eZTemplate\$ForeachCounter
$ForeachCounter
Definition: eztemplate.php:2691
eZTemplate\isXHTMLCodeIncluded
static isXHTMLCodeIncluded()
Definition: eztemplate.php:2437
eZTemplate\resourceFor
resourceFor( $uri, &$res, &$template)
Definition: eztemplate.php:997
eZTemplate\NODE_FUNCTION
const NODE_FUNCTION
Definition: eztemplate.php:213
eZTemplate\undefinedFunction
undefinedFunction( $func_name)
Definition: eztemplate.php:2086
eZTemplate\TYPE_NUMERIC
const TYPE_NUMERIC
Definition: eztemplate.php:248
eZTemplate\$IncludeOutput
$IncludeOutput
Included outputs, usually performed by custom functions.
Definition: eztemplate.php:2644
eZTemplate\templatesUsageStatistics
static templatesUsageStatistics()
Definition: eztemplate.php:2601
eZTemplate\RESOURCE_FETCH
const RESOURCE_FETCH
Definition: eztemplate.php:200
eZTemplate\TYPE_STRING
const TYPE_STRING
Definition: eztemplate.php:247
eZTemplate\hasChildren
hasChildren(&$function, $functionName)
Definition: eztemplate.php:1032
eZTemplate\TYPE_OPERATOR_BIT
const TYPE_OPERATOR_BIT
Definition: eztemplate.php:274
eZTemplate\compileTemplate
compileTemplate(&$resourceData, &$extraParameters)
Definition: eztemplate.php:962
eZTemplate\NODE_INTERNAL_OUTPUT_DECREASE
const NODE_INTERNAL_OUTPUT_DECREASE
Definition: eztemplate.php:235
eZTemplate\registerFilter
registerFilter()
Definition: eztemplate.php:2015
eZTemplate\$Text
$Text
The original template text.
Definition: eztemplate.php:2640
eZTemplate\emptyVariable
emptyVariable()
Definition: eztemplate.php:1044
eZTemplate\ELEMENT_TEXT
const ELEMENT_TEXT
Definition: eztemplate.php:203
eZTemplate\NODE_INTERNAL_OUTPUT_INCREASE
const NODE_INTERNAL_OUTPUT_INCREASE
Definition: eztemplate.php:234
eZTemplate\errorCount
errorCount()
Definition: eztemplate.php:2306
eZTemplate\processVariable
processVariable(&$textElements, $variableData, $variablePlacement, $rootNamespace, $currentNamespace)
Definition: eztemplate.php:625
eZTemplate\NODE_INTERNAL_OUTPUT_SPACING_INCREASE
const NODE_INTERNAL_OUTPUT_SPACING_INCREASE
Definition: eztemplate.php:237
eZTemplate\load
load( $uri, $extraParameters=false, $returnResourceData=false)
Definition: eztemplate.php:674
eZTemplate\ELEMENT_END_TAG
const ELEMENT_END_TAG
Definition: eztemplate.php:206
eZTemplate\unregisterLiteral
unregisterLiteral( $func_name)
Definition: eztemplate.php:1901
eZTemplate\ELEMENT_SINGLE_TAG
const ELEMENT_SINGLE_TAG
Definition: eztemplate.php:204
eZTemplate\TYPE_OPTIMIZED_ATTRIBUTE_LOOKUP
const TYPE_OPTIMIZED_ATTRIBUTE_LOOKUP
Definition: eztemplate.php:264
eZTemplate\unsetLocalVariables
unsetLocalVariables()
Definition: eztemplate.php:467
eZTemplate\fetch
fetch( $template=false, $extraParameters=false, $returnResourceData=false)
Definition: eztemplate.php:493
eZTemplate\registerFunctions
registerFunctions(&$functionObject)
Definition: eztemplate.php:1775
eZTemplate\setLeftDelimiter
setLeftDelimiter( $delim)
Definition: eztemplate.php:367
eZTemplate\TYPE_MODIFIER_MASK
const TYPE_MODIFIER_MASK
Definition: eztemplate.php:282
eZTemplate\operatorParameterList
operatorParameterList( $name)
Definition: eztemplate.php:1407
eZTemplate\registerOperatorsInternal
registerOperatorsInternal( $operatorObject, $debug=false)
Definition: eztemplate.php:1975
eZTemplate\setCompileTest
setCompileTest( $val)
Definition: eztemplate.php:2621
eZTemplate\TYPE_VARIABLE_BIT
const TYPE_VARIABLE_BIT
Definition: eztemplate.php:272
eZTemplate\compileTemplateFile
compileTemplateFile( $file, $returnResourceData=false)
Definition: eztemplate.php:916
eZTemplate\$AutoloadPathList
$AutoloadPathList
Definition: eztemplate.php:2682
eZTemplate\TYPE_ALL
const TYPE_ALL
Definition: eztemplate.php:278
eZTemplate\ELEMENT_VARIABLE
const ELEMENT_VARIABLE
Definition: eztemplate.php:207
ezpI18n\tr
static tr( $context, $source, $comment=null, $arguments=null)
Definition: ezpi18n.php:86
$eZTemplateOperatorArray
$eZTemplateOperatorArray
Definition: lib/ezpdf/classes/eztemplateautoload.php:11
$eZTemplateFunctionArray
$eZTemplateFunctionArray
Definition: lib/eztemplate/classes/eztemplateautoload.php:109
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.