mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix dynamic configuration of $debugging_crtl did not work
- bugfix default value of $config_read_hidden changed to false - bugfix format of attribute array on compiler plugins - bugfix getTemplateVars() could return value from wrong scope
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
===== SVN trunk =====
|
===== SVN trunk =====
|
||||||
|
31/12/2010
|
||||||
|
- bugfix dynamic configuration of $debugging_crtl did not work
|
||||||
|
- bugfix default value of $config_read_hidden changed to false
|
||||||
|
- bugfix format of attribute array on compiler plugins
|
||||||
|
- bugfix getTemplateVars() could return value from wrong scope
|
||||||
|
|
||||||
28/12/2010
|
28/12/2010
|
||||||
- bugfix multiple {append} tags failed to compile.
|
- bugfix multiple {append} tags failed to compile.
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ class Smarty extends Smarty_Internal_Data {
|
|||||||
// config var settings
|
// config var settings
|
||||||
public $config_overwrite = true; //Controls whether variables with the same name overwrite each other.
|
public $config_overwrite = true; //Controls whether variables with the same name overwrite each other.
|
||||||
public $config_booleanize = true; //Controls whether config values of on/true/yes and off/false/no get converted to boolean
|
public $config_booleanize = true; //Controls whether config values of on/true/yes and off/false/no get converted to boolean
|
||||||
public $config_read_hidden = true; //Controls whether hidden config sections/vars are read from the file.
|
public $config_read_hidden = false; //Controls whether hidden config sections/vars are read from the file.
|
||||||
// config vars
|
// config vars
|
||||||
public $config_vars = array();
|
public $config_vars = array();
|
||||||
// assigned tpl vars
|
// assigned tpl vars
|
||||||
@@ -259,31 +259,6 @@ class Smarty extends Smarty_Internal_Data {
|
|||||||
$this->cache_dir = '.' . DS . 'cache' . DS;
|
$this->cache_dir = '.' . DS . 'cache' . DS;
|
||||||
$this->config_dir = '.' . DS . 'configs' . DS;
|
$this->config_dir = '.' . DS . 'configs' . DS;
|
||||||
$this->debug_tpl = SMARTY_DIR . 'debug.tpl';
|
$this->debug_tpl = SMARTY_DIR . 'debug.tpl';
|
||||||
if (!$this->debugging && $this->debugging_ctrl == 'URL') {
|
|
||||||
if (isset($_SERVER['QUERY_STRING'])) {
|
|
||||||
$_query_string = $_SERVER['QUERY_STRING'];
|
|
||||||
} else {
|
|
||||||
$_query_string = '';
|
|
||||||
}
|
|
||||||
if (false !== strpos($_query_string, $this->smarty_debug_id)) {
|
|
||||||
if (false !== strpos($_query_string, $this->smarty_debug_id . '=on')) {
|
|
||||||
// enable debugging for this browser session
|
|
||||||
setcookie('SMARTY_DEBUG', true);
|
|
||||||
$this->debugging = true;
|
|
||||||
} elseif (false !== strpos($_query_string, $this->smarty_debug_id . '=off')) {
|
|
||||||
// disable debugging for this browser session
|
|
||||||
setcookie('SMARTY_DEBUG', false);
|
|
||||||
$this->debugging = false;
|
|
||||||
} else {
|
|
||||||
// enable debugging for this page
|
|
||||||
$this->debugging = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (isset($_COOKIE['SMARTY_DEBUG'])) {
|
|
||||||
$this->debugging = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($_SERVER['SCRIPT_NAME'])) {
|
if (isset($_SERVER['SCRIPT_NAME'])) {
|
||||||
$this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
|
$this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
|
||||||
}
|
}
|
||||||
@@ -321,6 +296,32 @@ class Smarty extends Smarty_Internal_Data {
|
|||||||
if (isset($this->error_reporting)) {
|
if (isset($this->error_reporting)) {
|
||||||
$_smarty_old_error_level = error_reporting($this->error_reporting);
|
$_smarty_old_error_level = error_reporting($this->error_reporting);
|
||||||
}
|
}
|
||||||
|
// check URL debugging control
|
||||||
|
if (!$this->debugging && $this->debugging_ctrl == 'URL') {
|
||||||
|
if (isset($_SERVER['QUERY_STRING'])) {
|
||||||
|
$_query_string = $_SERVER['QUERY_STRING'];
|
||||||
|
} else {
|
||||||
|
$_query_string = '';
|
||||||
|
}
|
||||||
|
if (false !== strpos($_query_string, $this->smarty_debug_id)) {
|
||||||
|
if (false !== strpos($_query_string, $this->smarty_debug_id . '=on')) {
|
||||||
|
// enable debugging for this browser session
|
||||||
|
setcookie('SMARTY_DEBUG', true);
|
||||||
|
$this->debugging = true;
|
||||||
|
} elseif (false !== strpos($_query_string, $this->smarty_debug_id . '=off')) {
|
||||||
|
// disable debugging for this browser session
|
||||||
|
setcookie('SMARTY_DEBUG', false);
|
||||||
|
$this->debugging = false;
|
||||||
|
} else {
|
||||||
|
// enable debugging for this page
|
||||||
|
$this->debugging = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isset($_COOKIE['SMARTY_DEBUG'])) {
|
||||||
|
$this->debugging = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// obtain data for cache modified check
|
// obtain data for cache modified check
|
||||||
if ($this->cache_modified_check && $this->caching && $display) {
|
if ($this->cache_modified_check && $this->caching && $display) {
|
||||||
$_isCached = $_template->isCached() && !$_template->has_nocache_code;
|
$_isCached = $_template->isCached() && !$_template->has_nocache_code;
|
||||||
|
@@ -196,7 +196,9 @@ class Smarty_Internal_Data {
|
|||||||
$_ptr = $this;
|
$_ptr = $this;
|
||||||
} while ($_ptr !== null) {
|
} while ($_ptr !== null) {
|
||||||
foreach ($_ptr->tpl_vars AS $key => $var) {
|
foreach ($_ptr->tpl_vars AS $key => $var) {
|
||||||
$_result[$key] = $var->value;
|
if (!array_key_exists($key, $_result)) {
|
||||||
|
$_result[$key] = $var->value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// not found, try at parent
|
// not found, try at parent
|
||||||
if ($search_parents) {
|
if ($search_parents) {
|
||||||
@@ -207,7 +209,9 @@ class Smarty_Internal_Data {
|
|||||||
}
|
}
|
||||||
if ($search_parents && isset(Smarty::$global_tpl_vars)) {
|
if ($search_parents && isset(Smarty::$global_tpl_vars)) {
|
||||||
foreach (Smarty::$global_tpl_vars AS $key => $var) {
|
foreach (Smarty::$global_tpl_vars AS $key => $var) {
|
||||||
$_result[$key] = $var->value;
|
if (!array_key_exists($key, $_result)) {
|
||||||
|
$_result[$key] = $var->value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $_result;
|
return $_result;
|
||||||
|
@@ -196,7 +196,12 @@ class Smarty_Internal_TemplateCompilerBase {
|
|||||||
if ($plugin_type == Smarty::PLUGIN_BLOCK && $this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
|
if ($plugin_type == Smarty::PLUGIN_BLOCK && $this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
|
||||||
$plugin = 'smarty_compiler_' . $tag;
|
$plugin = 'smarty_compiler_' . $tag;
|
||||||
if (is_callable($plugin)) {
|
if (is_callable($plugin)) {
|
||||||
return $plugin($args, $this->smarty);
|
// convert arguments format for old compiler plugins
|
||||||
|
$new_args = array();
|
||||||
|
foreach ($args as $mixed) {
|
||||||
|
$new_args = array_merge($new_args, $mixed);
|
||||||
|
}
|
||||||
|
return $plugin($new_args, $this->smarty);
|
||||||
}
|
}
|
||||||
if (class_exists($plugin, false)) {
|
if (class_exists($plugin, false)) {
|
||||||
$plugin_object = new $plugin;
|
$plugin_object = new $plugin;
|
||||||
|
Reference in New Issue
Block a user