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.
This commit is contained in:
Tim Almdal
2009-03-24 17:41:20 +00:00
parent 520a4b41b3
commit 00ffb24eb0
3 changed files with 71 additions and 26 deletions
+10 -2
View File
@@ -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"));
}