Hello,
I am working on integrating the ADMIN module and the Rubik theme with the Modal Frame API and Node Relationships Modules. The problem I am having is once the admin validation line is added to the page template it injects the admin menu and all of the resources (css js) on any page load.
The Modal Frame module strips out the regions and displays nodes, views, and system screens in a modal dialog. My goal is to either check against a state when a modal frame content is loaded or add an override in the pre-processors for the ADMIN module to stop the inclusion of the admin menu in certain instances.
My question is which methods should I start reviewing to accomplish this?
If you are interested here is the issue I am working on to integrate everything together. (http://drupal.org/node/672970)
Comments
Comment #1
emptyvoid CreditAttribution: emptyvoid commentedsorry fixing a spelling mistake in the title of the post.
Comment #2
emptyvoid CreditAttribution: emptyvoid commentedComment #3
markus_petrux CreditAttribution: markus_petrux commentedMaybe the admin module could provide a method to disable the output of the toolbar programmatically. For example, the admin_menu module implements hook_suppress() that can be invoked from other modules to suppress the admin_menu output like this:
Snippet from the Modal Frame API.
So... if admin module could provide something similar, I could use it from Modal Frame API to ensure the admin toolbar is not rendered in modal frames.
Comment #4
markus_petrux CreditAttribution: markus_petrux commentedBetter title.
Comment #5
markus_petrux CreditAttribution: markus_petrux commentedFor example, admin module could include this:
And then, maybe check the suppress flag in admin_preprocess_page() by patching this function like this:
Comment #6
ludo1960 CreditAttribution: ludo1960 commentedShouldn't that be:
to hide the menu ?
Comment #7
markus_petrux CreditAttribution: markus_petrux commentedTRUE is default. :)
Comment #8
ludo1960 CreditAttribution: ludo1960 commentedHmmm,
I tried without TRUE and it didn't work!
Comment #9
markus_petrux CreditAttribution: markus_petrux commentedI have edited comment #5 with a few changes. The idea is based on how admin_menu does this stuff. However, I do not use admin module myself, and I have just browsed the code. So this might need more love.
Comment #10
ludo1960 CreditAttribution: ludo1960 commentedLove is all you need! (Lennon, McCartney)
Comment #11
markus_petrux CreditAttribution: markus_petrux commentedYep!
Well, let's see if admin module maintainers agree on such an approach. Once they do, I would be glad to implement whatever is done here from Modal Frame API.
Comment #12
yhahn CreditAttribution: yhahn commentedThank you. I've committed the change here: http://drupal.org/cvs?commit=328052
Note that the way these suppress hooks have been written (as well as admin_menu()) allow for you to simply call
module_invoke_all('suppress')
instead of each module's hook individually.Comment #14
realityloopFor the benefit of others that may be trying to figure this out to call it for admin you use the following:
module_invoke('admin', 'suppress');
for admin menu:
module_invoke('admin_menu', 'suppress');