mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix #2041 don't replace lang codes in member menu until module init
This commit is contained in:
parent
b83c5c4b2c
commit
117ae626b9
2 changed files with 23 additions and 8 deletions
|
|
@ -400,7 +400,12 @@ class ModuleHandler extends Handler
|
|||
$this->is_mobile = Mobile::isFromMobilePhone();
|
||||
}
|
||||
|
||||
// Replace lang codes in member menu
|
||||
$logged_info = Context::get('logged_info');
|
||||
if ($logged_info)
|
||||
{
|
||||
MemberController::replaceLangForMemberMenu($logged_info);
|
||||
}
|
||||
|
||||
// Create an instance of the requested module and class
|
||||
if($class_name)
|
||||
|
|
|
|||
|
|
@ -2478,18 +2478,28 @@ class memberController extends member
|
|||
* Logged method for providing a personalized menu
|
||||
* Login information is used in the output widget, or personalized page
|
||||
*/
|
||||
function addMemberMenu($act, $str)
|
||||
public static function addMemberMenu($act, $str)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!is_object($logged_info))
|
||||
if(is_object($logged_info))
|
||||
{
|
||||
return;
|
||||
$logged_info->menu_list[$act] = $str;
|
||||
Context::set('logged_info', $logged_info);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace lang codes in member menu
|
||||
*
|
||||
* @param $logged_info
|
||||
* @return void
|
||||
*/
|
||||
public static function replaceLangForMemberMenu(&$logged_info)
|
||||
{
|
||||
if(is_object($logged_info) && !empty($logged_info->menu_list))
|
||||
{
|
||||
$logged_info->menu_list = array_map('lang', $logged_info->menu_list);
|
||||
}
|
||||
|
||||
$logged_info->menu_list[$act] = lang($str);
|
||||
|
||||
Context::set('logged_info', $logged_info);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue