PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_compile_call.php
Go to the documentation of this file.
1 <?php
19 
26  public $required_attributes = array('name');
33  public $shorttag_order = array('name');
40  public $optional_attributes = array('_any');
41 
50  public function compile($args, $compiler)
51  {
52  // check and get attributes
53  $_attr = $this->getAttributes($compiler, $args);
54  // save possible attributes
55  if (isset($_attr['assign'])) {
56  // output will be stored in a smarty variable instead of beind displayed
57  $_assign = $_attr['assign'];
58  }
59  $_name = $_attr['name'];
60  if ($compiler->compiles_template_function) {
61  $compiler->called_functions[] = trim($_name, "'\"");
62  }
63  unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
64  // set flag (compiled code of {function} must be included in cache file
65  if ($compiler->nocache || $compiler->tag_nocache) {
66  $_nocache = 'true';
67  } else {
68  $_nocache = 'false';
69  }
70  $_paramsArray = array();
71  foreach ($_attr as $_key => $_value) {
72  if (is_int($_key)) {
73  $_paramsArray[] = "$_key=>$_value";
74  } else {
75  $_paramsArray[] = "'$_key'=>$_value";
76  }
77  }
78  if (isset($compiler->template->properties['function'][$_name]['parameter'])) {
79  foreach ($compiler->template->properties['function'][$_name]['parameter'] as $_key => $_value) {
80  if (!isset($_attr[$_key])) {
81  if (is_int($_key)) {
82  $_paramsArray[] = "$_key=>$_value";
83  } else {
84  $_paramsArray[] = "'$_key'=>$_value";
85  }
86  }
87  }
88  } elseif (isset($compiler->smarty->template_functions[$_name]['parameter'])) {
89  foreach ($compiler->smarty->template_functions[$_name]['parameter'] as $_key => $_value) {
90  if (!isset($_attr[$_key])) {
91  if (is_int($_key)) {
92  $_paramsArray[] = "$_key=>$_value";
93  } else {
94  $_paramsArray[] = "'$_key'=>$_value";
95  }
96  }
97  }
98  }
99  //varibale name?
100  if (!(strpos($_name, '$') === false)) {
101  $call_cache = $_name;
102  $call_function = '$tmp = "smarty_template_function_".' . $_name . '; $tmp';
103  } else {
104  $_name = trim($_name, "'\"");
105  $call_cache = "'{$_name}'";
106  $call_function = 'smarty_template_function_' . $_name;
107  }
108 
109  $_params = 'array(' . implode(",", $_paramsArray) . ')';
110  $_hash = str_replace('-', '_', $compiler->template->properties['nocache_hash']);
111  // was there an assign attribute
112  if (isset($_assign)) {
113  if ($compiler->template->caching) {
114  $_output = "<?php ob_start(); Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
115  } else {
116  $_output = "<?php ob_start(); {$call_function}(\$_smarty_tpl,{$_params}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
117  }
118  } else {
119  if ($compiler->template->caching) {
120  $_output = "<?php Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache});?>\n";
121  } else {
122  $_output = "<?php {$call_function}(\$_smarty_tpl,{$_params});?>\n";
123  }
124  }
125  return $_output;
126  }
127 
128 }
129 
130 ?>
getAttributes($compiler, $attributes)
This function checks if the attributes passed are valid.
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
compile($args, $compiler)
Compiles the calls of user defined tags defined by {function}.

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