function _compile_include_tag($tag_args)
{
$attrs = $this->_parse_attrs($tag_args);
// ADD NEXT LINE (default value of the param scope = local).
$scope_action = "\$this->_tpl_vars = array_merge(\$_smarty_tpl_vars,\$GLOBALS[\"_smarty_tpl_vars_temp\"]);\n";
$arg_list = array();
if (empty($attrs['file'])) {
$this->_syntax_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__);
}
foreach ($attrs as $arg_name => $arg_value) {
if ($arg_name == 'file') {
$include_file = $arg_value;
continue;
} else if ($arg_name == 'assign') {
$assign_var = $arg_value;
continue;
}
// ADD: Startin block
else if( $arg_name == 'scope' )
{
$scope = @$this->_dequote($arg_value);
if( $scope != 'local' &&
$scope != 'parent' &&
$scope != 'global')
$this->_syntax_error("invalid 'scope' attribute value");
if( $scope == 'parent' )
$scope_action = "";
if( $scope == 'global' )
{
$scope_action = "".
"\$array_diff = array_diff( array_keys(\$this->_tpl_vars), array_keys(\$_smarty_tpl_vars) );".
"foreach( \$array_diff as \$key=>\$value ){".
"\$GLOBALS[\"_smarty_tpl_vars_temp\"][\$value] = \$this->_tpl_vars[\$value];\n".
"}";
}
}
// Ending block
if (is_bool($arg_value))
$arg_value = $arg_value ? 'true' : 'false';
// ADD one line
if( $arg_name != 'scope' )
$arg_list[] = "'$arg_name' => $arg_value";
}