From 30418468e80f30f41a8c254bb13e100e769b746a Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 7 Jan 2022 09:23:21 +0100 Subject: [PATCH] Convert the admins page to the new js module structure. --- application/controllers/Admins.php | 11 +- application/views/pages/admins.php | 35 +- assets/js/http/account_http_client.js | 4 +- assets/js/http/admins_http_client.js | 12 + assets/js/pages/admins.js | 439 +++++++++++++++++++++ assets/js/pages/backend_admins.js | 107 ----- assets/js/pages/backend_admins_helper.js | 475 ----------------------- 7 files changed, 472 insertions(+), 611 deletions(-) create mode 100644 assets/js/pages/admins.js delete mode 100644 assets/js/pages/backend_admins.js delete mode 100644 assets/js/pages/backend_admins_helper.js diff --git a/application/controllers/Admins.php b/application/controllers/Admins.php index c153b5e9..4e99f363 100644 --- a/application/controllers/Admins.php +++ b/application/controllers/Admins.php @@ -52,6 +52,13 @@ class Admins extends EA_Controller { $role_slug = session('role_slug'); + script_vars([ + 'timezones' => $this->timezones->to_array(), + 'user_id' => $user_id, + 'role_slug' => $role_slug, + 'min_password_length' => MIN_PASSWORD_LENGTH, + ]); + html_vars([ 'page_title' => lang('admins'), 'active_menu' => PRIV_USERS, @@ -100,7 +107,7 @@ class Admins extends EA_Controller { { try { - $admin = json_decode(request('admin'), TRUE); + $admin = request('admin'); if (cannot('add', PRIV_USERS)) { @@ -127,7 +134,7 @@ class Admins extends EA_Controller { { try { - $admin = json_decode(request('admin'), TRUE); + $admin = request('admin'); if (cannot('edit', PRIV_USERS)) { diff --git a/application/views/pages/admins.php b/application/views/pages/admins.php index ef9460b1..0c74795e 100755 --- a/application/views/pages/admins.php +++ b/application/views/pages/admins.php @@ -189,9 +189,9 @@
-
- -