The feature of disabling DHTML for specific menus, along with the possibility of menu blocks just not appearing on certain pages, means that the theme functions stand a good chance of not being called at all. Code registry to the rescue! dhtml_menu_theme* and their private helpers are used either all at once or not at all, so they had best be in a separate file.

dhtml_menu.theme.inc sounds like a winner.

That leaves dhtml_menu.module with only hook_init, hook_help and the serialized defaults constant.

Comments

cburschka’s picture

Addendum: On second thought, of course the theme functions will still be called for DHTML-disabled menus. But still, these menus don't necessarily appear at all, so the refactoring still makes sense.

cburschka’s picture

Status: Active » Needs review
StatusFileSize
new12.28 KB

Here it comes.

cburschka’s picture

Status: Needs review » Needs work

Um, whoops. Adding a file requires a change to dhtml_menu.info too, or the code registry is unhappy.

cburschka’s picture

Status: Needs work » Needs review
StatusFileSize
new12.96 KB

Removed some superfluous comments from dhtml_menu.info too.

cburschka’s picture

StatusFileSize
new12.96 KB

Whoops again. I accidentally removed the .install file.

cburschka’s picture

Status: Needs review » Fixed

Committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.