Files
FHC-Core/application/controllers/widgets/Language.php
T
Paolo 0319d0cc2a - Added new constants in config/constants.php:
- LANG_SESSION_ACTIVE_LANGUAGES
        - LANG_SESSION_CURRENT_LANGUAGE
- Added new functions in helper hlp_language_helper:
        - setUserLanguage
        - getDBActiveLanguages
        - getActiveLanguages
- Adapted code to make use of them
- Added new controller controllers/widgets/Language
2019-11-26 15:24:26 +01:00

32 lines
650 B
PHP

<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller is used to set the current language for a user
* It is part of the Language Switcher Widget
*/
class Language extends FHC_Controller
{
/**
* Calls the parent's constructor
*/
public function __construct()
{
parent::__construct();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
*
*/
public function setSessionLanguage()
{
$language = $this->input->post('language');
$this->outputJson(setUserLanguage($language));
}
}