Open Jimmi08 opened 1 month ago
If you add Page methods , active works but admin UI Not (of course)
public function APage()
{
}
public function PPage() {
}
_preDispatch() in admin_ui() is looking for a method for each action and if it is doesn't exist it sets it as the default
This fixed it on localhost
$code = "
$(document).ready(function() {
var currentUrl = window.location.href;
$('#admin-ui-nav-menu li').each(function() {
var link = $(this).find('a').attr('href');
if (link === currentUrl) {
$('#admin-ui-nav-menu li').removeClass('active');
$(this).addClass('active');
}
});
});
";
e107::js('footer-inline', $code);
What e107 version are you using?
v2.3.3, Latest Github version (just updated)
Bug description
I am changing admin menu dynamically. Standart way with function init().
Admin UI works normally, if you check getAction() in class xy_ui extends e_admin_ui , it is correct.
Only problem is that not correct menu is marked as active.
After checking some request values and action values, they are not set correctly when admin menu is rendered.
action is always list
How to reproduce
This is classic menu settings:
Then dynamically are menus added:
Active works for list, create and help items.
getAction() returns "list" for them (in renderMenu() in admin_ui class) where selected is set
but in class xy_ui extends e_admin_ui getAction() returns the correct action and I am able to manipulate listQry() correctly.
I tried to use __construct() instead init(), but then menu items are not displayed at all.
Thanks for help
Expected behavior
Respect action parameter correctly
What browser(s) are you seeing the problem on?
Firefox
PHP Version
8.1