You are here

function om_maximenu_asset_loader in OM Maximenu 8

Same name and namespace in other branches
  1. 7 inc/om_maximenu.render.inc \om_maximenu_asset_loader()

Loads styles and js

2 calls to om_maximenu_asset_loader()
om_maximenu_block_load in inc/om_maximenu.render.inc
Load all OM Maximenu blocks
om_maximenu_load in inc/om_maximenu.render.inc
Load all OM Maximenu blocks

File

inc/om_maximenu.render.inc, line 49
OM Maximenu Render

Code

function om_maximenu_asset_loader($menu_content = array()) {

  // update change from tabbed to style
  $menu_content['style'] = isset($menu_content['tabbed']) ? $menu_content['tabbed'] : $menu_content['style'];

  // options
  $action = isset($menu_content['action']) ? $menu_content['action'] : 'hover';
  $active = isset($menu_content['active']) ? $menu_content['active'] : 0;
  $longmenu = isset($menu_content['longmenu']) ? $menu_content['longmenu'] : FALSE;
  $displace = isset($menu_content['displace']) ? $menu_content['displace'] : 0;
  $delay = isset($menu_content['delay']) ? $menu_content['delay'] : 1000;
  $fadeout = isset($menu_content['fadeout']) ? $menu_content['fadeout'] : 1;
  $skin = isset($menu_content['skin']) ? $menu_content['skin'] : 'bubble';
  $animated_bg = isset($menu_content['animated_bg']) ? 1 : 0;
  $animated_link = isset($menu_content['animated_link']) ? 1 : 0;
  $jiggle = isset($menu_content['jiggle']) ? 1 : 0;
  $scroll = isset($menu_content['scroll']) ? 1 : 0;
  $style = isset($menu_content['style']) ? $menu_content['style'] : '';
  $dock = isset($menu_content['float_options']['dock']) ? 1 : 0;
  $maximenu_name = om_string_name($menu_content['title']);

  // add action per OM Maximenu
  om_maximenu_action($action, $maximenu_name, $displace, $style, $delay, $fadeout);

  // add css per OM Maximenu
  drupal_add_css(OM_MAXIMENU_PATH . '/skin/' . $skin . '/' . $skin . '.css');

  // add 'active-trail' to menu li when submenus are active
  if ($active) {
    om_maximenu_active_js($maximenu_name, $animated_bg, $style);
  }

  // scroll long menu if it won't fit the container
  if ($longmenu) {
    om_maximenu_longmenu_js($maximenu_name, $longmenu);
  }

  // animated bg effect
  if ($animated_bg) {
    om_maximenu_bg_slider($maximenu_name);
  }

  // animated link effect
  if ($animated_link) {
    om_maximenu_link_slider($maximenu_name);
  }

  // animated link jiggle
  if ($jiggle) {
    om_maximenu_jiggle($maximenu_name);
  }

  // scrolling float
  if ($scroll) {
    om_maximenu_scroll($maximenu_name);
  }

  // jquery fisheye dock effect
  if ($dock) {
    om_maximenu_dock($maximenu_name);
  }
}