Two Menu Item Types Events Booking - Dashboard

  • ci-zeto
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 3 months ago #130414 by ci-zeto
I want to have two dashboards of EB in my backend menu. Actually I need 3, but 3rd one is on separated menu with different access level so I can check it by "if currently logged user got X access level than show/hide something".

Basically I have menu backend structure like:
MENU BACKEND
- EB Dashboard A (.../administrator/index.php?option=com_eventbooking&view=dashboard) - menu item type EB - Dashboard
- EB Dashboard B (.../administrator/index.php?option=com_eventbooking&view=dashboard) - same menu item type EB - Dashboard

Is there any way I can identify in which submenu I'm currently in (A or B )? Tried to use System Link with additional parameter in url like /administrator/index.php?option=com_eventbooking&view=dashboard&dashB and setting it up in session, but it is weak and full of holes...

I know it's not directly related to EB, but couldn't find any working solution in web.

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #130427 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Two Menu Item Types Events Booking - Dashboard
Honestly, I am unsure what's good solution. Why don't you just customize that single dashboard code to show the items you want base on the current user access levels?

Or maybe you can try:

$active = JFactory::getApplication()->getMenu()->getActive();

echo $active->id;

And then show hide items base on id of the active menu item?

Tuan

Please Log in or Create an account to join the conversation.

  • ci-zeto
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 3 months ago #130433 by ci-zeto
The point is that dashboard A and B must be view separately for same user with same access levels - just different menus in backend. They must have different category of events, different columns in registrants/events tables, different fields in event/registration forms, with or without agendas and speakers. Didn't know there will be so big issue to do that in EB.

Yeah, I also thought it would work, but JFactory::getApplication()->getMenu()->getActive() is NULL. Maybe I can configure it somewhere in Joomla to make it give me some ID, which would solve my problem.

I'm quite new to Joomla, but that's strange I cannot identify in PHP what is my current context in backend.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc