PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_function_call_handler.php
Go to the documentation of this file.
1 <?php
17 
28  public static function call($_name, Smarty_Internal_Template $_template, $_params, $_hash, $_nocache)
29  {
30  if ($_nocache) {
31  $_function = "smarty_template_function_{$_name}_nocache";
32  } else {
33  $_function = "smarty_template_function_{$_hash}_{$_name}";
34  }
35  if (!is_callable($_function)) {
36  $_code = "function {$_function}(\$_smarty_tpl,\$params) {
37  \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
38  foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);};
39  foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
40  if ($_nocache) {
41  $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",
42  "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);
43  $_template->smarty->template_functions[$_name]['called_nocache'] = true;
44  } else {
45  $_code .= preg_replace("/{$_template->smarty->template_functions[$_name]['nocache_hash']}/", $_template->properties['nocache_hash'], $_template->smarty->template_functions[$_name]['compiled']);
46  }
47  $_code .= "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}";
48  eval($_code);
49  }
50  $_function($_template, $_params);
51  }
52 
53 }
54 
55 ?>
static call($_name, Smarty_Internal_Template $_template, $_params, $_hash, $_nocache)
This function handles calls to template functions defined by {function} It does create a PHP function...

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.