This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/contrib/zoom/main.php
shish f8f7470e61 much friendlier get_theme_object
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1019 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 16:59:02 +00:00

29 lines
729 B
PHP

<?php
/**
* Name: Image Zoom
* Author: Shish <webmaster@shishnet.org>
* License: GPLv2
* Description: Scales down too-large images using browser based scaling
*/
class Zoom implements Extension {
var $theme;
public function receive_event(Event $event) {
if($this->theme == null) $this->theme = get_theme_object($this);
if($event instanceof DisplayingImageEvent) {
global $config;
$this->theme->display_zoomer($event->page, $event->image, $config->get_bool("image_zoom", false));
}
if($event instanceof SetupBuildingEvent) {
$sb = new SetupBlock("Image Zoom");
$sb->add_bool_option("image_zoom", "Zoom by default: ");
$event->panel->add_block($sb);
}
}
}
add_event_listener(new Zoom());
?>