mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-01 04:12:22 +03:00
Pull the available languages from the App.Vars.* object.
This commit is contained in:
parent
380ce3784a
commit
ca4e58313a
3 changed files with 4 additions and 3 deletions
|
@ -99,6 +99,7 @@ class EA_Controller extends CI_Controller {
|
||||||
script_vars([
|
script_vars([
|
||||||
'base_url' => config('base_url'),
|
'base_url' => config('base_url'),
|
||||||
'index_page' => config('index_page'),
|
'index_page' => config('index_page'),
|
||||||
|
'available_languages' => config('available_languages'),
|
||||||
'csrf_token' => $this->security->get_csrf_hash(),
|
'csrf_token' => $this->security->get_csrf_hash(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,7 +249,7 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
||||||
* Enable Language Selection
|
* Enable Language Selection
|
||||||
*
|
*
|
||||||
* Enables the language selection functionality. Must be called on every page has a language selection button.
|
* 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.
|
* @param {Object} $element Selected element button for the language selection.
|
||||||
*
|
*
|
||||||
|
|
|
@ -19,7 +19,7 @@ window.App.Utils.Lang = (function () {
|
||||||
* Enable Language Selection
|
* Enable Language Selection
|
||||||
*
|
*
|
||||||
* Enables the language selection functionality. Must be called on every page has a language selection button.
|
* 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.
|
* @param {Object} $target Selected element button for the language selection.
|
||||||
*/
|
*/
|
||||||
|
@ -27,7 +27,7 @@ window.App.Utils.Lang = (function () {
|
||||||
// Select Language
|
// Select Language
|
||||||
const $languageList = $('<ul/>', {
|
const $languageList = $('<ul/>', {
|
||||||
'id': 'language-list',
|
'id': 'language-list',
|
||||||
'html': availableLanguages.map((availableLanguage) =>
|
'html': App.Vars.available_languages.map((availableLanguage) =>
|
||||||
$('<li/>', {
|
$('<li/>', {
|
||||||
'class': 'language',
|
'class': 'language',
|
||||||
'data-language': availableLanguage,
|
'data-language': availableLanguage,
|
||||||
|
|
Loading…
Reference in a new issue