Module menu updating limitation


I have a question about the ModuleMenuSubscriber class.
When building modules, I have noticed that I can’t put a main menu link anywhere I want to. I think I have figured out where the limitation occurs. It is here.

It appears to me that there are only two places the main menu can be added to by a module and that would be reports and the module menu. Is that correct?

If it is correct, do you know why this limitation was imposed?


So this comes from ZH’s original hooks code and allows people from the module settings GUI to specify their module as having hooks into the reports or the modules menu system. It was something they setup leveraging the onMenuUpdate event.

You don’t have to use this particular mechanism at all. If you listen to the same menu event of onMenuUpdate you can modify anything in the menu structure that you want. I believe that’s how I setup my skeleton module to operate as I don’t use the module hooks structure that ZH setup at all.