adds widget/thumb option to random_thumb ext (for #323)

this code was suggested in the comments, but never actually added
This commit is contained in:
Daku 2014-02-16 04:38:58 +00:00
parent e8607ab6f2
commit c065e38145

View file

@ -45,11 +45,18 @@ class RandomImage extends Extension {
$page->set_data(file_get_contents($image->get_image_filename()));
}
}
if($action === "view") {
else if($action === "view") {
if(!is_null($image)) {
send_event(new DisplayingImageEvent($image, $page));
}
}
else if($action === "widget") {
if(!is_null($image)) {
$page->set_mode("data");
$page->set_type("text/html");
$page->set_data($this->theme->build_thumb_html($image));
}
}
}
}