From ca4e58313a47d65eabf42938b7b5901fb882812e Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 18 Jan 2022 07:20:04 +0100 Subject: [PATCH] Pull the available languages from the App.Vars.* object. --- application/core/EA_Controller.php | 1 + assets/js/utils/general_functions.js | 2 +- assets/js/utils/lang.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/core/EA_Controller.php b/application/core/EA_Controller.php index 615221bf..05b583e4 100644 --- a/application/core/EA_Controller.php +++ b/application/core/EA_Controller.php @@ -99,6 +99,7 @@ class EA_Controller extends CI_Controller { script_vars([ 'base_url' => config('base_url'), 'index_page' => config('index_page'), + 'available_languages' => config('available_languages'), 'csrf_token' => $this->security->get_csrf_hash(), ]); } diff --git a/assets/js/utils/general_functions.js b/assets/js/utils/general_functions.js index fd31697e..95cb3af3 100755 --- a/assets/js/utils/general_functions.js +++ b/assets/js/utils/general_functions.js @@ -249,7 +249,7 @@ window.GeneralFunctions = window.GeneralFunctions || {}; * Enable Language Selection * * Enables the language selection functionality. Must be called on every page has a language selection button. - * This method requires the global variable 'availableLanguages' to be initialized before the execution. + * This method requires the global variable 'App.Vars.available_languages' to be initialized before the execution. * * @param {Object} $element Selected element button for the language selection. * diff --git a/assets/js/utils/lang.js b/assets/js/utils/lang.js index b04429f1..2d1a5b41 100644 --- a/assets/js/utils/lang.js +++ b/assets/js/utils/lang.js @@ -19,7 +19,7 @@ window.App.Utils.Lang = (function () { * Enable Language Selection * * Enables the language selection functionality. Must be called on every page has a language selection button. - * This method requires the global variable 'availableLanguages' to be initialized before the execution. + * This method requires the global variable 'App.Vars.available_variables' to be initialized before the execution. * * @param {Object} $target Selected element button for the language selection. */ @@ -27,7 +27,7 @@ window.App.Utils.Lang = (function () { // Select Language const $languageList = $('