65 $this->saved_block_nesting =
$parser->block_nesting_level;
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);
121 return sprintf(
"(%s)", $this->data);
144 $this->subtrees[] = $subtree;
146 $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
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) {
160 $this->subtrees[$last_subtree]->data .=
'<?php echo ' . $subtree->data .
';?>';
162 $this->subtrees[$last_subtree]->data .=
'<?php echo "' . $subtree->data .
'";?>';
164 $this->subtrees[$last_subtree]->data .= $subtree->data;
167 $this->subtrees[] = $subtree;
170 $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
182 foreach ($this->subtrees as $subtree) {
187 $more_php = $subtree->assign_to_var();
189 $more_php = $subtree->to_smarty_php();
195 $this->parser->compiler->has_variable_string =
true;
232 return '"' . $this->data .
'"';
270 $this->subtrees[] = $subtree;
281 for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
282 if ($key + 2 < $cnt) {
287 if (substr($this->subtrees[$key]->data, -1) ==
'<' && $this->subtrees[$key + 1]->data ==
'' && substr($this->subtrees[$key + 2]->data, -1) ==
'?') {
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);
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);
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);
321 $code .= $this->subtrees[$key]->to_smarty_php();
__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))
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.