Menu weights, black/white list, and memory of menu selection

jweowu - August 22, 2009 - 14:06
Project:Menu Breadcrumb
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm attaching a version of this module that I've modified to try to address a few active issues. It builds upon various aspects of the following issues and/or their associated patches:

#275622: Doesn't work for Views pages (moved the theme code into a preprocess_page function)
#352294: Book outline overrides menu breadcrumb (stores the chosen menu name; not a 'fix' in and of itself, but it enables other code to change it back)
#303247: Menu Breadcrumb setting active menu to undesirable menus (menu white/black list)
#364363: Select default custom menu (preferred menu)

The main addition is that the menu list is now weighted, so that you can not only restrict which menus are selected from, but also determine the order of preference. Provision is made for the subsequent addition of new menus.

I also removed hook_enable() (which was redundant) and hook_disable() (which wasn't really appropriate). I moved the hook_disable() code to hook_uninstall() instead.

Lastly, there's a new hook to allow other modules to edit the (ordered) list of menus before one is chosen. This was added due to noticing some concerns about language-specific menus; the idea being that an implementation of the hook could change the preferred order of the menus according to the user's language settings.

AttachmentSize
menu_breadcrumb.tgz11.41 KB

#1

dboulet - October 2, 2009 - 19:17

jweowu, this is great, but it would be better if you submitted multiple patches in separate issues so that each fix/improvement can be tested and reviewed individually.

#2

jweowu - October 3, 2009 - 23:46

Slightly painful, but I've split this out into four patches, all against the current 6.x-1.x-dev (2009-Aug-31):

#595282: Menu weights
#595280: Ability to retrieve the selected menu.
#595244: hook_enable() and hook_disable() are mis-used. Replace with hook_uninstall()
#275622: Doesn't work for Views pages (comment #26)

I'm also attaching a new archive of this issue's version of the module, so as to match the committed 'menu_breadcrumb_filter' naming.

If I've messed anything up in these new patches, please compare against this version of the module, as I did a decent amount of testing on this one. If the new patches don't work, it's more likely that I just made a mistake extracting that functionality from this version and merging it into the dev branch.

This version might be also useful as reference for re-combining, if these patches are accepted.

AttachmentSize
menu_breadcrumb.tgz 11.39 KB
 
 

Drupal is a registered trademark of Dries Buytaert.