00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class eZTemplateNodeTool
00042 {
00043
00044
00045
00046 function eZTemplateNodeTool()
00047 {
00048 }
00049
00050
00051
00052
00053
00054 function removeFunctionNodeChildren( &$node )
00055 {
00056 $node[1] = false;
00057 }
00058
00059
00060
00061
00062
00063 function removeFunctionNodeParameters( &$node )
00064 {
00065 $node[3] = false;
00066 }
00067
00068
00069
00070
00071
00072 function removeFunctionNodePlacement( &$node )
00073 {
00074 $node[4] = false;
00075 }
00076
00077
00078
00079
00080
00081 function createVoidElement()
00082 {
00083 return array( EZ_TEMPLATE_TYPE_VOID );
00084 }
00085
00086
00087
00088
00089
00090
00091 function createConstantElement( $constant, $variablePlacement = false )
00092 {
00093 if ( is_array( $constant ) )
00094 return eZTemplateNodeTool::createArrayElement( $constant, $variablePlacement );
00095 else if ( is_string( $constant ) )
00096 return eZTemplateNodeTool::createStringElement( $constant, $variablePlacement );
00097 else if ( is_bool( $constant ) )
00098 return eZTemplateNodeTool::createBooleanElement( $constant, $variablePlacement );
00099 else if ( is_numeric( $constant ) )
00100 return eZTemplateNodeTool::createNumericElement( $constant, $variablePlacement );
00101 else
00102 return eZTemplateNodeTool::createVoidElement();
00103 }
00104
00105
00106
00107
00108
00109 function createStaticElement( $static, $variablePlacement = false )
00110 {
00111 if ( is_array( $static ) )
00112 return eZTemplateNodeTool::createArrayElement( $static, $variablePlacement );
00113 else if ( is_string( $static ) )
00114 return eZTemplateNodeTool::createStringElement( $static, $variablePlacement );
00115 else if ( is_bool( $static ) )
00116 return eZTemplateNodeTool::createBooleanElement( $static, $variablePlacement );
00117 else if ( is_numeric( $static ) )
00118 return eZTemplateNodeTool::createNumericElement( $static, $variablePlacement );
00119 else
00120 return eZTemplateNodeTool::createVoidElement();
00121 }
00122
00123
00124
00125
00126
00127 function createStringElement( $string, $variablePlacement = false )
00128 {
00129 return array( EZ_TEMPLATE_TYPE_STRING,
00130 $string, $variablePlacement );
00131 }
00132
00133
00134
00135
00136
00137 function createNumericElement( $number, $variablePlacement = false )
00138 {
00139 return array( EZ_TEMPLATE_TYPE_NUMERIC,
00140 $number, $variablePlacement );
00141 }
00142
00143
00144
00145
00146
00147 function createIdentifierElement( $identifier, $variablePlacement = false )
00148 {
00149 return array( EZ_TEMPLATE_TYPE_IDENTIFIER,
00150 $identifier, $variablePlacement );
00151 }
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 function createDynamicArrayElement( &$arrayKeys, &$arrayValues, $variablePlacement = false )
00162 {
00163 return array( EZ_TEMPLATE_TYPE_DYNAMIC_ARRAY,
00164 $arrayKeys, $arrayValues, $variablePlacement );
00165 }
00166
00167
00168
00169
00170
00171 function createArrayElement( $array, $variablePlacement = false )
00172 {
00173 return array( EZ_TEMPLATE_TYPE_ARRAY,
00174 $array, $variablePlacement );
00175 }
00176
00177
00178
00179
00180
00181 function createBooleanElement( $boolean, $variablePlacement = false )
00182 {
00183 if ( !is_bool( $boolean ) )
00184 $boolean = (bool)$boolean;
00185 return array( EZ_TEMPLATE_TYPE_BOOLEAN,
00186 $boolean, $variablePlacement );
00187 }
00188
00189
00190
00191
00192
00193 function createPHPVariableElement( $variableName, $variablePlacement = false )
00194 {
00195 return array( EZ_TEMPLATE_TYPE_PHP_VARIABLE,
00196 $variableName, $variablePlacement );
00197 }
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 function createVariableElement( $variableName, $namespaceName, $namespaceScope = EZ_TEMPLATE_NAMESPACE_SCOPE_LOCAL, $variablePlacement = false )
00208 {
00209 return array( EZ_TEMPLATE_TYPE_VARIABLE,
00210 array( $namespaceName, $namespaceScope, $variableName ), $variablePlacement );
00211 }
00212
00213
00214
00215
00216
00217
00218 function createAttributeLookupElement( $attributeValues = array(), $variablePlacement = false )
00219 {
00220 if ( is_numeric( $attributeValues ) )
00221 $attributeValues = array( eZTemplateNodeTool::createNumericElement( $attributeValues, $variablePlacement ) );
00222 else if ( !is_array( $attributeValues ) )
00223 $attributeValues = array( eZTemplateNodeTool::createStringElement( $attributeValues, $variablePlacement ) );
00224 return array( EZ_TEMPLATE_TYPE_ATTRIBUTE,
00225 $attributeValues, $variablePlacement );
00226 }
00227
00228
00229
00230
00231
00232
00233
00234 function createOperatorElement( $name, $parameters = array(), $variablePlacement = false )
00235 {
00236 return array( EZ_TEMPLATE_TYPE_ATTRIBUTE,
00237 array_merge( array( $name ), $parameters ), $variablePlacement );
00238 }
00239
00240
00241
00242
00243
00244
00245 function elementConstantValue( $elements )
00246 {
00247 if ( eZTemplateNodeTool::isConstantElement( $elements ) or
00248 eZTemplateNodeTool::isPHPVariableElement( $elements ) )
00249 return $elements[0][1];
00250 return null;
00251 }
00252
00253
00254
00255
00256
00257 function elementStaticValue( $elements )
00258 {
00259 if ( eZTemplateNodeTool::isConstantElement( $elements ) or
00260 eZTemplateNodeTool::isPHPVariableElement( $elements ) )
00261 return $elements[0][1];
00262 return null;
00263 }
00264
00265
00266
00267
00268 function elementDynamicArrayKeys( $elements )
00269 {
00270 if ( !eZTemplateNodeTool::isDynamicArrayElement( $elements ) )
00271 return null;
00272 return $elements[0][1];
00273 }
00274
00275
00276
00277
00278 function elementDynamicArray( $elements )
00279 {
00280 if ( !eZTemplateNodeTool::isDynamicArrayElement( $elements ) )
00281 return null;
00282 return $elements[0][2];
00283 }
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293 function isConstantElement( $elements )
00294 {
00295 $constantElements = array( EZ_TEMPLATE_TYPE_VOID,
00296 EZ_TEMPLATE_TYPE_STRING, EZ_TEMPLATE_TYPE_IDENTIFIER,
00297 EZ_TEMPLATE_TYPE_NUMERIC, EZ_TEMPLATE_TYPE_BOOLEAN, EZ_TEMPLATE_TYPE_ARRAY );
00298
00299 if ( count( $elements ) == 0 )
00300 return false;
00301 if ( count( $elements ) > 1 )
00302 return false;
00303
00304 if ( in_array( $elements[0][0], $constantElements ) )
00305 return true;
00306 return false;
00307 }
00308
00309
00310
00311
00312 function isStaticElement( $elements )
00313 {
00314 $staticElements = array( EZ_TEMPLATE_TYPE_VOID,
00315 EZ_TEMPLATE_TYPE_STRING, EZ_TEMPLATE_TYPE_IDENTIFIER,
00316 EZ_TEMPLATE_TYPE_NUMERIC, EZ_TEMPLATE_TYPE_BOOLEAN, EZ_TEMPLATE_TYPE_ARRAY );
00317
00318 if ( count( $elements ) == 0 )
00319 return false;
00320 if ( count( $elements ) > 1 )
00321 return false;
00322
00323 if ( in_array( $elements[0][0], $staticElements ) )
00324 return true;
00325 return false;
00326 }
00327
00328
00329
00330
00331 function isInternalCodePiece( $elements )
00332 {
00333 if ( isset( $elements[0][0]) && ( $elements[0][0] == EZ_TEMPLATE_TYPE_INTERNAL_CODE_PIECE ) )
00334 return true;
00335 return false;
00336 }
00337
00338
00339
00340
00341 function isVariableElement( $elements )
00342 {
00343 if ( isset( $elements[0][0] ) && ( $elements[0][0] == EZ_TEMPLATE_TYPE_VARIABLE ) )
00344 return true;
00345 return false;
00346 }
00347
00348
00349
00350
00351
00352
00353
00354
00355 function isPHPVariableElement( $elements )
00356 {
00357 if ( count( $elements ) == 0 )
00358 return false;
00359 if ( count( $elements ) > 1 )
00360 return false;
00361
00362 if ( $elements[0][0] == EZ_TEMPLATE_TYPE_PHP_VARIABLE )
00363 return true;
00364 return false;
00365 }
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377 function isNumericElement( $elements )
00378 {
00379 $constantElements = array( EZ_TEMPLATE_TYPE_NUMERIC );
00380
00381 if ( count( $elements ) == 0 )
00382 return false;
00383
00384 if ( in_array( $elements[0][0], $constantElements ) )
00385 return true;
00386 return false;
00387 }
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399 function isStringElement( $elements )
00400 {
00401 $constantElements = array( EZ_TEMPLATE_TYPE_STRING, EZ_TEMPLATE_TYPE_IDENTIFIER );
00402
00403 if ( count( $elements ) == 0 )
00404 return false;
00405
00406 if ( in_array( $elements[0][0], $constantElements ) )
00407 return true;
00408 return false;
00409 }
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420 function isIdentifierElement( $elements )
00421 {
00422 $constantElements = array( EZ_TEMPLATE_TYPE_IDENTIFIER );
00423
00424 if ( count( $elements ) == 0 )
00425 return false;
00426
00427 if ( in_array( $elements[0][0], $constantElements ) )
00428 return true;
00429 return false;
00430 }
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442 function isBooleanElement( $elements )
00443 {
00444 $constantElements = array( EZ_TEMPLATE_TYPE_BOOLEAN );
00445
00446 if ( count( $elements ) == 0 )
00447 return false;
00448
00449 if ( in_array( $elements[0][0], $constantElements ) )
00450 return true;
00451 return false;
00452 }
00453
00454
00455
00456
00457
00458 function isDynamicArrayElement( $elements )
00459 {
00460 if ( count( $elements ) == 0 )
00461 return false;
00462
00463 if ( $elements[0][0] == EZ_TEMPLATE_TYPE_DYNAMIC_ARRAY )
00464 return true;
00465 return false;
00466 }
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476 function isArrayElement( $elements )
00477 {
00478 $constantElements = array( EZ_TEMPLATE_TYPE_ARRAY );
00479
00480 if ( count( $elements ) == 0 )
00481 return false;
00482
00483 if ( in_array( $elements[0][0], $constantElements ) )
00484 return true;
00485 return false;
00486 }
00487
00488
00489
00490
00491
00492
00493 function createFunctionNodeHook( &$node, $hookName, $hookParameters = array(), $hookFunction = false )
00494 {
00495 $node[5] = array( 'name' => $hookName,
00496 'parameters' => $hookParameters,
00497 'function' => $hookFunction );
00498 }
00499
00500
00501
00502
00503
00504 function createVariableNode( $originalNode = false, $variableData = false, $variablePlacement = false,
00505 $parameters = array(), $variableAssignmentName = false, $onlyExisting = false,
00506 $overWrite = true, $assignFromVariable = false, $rememberSet = false )
00507 {
00508 $node = array();
00509 if ( $originalNode )
00510 $node = $originalNode;
00511 else
00512 {
00513 $node[0] = EZ_TEMPLATE_NODE_VARIABLE;
00514 $node[1] = $variableAssignmentName;
00515 if ( is_array( $variableData ) )
00516 $node[2] = $variableData;
00517 else if ( $assignFromVariable )
00518 $node[2] = array( array( EZ_TEMPLATE_TYPE_PHP_VARIABLE,
00519 $variableData,
00520 false ) );
00521 else if ( is_bool( $variableData ) )
00522 $node[2] = array( array( EZ_TEMPLATE_TYPE_BOOLEAN,
00523 $variableData,
00524 false ) );
00525 else if ( is_string( $variableData ) )
00526 $node[2] = array( array( EZ_TEMPLATE_TYPE_STRING,
00527 $variableData,
00528 false ) );
00529 else if ( is_numeric( $variableData ) )
00530 $node[2] = array( array( EZ_TEMPLATE_TYPE_NUMERIC,
00531 $variableData,
00532 false ) );
00533 else
00534 $node[2] = array( array( EZ_TEMPLATE_TYPE_STRING,
00535 $variableData,
00536 false ) );
00537 $node[3] = $variablePlacement;
00538 }
00539 $node[4] = $parameters;
00540 $node[5] = $onlyExisting;
00541 $node[6] = $overWrite;
00542 $node[7] = $rememberSet;
00543 return $node;
00544 }
00545
00546 function createCodePieceElement( $codePiece, $values = false, $placement = false, $tmpValues = false, $knownTypes = true )
00547 {
00548 $element = array( EZ_TEMPLATE_TYPE_INTERNAL_CODE_PIECE,
00549 $codePiece,
00550 $placement,
00551 $values, $tmpValues, $knownTypes );
00552 return $element;
00553 }
00554
00555 function createTextNode( $text )
00556 {
00557 $node = array( EZ_TEMPLATE_NODE_TEXT, false, $text, false );
00558 return $node;
00559 }
00560
00561 function createWarningNode( $text, $label, $placement = false, $parameters = array() )
00562 {
00563 $node = array( EZ_TEMPLATE_NODE_INTERNAL_WARNING,
00564 $text, $label,
00565 $parameters, $placement );
00566 return $node;
00567 }
00568
00569 function createErrorNode( $text, $label, $placement = false, $parameters = array() )
00570 {
00571 $node = array( EZ_TEMPLATE_NODE_INTERNAL_ERROR,
00572 $text, $label,
00573 $parameters, $placement );
00574 return $node;
00575 }
00576
00577 function createCodePieceNode( $codePiece, $parameters = array() )
00578 {
00579 $node = array( EZ_TEMPLATE_NODE_INTERNAL_CODE_PIECE,
00580 $codePiece,
00581 $parameters );
00582 return $node;
00583 }
00584
00585 function createVariableUnsetNode( $variableName, $parameters = array() )
00586 {
00587 $node = array( EZ_TEMPLATE_NODE_INTERNAL_VARIABLE_UNSET,
00588 $variableName,
00589 $parameters );
00590 return $node;
00591 }
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601 function createWriteToOutputVariableNode( $variableName, $parameters = array(), $assignmentType = EZ_PHPCREATOR_VARIABLE_APPEND_TEXT )
00602 {
00603 $node = array( EZ_TEMPLATE_NODE_INTERNAL_OUTPUT_ASSIGN,
00604 $variableName,
00605 $parameters,
00606 $assignmentType );
00607 return $node;
00608 }
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618 function createAssignFromOutputVariableNode( $variableName, $parameters = array(), $assignmentType = EZ_PHPCREATOR_VARIABLE_ASSIGNMENT )
00619 {
00620 $node = array( EZ_TEMPLATE_NODE_INTERNAL_OUTPUT_READ,
00621 $variableName,
00622 $parameters,
00623 $assignmentType );
00624 return $node;
00625 }
00626
00627 function createOutputVariableIncreaseNode( $parameters = array() )
00628 {
00629 $node = array( EZ_TEMPLATE_NODE_INTERNAL_OUTPUT_INCREASE,
00630 $parameters );
00631 return $node;
00632 }
00633
00634 function createOutputVariableDecreaseNode( $parameters = array() )
00635 {
00636 $node = array( EZ_TEMPLATE_NODE_INTERNAL_OUTPUT_DECREASE,
00637 $parameters );
00638 return $node;
00639 }
00640
00641 function createSpacingIncreaseNode( $spacing = 4, $parameters = array() )
00642 {
00643 $node = array( EZ_TEMPLATE_NODE_INTERNAL_SPACING_INCREASE,
00644 $spacing, $parameters );
00645 return $node;
00646 }
00647
00648 function createSpacingDecreaseNode( $spacing = 4, $parameters = array() )
00649 {
00650 $node = array( EZ_TEMPLATE_NODE_INTERNAL_SPACING_DECREASE,
00651 $spacing, $parameters );
00652 return $node;
00653 }
00654
00655 function createNamespaceChangeNode( $variableData, $parameters = array() )
00656 {
00657 if ( is_string( $variableData ) )
00658 $variableData = array( eZTemplateNodeTool::createStringElement( $variableData ) );
00659 else if ( is_numeric( $variableData ) )
00660 $variableData = array( eZTemplateNodeTool::createNumericElement( $variableData ) );
00661 $node = array( EZ_TEMPLATE_NODE_INTERNAL_NAMESPACE_CHANGE,
00662 $variableData,
00663 $parameters );
00664 return $node;
00665 }
00666
00667 function createNamespaceRestoreNode( $parameters = array() )
00668 {
00669 $node = array( EZ_TEMPLATE_NODE_INTERNAL_NAMESPACE_RESTORE,
00670 $parameters );
00671 return $node;
00672 }
00673
00674 function createResourceAcquisitionNode( $resourceName, $templateName, $fileName,
00675 $method, $extraParameters, $placement = false,
00676 $parameters = array(), $newRootNamespace = false, $resourceVariableName = false )
00677 {
00678 $node = array( EZ_TEMPLATE_NODE_INTERNAL_RESOURCE_ACQUISITION,
00679 $resourceName, $templateName, $fileName,
00680 $method, $extraParameters, $placement );
00681 if ( count( $parameters ) > 0 )
00682 $node[] = $parameters;
00683 else
00684 $node[] = false;
00685 $node[] = $newRootNamespace;
00686 $node[] = $resourceVariableName;
00687 return $node;
00688 }
00689
00690 function extractNodes( $nodeList, $parameters = array() )
00691 {
00692 $match = false;
00693 if ( isset( $parameters['match'] ) )
00694 $match = $parameters['match'];
00695 $newNodes = array();
00696 $skipNode = false;
00697 if ( $match['type'] == 'after' )
00698 $skipNode = true;
00699
00700 if ( !is_array( $nodeList ) )
00701 {
00702 return $newNodes;
00703 }
00704 foreach ( $nodeList as $node )
00705 {
00706 if ( $match )
00707 {
00708 $isMatch = true;
00709 foreach ( $match['matches'] as $matchItem )
00710 {
00711 $operand1 = $matchItem['match-with'];
00712 $matchKeys = $matchItem['match-keys'];
00713 $operand2 = $node;
00714 foreach ( $matchKeys as $matchKey )
00715 {
00716 $operand2 = $operand2[$matchKey];
00717 }
00718 if ( isset( $matchItem['match-function'] ) )
00719 {
00720 $function = $matchItem['match-function'];
00721 $functionResult = $function( $operand1, $operand2 );
00722 $wasMatch = $functionResult == 0;
00723 }
00724 else
00725 {
00726 if ( is_array( $operand1 ) )
00727 $wasMatch = in_array( $operand2, $operand1 );
00728 else
00729 $wasMatch = ( $operand1 == $operand2 );
00730 }
00731 if ( !$wasMatch )
00732 {
00733 $isMatch = false;
00734 break;
00735 }
00736 }
00737 if ( $match['type'] == 'equal' )
00738 {
00739 if ( !$isMatch )
00740 continue;
00741 }
00742 else if ( $match['type'] == 'before' )
00743 {
00744 if ( $isMatch )
00745 break;
00746 }
00747 else if ( $match['type'] = 'after' )
00748 {
00749 if ( $isMatch )
00750 {
00751 $skipNode = false;
00752 $match = false;
00753 continue;
00754 }
00755 }
00756 }
00757 if ( $skipNode )
00758 continue;
00759 if ( $match and isset( $match['filter'] ) )
00760 {
00761 $isMatch = true;
00762 foreach ( $match['filter'] as $matchFilterItem )
00763 {
00764 foreach ( $matchFilterItem as $matchItem )
00765 {
00766 $operand1 = $matchItem['match-with'];
00767 $matchKeys = $matchItem['match-keys'];
00768 $operand2 = $node;
00769 foreach ( $matchKeys as $matchKey )
00770 {
00771 $operand2 = $operand2[$matchKey];
00772 }
00773 if ( isset( $matchItem['match-function'] ) )
00774 {
00775 $function = $matchItem['match-function'];
00776 $functionResult = $function( $operand1, $operand2 );
00777 $wasMatch = $functionResult == 0;
00778 }
00779 else
00780 {
00781 if ( is_array( $operand1 ) )
00782 $wasMatch = in_array( $operand2, $operand1 );
00783 else
00784 $wasMatch = ( $operand1 == $operand2 );
00785 }
00786 if ( !$wasMatch )
00787 {
00788 $isMatch = false;
00789 break;
00790 }
00791 }
00792 if ( $isMatch )
00793 break;
00794 }
00795 if ( $isMatch )
00796 continue;
00797 }
00798 $newNodes[] = $node;
00799 }
00800 return $newNodes;
00801 }
00802
00803
00804
00805
00806
00807 function extractFunctionNodePlacement( &$node )
00808 {
00809 return $node[4];
00810 }
00811
00812
00813
00814
00815
00816 function extractFunctionNodeChildren( &$node )
00817 {
00818 return $node[1];
00819 }
00820
00821
00822
00823
00824
00825 function extractFunctionNodeParameters( &$node )
00826 {
00827 return $node[3];
00828 }
00829
00830
00831
00832
00833
00834 function extractFunctionNodeParameterNames( &$node )
00835 {
00836 return array_keys( $node[3] );
00837 }
00838
00839
00840
00841
00842
00843 function extractVariableNodeData( &$node )
00844 {
00845 return $node[1];
00846 }
00847
00848
00849
00850
00851
00852 function extractFunctionNodeName( &$node )
00853 {
00854 return $node[2];
00855 }
00856
00857
00858
00859
00860
00861 function extractVariableNodePlacement( &$node )
00862 {
00863 return $node[2];
00864 }
00865
00866
00867
00868
00869
00870 function extractOperatorNodeParameters( &$node )
00871 {
00872 return array_slice( $node[1], 1 );
00873 }
00874
00875
00876
00877
00878
00879
00880
00881 function deflateFunctionNode( &$node, $preHook, $postHook )
00882 {
00883 $newNodes = array();
00884 $children = eZTemplateNodeTool::extractFunctionNodeChildren( $node );
00885 eZTemplateNodeTool::removeFunctionNodeChildren( $node );
00886 $preNode = $node;
00887 $preHookParameters = array();
00888 if ( isset( $preHook['parameters'] ) )
00889 $preHookParameters = $preHook['parameters'];
00890 $preHookFunction = false;
00891 if ( isset( $preHook['function'] ) )
00892 $preHookFunction = $preHook['function'];
00893 eZTemplateNodeTool::createFunctionNodeHook( $preNode, $preHook['name'], $preHookParameters, $preHookFunction );
00894 if ( isset( $preHook['use-parameters'] ) and
00895 !$preHook['use-parameters'] )
00896 eZTemplateNodeTool::removeFunctionNodeParameters( $preNode );
00897 $newNodes[] = $preNode;
00898 $newNodes = array_merge( $newNodes, $children );
00899 $postNode = $node;
00900 $postHookParameters = array();
00901 if ( isset( $postHook['parameters'] ) )
00902 $postHookParameters = $postHook['parameters'];
00903 $postHookFunction = false;
00904 if ( isset( $postHook['function'] ) )
00905 $postHookFunction = $postHook['function'];
00906 eZTemplateNodeTool::createFunctionNodeHook( $postNode, $postHook['name'], $postHookParameters, $postHookFunction );
00907 if ( isset( $postHook['use-parameters'] ) and
00908 !$postHook['use-parameters'] )
00909 eZTemplateNodeTool::removeFunctionNodeParameters( $postNode );
00910 $newNodes[] = $postNode;
00911 return $newNodes;
00912 }
00913 }
00914
00915 ?>