From 5b193e89c0168d09bc1eff3b1ef1b7fb3bf2710e Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Tue, 11 Jun 2024 10:23:09 +0200 Subject: [PATCH] Cleanup --- .../controllers/components/stv/Favorites.php | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 application/controllers/components/stv/Favorites.php diff --git a/application/controllers/components/stv/Favorites.php b/application/controllers/components/stv/Favorites.php deleted file mode 100644 index e0e7bbf7e..000000000 --- a/application/controllers/components/stv/Favorites.php +++ /dev/null @@ -1,61 +0,0 @@ -load->model('system/Variable_model', 'VariableModel'); - - // Load libraries - $this->load->library('AuthLib'); - - // TODO(chris): variable table might be to small to store favorites! - } - - public function index() - { - $result = $this->VariableModel->getVariables(getAuthUID(), ['stv_favorites']); - - if (isError($result)) { - $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - return $this->outputJson(getError($result)); - } - - $result = getData($result); - if (!$result) - $this->outputJson(null); - else - $this->outputJson($result['stv_favorites']); - } - - public function set() - { - $_POST = json_decode(utf8_encode($this->input->raw_input_stream), true); - - $this->load->library('form_validation'); - - $this->form_validation->set_rules('favorites', 'Favorites', 'required'); - - if ($this->form_validation->run() == false) { - $this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST); - return $this->outputJson($this->form_validation->error_array()); - } - - $favorites = $this->input->post('favorites'); - - $result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites); - - if (isError($result)) { - $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - return $this->outputJson(getError($result)); - } - - $this->outputJsonSuccess(true); - } -}