mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
fix case in class name
This commit is contained in:
@@ -1290,7 +1290,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
if (!empty($data) && is_array($data)) {
|
if (!empty($data) && is_array($data)) {
|
||||||
// set up variable values
|
// set up variable values
|
||||||
foreach ($data as $_key => $_val) {
|
foreach ($data as $_key => $_val) {
|
||||||
$tpl->tpl_vars[$_key] = new Smarty_variable($_val);
|
$tpl->tpl_vars[$_key] = new Smarty_Variable($_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->debugging) {
|
if ($this->debugging) {
|
||||||
|
@@ -57,7 +57,7 @@ class Smarty_Data extends Smarty_Internal_Data
|
|||||||
} elseif (is_array($_parent)) {
|
} elseif (is_array($_parent)) {
|
||||||
// set up variable values
|
// set up variable values
|
||||||
foreach ($_parent as $_key => $_val) {
|
foreach ($_parent as $_key => $_val) {
|
||||||
$this->tpl_vars[$_key] = new Smarty_variable($_val);
|
$this->tpl_vars[$_key] = new Smarty_Variable($_val);
|
||||||
}
|
}
|
||||||
} elseif ($_parent != null) {
|
} elseif ($_parent != null) {
|
||||||
throw new SmartyException("Wrong type for template variables");
|
throw new SmartyException("Wrong type for template variables");
|
||||||
|
@@ -42,7 +42,7 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase
|
|||||||
if (isset($compiler->template->tpl_vars[trim($_attr['var'], "'")])) {
|
if (isset($compiler->template->tpl_vars[trim($_attr['var'], "'")])) {
|
||||||
$compiler->template->tpl_vars[trim($_attr['var'], "'")]->nocache = true;
|
$compiler->template->tpl_vars[trim($_attr['var'], "'")]->nocache = true;
|
||||||
} else {
|
} else {
|
||||||
$compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// scope setup
|
// scope setup
|
||||||
@@ -66,9 +66,9 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase
|
|||||||
if ($compiler->template->smarty instanceof SmartyBC) {
|
if ($compiler->template->smarty instanceof SmartyBC) {
|
||||||
$output = "<?php if (isset(\$_smarty_tpl->tpl_vars[$_attr[var]])) {\$_smarty_tpl->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
|
$output = "<?php if (isset(\$_smarty_tpl->tpl_vars[$_attr[var]])) {\$_smarty_tpl->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
|
||||||
$output .= "\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = $_nocache; \$_smarty_tpl->tpl_vars[$_attr[var]]->scope = $_scope;";
|
$output .= "\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = $_nocache; \$_smarty_tpl->tpl_vars[$_attr[var]]->scope = $_scope;";
|
||||||
$output .= "\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);";
|
$output .= "\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_Variable($_attr[value], $_nocache, $_scope);";
|
||||||
} else {
|
} else {
|
||||||
$output = "<?php \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);";
|
$output = "<?php \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_Variable($_attr[value], $_nocache, $_scope);";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($_scope == Smarty::SCOPE_PARENT) {
|
if ($_scope == Smarty::SCOPE_PARENT) {
|
||||||
|
@@ -156,10 +156,10 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
|||||||
}
|
}
|
||||||
$output .= "ob_start();\n";
|
$output .= "ob_start();\n";
|
||||||
$output .= $_paramsCode;
|
$output .= $_paramsCode;
|
||||||
$output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);\n}";
|
$output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value);\n}";
|
||||||
$output .= "\$params = var_export(\$params, true);\n";
|
$output .= "\$params = var_export(\$params, true);\n";
|
||||||
$output .= "echo \"/*%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/<?php ";
|
$output .= "echo \"/*%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/<?php ";
|
||||||
$output .= "\\\$saved_tpl_vars = \\\$_smarty_tpl->tpl_vars;\nforeach (\$params as \\\$key => \\\$value) {\n\\\$_smarty_tpl->tpl_vars[\\\$key] = new Smarty_variable(\\\$value);\n}\n?>";
|
$output .= "\\\$saved_tpl_vars = \\\$_smarty_tpl->tpl_vars;\nforeach (\$params as \\\$key => \\\$value) {\n\\\$_smarty_tpl->tpl_vars[\\\$key] = new Smarty_Variable(\\\$value);\n}\n?>";
|
||||||
$output .= "/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/\n\";?>";
|
$output .= "/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/\n\";?>";
|
||||||
$compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $output));
|
$compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $output));
|
||||||
$compiler->parser->current_buffer->append_subtree($_functionCode);
|
$compiler->parser->current_buffer->append_subtree($_functionCode);
|
||||||
@@ -191,7 +191,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
|||||||
}
|
}
|
||||||
$output .= "\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;\n";
|
$output .= "\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;\n";
|
||||||
$output .= $_paramsCode;
|
$output .= $_paramsCode;
|
||||||
$output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);\n}?>";
|
$output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value);\n}?>";
|
||||||
$compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $output));
|
$compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $output));
|
||||||
$compiler->parser->current_buffer->append_subtree($_functionCode);
|
$compiler->parser->current_buffer->append_subtree($_functionCode);
|
||||||
$output = "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;\n";
|
$output = "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;\n";
|
||||||
|
@@ -42,9 +42,9 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase
|
|||||||
$_nocache = ',true';
|
$_nocache = ',true';
|
||||||
// create nocache var to make it know for further compiling
|
// create nocache var to make it know for further compiling
|
||||||
if (is_array($parameter['if condition']['var'])) {
|
if (is_array($parameter['if condition']['var'])) {
|
||||||
$compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
} else {
|
} else {
|
||||||
$compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$_nocache = '';
|
$_nocache = '';
|
||||||
@@ -124,9 +124,9 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase
|
|||||||
$_nocache = ',true';
|
$_nocache = ',true';
|
||||||
// create nocache var to make it know for further compiling
|
// create nocache var to make it know for further compiling
|
||||||
if (is_array($parameter['if condition']['var'])) {
|
if (is_array($parameter['if condition']['var'])) {
|
||||||
$compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
} else {
|
} else {
|
||||||
$compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$_nocache = '';
|
$_nocache = '';
|
||||||
|
@@ -227,7 +227,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
// create variables
|
// create variables
|
||||||
foreach ($_attr as $key => $value) {
|
foreach ($_attr as $key => $value) {
|
||||||
$_pairs[] = "'$key'=>$value";
|
$_pairs[] = "'$key'=>$value";
|
||||||
$_vars_nc .= "\$_smarty_tpl->tpl_vars['$key'] = new Smarty_variable($value);\n";
|
$_vars_nc .= "\$_smarty_tpl->tpl_vars['$key'] = new Smarty_Variable($value);\n";
|
||||||
}
|
}
|
||||||
$_vars = 'array(' . join(',', $_pairs) . ')';
|
$_vars = 'array(' . join(',', $_pairs) . ')';
|
||||||
} else {
|
} else {
|
||||||
@@ -252,7 +252,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
//$compiler->suppressNocacheProcessing = true;
|
//$compiler->suppressNocacheProcessing = true;
|
||||||
}
|
}
|
||||||
if (isset($_assign)) {
|
if (isset($_assign)) {
|
||||||
$_output .= " \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(\$_smarty_tpl->getInlineSubTemplate({$include_file}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_parent_scope}, '{$_hash}', '{$compiler->parent_compiler->mergedSubTemplatesData[$tpl_name][$uid]['func']}'));\n";
|
$_output .= " \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_Variable(\$_smarty_tpl->getInlineSubTemplate({$include_file}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_parent_scope}, '{$_hash}', '{$compiler->parent_compiler->mergedSubTemplatesData[$tpl_name][$uid]['func']}'));\n";
|
||||||
} else {
|
} else {
|
||||||
$_output .= "echo \$_smarty_tpl->getInlineSubTemplate({$include_file}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_parent_scope}, '{$_hash}', '{$compiler->parent_compiler->mergedSubTemplatesData[$tpl_name][$uid]['func']}');\n";
|
$_output .= "echo \$_smarty_tpl->getInlineSubTemplate({$include_file}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_parent_scope}, '{$_hash}', '{$compiler->parent_compiler->mergedSubTemplatesData[$tpl_name][$uid]['func']}');\n";
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
}
|
}
|
||||||
// was there an assign attribute
|
// was there an assign attribute
|
||||||
if (isset($_assign)) {
|
if (isset($_assign)) {
|
||||||
$_output .= "\$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(\$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope));\n";
|
$_output .= "\$_smarty_tpl->tpl_vars[$_assign] = new Smarty_Variable(\$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope));\n";
|
||||||
} else {
|
} else {
|
||||||
$_output .= "echo \$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope);\n";
|
$_output .= "echo \$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope);\n";
|
||||||
}
|
}
|
||||||
|
@@ -42,9 +42,9 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase
|
|||||||
$_nocache = ',true';
|
$_nocache = ',true';
|
||||||
// create nocache var to make it know for further compiling
|
// create nocache var to make it know for further compiling
|
||||||
if (is_array($parameter['if condition']['var'])) {
|
if (is_array($parameter['if condition']['var'])) {
|
||||||
$compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
} else {
|
} else {
|
||||||
$compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
|
$compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_Variable(null, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$_nocache = '';
|
$_nocache = '';
|
||||||
|
@@ -55,12 +55,12 @@ class Smarty_Internal_Data
|
|||||||
if (is_array($tpl_var)) {
|
if (is_array($tpl_var)) {
|
||||||
foreach ($tpl_var as $_key => $_val) {
|
foreach ($tpl_var as $_key => $_val) {
|
||||||
if ($_key != '') {
|
if ($_key != '') {
|
||||||
$this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache);
|
$this->tpl_vars[$_key] = new Smarty_Variable($_val, $nocache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($tpl_var != '') {
|
if ($tpl_var != '') {
|
||||||
$this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache);
|
$this->tpl_vars[$tpl_var] = new Smarty_Variable($value, $nocache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ class Smarty_Internal_Data
|
|||||||
public function assignGlobal($varname, $value = null, $nocache = false)
|
public function assignGlobal($varname, $value = null, $nocache = false)
|
||||||
{
|
{
|
||||||
if ($varname != '') {
|
if ($varname != '') {
|
||||||
Smarty::$global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
|
Smarty::$global_tpl_vars[$varname] = new Smarty_Variable($value, $nocache);
|
||||||
$ptr = $this;
|
$ptr = $this;
|
||||||
while ($ptr instanceof Smarty_Internal_Template) {
|
while ($ptr instanceof Smarty_Internal_Template) {
|
||||||
$ptr->tpl_vars[$varname] = clone Smarty::$global_tpl_vars[$varname];
|
$ptr->tpl_vars[$varname] = clone Smarty::$global_tpl_vars[$varname];
|
||||||
@@ -102,7 +102,7 @@ class Smarty_Internal_Data
|
|||||||
public function assignByRef($tpl_var, &$value, $nocache = false)
|
public function assignByRef($tpl_var, &$value, $nocache = false)
|
||||||
{
|
{
|
||||||
if ($tpl_var != '') {
|
if ($tpl_var != '') {
|
||||||
$this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
|
$this->tpl_vars[$tpl_var] = new Smarty_Variable(null, $nocache);
|
||||||
$this->tpl_vars[$tpl_var]->value = &$value;
|
$this->tpl_vars[$tpl_var]->value = &$value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class Smarty_Internal_Data
|
|||||||
if (!isset($this->tpl_vars[$_key])) {
|
if (!isset($this->tpl_vars[$_key])) {
|
||||||
$tpl_var_inst = $this->getVariable($_key, null, true, false);
|
$tpl_var_inst = $this->getVariable($_key, null, true, false);
|
||||||
if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {
|
if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {
|
||||||
$this->tpl_vars[$_key] = new Smarty_variable(null, $nocache);
|
$this->tpl_vars[$_key] = new Smarty_Variable(null, $nocache);
|
||||||
} else {
|
} else {
|
||||||
$this->tpl_vars[$_key] = clone $tpl_var_inst;
|
$this->tpl_vars[$_key] = clone $tpl_var_inst;
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ class Smarty_Internal_Data
|
|||||||
if (!isset($this->tpl_vars[$tpl_var])) {
|
if (!isset($this->tpl_vars[$tpl_var])) {
|
||||||
$tpl_var_inst = $this->getVariable($tpl_var, null, true, false);
|
$tpl_var_inst = $this->getVariable($tpl_var, null, true, false);
|
||||||
if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {
|
if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {
|
||||||
$this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
|
$this->tpl_vars[$tpl_var] = new Smarty_Variable(null, $nocache);
|
||||||
} else {
|
} else {
|
||||||
$this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
|
$this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@ class Smarty_Internal_Data
|
|||||||
{
|
{
|
||||||
if ($tpl_var != '' && isset($value)) {
|
if ($tpl_var != '' && isset($value)) {
|
||||||
if (!isset($this->tpl_vars[$tpl_var])) {
|
if (!isset($this->tpl_vars[$tpl_var])) {
|
||||||
$this->tpl_vars[$tpl_var] = new Smarty_variable();
|
$this->tpl_vars[$tpl_var] = new Smarty_Variable();
|
||||||
}
|
}
|
||||||
if (!is_array($this->tpl_vars[$tpl_var]->value)) {
|
if (!is_array($this->tpl_vars[$tpl_var]->value)) {
|
||||||
settype($this->tpl_vars[$tpl_var]->value, 'array');
|
settype($this->tpl_vars[$tpl_var]->value, 'array');
|
||||||
|
@@ -459,7 +459,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
// set up variable values
|
// set up variable values
|
||||||
foreach ($data as $_key => $_val) {
|
foreach ($data as $_key => $_val) {
|
||||||
$tpl->tpl_vars[$_key] = new Smarty_variable($_val);
|
$tpl->tpl_vars[$_key] = new Smarty_Variable($_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $tpl;
|
return $tpl;
|
||||||
@@ -623,7 +623,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
|
public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
|
||||||
{
|
{
|
||||||
if (!isset($this->tpl_vars[$tpl_var])) {
|
if (!isset($this->tpl_vars[$tpl_var])) {
|
||||||
$this->tpl_vars[$tpl_var] = new Smarty_variable(array(), $nocache, $scope);
|
$this->tpl_vars[$tpl_var] = new Smarty_Variable(array(), $nocache, $scope);
|
||||||
} else {
|
} else {
|
||||||
$this->tpl_vars[$tpl_var] = clone $this->tpl_vars[$tpl_var];
|
$this->tpl_vars[$tpl_var] = clone $this->tpl_vars[$tpl_var];
|
||||||
if ($scope != Smarty::SCOPE_LOCAL) {
|
if ($scope != Smarty::SCOPE_LOCAL) {
|
||||||
|
Reference in New Issue
Block a user