API konsolidierung StV Config

This commit is contained in:
cgfhtw
2024-04-29 11:40:46 +02:00
parent b5c830ed35
commit 7bb98479dd
5 changed files with 42 additions and 17 deletions
@@ -1,21 +1,44 @@
<?php
/**
* Copyright (C) 2024 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
use CI3_Events as Events;
class Config extends FHC_Controller
/**
* This controller operates between (interface) the JS (GUI) and the back-end
* Provides data to the ajax get calls about the StV Config
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Config extends FHCAPI_Controller
{
public function __construct()
{
// TODO(chris): access!
parent::__construct();
parent::__construct([
'student' => self::PERM_LOGGED,
'students' => self::PERM_LOGGED
]);
$this->load->library('AuthLib');
$this->load->library('PermissionLib');
// Load Phrases
$this->loadPhrases([
'global',
'person',
@@ -48,10 +71,6 @@ class Config extends FHC_Controller
'title' => 'Status',
'component' => './Stv/Studentenverwaltung/Details/MultiStatus.js'
];
$result['konto'] = [
'title' => 'Konto',
'component' => './Stv/Studentenverwaltung/Details/Konto.js'
];
$result['banking'] = [
'title' => $this->p->t('stv', 'tab_banking'),
'component' => './Stv/Studentenverwaltung/Details/Konto.js',
@@ -77,7 +96,7 @@ class Config extends FHC_Controller
return $result;
});
$this->outputJsonSuccess($result);
$this->terminateWithSuccess($result);
}
public function students()
@@ -111,7 +130,7 @@ class Config extends FHC_Controller
return $result;
});
$this->outputJsonSuccess($result);
$this->terminateWithSuccess($result);
}
protected function kontoColumns()