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 /modules | |
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 'modules')
-rw-r--r-- | modules/local_import/controllers/local_import.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/local_import/controllers/local_import.php b/modules/local_import/controllers/local_import.php index 8fc183b7..ee4a4f1a 100644 --- a/modules/local_import/controllers/local_import.php +++ b/modules/local_import/controllers/local_import.php @@ -65,8 +65,8 @@ class Local_Import_Controller extends Controller { } $path = $this->input->post("path"); - module::event("start_batch"); - + batch::operation("add", $parent); + $source_path = $path[0]; for ($i = 1; $i < count($path); $i++) { // skip the first path $source_path .= "/$path[$i]"; @@ -92,7 +92,7 @@ class Local_Import_Controller extends Controller { } public function finish() { - module::event("end_batch"); + batch::end_operation("add"); print json_encode(array("result" => "success")); } |