mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
LSsession : permit to pass lang and encoding to initialize() and setLocale() methods
This commit is contained in:
parent
742a5e74da
commit
3239559128
1 changed files with 32 additions and 25 deletions
|
@ -323,7 +323,8 @@ class LSsession {
|
|||
*
|
||||
* @retval void
|
||||
*/
|
||||
public static function setLocale() {
|
||||
public static function setLocale($lang=null,$encoding=null) {
|
||||
if (is_null($lang)) {
|
||||
if (isset($_REQUEST['lang'])) {
|
||||
$lang = $_REQUEST['lang'];
|
||||
}
|
||||
|
@ -336,7 +337,9 @@ class LSsession {
|
|||
else {
|
||||
$lang = LSconfig :: get('lang');
|
||||
}
|
||||
}
|
||||
|
||||
if (is_null($enconding)) {
|
||||
if (isset($_REQUEST['encoding'])) {
|
||||
$encoding = $_REQUEST['encoding'];
|
||||
}
|
||||
|
@ -349,6 +352,7 @@ class LSsession {
|
|||
else {
|
||||
$encoding = LSconfig :: get('encoding');
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['LSlang']=$lang;
|
||||
self :: $lang=$lang;
|
||||
|
@ -441,9 +445,12 @@ class LSsession {
|
|||
/**
|
||||
* Initialisation LdapSaisie
|
||||
*
|
||||
* @param[in] $lang string La langue (Ex : fr_FR / Optionnel)
|
||||
* @param[in] $encoding string L'encodage de caractère (Ex : UTF8 / Optionnel)
|
||||
*
|
||||
* @retval boolean True si l'initialisation à réussi, false sinon.
|
||||
*/
|
||||
public static function initialize() {
|
||||
public static function initialize($lang=false,$encoding=false) {
|
||||
try {
|
||||
if (!self :: startLSconfig()) {
|
||||
return;
|
||||
|
@ -454,7 +461,7 @@ class LSsession {
|
|||
|
||||
session_start();
|
||||
|
||||
self :: setLocale();
|
||||
self :: setLocale($lang,$encoding);
|
||||
|
||||
self :: loadLSaddons();
|
||||
self :: loadLSauth();
|
||||
|
|
Loading…
Reference in a new issue