- retaining newlines at registered functions and function plugins

This commit is contained in:
Uwe.Tews
2010-02-02 20:09:57 +00:00
parent 3c88d12e00
commit fde7a592f4
7 changed files with 11 additions and 8 deletions

View File

@@ -1,3 +1,6 @@
02/02/2010
- retaining newlines at registered functions and function plugins
01/25/2010
- bugfix cache resource was not loaded when caching was globally off but enabled at a template object
- added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php

View File

@@ -66,7 +66,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
$output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo ' . $function . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
}
}
return $output;
return $output."\n";
}
}

View File

@@ -42,9 +42,9 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
$_params = 'array(' . implode(",", $_paramsArray) . ')';
// compile code
if (is_array($function)) {
$output = '<?php echo call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),(array(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl));?>';
$output = "<?php echo call_user_func_array(array('{$function[0]}','{$function[1]}'),(array({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl));?>\n";
} else {
$output = '<?php echo ' . $function . '(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl);?>';
$output = "<?php echo {$function}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n";
}
return $output;
}

View File

@@ -52,7 +52,7 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter
// compile code
$output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_objects[\'' . substr($tag, 0, -5) . '\'][0]->' . $methode . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
}
return $output;
return $output."\n";
}
}

View File

@@ -42,10 +42,10 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co
}
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
$output = "<?php echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>";
$output = "<?php echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n";
} else {
$_params = implode(",", $_attr);
$output = "<?php echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params});?>";
$output = "<?php echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params});?>\n";
}
return $output;
}

View File

@@ -72,7 +72,7 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C
$output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl)); }?>';
}
}
return $output;
return $output."\n";
}
}

View File

@@ -43,7 +43,7 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
// compile code
$output = '<?php echo call_user_func_array($_smarty_tpl->smarty->registered_plugins[\'function\'][\'' . $tag . '\'][0],array(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl));?>';
$output = "<?php echo call_user_func_array(\$_smarty_tpl->smarty->registered_plugins['function']['{$tag}'][0],array({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl));?>\n";
return $output;
}
}