diff --git a/e107_admin/language.php b/e107_admin/language.php index 3a9228af7..bb0e72f79 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -67,6 +67,8 @@ if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage']) && getper e107::getConfig()->setPref($temp)->save(true); + e107::getSession()->clear('e_language'); + // if ($admin_log->logArrayDiffs($temp, $pref, 'LANG_01')) { diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 0a48a99ca..8d807040e 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1661,10 +1661,17 @@ Inverse 10 10 { $slng = e107::getLanguage(); $languages = $slng->installed();//array('English','French'); + $multiDoms = array(); - $langSubs = explode("\n", e107::getPref('multilanguage_subdomain')); - - // print_a($langSubs); + if($langSubs = explode("\n", e107::getPref('multilanguage_subdomain'))) + { + + foreach($langSubs as $v) + { + $multiDoms[] = trim($v); + } + + } if(count($languages) > 1) { @@ -1679,7 +1686,7 @@ Inverse 10 10 $checked = $tp->toGlyph('ok')." "; $link = '#'; } - elseif(!empty($langSubs) && in_array(e_DOMAIN,$langSubs)) + elseif(in_array(e_DOMAIN,$multiDoms)) { $code = ($lng == e107::getPref('sitelanguage')) ? 'www' : $code; $link = str_replace($_SERVER['HTTP_HOST'], $code.'.'.e_DOMAIN, e_REQUEST_URL); // includes query string diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 2892cc31c..168438539 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2294,6 +2294,13 @@ class e107 return; } } + + $adminLanguage = self::getPref('adminlanguage'); + + if(e_ADMIN_AREA && vartrue($adminLanguage)) + { + $path = str_replace(e_LANGUAGE, $adminLanguage, $path); + } $ret = ($force) ? include($path) : include_once($path); return (isset($ret)) ? $ret : ""; @@ -2546,11 +2553,13 @@ class e107 break; case 'admin' : - $searchPath[1] = e_PLUGIN.$unitName.'/languages/'.e_LANGUAGE.'_admin_'.$unitName.'.php'; - $searchPath[2] = e_PLUGIN.$unitName.'/languages/'.e_LANGUAGE.'/'.'admin_'.$unitName.'.php'; - $searchPath[3] = e_PLUGIN.$unitName.'/languages/'.e_LANGUAGE.'/admin/'.e_LANGUAGE.'.php'; - $searchPath[4] = e_PLUGIN.$unitName.'/languages/'.e_LANGUAGE.'/'.e_LANGUAGE.'_admin.php'; // Preferred. - $searchPath[5] = e_PLUGIN.$unitName.'/languages/'.e_LANGUAGE.'_admin.php'; // consistent with English_global.php, English_log.php etc. + $adminLan = vartrue(self::getPref('adminlanguage'), e_LANGUAGE); + + $searchPath[1] = e_PLUGIN.$unitName.'/languages/'.$adminLan.'_admin_'.$unitName.'.php'; + $searchPath[2] = e_PLUGIN.$unitName.'/languages/'.$adminLan.'/'.'admin_'.$unitName.'.php'; + $searchPath[3] = e_PLUGIN.$unitName.'/languages/'.$adminLan.'/admin/'.$adminLan.'.php'; + $searchPath[4] = e_PLUGIN.$unitName.'/languages/'.$adminLan.'/'.$adminLan.'_admin.php'; // Preferred. + $searchPath[5] = e_PLUGIN.$unitName.'/languages/'.$adminLan.'_admin.php'; // consistent with English_global.php, English_log.php etc. break; case 'theme' : diff --git a/e107_handlers/language_class.php b/e107_handlers/language_class.php index 826b9e110..3e231d7a4 100644 --- a/e107_handlers/language_class.php +++ b/e107_handlers/language_class.php @@ -535,7 +535,8 @@ class language{ } else { - $user_language = (e_ADMIN_AREA && vartrue($pref['adminlanguage'])) ? $pref['adminlanguage'] : $pref['sitelanguage']; + + $user_language = $pref['sitelanguage']; if($session->is('e_language')) {