summaryrefslogtreecommitdiff
path: root/core/controllers/scaffold.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-28 20:12:54 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-28 20:12:54 +0000
commitbed1bb48f33c1c20decb6b592b1d713f5c9fb48e (patch)
tree24ede306b64a9cc56634680bb504b1092ccb6145 /core/controllers/scaffold.php
parentc04ff8e02f01691dc2e325efc523e43f3aebaf95 (diff)
The scaffolding, simple_uploader and local_import now call two new
events: start_add_batch and end_add_batch. The parameter is a batch id which is generated on the first add request. The protocol is call the add_photo as many times as required and then call finish when done. Also renamed the add method in local_import to add_photo so it is consistent with simple_uploader
Diffstat (limited to 'core/controllers/scaffold.php')
-rw-r--r--core/controllers/scaffold.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/controllers/scaffold.php b/core/controllers/scaffold.php
index cdbe0f95..2cdff2d3 100644
--- a/core/controllers/scaffold.php
+++ b/core/controllers/scaffold.php
@@ -218,6 +218,8 @@ class Scaffold_Controller extends Template_Controller {
throw new Exception("@todo BAD_ALBUM");
}
+ $batch_id = mt_rand();
+ module::event("start_add_batch", $batch_id);
cookie::set("add_photos_path", $path);
$photo_count = 0;
foreach (glob("$path/*.[Jj][Pp][Gg]") as $file) {
@@ -225,6 +227,7 @@ class Scaffold_Controller extends Template_Controller {
photo::create($parent, $file, basename($file), basename($file));
$photo_count++;
}
+ module::event("end_add_batch", $batch_id);
if ($photo_count > 0) {
log::success("content", "(scaffold) Added $photo_count photos",
@@ -241,6 +244,8 @@ class Scaffold_Controller extends Template_Controller {
$test_images = glob(APPPATH . "tests/images/*.[Jj][Pp][Gg]");
+ $batch_id = mt_rand();
+ module::event("start_add_batch", $batch_id);
$album_count = $photo_count = 0;
for ($i = 0; $i < $count; $i++) {
set_time_limit(30);
@@ -264,6 +269,7 @@ class Scaffold_Controller extends Template_Controller {
$photo_count++;
}
}
+ module::event("end_add_batch", $batch_id);
if ($photo_count > 0) {
log::success("content", "(scaffold) Added $photo_count photos");