By moving from hook_init() into hook_preprocess_page() we
- can skip JS settings and client-side caching completely on pages that want to suppress admin_menu
- only add admin_menu to pages. Doesn't make sense elsewhere.
- make that whole stuff cleaner.
Perhaps we can even eliminate hook_footer().
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | admin_menu.page-build.13.patch | 4.56 KB | sun |
| #7 | admin_menu.patch | 1.09 KB | chellman |
Comments
Comment #1
sun+ we completely prevent rendering on "other" pages, such as print output, popups/dialogs, and other custom pages.
Comment #2
alexkb commentedHi Sun,
Firstly, let me say, great module!
Anyway, I just wanted to know when things would be fixed so that the menu didn't show up on imce popups as per the reported duplicate issue here: #540120: "Administration menu" appears on some popups. Or is this for the imce or imce_wysiwyg module developers to make adaptions to. I'm using admin_menu-6.x-3.0-alpha3.
Thanks.
Comment #3
chadvb commentedI am having the same issue as alexkb which is a real drag. I'm not a developer so I'm hoping you could explain a little more how to implement this change to clear up the issue.
Comment #4
BarisW commented+1 Same here. Appears on IMCE popup window..
Comment #5
BarisW commentedComment #6
g10tto commentedAlso having the IMCE popup window issue.
Comment #7
chellman commentedHere's a patch that seems to work for me in limited testing. All I've done is move everything from admin_menu_init() into admin_menu_preprocess_page() and added a couple lines. After clearing the Drupal cache, admin menu shows up again normally, but not on IMCE (which is right, I think).
Meantime, the IMCE issue can be solved by modifying imce/inc/page.inc:
Comment #8
chellman commentedUpdated status.
Comment #9
imclean commentedchellman's patch in #7 works for me. Cheers.
Comment #11
sunComment #12
geerlingguy commentedSubscribe. I'd love an easier way to disable the admin_menu on certain pages (especially atypical drupal pages, or pages I embed via an iframe on other sites), than to do a module_invoke() in a custom module's hook_init().
Comment #13
sunLet's see whether this passes tests.
Comment #14
sunTotally works. :)
Thanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #15
geerlingguy commentedWonderful!