summaryrefslogtreecommitdiffstats
path: root/application/controllers/file/file_default.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-11-01 17:27:20 +0100
committerFlorian Pritz <bluewind@xinu.at>2016-11-01 17:27:20 +0100
commitcb58719aa2db88fc810b1d5724ec9f6e7fdc984c (patch)
treeaf2055c6d513c4c3c3e3305e0539ed7f547581ab /application/controllers/file/file_default.php
parent9efd2db81ccf987a5455e0e4575c7d3f9072870f (diff)
parentc3d5786689bbc4a7f499f07cf1390afd800dc69a (diff)
Merge branch 'webui-multipaste' into dev
Diffstat (limited to 'application/controllers/file/file_default.php')
-rw-r--r--application/controllers/file/file_default.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/application/controllers/file/file_default.php b/application/controllers/file/file_default.php
index 2b77866a0..3b5eb0ee4 100644
--- a/application/controllers/file/file_default.php
+++ b/application/controllers/file/file_default.php
@@ -683,6 +683,40 @@ class File_default extends MY_Controller {
$this->load->view('footer', $this->data);
}
+ public function handle_history_submit()
+ {
+ $this->muser->require_access("apikey");
+
+ $process = $this->input->post("process");
+
+ $dispatcher = [
+ "delete" => function() {
+ return $this->do_delete();
+ },
+ "multipaste" => function() {
+ return $this->_append_multipaste_queue();
+ },
+ ];
+
+ if (isset($dispatcher[$process])) {
+ $dispatcher[$process]();
+ } else {
+ throw new \exceptions\UserInputException("file/handle_history_submit/invalid-process-value", "Value in process field not found in dispatch table");
+ }
+ }
+
+ private function _append_multipaste_queue()
+ {
+ $ids = $this->input->post("ids");
+ if ($ids === false) {
+ $ids = [];
+ }
+
+ $m = new \service\multipaste_queue();
+ $m->append($ids);
+ redirect("file/multipaste/queue");
+ }
+
function upload_history()
{
$this->muser->require_access("apikey");