Added ImageDownloadingEvent that allows extensions to stop a user from viewing an image or perform other operations on the image before the image is downloaded to the user
This commit is contained in:
@ -28,9 +28,9 @@ class RandomImage extends Extension
|
||||
}
|
||||
|
||||
if ($action === "download") {
|
||||
$page->set_mode(PageMode::DATA);
|
||||
$page->set_type($image->get_mime_type());
|
||||
$page->set_data(file_get_contents($image->get_image_filename()));
|
||||
if (!is_null($image)) {
|
||||
send_event(new ImageDownloadingEvent($image, $image->get_image_filename(), $image->get_mime_type()));
|
||||
}
|
||||
} elseif ($action === "view") {
|
||||
send_event(new DisplayingImageEvent($image));
|
||||
} elseif ($action === "widget") {
|
||||
|
Reference in New Issue
Block a user