PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_parsetree.php
Go to the documentation of this file.
1 <?php
18 abstract class _smarty_parsetree {
19 
24  public $parser;
29  public $data;
30 
36  abstract public function to_smarty_php();
37 
38 }
39 
48 
54 
61  public function __construct($parser, $data)
62  {
63  $this->parser = $parser;
64  $this->data = $data;
65  $this->saved_block_nesting = $parser->block_nesting_level;
66  }
67 
73  public function to_smarty_php()
74  {
75  return $this->data;
76  }
77 
83  public function assign_to_var()
84  {
85  $var = sprintf('$_tmp%d', ++$this->parser->prefix_number);
86  $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
87  return $var;
88  }
89 
90 }
91 
100 
101 
108  public function __construct($parser, $data)
109  {
110  $this->parser = $parser;
111  $this->data = $data;
112  }
113 
119  public function to_smarty_php()
120  {
121  return sprintf("(%s)", $this->data);
122  }
123 
124 }
125 
134 
141  public function __construct($parser, _smarty_parsetree $subtree)
142  {
143  $this->parser = $parser;
144  $this->subtrees[] = $subtree;
145  if ($subtree instanceof _smarty_tag) {
146  $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
147  }
148  }
149 
155  public function append_subtree(_smarty_parsetree $subtree)
156  {
157  $last_subtree = count($this->subtrees) - 1;
158  if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
159  if ($subtree instanceof _smarty_code) {
160  $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
161  } elseif ($subtree instanceof _smarty_dq_content) {
162  $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
163  } else {
164  $this->subtrees[$last_subtree]->data .= $subtree->data;
165  }
166  } else {
167  $this->subtrees[] = $subtree;
168  }
169  if ($subtree instanceof _smarty_tag) {
170  $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
171  }
172  }
173 
179  public function to_smarty_php()
180  {
181  $code = '';
182  foreach ($this->subtrees as $subtree) {
183  if ($code !== "") {
184  $code .= ".";
185  }
186  if ($subtree instanceof _smarty_tag) {
187  $more_php = $subtree->assign_to_var();
188  } else {
189  $more_php = $subtree->to_smarty_php();
190  }
191 
192  $code .= $more_php;
193 
194  if (!$subtree instanceof _smarty_dq_content) {
195  $this->parser->compiler->has_variable_string = true;
196  }
197  }
198  return $code;
199  }
200 
201 }
202 
211 
212 
219  public function __construct($parser, $data)
220  {
221  $this->parser = $parser;
222  $this->data = $data;
223  }
224 
230  public function to_smarty_php()
231  {
232  return '"' . $this->data . '"';
233  }
234 
235 }
236 
245 
251  public $subtrees = Array();
252 
258  public function __construct($parser)
259  {
260  $this->parser = $parser;
261  }
262 
268  public function append_subtree(_smarty_parsetree $subtree)
269  {
270  $this->subtrees[] = $subtree;
271  }
272 
278  public function to_smarty_php()
279  {
280  $code = '';
281  for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
282  if ($key + 2 < $cnt) {
283  if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
284  $key = $key + 1;
285  continue;
286  }
287  if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
288  $key = $key + 2;
289  continue;
290  }
291  }
292  if (substr($code, -1) == '<') {
293  $subtree = $this->subtrees[$key]->to_smarty_php();
294  if (substr($subtree, 0, 1) == '?') {
295  $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
296  } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
297  $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
298  } else {
299  $code .= $subtree;
300  }
301  continue;
302  }
303  if ($this->parser->asp_tags && substr($code, -1) == '%') {
304  $subtree = $this->subtrees[$key]->to_smarty_php();
305  if (substr($subtree, 0, 1) == '>') {
306  $code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
307  } else {
308  $code .= $subtree;
309  }
310  continue;
311  }
312  if (substr($code, -1) == '?') {
313  $subtree = $this->subtrees[$key]->to_smarty_php();
314  if (substr($subtree, 0, 1) == '>') {
315  $code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
316  } else {
317  $code .= $subtree;
318  }
319  continue;
320  }
321  $code .= $this->subtrees[$key]->to_smarty_php();
322  }
323  return $code;
324  }
325 
326 }
327 
336 
337 
344  public function __construct($parser, $data)
345  {
346  $this->parser = $parser;
347  $this->data = $data;
348  }
349 
355  public function to_smarty_php()
356  {
357  return $this->data;
358  }
359 
360 }
361 
370 
377  public function __construct($parser, $data)
378  {
379  $this->parser = $parser;
380  $this->data = $data;
381  }
382 
388  public function to_smarty_php()
389  {
390  return $this->data;
391  }
392 
393 }
394 
395 ?>
__construct($parser, $data)
Create parse tree buffer with string content.
to_smarty_php()
Return linebrak.
__construct($parser, $data)
Create template text buffer.
to_smarty_php()
Return buffer content in parentheses.
to_smarty_php()
Return buffer content.
to_smarty_php()
Sanitize and merge subtree buffers together.
__construct($parser)
Create root of parse tree for template elements.
__construct($parser, _smarty_parsetree $subtree)
Create parse tree buffer for double quoted string subtrees.
append_subtree(_smarty_parsetree $subtree)
Append buffer to subtree.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
append_subtree(_smarty_parsetree $subtree)
Append buffer to subtree.
__construct($parser, $data)
Create parse tree buffer for code fragment.
__construct($parser, $data)
Create parse tree buffer for Smarty tag.
to_smarty_php()
Return buffer.
to_smarty_php()
Merge subtree buffer content together.
__construct($parser, $data)
Create buffer with linebreak content.
assign_to_var()
Return complied code that loads the evaluated outout of buffer content into a temporary variable...
to_smarty_php()
Return content as double quoted string.
to_smarty_php()
Return buffer content.

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:17 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.