[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/Smarty/libs/plugins/ -> modifiercompiler.wordwrap.php (source)

   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      $function = 'wordwrap';
  33      if (Smarty::$_MBSTRING) {
  34          if ($compiler->tag_nocache | $compiler->nocache) {
  35              $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';
  36              $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';
  37          } else {
  38              $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';
  39              $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';
  40          }
  41          $function = 'smarty_mb_wordwrap';
  42      }
  43      return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')';
  44  } 
  45  
  46  ?>


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1