Create a pause method on the server_add controller and get rid of the

optional parameter/
This commit is contained in:
Tim Almdal
2009-04-09 17:59:43 +00:00
parent 093422bfbc
commit e692868e8a
2 changed files with 13 additions and 3 deletions
+12 -2
View File
@@ -135,12 +135,12 @@ class Server_Add_Controller extends Controller {
}
}
public function finish($id, $task_id, $cancelled=false) {
public function finish($id, $task_id) {
access::verify_csrf();
$task = ORM::factory("task", $task_id);
if (!$task->done && $cancelled) {
if (!$task->done) {
message::warning(t("Add from server was cancelled prior to completion"));
}
@@ -148,6 +148,16 @@ class Server_Add_Controller extends Controller {
print json_encode(array("result" => "success"));
}
public function pause($id, $task_id) {
access::verify_csrf();
$task = ORM::factory("task", $task_id);
message::warning(t("Add from server was cancelled prior to completion"));
batch::stop();
print json_encode(array("result" => "success"));
}
private function _get_children($path) {
$directory_list = $file_list = array();
$files = new DirectoryIterator($path);