From 00ffb24eb05705813505ac6e83adb155a9303496 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 24 Mar 2009 17:41:20 +0000 Subject: Add a pause button to the server add dialog and if it is clicked then the upload is paused. If the dialog is closed and the task is not complete then a warning message is displayed on the album. --- modules/server_add/controllers/server_add.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/server_add/controllers/server_add.php') diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 430d8745..8f0ff4d8 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -107,7 +107,7 @@ class Server_Add_Controller extends Controller { break; case "error": - message::success(t("Add from server completed with errors")); + message::warning(t("Add from server completed with errors")); break; } print json_encode(array("result" => "success", @@ -119,7 +119,15 @@ class Server_Add_Controller extends Controller { } } - public function finish($id, $task_id) { + public function finish($id, $task_id, $cancelled=false) { + access::verify_csrf(); + + $task = task::run($task_id); + + if (!$task->done && $cancelled) { + message::warning(t("Add from server was cancelled prior to completion")); + } + batch::stop(); print json_encode(array("result" => "success")); } -- cgit v1.2.3