mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-16 18:32:07 -04:00
Create a pause method on the server_add controller and get rid of the
optional parameter/
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user