mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-07-14 20:14:24 +02:00
Language Switching
customer can now choose preferred language from available language list. we are store language in session for now, if customer logout the language will reset back to default, we will move it to database in the coming update.
This commit is contained in:
parent
676dcbe478
commit
5cb1a901c3
5 changed files with 102 additions and 11 deletions
|
@ -37,7 +37,7 @@ switch ($action) {
|
|||
}
|
||||
$user->password = $npass;
|
||||
$turs = ORM::for_table('tbl_user_recharges')->where('customer_id', $user['id'])->find_many();
|
||||
foreach($turs as $tur) {
|
||||
foreach ($turs as $tur) {
|
||||
// if has active plan, change the password to devices
|
||||
if ($tur['status'] == 'on') {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
|
||||
|
@ -239,6 +239,29 @@ switch ($action) {
|
|||
r2(U . 'accounts/profile', 's', Lang::T('Phone number updated successfully'));
|
||||
break;
|
||||
|
||||
case 'language-update-post':
|
||||
global $root_path;
|
||||
if (!empty($_POST['language'])) {
|
||||
$selected_language = $_POST['language'];
|
||||
|
||||
$_SESSION['user_language'] = $selected_language;
|
||||
|
||||
$lan_file = $root_path . File::pathFixer('system/lan/' . $selected_language . '.json');
|
||||
|
||||
if (file_exists($lan_file)) {
|
||||
$_L = json_decode(file_get_contents($lan_file), true);
|
||||
$_SESSION['Lang'] = $_L;
|
||||
} else {
|
||||
$_L['author'] = 'Auto Generated by iBNuX Script';
|
||||
$_SESSION['Lang'] = $_L;
|
||||
file_put_contents($lan_file, json_encode($_L));
|
||||
}
|
||||
|
||||
r2($_SERVER['HTTP_REFERER'], 's', Lang::T('Languge set to ' . $selected_language));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
$ui->display('a404.tpl');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue