*** empty log message ***

This commit is contained in:
andrey
2000-12-27 19:58:05 +00:00
parent ec358c7a62
commit 38c00e43b2
7 changed files with 25 additions and 11 deletions

View File

@@ -24,8 +24,9 @@ function _smarty_mod_handler()
$var[$key] = call_user_func_array($func_name, $args); $var[$key] = call_user_func_array($func_name, $args);
} }
return $var; return $var;
} else } else {
return call_user_func_array($func_name, $args); return call_user_func_array($func_name, $args);
}
} }
@@ -91,6 +92,13 @@ function smarty_mod_replace($string, $search, $replace)
return str_replace($search, $replace, $string); return str_replace($search, $replace, $string);
} }
function smarty_mod_strip_tags($string, $replace_with_space = false)
{
if ($replace_with_space)
return preg_replace('!<[^>]*?>!', ' ', $string);
else
return strip_tags($string);
}
/*============================================*\ /*============================================*\
Custom tag functions Custom tag functions

View File

@@ -53,7 +53,8 @@ class Smarty
'spacify' => 'smarty_mod_spacify', 'spacify' => 'smarty_mod_spacify',
'date_format' => 'smarty_mod_date_format', 'date_format' => 'smarty_mod_date_format',
'string_format' => 'smarty_mod_string_format', 'string_format' => 'smarty_mod_string_format',
'replace' => 'smarty_mod_replace' 'replace' => 'smarty_mod_replace',
'strip_tags' => 'smarty_mod_strip_tags'
); );
var $global_assign = array( 'SCRIPT_NAME' var $global_assign = array( 'SCRIPT_NAME'
); );
@@ -541,13 +542,13 @@ class Smarty
} }
return "<?php\n" . return "<?php\n" .
"function $include_func_name(\$file_name, \$tpl_vars, \$include_vars)\n" . "function $include_func_name(\$file_name, \$def_vars, \$include_vars)\n" .
"{\n" . "{\n" .
" extract(\$tpl_vars);\n" . " extract(\$def_vars);\n" .
" extract(\$include_vars);\n" . " extract(\$include_vars);\n" .
" include \"\$file_name\";\n" . " include \"\$file_name\";\n" .
"}\n" . "}\n" .
"$include_func_name(\"$include_file_name\", \$this->_tpl_vars, array(".implode(',', (array)$arg_list)."));\n?>\n"; "$include_func_name(\"$include_file_name\", get_defined_vars(), array(".implode(',', (array)$arg_list)."));\n?>\n";
} else } else
return '<?php include "'.$this->template_dir.$this->compile_dir_ext.'/'.$attrs['file'].'"; ?>'; return '<?php include "'.$this->template_dir.$this->compile_dir_ext.'/'.$attrs['file'].'"; ?>';
} }
@@ -599,6 +600,7 @@ class Smarty
for ({$section_props}['index'] = 0; for ({$section_props}['index'] = 0;
{$section_props}['index'] < {$section_props}['loop']; {$section_props}['index'] < {$section_props}['loop'];
{$section_props}['index']++):\n"; {$section_props}['index']++):\n";
$output .= "{$section_props}['rownum'] = {$section_props}['index'] + 1;\n";
$output .= "?>\n"; $output .= "?>\n";

View File

@@ -1,3 +1,3 @@
<HTML> <HTML>
<BODY> <BODY>
<TITLE>{$title} - {$section}</TITLE> <TITLE>{$title} - {$Name}</TITLE>

View File

@@ -1,4 +1,5 @@
{config_load file=test.conf section="my foo"} {config_load file=test.conf section="my foo"}
{include file=header.tpl title=foo}
Title: {#title#|capitalize} Title: {#title#|capitalize}

View File

@@ -53,7 +53,8 @@ class Smarty
'spacify' => 'smarty_mod_spacify', 'spacify' => 'smarty_mod_spacify',
'date_format' => 'smarty_mod_date_format', 'date_format' => 'smarty_mod_date_format',
'string_format' => 'smarty_mod_string_format', 'string_format' => 'smarty_mod_string_format',
'replace' => 'smarty_mod_replace' 'replace' => 'smarty_mod_replace',
'strip_tags' => 'smarty_mod_strip_tags'
); );
var $global_assign = array( 'SCRIPT_NAME' var $global_assign = array( 'SCRIPT_NAME'
); );
@@ -541,13 +542,13 @@ class Smarty
} }
return "<?php\n" . return "<?php\n" .
"function $include_func_name(\$file_name, \$tpl_vars, \$include_vars)\n" . "function $include_func_name(\$file_name, \$def_vars, \$include_vars)\n" .
"{\n" . "{\n" .
" extract(\$tpl_vars);\n" . " extract(\$def_vars);\n" .
" extract(\$include_vars);\n" . " extract(\$include_vars);\n" .
" include \"\$file_name\";\n" . " include \"\$file_name\";\n" .
"}\n" . "}\n" .
"$include_func_name(\"$include_file_name\", \$this->_tpl_vars, array(".implode(',', (array)$arg_list)."));\n?>\n"; "$include_func_name(\"$include_file_name\", get_defined_vars(), array(".implode(',', (array)$arg_list)."));\n?>\n";
} else } else
return '<?php include "'.$this->template_dir.$this->compile_dir_ext.'/'.$attrs['file'].'"; ?>'; return '<?php include "'.$this->template_dir.$this->compile_dir_ext.'/'.$attrs['file'].'"; ?>';
} }
@@ -599,6 +600,7 @@ class Smarty
for ({$section_props}['index'] = 0; for ({$section_props}['index'] = 0;
{$section_props}['index'] < {$section_props}['loop']; {$section_props}['index'] < {$section_props}['loop'];
{$section_props}['index']++):\n"; {$section_props}['index']++):\n";
$output .= "{$section_props}['rownum'] = {$section_props}['index'] + 1;\n";
$output .= "?>\n"; $output .= "?>\n";

View File

@@ -1,3 +1,3 @@
<HTML> <HTML>
<BODY> <BODY>
<TITLE>{$title} - {$section}</TITLE> <TITLE>{$title} - {$Name}</TITLE>

View File

@@ -1,4 +1,5 @@
{config_load file=test.conf section="my foo"} {config_load file=test.conf section="my foo"}
{include file=header.tpl title=foo}
Title: {#title#|capitalize} Title: {#title#|capitalize}