diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-03 05:59:38 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-03 05:59:38 +0000 |
commit | 7cadb4b21b90864b4151481da9aba244d7083788 (patch) | |
tree | f8df3ce866f69a6bc11790d3b2cb4c18a4ba297b /core/controllers/simple_uploader.php | |
parent | 1d5cca34efcd25473f00ed5d6594ea15c569622f (diff) |
Refactored the batch Api: 1) created a small batch helper class:
Starting a batch call batch::operation(name, item). In the case of
adding photos name = add and item is the parent of the new items.
When the operation is finished the batch::end_operation(name) is
called.
operation and end_operation events are called. Handlers
(i.e. item_created) can call batch::in_progress(name) to determine if
a batch is being processed.
Diffstat (limited to 'core/controllers/simple_uploader.php')
-rw-r--r-- | core/controllers/simple_uploader.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/controllers/simple_uploader.php b/core/controllers/simple_uploader.php index 5ae4bb2a..38eb5c38 100644 --- a/core/controllers/simple_uploader.php +++ b/core/controllers/simple_uploader.php @@ -48,7 +48,7 @@ class Simple_Uploader_Controller extends Controller { $file_validation = new Validation($_FILES); $file_validation->add_rules("file", "upload::valid", "upload::type[gif,jpg,png,flv,mp4]"); if ($file_validation->validate()) { - module::event("start_batch"); + batch::operation("add", $album); $temp_filename = upload::save("file"); $title = substr(basename($temp_filename), 10); // Skip unique identifier Kohana adds $path_info = pathinfo($temp_filename); @@ -65,7 +65,7 @@ class Simple_Uploader_Controller extends Controller { } public function finish() { - module::event("end_batch"); + batch::end_operation("add"); print json_encode(array("result" => "success")); } |