summaryrefslogtreecommitdiff
path: root/modules/server_add/controllers/server_add.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-24 17:41:20 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-24 17:41:20 +0000
commit00ffb24eb05705813505ac6e83adb155a9303496 (patch)
treef213b518c4f0249abb9e55645ed938bd846d3baa /modules/server_add/controllers/server_add.php
parent520a4b41b3776c0ffb71af5580668d6530d9ed05 (diff)
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.
Diffstat (limited to 'modules/server_add/controllers/server_add.php')
-rw-r--r--modules/server_add/controllers/server_add.php12
1 files changed, 10 insertions, 2 deletions
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"));
}