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
+2 -1
View File
@@ -34,6 +34,7 @@ class Cis4 extends FHC_Controller
show_error("name couldn't be loaded for username ".getAuthUID());
}
$begruesung = getData($begruesung);
$this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]);
}
}
}
+11 -2
View File
@@ -27,6 +27,15 @@ class Dashboard extends Auth_Controller
*/
public function index()
{
$this->load->view('CisVue/Dashboard.php');
$this->load->model('person/Person_model','PersonModel');
$begruesung = $this->PersonModel->getFirstName(getAuthUID());
if(isError($begruesung))
{
show_error("name couldn't be loaded for username ".getAuthUID());
}
$begruesung = getData($begruesung);
$this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]);
}
}
}
@@ -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);
}
}