git-svn-id: file:///home/shish/svn/shimmie2/trunk@1003 7f39781d-f577-437e-ae19-be835c7a54ca
		
			
				
	
	
		
			27 lines
		
	
	
		
			657 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			657 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| class LoadExtData implements Extension {
 | |
| 	public function receive_event(Event $event) {
 | |
| 		if($event instanceof PageRequestEvent) {
 | |
| 			global $page, $config;
 | |
| 
 | |
| 			$data_href = get_base_href();
 | |
| 
 | |
| 			$css_files = glob("ext/*/style.css");
 | |
| 			if($css_files) {
 | |
| 				foreach($css_files as $css_file) {
 | |
| 					$page->add_header("<link rel='stylesheet' href='$data_href/$css_file' type='text/css'>");
 | |
| 				}
 | |
| 			}
 | |
| 
 | |
| 			$js_files = glob("ext/*/script.js");
 | |
| 			if($js_files) {
 | |
| 				foreach($js_files as $js_file) {
 | |
| 					$page->add_header("<script src='$data_href/$js_file' type='text/javascript'></script>");
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| }
 | |
| add_event_listener(new LoadExtData());
 | |
| ?>
 |