Location: PHPKode > scripts > Ja2BU > libs/plugins/core.run_insert_handler.php
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Handle insert tags
 *
 * @param array $args
 * @return string
 */	
function smarty_core_run_insert_handler($params, &$this)
{
	
	if ($this->debugging) {
		$_params = array();
		$_debug_start_time = $this->_execute_core_function('get_microtime', $_params);
	}

	if (isset($params['args']['script'])) {				
		$_params = array('file_path' => $this->_dequote($params['args']['script']));
		if(!$this->_execute_core_function('get_php_resource', $_params)) {
			return false;
		}

		if ($_params['resource_type'] == 'file') {
			include_once($_params['php_resource']);
		} else {
			eval($_params['php_resource']);
		}
		unset($params['args']['script']);
	}

	$_funcname = $this->_plugins['insert'][$params['args']['name']][0];
	$_content = $_funcname($params['args'], $this);
	if ($this->debugging) {
		$_params = array();
		$this->_smarty_debug_info[] = array('type'	  => 'insert',
											'filename'  => 'insert_'.$params['args']['name'],
											'depth'	 => $this->_inclusion_depth,
											'exec_time' => $this->_execute_core_function('get_microtime', $_params) - $_debug_start_time);
	}

	if (!empty($params['args']["assign"])) {
		$this->assign($params['args']["assign"], $_content);
	} else {
		return $_content;
	}
}

/* vim: set expandtab: */

?>
Return current item: Ja2BU