veto API
git-svn-id: file:///home/shish/svn/shimmie2/trunk@269 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
b8b968ab56
commit
a9908508d0
3 changed files with 6 additions and 4 deletions
|
@ -41,8 +41,9 @@ class BulkAdd extends Extension {
|
|||
$image = new Image($tmpname, $filename, $tags);
|
||||
|
||||
if($image->is_ok()) {
|
||||
send_event(new UploadingImageEvent($image));
|
||||
$ok = true;
|
||||
$uie = new UploadingImageEvent($image);
|
||||
send_event($uie);
|
||||
$ok = $uie->_live;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ class ImageIO extends Extension {
|
|||
}
|
||||
|
||||
if(is_a($event, 'UploadingImageEvent')) {
|
||||
$event->ok = $this->add_image($event->image);
|
||||
$ok = $this->add_image($event->image);
|
||||
if(!$ok) $event->veto();
|
||||
}
|
||||
|
||||
if(is_a($event, 'ImageDeletionEvent')) {
|
||||
|
|
|
@ -71,7 +71,7 @@ class Upload extends Extension {
|
|||
if($image->is_ok()) {
|
||||
$event = new UploadingImageEvent($image);
|
||||
send_event($event);
|
||||
$ok = $event->ok;
|
||||
$ok = $event->_live;
|
||||
}
|
||||
else {
|
||||
$this->theme->display_upload_error("Error with ".html_escape($file['name']),
|
||||
|
|
Reference in a new issue