00001 <?php 00014 function smarty_core_run_insert_handler($params, &$smarty) 00015 { 00016 00017 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); 00018 if ($smarty->debugging) { 00019 $_params = array(); 00020 $_debug_start_time = smarty_core_get_microtime($_params, $smarty); 00021 } 00022 00023 if ($smarty->caching) { 00024 $_arg_string = serialize($params['args']); 00025 $_name = $params['args']['name']; 00026 if (!isset($smarty->_cache_info['insert_tags'][$_name])) { 00027 $smarty->_cache_info['insert_tags'][$_name] = array('insert', 00028 $_name, 00029 $smarty->_plugins['insert'][$_name][1], 00030 $smarty->_plugins['insert'][$_name][2], 00031 !empty($params['args']['script']) ? true : false); 00032 } 00033 return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5; 00034 } else { 00035 if (isset($params['args']['script'])) { 00036 $_params = array('resource_name' => $smarty->_dequote($params['args']['script'])); 00037 require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); 00038 if(!smarty_core_get_php_resource($_params, $smarty)) { 00039 return false; 00040 } 00041 00042 if ($_params['resource_type'] == 'file') { 00043 $smarty->_include($_params['php_resource'], true); 00044 } else { 00045 $smarty->_eval($_params['php_resource']); 00046 } 00047 unset($params['args']['script']); 00048 } 00049 00050 $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0]; 00051 $_content = $_funcname($params['args'], $smarty); 00052 if ($smarty->debugging) { 00053 $_params = array(); 00054 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); 00055 $smarty->_smarty_debug_info[] = array('type' => 'insert', 00056 'filename' => 'insert_'.$params['args']['name'], 00057 'depth' => $smarty->_inclusion_depth, 00058 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); 00059 } 00060 00061 if (!empty($params['args']["assign"])) { 00062 $smarty->assign($params['args']["assign"], $_content); 00063 } else { 00064 return $_content; 00065 } 00066 } 00067 } 00068 00069 /* vim: set expandtab: */ 00070 00071 ?>
| Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|
