Commit 5380dfa8 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5568 Fixing language setting and menu reloading

parent e7cf9dda
......@@ -62,6 +62,8 @@ class pluglist {
/* Fill info part of pluglist */
$classes = get_declared_classes();
/* To avoid plugins changing index when reloading */
sort($classes);
$index = 0;
$depends_infos = array();
......@@ -477,16 +479,6 @@ class pluglist {
return isset($this->allowed_plugins[$plug_id]);
}
/*!
* \brief Force the menu to be recreated
*/
function reset_menus()
{
$this->menu = "";
$this->iconmenu = "";
}
static function pluginInfos($cname)
{
$plist = session::global_get('plist');
......
......@@ -159,7 +159,7 @@ function plugin_available($plugin)
*/
function load_plist ($ldap_available = TRUE)
{
global $config;
global $config, $plist;
if (!session::global_is_set('plist')) {
/* Initially load all classes */
load_all_classes();
......@@ -2570,15 +2570,16 @@ function initLanguage($lang = NULL)
$ret = FALSE;
/* Reset menu cache if language changed */
/* Reset plist cache if language changed */
if ((!session::global_is_set('lang')) || (session::global_get('lang') != $lang)) {
$ret = TRUE;
if (session::global_is_set('plist')) {
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, session::global_get('lang'), 'Plist already loaded with language ');
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, session::global_get('lang'), 'Plist already loaded with language');
}
$plist = session::global_get('plist');
$plist->reset_menus();
session::global_un_set('plist');
session::global_set('lang', $lang);
load_plist();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment