Changeset 2712 for trunk/include
- Timestamp:
- Oct 11, 2008, 2:55:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r2699 r2712 67 67 $this->smarty->register_block('html_head', array(&$this, 'block_html_head') ); 68 68 $this->smarty->register_function('known_script', array(&$this, 'func_known_script') ); 69 $this->smarty->register_function('known_template', array(&$this, 'func_known_template') ); 69 70 $this->smarty->register_prefilter( array('Template', 'prefilter_white_space') ); 70 71 if ( $conf['compiled_template_cache_language'] ) … … 409 410 } 410 411 412 /** 413 * This smarty "known_template" functions allows to include template 414 * If extent[$params['id']] exists, include template extension 415 * else include $params[$file] 416 */ 417 function func_known_template($params, &$smarty ) 418 { 419 if (!isset($params['file'])) 420 { 421 $smarty->trigger_error("known_template: missing 'file' parameter"); 422 return; 423 } 424 425 if (isset($params['id']) and isset($this->extents[$params['id']])) 426 { 427 $file = $this->extents[$params['id']]; 428 } 429 else 430 { 431 $file = $params['file']; 432 } 433 434 return $smarty->_smarty_include(array( 435 'smarty_include_tpl_file' => $file, 436 'smarty_include_vars' => array() 437 )); 438 } 439 411 440 static function prefilter_white_space($source, &$smarty) 412 441 {
Note: See TracChangeset
for help on using the changeset viewer.