From 3a2e7c9192620c70c798b4a01ab8d0a0cd1d1665 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Sat, 30 Mar 2024 12:02:57 +0700 Subject: [PATCH] remove $_L --- init.php | 8 +++++++- system/controllers/bandwidth.php | 2 +- system/controllers/customers.php | 4 ++-- system/controllers/plan.php | 2 +- system/controllers/pool.php | 2 +- system/controllers/radius.php | 4 ++-- system/controllers/routers.php | 2 +- system/controllers/services.php | 4 ++-- system/controllers/settings.php | 6 +++--- system/lan/english.json | 3 ++- ui/ui/routers-add.tpl | 2 +- ui/ui/routers-edit.tpl | 2 +- 12 files changed, 24 insertions(+), 17 deletions(-) diff --git a/init.php b/init.php index db71de19..a2442cb2 100644 --- a/init.php +++ b/init.php @@ -254,7 +254,13 @@ function r2($to, $ntype = 'e', $msg = '') function _alert($text, $type = 'success', $url = "home", $time = 3) { - global $ui; + global $ui, $isApi; + if ($isApi) { + showResult( + ($type=='success')? true : false, + $text + ); + } if (!isset($ui)) return; if (strlen($url) > 4) { if (substr($url, 0, 4) != "http") { diff --git a/system/controllers/bandwidth.php b/system/controllers/bandwidth.php index bdca963c..2d490614 100644 --- a/system/controllers/bandwidth.php +++ b/system/controllers/bandwidth.php @@ -53,7 +53,7 @@ switch ($action) { $ui->assign('d', $d); $ui->display('bandwidth-edit.tpl'); } else { - r2(U . 'bandwidth/list', 'e', $_L['Account_Not_Found']); + r2(U . 'bandwidth/list', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/customers.php b/system/controllers/customers.php index 21143c2f..01e40278 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -207,7 +207,7 @@ switch ($action) { $ui->assign('xheader', $leafletpickerHeader); $ui->display('customers-view.tpl'); } else { - r2(U . 'customers/list', 'e', $_L['Account_Not_Found']); + r2(U . 'customers/list', 'e', Lang::T('Account Not Found')); } break; case 'edit': @@ -227,7 +227,7 @@ switch ($action) { $ui->assign('xheader', $leafletpickerHeader); $ui->display('customers-edit.tpl'); } else { - r2(U . 'customers/list', 'e', $_L['Account_Not_Found']); + r2(U . 'customers/list', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/plan.php b/system/controllers/plan.php index e2996ee8..940bc44d 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -253,7 +253,7 @@ switch ($action) { $ui->assign('_title', 'Edit Plan'); $ui->display('plan-edit.tpl'); } else { - r2(U . 'plan/list', 'e', $_L['Account_Not_Found']); + r2(U . 'plan/list', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/pool.php b/system/controllers/pool.php index 311188c8..980b0892 100644 --- a/system/controllers/pool.php +++ b/system/controllers/pool.php @@ -50,7 +50,7 @@ switch ($action) { run_hook('view_edit_pool'); #HOOK $ui->display('pool-edit.tpl'); } else { - r2(U . 'pool/list', 'e', $_L['Account_Not_Found']); + r2(U . 'pool/list', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/radius.php b/system/controllers/radius.php index a831aa13..3e1357f3 100644 --- a/system/controllers/radius.php +++ b/system/controllers/radius.php @@ -5,7 +5,7 @@ * by https://t.me/ibnux **/ _admin(); -$ui->assign('_title', $_L['Plugin Manager']); +$ui->assign('_title', Lang::T('Plugin Manager')); $ui->assign('_system_menu', 'settings'); $action = $routes['1']; @@ -80,7 +80,7 @@ switch ($action) { $ui->assign('d', $d); $ui->display('radius-nas-edit.tpl'); } else { - r2(U . 'radius/list', 'e', $_L['Account_Not_Found']); + r2(U . 'radius/list', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/routers.php b/system/controllers/routers.php index 9c73351f..acade1d3 100644 --- a/system/controllers/routers.php +++ b/system/controllers/routers.php @@ -54,7 +54,7 @@ switch ($action) { run_hook('view_router_edit'); #HOOK $ui->display('routers-edit.tpl'); } else { - r2(U . 'routers/list', 'e', $_L['Account_Not_Found']); + r2(U . 'routers/list', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/services.php b/system/controllers/services.php index 5a07f116..88f4f2d7 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -152,7 +152,7 @@ switch ($action) { run_hook('view_edit_plan'); #HOOK $ui->display('hotspot-edit.tpl'); } else { - r2(U . 'services/hotspot', 'e', $_L['Account_Not_Found']); + r2(U . 'services/hotspot', 'e', Lang::T('Account Not Found')); } break; @@ -432,7 +432,7 @@ switch ($action) { run_hook('view_edit_ppoe'); #HOOK $ui->display('pppoe-edit.tpl'); } else { - r2(U . 'services/pppoe', 'e', $_L['Account_Not_Found']); + r2(U . 'services/pppoe', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/controllers/settings.php b/system/controllers/settings.php index e6282722..d143b7b3 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -393,7 +393,7 @@ switch ($action) { $ui->assign('_title', $d['username']); $ui->display('users-view.tpl'); } else { - r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); + r2(U . 'settings/users', 'e', Lang::T('Account Not Found')); } break; case 'users-edit': @@ -430,7 +430,7 @@ switch ($action) { run_hook('view_edit_admin'); #HOOK $ui->display('users-edit.tpl'); } else { - r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); + r2(U . 'settings/users', 'e', Lang::T('Account Not Found')); } break; @@ -449,7 +449,7 @@ switch ($action) { $d->delete(); r2(U . 'settings/users', 's', Lang::T('User deleted Successfully')); } else { - r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); + r2(U . 'settings/users', 'e', Lang::T('Account Not Found')); } break; diff --git a/system/lan/english.json b/system/lan/english.json index 41f9dff5..71f8294a 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -536,5 +536,6 @@ "Testing__if_checked_no_real_message_is_sent_": "Testing [if checked no real message is sent]", "All_fields_are_required": "All fields are required", "Personal": "Personal", - "Email_Notification": "Email Notification" + "Email_Notification": "Email Notification", + "Router_Name___Location": "Router Name \/ Location" } \ No newline at end of file diff --git a/ui/ui/routers-add.tpl b/ui/ui/routers-add.tpl index 1f4420cf..c9cca4e7 100644 --- a/ui/ui/routers-add.tpl +++ b/ui/ui/routers-add.tpl @@ -20,7 +20,7 @@
- +

{Lang::T('Name of Area that router operated')}

diff --git a/ui/ui/routers-edit.tpl b/ui/ui/routers-edit.tpl index 971ebe78..89af563f 100644 --- a/ui/ui/routers-edit.tpl +++ b/ui/ui/routers-edit.tpl @@ -20,7 +20,7 @@
- +

{Lang::T('Name of Area that router operated')}