Changeset 24988 for trunk/include/template.class.php
- Timestamp:
- Oct 19, 2013, 11:21:01 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r23688 r24988 96 96 $this->smarty->registerPlugin('modifiercompiler', 'translate_dec', array('Template', 'modcompiler_translate_dec') ); 97 97 $this->smarty->registerPlugin('modifier', 'explode', array('Template', 'mod_explode') ); 98 $this->smarty->registerPlugin( 98 $this->smarty->registerPlugin('modifier', 'get_extent', array($this, 'get_extent') ); 99 99 $this->smarty->registerPlugin('block', 'html_head', array($this, 'block_html_head') ); 100 100 $this->smarty->registerPlugin('block', 'html_style', array($this, 'block_html_style') ); … … 488 488 } 489 489 490 static function get_php_str_val($str)490 private static function get_php_str_val($str) 491 491 { 492 492 if (is_string($str) && strlen($str)>1) … … 508 508 { 509 509 global $conf, $lang; 510 if ( $conf['compiled_template_cache_language'] 511 && ($key=self::get_php_str_val($params[0])) !== null) 512 { 513 if (isset($lang[$key])) 510 511 switch (count($params)) 512 { 513 case 1: 514 if ($conf['compiled_template_cache_language'] 515 && ($key=self::get_php_str_val($params[0])) !== null 516 && isset($lang[$key]) 517 ) { 514 518 return var_export($lang[$key], true); 515 } 516 return 'l10n('.$params[0].')'; 519 } 520 return 'l10n('.$params[0].')'; 521 522 default: 523 if ($conf['compiled_template_cache_language']) 524 { 525 $ret = 'sprintf('; 526 $ret .= self::modcompiler_translate( array($params[0]) ); 527 $ret .= ','. implode(',', array_slice($params, 1)); 528 $ret .= ')'; 529 return $ret; 530 } 531 return 'l10n('.$params[0].','.implode(',', array_slice($params, 1)).')'; 532 } 517 533 } 518 534 … … 520 536 { 521 537 global $conf, $lang, $lang_info; 522 if ( 538 if ($conf['compiled_template_cache_language']) 523 539 { 524 540 $ret = 'sprintf(';
Note: See TracChangeset
for help on using the changeset viewer.