git-svn-id: file:///home/shish/svn/shimmie2/trunk@201 7f39781d-f577-437e-ae19-be835c7a54ca
		
			
				
	
	
		
			28 lines
		
	
	
		
			661 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			661 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| class Zoom extends Extension {
 | |
| 	var $theme;
 | |
| 
 | |
| 	public function receive_event($event) {
 | |
| 		if($this->theme == null) $this->theme = get_theme_object("zoom", "ZoomTheme");
 | |
| 
 | |
| 		if(is_a($event, 'DisplayingImageEvent')) {
 | |
| 			global $page;
 | |
| 			global $config;
 | |
| 			$this->theme->display_zoomer($page, $config->get_bool("image_zoom", false));
 | |
| 		}
 | |
| 		
 | |
| 		if(is_a($event, 'SetupBuildingEvent')) {
 | |
| 			$sb = new SetupBlock("Image Zoom");
 | |
| 			$sb->add_bool_option("image_zoom", "Zoom by default: ");
 | |
| 			$event->panel->add_block($sb);
 | |
| 		}
 | |
| 		if(is_a($event, 'ConfigSaveEvent')) {
 | |
| 			$event->config->set_bool_from_post("image_zoom");
 | |
| 		}
 | |
| 	}
 | |
| 
 | |
| }
 | |
| add_event_listener(new Zoom());
 | |
| ?>
 |