Revert "MDL-40699 Language - Add option to Override Moodle's default behaviour to reset the UI language on logout"

This reverts commit 08174740fbdc5d0a86d67c3736d4c78dced11331.
This commit is contained in:
Sam Hemelryk 2014-03-13 16:34:35 +13:00 committed by Eloy Lafuente (stronk7)
parent 2d1823eb51
commit e9c78971b5
3 changed files with 7 additions and 26 deletions

View File

@ -6,25 +6,14 @@ if ($hassiteconfig) {
// "languageandlocation" settingpage
$temp = new admin_settingpage('langsettings', new lang_string('languagesettings', 'admin'));
$temp->add(new admin_setting_configcheckbox('autolang',
new lang_string('autolang', 'admin'), new lang_string('configautolang', 'admin'), 1));
$temp->add(new admin_setting_configselect('lang', new lang_string('lang', 'admin'),
new lang_string('configlang', 'admin'), current_language(),
get_string_manager()->get_list_of_translations()));
// The $CFG->lang variable might be set in installer already, default en is in setup.php.
$temp->add(new admin_setting_configcheckbox('keeplogoutlang', new lang_string('keeplogoutlang', 'admin'),
new lang_string('keeplogoutlang_desc', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('langmenu', new lang_string('langmenu', 'admin'),
new lang_string('configlangmenu', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('autolang', new lang_string('autolang', 'admin'), new lang_string('configautolang', 'admin'), 1));
$temp->add(new admin_setting_configselect('lang', new lang_string('lang', 'admin'), new lang_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
$temp->add(new admin_setting_configcheckbox('langmenu', new lang_string('langmenu', 'admin'), new lang_string('configlangmenu', 'admin'), 1));
$temp->add(new admin_setting_langlist());
$temp->add(new admin_setting_configcheckbox('langcache', new lang_string('langcache', 'admin'),
new lang_string('langcache_desc', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('langstringcache', new lang_string('langstringcache', 'admin'),
new lang_string('configlangstringcache', 'admin'), 1));
$temp->add(new admin_setting_configtext('locale', new lang_string('localetext', 'admin'),
new lang_string('configlocale', 'admin'), '', PARAM_FILE));
$temp->add(new admin_setting_configselect('latinexcelexport', new lang_string('latinexcelexport', 'admin'),
new lang_string('configlatinexcelexport', 'admin'), '0', array('0' => 'Unicode', '1' => 'Latin')));
$temp->add(new admin_setting_configcheckbox('langcache', new lang_string('langcache', 'admin'), new lang_string('langcache_desc', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('langstringcache', new lang_string('langstringcache', 'admin'), new lang_string('configlangstringcache', 'admin'), 1));
$temp->add(new admin_setting_configtext('locale', new lang_string('localetext', 'admin'), new lang_string('configlocale', 'admin'), '', PARAM_FILE));
$temp->add(new admin_setting_configselect('latinexcelexport', new lang_string('latinexcelexport', 'admin'), new lang_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
$ADMIN->add('language', $temp);

View File

@ -597,8 +597,6 @@ $string['iplookupinfo'] = 'By default Moodle uses the free online NetGeo (The In
It is recommended to install local copy of free GeoLite City database from MaxMind.<br />
IP address location is displayed on simple map or using Google Maps. Please note that you need to have a Google account and apply for free Google Maps API key to enable interactive maps.';
$string['iplookupmaxmindnote'] = 'This product includes GeoLite data created by MaxMind, available from <a href="http://www.maxmind.com/">http://www.maxmind.com/</a>.';
$string['keeplogoutlang'] = 'Keep language on logout';
$string['keeplogoutlang_desc'] = 'Enable this option to prevent the user interface language from reverting back to the site\'s default language when users log out.';
$string['keeptagnamecase'] = 'Keep tag name casing';
$string['lang'] = 'Default language';
$string['langcache'] = 'Cache language menu';

View File

@ -39,12 +39,6 @@ if ($login) {
$redirect = $CFG->wwwroot.'/';
}
if (!empty($CFG->keeplogoutlang)) {
// Override Moodle's default behaviour to reset the UI language on logout.
$redirectlang = optional_param('lang', current_language(), PARAM_LANG);
$redirect = new moodle_url($redirect, array('lang' => $redirectlang));
}
if (!isloggedin()) {
// no confirmation, user has already logged out
require_logout();