You are here

function admin_menu_menu in Administration menu 5

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

Implementation of hook_menu().

PHP-only based themes like chameleon load and output scripts and stylesheets in front of theme_closure(), so we ensure Admin menu's styles and scripts are loaded on all pages via hook_menu().

File

./admin_menu.module, line 27

Code

function admin_menu_menu($may_cache) {
  $items = array();
  if (!user_access('access administration menu')) {
    return $items;
  }
  $path = drupal_get_path('module', 'admin_menu');
  drupal_add_css($path . '/admin_menu.css', 'module', 'screen', false);

  // IE6 fix.
  $ie_header = '<!--[if lt IE 7]>';
  $ie_header .= '<script type="text/javascript" src="' . base_path() . $path . '/admin_menu.js' . '"></script>';
  $ie_header .= '<![endif]-->';
  drupal_set_html_head($ie_header);
  return $items;
}