You are here

function admin_menu_suppress in Administration menu 6.3

Same name and namespace in other branches
  1. 8.3 admin_menu.module \admin_menu_suppress()
  2. 5.3 admin_menu.module \admin_menu_suppress()
  3. 5.2 admin_menu.module \admin_menu_suppress()
  4. 6 admin_menu.module \admin_menu_suppress()
  5. 7.3 admin_menu.module \admin_menu_suppress()

Suppress display of administration menu.

This function should be called from within another module's page callback (preferably using module_invoke()) when the menu should not be displayed. This is useful for modules that implement popup pages or other special pages where the menu would be distracting or break the layout.

Parameters

$set: Defaults to TRUE. If called before hook_footer(), the menu will not be displayed. If FALSE is passed, the suppression state is returned.

3 calls to admin_menu_suppress()
admin_menu_init in ./admin_menu.module
Implements hook_init().
admin_menu_output in ./admin_menu.module
Build the administration menu output.
admin_menu_toolbar_init in admin_menu_toolbar/admin_menu_toolbar.module
Implementation of hook_init().

File

./admin_menu.module, line 303
Render an administrative menu as a dropdown menu at the top of the window.

Code

function admin_menu_suppress($set = TRUE) {
  static $suppress = FALSE;

  // drupal_add_js() must only be invoked once.
  if (!empty($set) && $suppress === FALSE) {
    $suppress = TRUE;
    drupal_add_js(array(
      'admin_menu' => array(
        'suppress' => 1,
      ),
    ), 'setting');
  }
  return $suppress;
}