Hi!

I have a question and maybe you have met same problem.

I have a module which offers a hook to others modules. This hook save a cache of statuses in a specific table into database. For example, I have a button on an admin page "Rebuild statuses cache". When an admin user clicks on this button, my module calls hook_status() in all modules (if implementing by others). Results are parsed and saved into database.

The problem is here : how rebuild cache when Admin enable or disable a module which implements my hook_statuses interface ? How create a "trigger" to rebuild statuses cache when a module is enabled ?

My process can be compared to hook_menu() and hook_perm() processes.

Many thanks for you help ;)

Comments

mooffie’s picture

Drupal 7 has hooks that notify modules about enabled/disabled modules. For D6 I guess you should add a #submit hook to the modules form. Or put your 'rebuild' code in hook_menu.

lphm’s picture

Thanks for your reply. I will call 'rebuild' function into the hook_menu.

I have read new hooks for Drupal 7. It's very usefull features !