added set language feature; phrasen plugin with optional reload if non responsive phrasen are used; stundenplan header mode & buttons reworked

This commit is contained in:
Johann Hoffmann
2024-10-24 17:46:42 +02:00
parent 805ed20a18
commit e387671e09
20 changed files with 166 additions and 42 deletions
@@ -28,8 +28,11 @@ class Phrasen extends FHCAPI_Controller
public function __construct()
{
parent::__construct([
'loadModule' => self::PERM_ANONYMOUS
'loadModule' => self::PERM_ANONYMOUS,
'setLanguage' => self::PERM_ANONYMOUS
]);
$this->load->helper('hlp_language');
}
//------------------------------------------------------------------------------------------------------------------
@@ -43,4 +46,18 @@ class Phrasen extends FHCAPI_Controller
$this->load->library('PhrasesLib', [$module], 'pj');
$this->terminateWithSuccess(json_decode($this->pj->getJSON()));
}
}
public function setLanguage()
{
$postParams = $this->getPostJSON();
$language = $postParams->language;
$categories = $postParams->categories;
setUserLanguage($language);
$this->load->library('PhrasesLib', array($categories, $language), 'p');
$phrases = $this->p->setPhrases($categories, $language);
$this->terminateWithSuccess($phrases);
}
}