Merge branch 'feature-25999/C4_cleanup' into feature-25999/C4_anwesenheiten_widget

This commit is contained in:
Johann Hoffmann
2024-11-28 10:22:57 +01:00
13 changed files with 140 additions and 56 deletions
@@ -29,7 +29,9 @@ class Phrasen extends FHCAPI_Controller
{
parent::__construct([
'loadModule' => self::PERM_ANONYMOUS,
'setLanguage' => self::PERM_ANONYMOUS
'setLanguage' => self::PERM_ANONYMOUS,
'getLanguage' => self::PERM_ANONYMOUS,
'getAllLanguages' => self::PERM_ANONYMOUS,
]);
$this->load->helper('hlp_language');
@@ -60,4 +62,23 @@ class Phrasen extends FHCAPI_Controller
$phrases = $this->p->setPhrases($categories, $language);
$this->terminateWithSuccess($phrases);
}
// gets the langauge of the currently logged in user session and otherwhise the system language
public function getLanguage()
{
$lang = getUserLanguage();
$this->terminateWithSuccess($lang);
}
// gets all languages that are set as active in the database
public function getAllLanguages()
{
$langs = getDBActiveLanguages();
$langs = $this->getDataOrTerminateWithError($langs);
$langs = array_map(function($lang){
return $lang->sprache;
}, $langs);
$this->terminateWithSuccess($langs);
}
}