2007-04-16 11:58:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Zoom extends Extension {
|
2007-06-30 01:19:11 +00:00
|
|
|
var $theme;
|
|
|
|
|
2007-04-16 11:58:25 +00:00
|
|
|
public function receive_event($event) {
|
2007-06-30 01:19:11 +00:00
|
|
|
if($this->theme == null) $this->theme = get_theme_object("zoom", "ZoomTheme");
|
|
|
|
|
2007-04-16 11:58:25 +00:00
|
|
|
if(is_a($event, 'DisplayingImageEvent')) {
|
|
|
|
global $page;
|
2007-06-30 01:19:11 +00:00
|
|
|
global $config;
|
|
|
|
$this->theme->display_zoomer($page, $config->get_bool("image_zoom", false));
|
2007-04-16 11:58:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(is_a($event, 'SetupBuildingEvent')) {
|
|
|
|
$sb = new SetupBlock("Image Zoom");
|
2007-05-08 20:36:02 +00:00
|
|
|
$sb->add_bool_option("image_zoom", "Zoom by default: ");
|
2007-06-30 01:19:11 +00:00
|
|
|
$event->panel->add_block($sb);
|
2007-04-16 11:58:25 +00:00
|
|
|
}
|
|
|
|
if(is_a($event, 'ConfigSaveEvent')) {
|
2007-04-28 15:49:25 +00:00
|
|
|
$event->config->set_bool_from_post("image_zoom");
|
2007-04-16 11:58:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
add_event_listener(new Zoom());
|
|
|
|
?>
|