diff options
Diffstat (limited to 'core/controllers')
-rw-r--r-- | core/controllers/scaffold.php | 12 | ||||
-rw-r--r-- | core/controllers/simple_uploader.php | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/core/controllers/scaffold.php b/core/controllers/scaffold.php index 45242b8c..c7f336df 100644 --- a/core/controllers/scaffold.php +++ b/core/controllers/scaffold.php @@ -218,8 +218,8 @@ class Scaffold_Controller extends Template_Controller { throw new Exception("@todo BAD_ALBUM"); } - $batch_id = mt_rand(); - module::event("start_batch"); + batch::operation("add", $parent); + cookie::set("add_photos_path", $path); $photo_count = 0; foreach (glob("$path/*.[Jj][Pp][Gg]") as $file) { @@ -227,7 +227,7 @@ class Scaffold_Controller extends Template_Controller { photo::create($parent, $file, basename($file), basename($file)); $photo_count++; } - module::event("end_batch"); + batch::end_operation("add"); if ($photo_count > 0) { log::success("content", "(scaffold) Added $photo_count photos", @@ -244,8 +244,8 @@ class Scaffold_Controller extends Template_Controller { $test_images = glob(APPPATH . "tests/images/*.[Jj][Pp][Gg]"); - $batch_id = mt_rand(); - module::event("start_batch"); + batch::operation("add", null); + $album_count = $photo_count = 0; for ($i = 0; $i < $count; $i++) { set_time_limit(30); @@ -269,7 +269,7 @@ class Scaffold_Controller extends Template_Controller { $photo_count++; } } - module::event("end_batch"); + batch::end_operation("add"); if ($photo_count > 0) { log::success("content", "(scaffold) Added $photo_count photos"); 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")); } |