Magento 1 – How to Hide Admin Menu if Custom Module is Disabled

modulenavigation

I am working on a custom backend module that has an option in System > Configuration to enable or disable the module.

System > Configuration

I would like to know if it is possible to hide the navigation item from the admin dashboard if the module is disabled?

Admin Dashboard

Best Answer

There's a good article by Ecomdev that gives an example of how you can do this with the 'depends' functionality. Search for 'depends' on that page and it will demonstrate how to use a config value. e.g.

<depends>
    <config>payment/checkmo/active</config>
</depends>

The menu item will only show if the check payment method is active.

http://www.ecomdev.org/2010/10/28/defining-acl-resources-custom-and-admin-menu-in-magento.html

Related Topic