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
00042
00043
00044
00045 class eZTemplateFunctionElement
00046 {
00047
00048
00049
00050 function eZTemplateFunctionElement( $name, $params, $children = array() )
00051 {
00052 $this->Name = $name;
00053 $this->Params =& $params;
00054 $this->Children = $children;
00055 }
00056
00057 function setResourceRelation( $resource )
00058 {
00059 $this->Resource = $resource;
00060 }
00061
00062 function setTemplateNameRelation( $templateName )
00063 {
00064 $this->TemplateName = $templateName;
00065 }
00066
00067 function resourceRelation()
00068 {
00069 return $this->Resource;
00070 }
00071
00072 function templateNameRelation()
00073 {
00074 return $this->TemplateName;
00075 }
00076
00077
00078
00079
00080 function name()
00081 {
00082 return $this->Name;
00083 }
00084
00085 function serializeData()
00086 {
00087 return array( 'class_name' => 'eZTemplateFunctionElement',
00088 'parameters' => array( 'name', 'parameters', 'children' ),
00089 'variables' => array( 'name' => 'Name',
00090 'parameters' => 'Params',
00091 'children' => 'Children' ) );
00092 }
00093
00094
00095
00096
00097
00098 function process( &$tpl, &$text, $nspace, $current_nspace )
00099 {
00100 $tmp = $tpl->doFunction( $this->Name, $this, $nspace, $current_nspace );
00101 if ( $tmp === false )
00102 return;
00103 $tpl->appendElement( $text, $tmp, $nspace, $current_nspace );
00104 }
00105
00106
00107
00108
00109 function ¶meters()
00110 {
00111 return $this->Params;
00112 }
00113
00114
00115
00116
00117 function &children()
00118 {
00119 return $this->Children;
00120 }
00121
00122
00123
00124
00125 function appendChild( &$node )
00126 {
00127 $this->Children[] =& $node;
00128 }
00129
00130
00131 var $Name;
00132
00133 var $Params;
00134
00135 var $Children = array();
00136
00137 var $Resource;
00138 var $TemplateName;
00139 }
00140
00141 ?>