From 52f7c3a2051d56cbea6f3d38a356b00bab6d383c Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 6 May 2020 16:06:05 +0200 Subject: [PATCH] Move LSsession lang stuff to dedicated LSlang class --- .../class/class.LSformElement_date.php | 2 +- src/includes/class/class.LSlang.php | 192 ++++++++++++++++++ src/includes/class/class.LSsession.php | 177 ++-------------- src/templates/default/login.tpl | 4 +- src/templates/default/recoverpassword.tpl | 2 +- src/templates/default/top.tpl | 2 +- 6 files changed, 219 insertions(+), 160 deletions(-) create mode 100644 src/includes/class/class.LSlang.php diff --git a/src/includes/class/class.LSformElement_date.php b/src/includes/class/class.LSformElement_date.php index 9357b955..fca7c08a 100644 --- a/src/includes/class/class.LSformElement_date.php +++ b/src/includes/class/class.LSformElement_date.php @@ -164,7 +164,7 @@ class LSformElement_date extends LSformElement { ); LSsession :: addJSconfigParam($this -> name, $params); - $codeLang = str_replace('_','-',preg_replace('/\..*$/','',LSsession :: getLang())); + $codeLang = str_replace('_','-',preg_replace('/\..*$/','', LSlang :: getLang())); LSsession :: addLibJSscript('arian-mootools-datepicker/Picker.js'); LSsession :: addLibJSscript('arian-mootools-datepicker/Picker.Attach.js'); diff --git a/src/includes/class/class.LSlang.php b/src/includes/class/class.LSlang.php new file mode 100644 index 00000000..4e3a867f --- /dev/null +++ b/src/includes/class/class.LSlang.php @@ -0,0 +1,192 @@ +
{$loginform_label_pwd|escape:"htmlall"}
-
{$lang_label|escape:"htmlall"}
+
{tr msg="Language"}
-{$lang_label} : {$LSlang|escape:"htmlall"} +{tr msg="Language"} : {$LSlang|escape:"htmlall"} {$loginform_label_recoverPassword|escape:"htmlall"} {include file='ls:LSsession_js.tpl'} diff --git a/src/templates/default/recoverpassword.tpl b/src/templates/default/recoverpassword.tpl index a3705f09..eba097e8 100644 --- a/src/templates/default/recoverpassword.tpl +++ b/src/templates/default/recoverpassword.tpl @@ -30,7 +30,7 @@ {/if}

{$recoverpassword_msg|escape:"htmlall"}

-{$lang_label|escape:"htmlall"} : {$LSlang|escape:"htmlall"} +{tr msg="Language"} : {$LSlang|escape:"htmlall"} {$recoverpasswordform_label_back|escape:"htmlall"} {include file='ls:LSsession_js.tpl'} diff --git a/src/templates/default/top.tpl b/src/templates/default/top.tpl index 7a5b1fae..20c65b09 100644 --- a/src/templates/default/top.tpl +++ b/src/templates/default/top.tpl @@ -50,7 +50,7 @@ - {$lang_label|escape:"htmlall"} : {$LSlang|escape:"htmlall"} + {tr msg="Language"} : {$LSlang|escape:"htmlall"}