*** empty log message ***

This commit is contained in:
andrey
2001-04-12 13:44:19 +00:00
parent ef9e900fa1
commit 420d376460
5 changed files with 16 additions and 14 deletions

View File

@@ -557,7 +557,7 @@ class Smarty
Purpose: called for included templates
\*======================================================================*/
function _smarty_include($_smarty_include_tpl_file,$_smarty_def_vars,
$_smarty_include_vars,&$parent_smarty_config)
$_smarty_include_vars,&$_smarty_config_parent)
{
extract($_smarty_def_vars);
extract($_smarty_include_vars);

View File

@@ -85,7 +85,7 @@ class Smarty_Compiler extends Smarty {
/* TODO: speed up the following with preg_replace and /F once we require that version of PHP */
/* loop through text blocks */
for ($curr_tb = 0; $curr_tb <= count($text_blocks); $curr_tb++) {
for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++) {
/* match anything within <? ?> */
if (preg_match_all('!(<\?[^?]*?\?>|<script\s+language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $text_blocks[$curr_tb], $sp_match)) {
/* found at least one match, loop through each one */
@@ -329,14 +329,14 @@ class Smarty_Compiler extends Smarty {
" include_once 'Config_File.class.php';\n" .
"if (!is_object(\$GLOBALS['_smarty_conf_obj']) || get_class(\$GLOBALS['_smarty_conf_obj']) != 'config_file')\n" .
" \$GLOBALS['_smarty_conf_obj'] = new Config_File('".$this->config_dir."');\n" .
"if (isset(\$parent_smarty_config) && $update_parent)\n" .
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n" .
"if ($update_parent)\n" .
" \$_smarty_config_parent = array_merge((array)\$_smarty_config_parent, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n" .
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n";
if (!empty($attrs['section'])) {
$output .= "if (isset(\$parent_smarty_config) && $update_parent)\n" .
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n" .
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n";
$output .= "if ($update_parent)\n" .
" \$_smarty_config_parent = array_merge((array)\$_smarty_config_parent, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n" .
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n";
}
$output .= '?>';

2
TODO
View File

@@ -4,3 +4,5 @@
* handle asp style tags in $php_handler
* correctly capture nested php tag syntax in templates:
<?php echo "<?php exit(); ?>"; ?>
* think about passing default structures to includes, i.e. {include
default=$foo}, then using $bar in included template, instead of $foo.bar

View File

@@ -557,7 +557,7 @@ class Smarty
Purpose: called for included templates
\*======================================================================*/
function _smarty_include($_smarty_include_tpl_file,$_smarty_def_vars,
$_smarty_include_vars,&$parent_smarty_config)
$_smarty_include_vars,&$_smarty_config_parent)
{
extract($_smarty_def_vars);
extract($_smarty_include_vars);

View File

@@ -85,7 +85,7 @@ class Smarty_Compiler extends Smarty {
/* TODO: speed up the following with preg_replace and /F once we require that version of PHP */
/* loop through text blocks */
for ($curr_tb = 0; $curr_tb <= count($text_blocks); $curr_tb++) {
for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++) {
/* match anything within <? ?> */
if (preg_match_all('!(<\?[^?]*?\?>|<script\s+language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $text_blocks[$curr_tb], $sp_match)) {
/* found at least one match, loop through each one */
@@ -329,14 +329,14 @@ class Smarty_Compiler extends Smarty {
" include_once 'Config_File.class.php';\n" .
"if (!is_object(\$GLOBALS['_smarty_conf_obj']) || get_class(\$GLOBALS['_smarty_conf_obj']) != 'config_file')\n" .
" \$GLOBALS['_smarty_conf_obj'] = new Config_File('".$this->config_dir."');\n" .
"if (isset(\$parent_smarty_config) && $update_parent)\n" .
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n" .
"if ($update_parent)\n" .
" \$_smarty_config_parent = array_merge((array)\$_smarty_config_parent, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n" .
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n";
if (!empty($attrs['section'])) {
$output .= "if (isset(\$parent_smarty_config) && $update_parent)\n" .
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n" .
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n";
$output .= "if ($update_parent)\n" .
" \$_smarty_config_parent = array_merge((array)\$_smarty_config_parent, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n" .
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n";
}
$output .= '?>';