mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
*** empty log message ***
This commit is contained in:
@@ -557,7 +557,7 @@ class Smarty
|
|||||||
Purpose: called for included templates
|
Purpose: called for included templates
|
||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _smarty_include($_smarty_include_tpl_file,$_smarty_def_vars,
|
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_def_vars);
|
||||||
extract($_smarty_include_vars);
|
extract($_smarty_include_vars);
|
||||||
|
@@ -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 */
|
/* TODO: speed up the following with preg_replace and /F once we require that version of PHP */
|
||||||
|
|
||||||
/* loop through text blocks */
|
/* 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 <? ?> */
|
/* match anything within <? ?> */
|
||||||
if (preg_match_all('!(<\?[^?]*?\?>|<script\s+language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $text_blocks[$curr_tb], $sp_match)) {
|
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 */
|
/* 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" .
|
" include_once 'Config_File.class.php';\n" .
|
||||||
"if (!is_object(\$GLOBALS['_smarty_conf_obj']) || get_class(\$GLOBALS['_smarty_conf_obj']) != 'config_file')\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" .
|
" \$GLOBALS['_smarty_conf_obj'] = new Config_File('".$this->config_dir."');\n" .
|
||||||
"if (isset(\$parent_smarty_config) && $update_parent)\n" .
|
"if ($update_parent)\n" .
|
||||||
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\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";
|
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n";
|
||||||
|
|
||||||
if (!empty($attrs['section'])) {
|
if (!empty($attrs['section'])) {
|
||||||
$output .= "if (isset(\$parent_smarty_config) && $update_parent)\n" .
|
$output .= "if ($update_parent)\n" .
|
||||||
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\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";
|
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '?>';
|
$output .= '?>';
|
||||||
|
2
TODO
2
TODO
@@ -4,3 +4,5 @@
|
|||||||
* handle asp style tags in $php_handler
|
* handle asp style tags in $php_handler
|
||||||
* correctly capture nested php tag syntax in templates:
|
* correctly capture nested php tag syntax in templates:
|
||||||
<?php echo "<?php exit(); ?>"; ?>
|
<?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
|
||||||
|
@@ -557,7 +557,7 @@ class Smarty
|
|||||||
Purpose: called for included templates
|
Purpose: called for included templates
|
||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _smarty_include($_smarty_include_tpl_file,$_smarty_def_vars,
|
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_def_vars);
|
||||||
extract($_smarty_include_vars);
|
extract($_smarty_include_vars);
|
||||||
|
@@ -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 */
|
/* TODO: speed up the following with preg_replace and /F once we require that version of PHP */
|
||||||
|
|
||||||
/* loop through text blocks */
|
/* 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 <? ?> */
|
/* match anything within <? ?> */
|
||||||
if (preg_match_all('!(<\?[^?]*?\?>|<script\s+language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $text_blocks[$curr_tb], $sp_match)) {
|
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 */
|
/* 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" .
|
" include_once 'Config_File.class.php';\n" .
|
||||||
"if (!is_object(\$GLOBALS['_smarty_conf_obj']) || get_class(\$GLOBALS['_smarty_conf_obj']) != 'config_file')\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" .
|
" \$GLOBALS['_smarty_conf_obj'] = new Config_File('".$this->config_dir."');\n" .
|
||||||
"if (isset(\$parent_smarty_config) && $update_parent)\n" .
|
"if ($update_parent)\n" .
|
||||||
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\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";
|
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file']."));\n";
|
||||||
|
|
||||||
if (!empty($attrs['section'])) {
|
if (!empty($attrs['section'])) {
|
||||||
$output .= "if (isset(\$parent_smarty_config) && $update_parent)\n" .
|
$output .= "if ($update_parent)\n" .
|
||||||
" \$parent_smarty_config = array_merge((array)\$parent_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\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";
|
"\$_smarty_config = array_merge((array)\$_smarty_config, \$GLOBALS['_smarty_conf_obj']->get(".$attrs['file'].", ".$attrs['section']."));\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '?>';
|
$output .= '?>';
|
||||||
|
Reference in New Issue
Block a user