diff options
Diffstat (limited to '3dparty/Smarty/plugins/modifiercompiler.wordwrap.php')
-rw-r--r-- | 3dparty/Smarty/plugins/modifiercompiler.wordwrap.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/3dparty/Smarty/plugins/modifiercompiler.wordwrap.php b/3dparty/Smarty/plugins/modifiercompiler.wordwrap.php new file mode 100644 index 00000000000..6581d3d3183 --- /dev/null +++ b/3dparty/Smarty/plugins/modifiercompiler.wordwrap.php @@ -0,0 +1,35 @@ +<?php +/** + * Smarty plugin + * + * @package Smarty + * @subpackage PluginsModifierCompiler + */ + +/** + * Smarty wordwrap modifier plugin + * + * Type: modifier<br> + * Name: wordwrap<br> + * Purpose: wrap a string of text at a given length + * + * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) + * @author Uwe Tews + * @param array $params parameters + * @return string with compiled code + */ +function smarty_modifiercompiler_wordwrap($params, $compiler) +{ + if (!isset($params[1])) { + $params[1] = 80; + } + if (!isset($params[2])) { + $params[2] = '"\n"'; + } + if (!isset($params[3])) { + $params[3] = 'false'; + } + return 'wordwrap(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; +} + +?>
\ No newline at end of file |