Changeset 5208 for trunk/include/template.class.php
- Timestamp:
- Mar 21, 2010, 12:14:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r5196 r5208 50 50 $this->smarty = new Smarty; 51 51 $this->smarty->debugging = $conf['debug_template']; 52 $this->smarty->compile_check=$conf['template_compile_check']; 52 $this->smarty->compile_check = $conf['template_compile_check']; 53 $this->smarty->force_compile = $conf['template_force_compile']; 53 54 54 55 $compile_dir = $conf['local_data_dir'].'/templates_c'; … … 71 72 $this->smarty->template_dir = array(); 72 73 if ( !empty($theme) ) 74 { 73 75 $this->set_theme($root, $theme, $path); 76 $this->set_prefilter( 'header', array('Template', 'prefilter_local_css') ); 77 } 74 78 else 75 79 $this->set_template_dir($root); … … 546 550 return $source; 547 551 } 552 553 static function prefilter_local_css($source, &$smarty) 554 { 555 $css = array(); 556 557 foreach ($smarty->get_template_vars('themes') as $theme) 558 { 559 if (file_exists(PHPWG_ROOT_PATH.'local/css/'.$theme['id'].'-rules.css')) 560 { 561 array_push($css, '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}local/css/'.$theme['id'].'-rules.css">'); 562 } 563 } 564 if (file_exists(PHPWG_ROOT_PATH.'local/css/rules.css')) 565 { 566 array_push($css, '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}local/css/rules.css">'); 567 } 568 569 if (!empty($css)) 570 { 571 $source = str_replace("\n</head>", "\n".implode( "\n", $css )."\n</head>", $source); 572 } 573 574 return $source; 575 } 548 576 } 549 577
Note: See TracChangeset
for help on using the changeset viewer.