onPreprocessMenuItems hikashop menu system plugin
- jameswadsworth
-
Topic Author
- Offline
Less
More
8 years 1 month ago - 8 years 1 month ago #296333
by jameswadsworth
onPreprocessMenuItems hikashop menu system plugin was created by jameswadsworth
-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.2
Hi
we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.
The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:
so we can call hikashop functions such as hikashop_config() and hikahop_isAllowed().
However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens?
Thanks
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.2
Hi
we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.
The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:
Code:
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return true;
However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens?
Thanks
Last edit: 8 years 1 month ago by jameswadsworth.
Please Log in or Create an account to join the conversation.
8 years 1 month ago #296341
by nicolas
Replied by nicolas on topic onPreprocessMenuItems hikashop menu system plugin
Hi,
I don't know what com_dacshop is but it's not a HikaShop file you're loading if you have com_dacshop instead of com_hikashop.
I tried to load the helper of HikaShop in a onPreprocessMenuItems trigger of a system plugin and do overrides of com_banner translations and it worked just fine.
Please note that next version of HikaShop will have use that trigger to remove the different menu items based on the ACLs and it won't load the HikaShop helper (to avoid having to load it on every page of the backend which is not really nice).
I don't know what com_dacshop is but it's not a HikaShop file you're loading if you have com_dacshop instead of com_hikashop.
I tried to load the helper of HikaShop in a onPreprocessMenuItems trigger of a system plugin and do overrides of com_banner translations and it worked just fine.
Please note that next version of HikaShop will have use that trigger to remove the different menu items based on the ACLs and it won't load the HikaShop helper (to avoid having to load it on every page of the backend which is not really nice).
The following user(s) said Thank You: jameswadsworth
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
8 years 1 month ago #296356
by jameswadsworth
Replied by jameswadsworth on topic onPreprocessMenuItems hikashop menu system plugin
That is great. We look forward to the next version then!
Please Log in or Create an account to join the conversation.
Time to create page: 0.199 seconds