allow parts of the upload process to say 'no, not ok!'

git-svn-id: file:///home/shish/svn/shimmie2/trunk@234 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-06 06:41:13 +00:00
parent e0d279f347
commit a46fcb8463
3 changed files with 6 additions and 3 deletions

View file

@ -7,9 +7,11 @@
*/
class UploadingImageEvent extends Event {
var $image;
var $ok;
public function UploadingImageEvent($image) {
$this->image = $image;
$this->ok = false;
}
}
?>

View file

@ -22,7 +22,7 @@ class ImageIO extends Extension {
}
if(is_a($event, 'UploadingImageEvent')) {
$this->add_image($event->image);
$event->ok = $this->add_image($event->image);
}
if(is_a($event, 'ImageDeletionEvent')) {

View file

@ -74,8 +74,9 @@ class Upload extends Extension {
$image = new Image($file['tmp_name'], $file['name'], $_POST['tags']);
if($image->is_ok()) {
send_event(new UploadingImageEvent($image));
$ok = true;
$event = new UploadingImageEvent($image);
send_event($event);
$ok = $event->ok;
}
else {
$this->theme->display_upload_error("Error with ".html_escape($file['name']),