We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.3.3, Latest Github version (just updated)
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
This is classic menu settings:
protected $adminMenu = array( //'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'), 'main/list' => array('caption' => LAN_MANAGE, 'perm' => 'P'), 'main/create' => array('caption' => _ADDNEWPANEL, 'perm' => 'P'), 'main/div0' => array('divider' => true), // 'main/help' => array('caption'=> 'Help Page', 'perm' => 'P'), );
Then dynamically are menus added:
function init() { $panelTypes = e107::getEfiction()->getPanelTypes(); foreach ($panelTypes as $key => $value) { $mode = "main"; $action = $key; $menu = $mode . '/' . $action; $this->adminMenu[$menu] = array( 'caption' => $value, 'perm' => 'P' ); } $this->adminMenu['main/div1'] = array('divider' => true); $this->adminMenu['main/help'] = array( 'caption' => 'Help Page', 'perm' => 'P' ); }
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
Respect action parameter correctly
Firefox
8.1
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
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);
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: