17 require_once(SMARTY_CORE_DIR .
'core.get_microtime.php');
18 if ($smarty->debugging) {
23 if ($smarty->caching) {
24 $_arg_string = serialize($params[
'args']);
25 $_name = $params[
'args'][
'name'];
26 if (!isset($smarty->_cache_info[
'insert_tags'][$_name])) {
27 $smarty->_cache_info[
'insert_tags'][$_name] = array(
'insert',
29 $smarty->_plugins[
'insert'][$_name][1],
30 $smarty->_plugins[
'insert'][$_name][2],
31 !empty($params[
'args'][
'script']) ?
true :
false);
33 return $smarty->_smarty_md5.
"{insert_cache $_arg_string}".$smarty->_smarty_md5;
35 if (isset($params[
'args'][
'script'])) {
36 $_params = array(
'resource_name' => $smarty->_dequote($params[
'args'][
'script']));
37 require_once(SMARTY_CORE_DIR .
'core.get_php_resource.php');
42 if ($_params[
'resource_type'] ==
'file') {
43 $smarty->_include($_params[
'php_resource'],
true);
45 $smarty->_eval($_params[
'php_resource']);
47 unset($params[
'args'][
'script']);
50 $_funcname = $smarty->_plugins[
'insert'][$params[
'args'][
'name']][0];
51 $_content = $_funcname($params[
'args'], $smarty);
52 if ($smarty->debugging) {
54 require_once(SMARTY_CORE_DIR .
'core.get_microtime.php');
55 $smarty->_smarty_debug_info[] = array(
'type' =>
'insert',
56 'filename' =>
'insert_'.$params[
'args'][
'name'],
57 'depth' => $smarty->_inclusion_depth,
61 if (!empty($params[
'args'][
"assign"])) {
62 $smarty->assign($params[
'args'][
"assign"], $_content);