. */ if (! defined('BASEPATH')) exit('No direct script access allowed'); /** * This controller operates between (interface) the JS (GUI) and the back-end * Provides data to the ajax get calls about menues * This controller works with JSON calls on the HTTP GET or POST and the output is always JSON */ class Menu extends FHCAPI_Controller { public function __construct() { $permissions = []; $router = load_class('Router'); // TODO(chris): permission $permissions[$router->method] = ['admin:r', 'assistenz:r']; parent::__construct($permissions); // Load Config $this->config->load('menubuilder'); } /** * @param string $method * @param array $params (optional) * * @return void */ public function _remap($method, $params = []) { $this->load->library($this->config->item($method), null, 'menulib'); if (!$this->menulib) show_404(); $submenu = $this->menulib->build($params); $this->terminateWithSuccess($submenu); } }