You are here

function megamenu_init in Megamenu 6

Same name and namespace in other branches
  1. 6.2 megamenu.module \megamenu_init()

Implementation of hook_init().

We are adding the JavaScript and CSS here rather than theme_menu_tree() because when block caching is enabled none of it would get fired and the menus are unstyled.

File

./megamenu.module, line 23
megamenu-Menu Builder

Code

function megamenu_init() {

  // Add JavaScript
  drupal_add_js(drupal_get_path('module', 'megamenu') . '/megamenu.js');

  // Add main CSS functionality.
  drupal_add_css(drupal_get_path('module', 'megamenu') . '/megamenu.css');

  // Add custom CSS layout skins TODO: if specified.
  drupal_add_css(drupal_get_path('module', 'megamenu') . '/megamenu-skins.css');
}