Changeset 8378 for trunk/include
- Timestamp:
- Dec 29, 2010, 10:00:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r8305 r8378 93 93 $this->smarty->register_function('get_combined_scripts', array(&$this, 'func_get_combined_scripts') ); 94 94 $this->smarty->register_function('combine_css', array(&$this, 'func_combine_css') ); 95 $this->smarty->register_ function('get_combined_css', array(&$this, 'func_get_combined_css') );95 $this->smarty->register_compiler_function('get_combined_css', array(&$this, 'func_get_combined_css') ); 96 96 $this->smarty->register_block('footer_script', array(&$this, 'block_footer_script') ); 97 97 $this->smarty->register_function('known_script', array(&$this, 'func_known_script') ); … … 443 443 implode( "\n", $content ), 444 444 $this->output ); 445 $this->css_by_priority = array(); 445 446 } 446 447 … … 607 608 $content[]= '<script type="text/javascript">'; 608 609 $content[]= '(function() { 609 610 610 var after = document.getElementsByTagName(\'script\')[document.getElementsByTagName(\'script\').length-1]; 611 var s;'; 611 612 foreach ($scripts[1] as $id => $script) 612 613 { 613 614 $content[]= 614 's=document.createElement(\'script\'); s.type = \'text/javascript\'; s.async = true; s.src =\''615 's=document.createElement(\'script\'); s.type=\'text/javascript\'; s.async=true; s.src=\'' 615 616 . self::make_script_src($script) 616 617 .'\';'; … … 662 663 function func_get_combined_css($params, &$smarty) 663 664 { 664 return self::COMBINED_CSS_TAG;665 return 'echo '.var_export(self::COMBINED_CSS_TAG,true); 665 666 } 666 667 … … 736 737 737 738 $regex = array(); 738 $tags = array('if', 'foreach', 'section');739 $tags = array('if','foreach','section','footer_script'); 739 740 foreach($tags as $tag) 740 741 { … … 742 743 array_push($regex, "#^[ \t]+($ldq/$tag$rdq)\s*$#m"); 743 744 } 744 $tags = array('include', 'else','html_head');745 $tags = array('include','else','combine_script','html_head'); 745 746 foreach($tags as $tag) 746 747 { … … 1192 1193 } 1193 1194 1194 $output = ''; 1195 $output .= "/* ".count($this->files)."\n".join("\n", $this->files)."*/\n"; 1195 $output = "/* ".join("\n", $this->files)."*/\n"; 1196 1196 foreach ($this->files as $input_file) 1197 1197 { … … 1227 1227 require_once(PHPWG_ROOT_PATH.'include/cssmin.class.php'); 1228 1228 $css = CssMin::minify($css, array('emulate-css3-variables'=>false)); 1229 $css = trigger_event('combined_css_postfilter', $css); 1229 1230 return $css; 1230 1231 } … … 1243 1244 $relative = dirname($file) . "/$match[1]"; 1244 1245 $search[] = $match[0]; 1245 $replace[] = "url('" . get_absolute_root_url(false) . $relative . "')";1246 $replace[] = 'url('.embellish_url(get_absolute_root_url(false)).$relative.')'; 1246 1247 } 1247 1248 }
Note: See TracChangeset
for help on using the changeset viewer.