- update scope handling

This commit is contained in:
uwetews
2016-01-02 02:47:32 +01:00
parent bdf9f41da8
commit 59343127f7
8 changed files with 82 additions and 91 deletions
@@ -58,8 +58,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
*
* @var array
*/
public $valid_scopes = array('local' => true, 'parent' => true, 'root' => true, 'global' => true,
'smarty' => true, 'tpl_root' => true);
public $valid_scopes = array('local' => true, 'parent' => true, 'root' => true,
'tpl_root' => true);
/**
* Compiles code for the {include} tag
@@ -124,16 +124,11 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
$_scope = Smarty::SCOPE_PARENT;
} elseif ($_attr['scope'] == 'root') {
$_scope = Smarty::SCOPE_ROOT;
} elseif ($_attr['scope'] == 'global') {
$_scope = Smarty::SCOPE_GLOBAL;
} elseif ($_attr['scope'] == 'smarty') {
$_scope = Smarty::SCOPE_SMARTY;
} elseif ($_attr['scope'] == 'tpl_root') {
$_scope = Smarty::SCOPE_TPL_ROOT;
}
if ($_attr['bubble_up'] === true) {
$_scope = $_scope + Smarty::SCOPE_BUBBLE_UP;
}
$_scope += (isset($_attr[ 'bubble_up' ]) && $_attr[ 'bubble_up' ] == 'false') ? 0 :
Smarty::SCOPE_BUBBLE_UP;
}
}