2003-05-08 20:21:16 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Smarty plugin
|
|
|
|
|
* @package Smarty
|
|
|
|
|
* @subpackage plugins
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* called for included templates
|
|
|
|
|
*
|
|
|
|
|
* @param string $_smarty_include_tpl_file
|
|
|
|
|
* @param string $_smarty_include_vars
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// $_smarty_include_tpl_file, $_smarty_include_vars
|
|
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
function smarty_core_smarty_include($params, &$smarty)
|
2003-05-08 20:21:16 +00:00
|
|
|
{
|
2003-06-29 22:57:33 +00:00
|
|
|
if ($smarty->debugging) {
|
|
|
|
|
$_params = array();
|
|
|
|
|
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
|
|
|
|
|
$debug_start_time = smarty_core_get_microtime($_params, $smarty);
|
|
|
|
|
$smarty->_smarty_debug_info[] = array('type' => 'template',
|
2003-05-08 20:21:16 +00:00
|
|
|
'filename' => $params['smarty_include_tpl_file'],
|
2003-06-29 22:57:33 +00:00
|
|
|
'depth' => ++$smarty->_inclusion_depth);
|
|
|
|
|
$included_tpls_idx = count($smarty->_smarty_debug_info) - 1;
|
2003-05-08 20:21:16 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
$smarty->_tpl_vars = array_merge($smarty->_tpl_vars, $params['smarty_include_vars']);
|
2003-05-08 20:21:16 +00:00
|
|
|
|
|
|
|
|
// config vars are treated as local, so push a copy of the
|
|
|
|
|
// current ones onto the front of the stack
|
2003-06-29 22:57:33 +00:00
|
|
|
array_unshift($smarty->_config, $smarty->_config[0]);
|
2003-05-08 20:21:16 +00:00
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
$_smarty_compile_path = $smarty->_get_compile_path($params['smarty_include_tpl_file']);
|
2003-05-08 20:21:16 +00:00
|
|
|
|
2003-06-17 16:47:35 +00:00
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
if ($smarty->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path)
|
|
|
|
|
|| $smarty->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path))
|
2003-06-17 16:47:35 +00:00
|
|
|
{
|
2003-06-29 22:57:33 +00:00
|
|
|
$smarty->smarty_include($_smarty_compile_path);
|
2003-05-08 20:21:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// pop the local vars off the front of the stack
|
2003-06-29 22:57:33 +00:00
|
|
|
array_shift($smarty->_config);
|
2003-05-08 20:21:16 +00:00
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
$smarty->_inclusion_depth--;
|
2003-05-08 20:21:16 +00:00
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
if ($smarty->debugging) {
|
2003-05-08 20:21:16 +00:00
|
|
|
// capture time for debugging info
|
2003-06-29 22:57:33 +00:00
|
|
|
$_params = array();
|
|
|
|
|
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
|
|
|
|
|
$smarty->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $smarty) - $debug_start_time;
|
2003-05-08 20:21:16 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-29 22:57:33 +00:00
|
|
|
if ($smarty->caching) {
|
|
|
|
|
$smarty->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
|
2003-05-08 20:21:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* vim: set expandtab: */
|
|
|
|
|
|
|
|
|
|
?>
|