Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

eztemplateoperatorelement.php
Go to the documentation of this file.
1 <?php
23 class eZTemplateOperatorElement
24 {
33 public function __construct( $name, $params, $resource = null, $templateName = null )
34 {
35 $this->Name = $name;
36 $this->Params = $params;
37 $this->Resource = $resource;
38 $this->TemplateName = $templateName;
39 }
40
41 function setResourceRelation( $resource )
42 {
43 $this->Resource = $resource;
44 }
45
46 function setTemplateNameRelation( $templateName )
47 {
48 $this->TemplateName = $templateName;
49 }
50
51 function resourceRelation()
52 {
53 return $this->Resource;
54 }
55
56 function templateNameRelation()
57 {
58 return $this->TemplateName;
59 }
60
64 function &name()
65 {
66 return $this->Name;
67 }
68
69 function serializeData()
70 {
71 return array( 'class_name' => 'eZTemplateOperatorElement',
72 'parameters' => array( 'name', 'parameters', 'resource', 'template_name' ),
73 'variables' => array( 'name' => 'Name',
74 'parameters' => 'Params',
75 'resource' => 'Resource',
76 'template_name' => 'TemplateName' ) );
77 }
78
83 function process( $tpl, &$value, $nspace, $current_nspace )
84 {
85 $named_params = array();
86 $param_list = $tpl->operatorParameterList( $this->Name );
87 $i = 0;
88 foreach ( $param_list as $param_name => $param_type )
89 {
90 if ( !isset( $this->Params[$i] ) or
91 $this->Params[$i]["type"] == "null" )
92 {
93 if ( $param_type["required"] )
94 {
95 $tpl->warning( "eZTemplateOperatorElement", "Parameter '$param_name' ($i) missing" );
96 $named_params[$param_name] = $param_type["default"];
97 }
98 else
99 {
100 $named_params[$param_name] = $param_type["default"];
101 }
102 }
103 else
104 {
105 $param_data = $this->Params[$i];
106 $named_params[$param_name] = $tpl->elementValue( $param_data, $nspace );
107 }
108 ++$i;
109 }
110 if ( $param_list !== null )
111 $tpl->doOperator( $this, $nspace, $current_nspace, $value, $this->Name, $this->Params, $named_params );
112 else
113 $tpl->doOperator( $this, $nspace, $current_nspace, $value, $this->Name, $this->Params );
114 }
115
119 function &parameters()
120 {
121 return $this->Params;
122 }
123
125 public $Name;
127 public $Params;
128 public $Resource;
129 public $TemplateName;
130 }
131
132 ?>
eZTemplateOperatorElement
Represents an operator element in the template tree.
Definition: eztemplateoperatorelement.php:24
eZTemplateOperatorElement\setResourceRelation
setResourceRelation( $resource)
Definition: eztemplateoperatorelement.php:41
eZTemplateOperatorElement\$Params
$Params
The paramer array.
Definition: eztemplateoperatorelement.php:127
eZTemplateOperatorElement\setTemplateNameRelation
setTemplateNameRelation( $templateName)
Definition: eztemplateoperatorelement.php:46
eZTemplateOperatorElement\name
& name()
Definition: eztemplateoperatorelement.php:64
eZTemplateOperatorElement\__construct
__construct( $name, $params, $resource=null, $templateName=null)
Definition: eztemplateoperatorelement.php:33
eZTemplateOperatorElement\serializeData
serializeData()
Definition: eztemplateoperatorelement.php:69
eZTemplateOperatorElement\process
process( $tpl, &$value, $nspace, $current_nspace)
Definition: eztemplateoperatorelement.php:83
eZTemplateOperatorElement\parameters
& parameters()
Definition: eztemplateoperatorelement.php:119
eZTemplateOperatorElement\$Name
$Name
The operator name.
Definition: eztemplateoperatorelement.php:125
eZTemplateOperatorElement\$TemplateName
$TemplateName
Definition: eztemplateoperatorelement.php:129
eZTemplateOperatorElement\$Resource
$Resource
Definition: eztemplateoperatorelement.php:128
eZTemplateOperatorElement\resourceRelation
resourceRelation()
Definition: eztemplateoperatorelement.php:51
eZTemplateOperatorElement\templateNameRelation
templateNameRelation()
Definition: eztemplateoperatorelement.php:56
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.