[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

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

   1  <?php
   2  /**

   3   * Smarty plugin

   4   *

   5   * @package Smarty

   6   * @subpackage PluginsModifierCompiler

   7   */
   8  
   9  /**

  10   * Smarty to_charset modifier plugin

  11   *

  12   * Type:     modifier<br>

  13   * Name:     to_charset<br>

  14   * Purpose:  convert character encoding from internal encoding to $charset

  15   *

  16   * @author Rodney Rehm

  17   * @param array $params parameters

  18   * @return string with compiled code

  19   */
  20  function smarty_modifiercompiler_to_charset($params, $compiler)
  21  {
  22      if (!Smarty::$_MBSTRING) {
  23          // FIXME: (rodneyrehm) shouldn't this throw an error?

  24          return $params[0];
  25      }
  26  
  27      if (!isset($params[1])) {
  28          $params[1] = '"ISO-8859-1"';
  29      }
  30  
  31      return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")';
  32  }
  33  
  34  ?>


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