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:
parent
e8607ab6f2
commit
c065e38145
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user