- Timestamp:
- Dec 26, 2010, 7:20:52 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r8299 r8305 411 411 ksort($this->css_by_priority); 412 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 413 global $conf; 414 $css = array(); 415 if ($conf['template_combine_files']) 416 { 417 $combiner = new FileCombiner('css'); 418 foreach ($this->css_by_priority as $files) 419 { 420 foreach ($files as $file_ver) 421 $combiner->add( $file_ver[0], $file_ver[1] ); 422 } 423 if ( $combiner->combine( $out_file, $out_version) ) 424 $css[] = array($out_file, $out_version); 425 } 426 else 427 { 428 foreach ($this->css_by_priority as $files) 429 $css = array_merge($css, $files); 430 } 431 432 $content = array(); 433 433 foreach( $css as $file_ver ) 434 434 { … … 438 438 // trigger the event for eventual use of a cdn 439 439 $href = trigger_event('combined_css', $href, $file_ver[0], $file_ver[1]); 440 440 $content[] = '<link rel="stylesheet" type="text/css" href="'.$href.'">'; 441 441 } 442 442 $this->output = str_replace(self::COMBINED_CSS_TAG, … … 970 970 function get_footer_scripts() 971 971 { 972 /*if (!$this->did_head)973 {974 trigger_error("Attempt to write footer scripts without header scripts", E_USER_ERROR );975 }*/976 972 $todo = array(); 977 973 foreach( $this->registered_scripts as $id => $script) … … 1003 999 return $scripts; 1004 1000 $combiner = new FileCombiner('js'); 1001 $result = array(); 1005 1002 foreach ($scripts as $script) 1006 1003 { 1007 if ($script->is_remote()) fatal_error("NOT IMPLEMENTED");// TODO - we cannot combine remote scripts 1008 $combiner->add( $script->path, $script->version ); 1004 if ($script->is_remote()) 1005 { 1006 if ( $combiner->combine( $out_file, $out_version) ) 1007 { 1008 $results[] = new Script($load_mode, 'combi', $out_file, $out_version, array() ); 1009 } 1010 $results[] = $script; 1011 } 1012 else 1013 $combiner->add( $script->path, $script->version ); 1009 1014 } 1010 1015 if ( $combiner->combine( $out_file, $out_version) ) 1011 1016 { 1012 return array( 'combi' => new Script($load_mode, 'combi', $out_file, $out_version, array()) );1013 } 1014 return null;1017 $results[] = new Script($load_mode, 'combi', $out_file, $out_version, array() ); 1018 } 1019 return $results; 1015 1020 } 1016 1021
Note: See TracChangeset
for help on using the changeset viewer.