. */ if (! defined('BASEPATH')) exit('No direct script access allowed'); use CI3_Events as Events; /** * 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 LvMenu extends FHCAPI_Controller { /** * Object initialization */ public function __construct() { // NOTE(chris): additional permission checks will be done in SearchBarLib parent::__construct([ 'getLvMenu' => self::PERM_LOGGED ]); } //------------------------------------------------------------------------------------------------------------------ // Public methods /** * Gets a JSON body via HTTP POST and provides the parameters */ public function getLvMenu($lvid, $studiensemester_kurzbz) { if(!isset($lvid) || !isset($studiensemester_kurzbz)) $this->terminateWithError('Missing parameters', self::ERROR_TYPE_GENERAL); $menu = array(); // get the menu of the fhc core, look menu_lv.class.php //todo require_once(FHCPATH.'config/cis.config.inc.php'); require_once(FHCPATH.'include/lehrveranstaltung.class.php'); require_once(FHCPATH.'include/studiensemester.class.php'); require_once(FHCPATH.'include/lehreinheit.class.php'); require_once(FHCPATH.'include/vertrag.class.php'); require_once(FHCPATH.'include/functions.inc.php'); require_once(FHCPATH.'include/benutzerberechtigung.class.php'); require_once(FHCPATH.'include/studiengang.class.php'); require_once(FHCPATH.'include/phrasen.class.php'); Events::trigger('lvMenuBuild', // callback function for the onEvents to add newValues to the $menu function ($newValue) use (&$menu) { $menu[]= $newValue; }, $lvid, $studiensemester_kurzbz ); $this->terminateWithSuccess($menu); } }