- bugfix for plugins defined in the script as smarty_function_foo

This commit is contained in:
Uwe.Tews
2009-12-30 14:26:42 +00:00
parent 67641b63e8
commit a6c4c0b192
3 changed files with 330 additions and 325 deletions

View File

@@ -1,3 +1,6 @@
12/30/2009
- bugfix for plugins defined in the script as smarty_function_foo
12/29/2009 12/29/2009
- use sha1() for filepath encoding - use sha1() for filepath encoding
- updates on nocache_hash handling - updates on nocache_hash handling

View File

@@ -12,7 +12,7 @@
/** /**
* Smarty Internal Plugin Compile Function_Call Class * Smarty Internal Plugin Compile Function_Call Class
*/ */
class Smarty_Internal_Compile_Private_Function_Call extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
/** /**
* Compiles the calls of user defined tags defined by {function} * Compiles the calls of user defined tags defined by {function}
* *

View File

@@ -118,7 +118,7 @@ class Smarty_Internal_TemplateCompilerBase {
if (isset($this->smarty->template_functions[$tag])) { if (isset($this->smarty->template_functions[$tag])) {
// template defined by {template} tag // template defined by {template} tag
$args['name'] = $tag; $args['name'] = $tag;
$_output = $this->callTagCompiler('private_function_call', $args); $_output = $this->callTagCompiler('call', $args);
} }
} }
if ($_output !== false) { if ($_output !== false) {
@@ -180,7 +180,8 @@ class Smarty_Internal_TemplateCompilerBase {
throw new Exception("Plugin \"{$tag}\" not callable"); throw new Exception("Plugin \"{$tag}\" not callable");
} }
} else { } else {
if ($function = $this->getPlugin($tag, $plugin_type)) { $function = 'smarty_' . $plugin_type . '_' . $tag;
if (is_callable($function) || $function = $this->getPlugin($tag, $plugin_type)) {
return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $tag, $function); return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $tag, $function);
} }
} }
@@ -203,7 +204,8 @@ class Smarty_Internal_TemplateCompilerBase {
return $this->callTagCompiler('private_registered_block', $args, $tag); return $this->callTagCompiler('private_registered_block', $args, $tag);
} }
// block plugin? // block plugin?
if ($function = $this->getPlugin($base_tag, 'block')) { $function = 'smarty_block_' . $base_tag;
if (is_callable($function) || $function = $this->getPlugin($base_tag, 'block')) {
return $this->callTagCompiler('private_block_plugin', $args, $tag, $function); return $this->callTagCompiler('private_block_plugin', $args, $tag, $function);
} }
if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) { if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {