Download & Extend

Move invocation/processing into hook_preprocess_page

Project:Administration menu
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:D7 stable release blocker

Issue Summary

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().

Comments

#1

+ we completely prevent rendering on "other" pages, such as print output, popups/dialogs, and other custom pages.

#2

Hi 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.

#3

I 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.

#4

+1 Same here. Appears on IMCE popup window..

#5

Category:task» bug report

#6

Also having the IMCE popup window issue.

#7

Here'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:

<?php
function imce_page() {
 
$jsop = isset($_GET['jsop']) ? $_GET['jsop'] : NULL;

 
// disable admin_menu here
 
module_invoke('admin_menu', 'suppress');
 
  print
theme('imce_page', imce_content($GLOBALS['user'], $jsop));
  exit();
}
?>
AttachmentSizeStatusTest resultOperations
admin_menu.patch1.09 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch admin_menu_25.patch.View details | Re-test

#8

Status:active» needs review

Updated status.

#9

chellman's patch in #7 works for me. Cheers.

#10

Status:needs review» needs work

The last submitted patch, admin_menu.patch, failed testing.

#11

Version:6.x-3.x-dev» 7.x-3.x-dev

#12

Subscribe. 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().