From 19f0aab3221dd7760387cbec745c1eca9b215af7 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 9 Sep 2017 16:08:00 +0200 Subject: WIP: CI3 migration Signed-off-by: Florian Pritz --- application/controllers/file/multipaste.php | 113 ---------------------------- 1 file changed, 113 deletions(-) delete mode 100644 application/controllers/file/multipaste.php (limited to 'application/controllers/file/multipaste.php') diff --git a/application/controllers/file/multipaste.php b/application/controllers/file/multipaste.php deleted file mode 100644 index 50367697c..000000000 --- a/application/controllers/file/multipaste.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * Licensed under AGPLv3 - * (see COPYING for full license text) - * - */ - -class Multipaste extends MY_Controller { - - function __construct() { - parent::__construct(); - - $this->load->model('mfile'); - $this->load->model('mmultipaste'); - } - - public function append_multipaste_queue() { - $this->muser->require_access("basic"); - - $ids = $this->input->post_array("ids"); - if ($ids === false) { - $ids = []; - } - - $m = new \service\multipaste_queue(); - $m->append($ids); - - redirect("file/multipaste/queue"); - } - - public function review_multipaste() { - $this->muser->require_access("basic"); - - $this->load->view('header', $this->data); - $this->load->view('file/review_multipaste', $this->data); - $this->load->view('footer', $this->data); - } - - public function queue() { - $this->muser->require_access("basic"); - - $m = new \service\multipaste_queue(); - $ids = $m->get(); - - $this->data['ids'] = $ids; - $this->data['items'] = array_map(function($id) {return $this->_get_multipaste_item($id);}, $ids); - - $this->load->view('header', $this->data); - $this->load->view('file/multipaste/queue', $this->data); - $this->load->view('footer', $this->data); - } - - public function form_submit() { - $this->muser->require_access("basic"); - - $ids = $this->input->post_array('ids'); - $process = $this->input->post('process'); - - if ($ids === false) { - $ids = []; - } - - $m = new \service\multipaste_queue(); - $m->set($ids); - - $dispatcher = [ - 'save' => function() use ($ids, $m) { - redirect("file/multipaste/queue"); - }, - 'create' => function() use ($ids, $m) { - $userid = $this->muser->get_userid(); - $limits = $this->muser->get_upload_id_limits(); - $ret = \service\files::create_multipaste($ids, $userid, $limits); - $m->set([]); - redirect($ret['url_id'].'/'); - }, - ]; - - if (isset($dispatcher[$process])) { - $dispatcher[$process](); - } else { - throw new \exceptions\UserInputException("file/multipaste/form_submit/invalid-process-value", "Value in process field not found in dispatch table"); - } - } - - public function ajax_submit() { - $this->muser->require_access("basic"); - $ids = $this->input->post_array('ids'); - - if ($ids === false) { - $ids = []; - } - - $m = new \service\multipaste_queue(); - $m->set($ids); - } - - private function _get_multipaste_item($id) { - $filedata = $this->mfile->get_filedata($id); - $item = []; - $item['id'] = $filedata['id']; - $item['tooltip'] = \service\files::tooltip($filedata); - $item['title'] = $filedata['filename']; - if (\libraries\Image::type_supported($filedata["mimetype"])) { - $item['thumbnail'] = site_url("file/thumbnail/".$filedata['id']); - } - - return $item; - } - -} -- cgit v1.2.3-24-g4f1b