From 2bd578edb3426d6714e92f0cb5a256056f973c06 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 13 Aug 2024 16:42:09 +0200 Subject: [PATCH] remove unused Abstract_Searchbar_Controller --- .../core/Abstract_Searchbar_Controller.php | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 application/core/Abstract_Searchbar_Controller.php diff --git a/application/core/Abstract_Searchbar_Controller.php b/application/core/Abstract_Searchbar_Controller.php deleted file mode 100644 index 8b383e042..000000000 --- a/application/core/Abstract_Searchbar_Controller.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -if (! defined('BASEPATH')) exit('No direct script access allowed'); - -/** - * This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end) - * Provides data to the ajax get calls about the searchbar component - * This controller works with JSON calls on the HTTP GET and the output is always JSON - */ -class Searchbar extends FHCAPI_Controller -{ - const SEARCHSTR_PARAM = 'searchstr'; - const TYPES_PARAM = 'types'; - - /** - * Object initialization - */ - public function __construct() - { - // NOTE(chris): additional permission checks will be done in SearchBarLib - parent::__construct([ - 'search' => self::PERM_LOGGED - ]); - - // Load the library SearchBarLib - $this->load->library('SearchBarLib'); - } - - //------------------------------------------------------------------------------------------------------------------ - // Public methods - - /** - * Gets a JSON body via HTTP POST and provides the parameters - */ - public function search() - { - $this->load->library('form_validation'); - - // Checks if the searchstr and the types parameters are in the POSTed JSON - $this->form_validation->set_rules(self::SEARCHSTR_PARAM, null, 'required'); - $this->form_validation->set_rules(self::TYPES_PARAM . '[]', null, 'required'); - - if (!$this->form_validation->run()) - $this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL); - - // Convert to json the result from searchbarlib->search - $result = $this->searchbarlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM)); - if (property_exists($result, 'error')) - $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - $this->terminateWithSuccess($result); - } -} -