Currently activemenu.js is hard-coded with information on what menus to attach to. This should rather be passed as a setting, and loaded from modules via a hook.
What I'd like to do is:
- Introduce module-specific include files in a activemenu/modules directory. These are conditionally loaded (if the module exists). They have hook_activemenu() implementations, returning data about the menus to attach to and the targets (paths to fetch menu data from). Initially, have menu.inc, user.inc, and book.inc.
- Send the data from these hook implementations via a drupal_to_js() call of type 'setting'.
- In activemenu.js, replace the current hard-coded data with data from this setting.
For code for the book support, we can draw on this well coded patch: http://drupal.org/node/89057.
Comments
Comment #1
nedjoMoved menu and user (navigation) menus to be added through a hook. We can work on book integration in the issue referenced.
Comment #2
(not verified) commented