Initial repo created
[timetracker.git] / WEB-INF / lib / smarty / plugins / modifiercompiler.wordwrap.php
1 <?php
2 /**
3  * Smarty plugin
4  *
5  * @package Smarty
6  * @subpackage PluginsModifierCompiler
7  */
8
9 /**
10  * Smarty wordwrap modifier plugin
11  * 
12  * Type:     modifier<br>
13  * Name:     wordwrap<br>
14  * Purpose:  wrap a string of text at a given length
15  * 
16  * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)
17  * @author Uwe Tews 
18  * @param array $params parameters
19  * @return string with compiled code
20  */
21 function smarty_modifiercompiler_wordwrap($params, $compiler)
22 {
23     if (!isset($params[1])) {
24         $params[1] = 80;
25     } 
26     if (!isset($params[2])) {
27         $params[2] = '"\n"';
28     } 
29     if (!isset($params[3])) {
30         $params[3] = 'false';
31     } 
32     return 'wordwrap(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')';
33
34
35 ?>